Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot start service nodered /dev/ttyAMA0 #248

Open
tester277 opened this issue Oct 2, 2022 · 2 comments
Open

Cannot start service nodered /dev/ttyAMA0 #248

tester277 opened this issue Oct 2, 2022 · 2 comments

Comments

@tester277
Copy link

I would like run the IOTstack on alternative hardware (instead raspi on a futro 740).
After Build a new stack nodered can not be started:
ERROR: for nodered Cannot start service nodered: error gathering device information while adding custom device "/dev/ttyAMA0".
The error message appears regardless of which nodered modules have been installed. Is there a way around the error?
Thanks
Holger

@Paraphraser
Copy link
Contributor

Yes, there is a way around this.

Please read these links:

  1. This project is dormant - which will explain why you should be starting at SensorsIot/IOTstack.
  2. The assumptions IOTstack makes so you understand that this is a "your mileage may vary" situation.

The ttyAMA0 device is the Raspberry Pi serial port. Apparently, "AMA" is the name of the bus on the Raspberry Pi SOC that connects to the UART.

Because /dev/ttyAMA0 is pretty much guaranteed to exist on a Raspberry Pi, it is used fairly often in IOTstack service definitions, both "for real" and as a placeholder.

Node-RED is an example of a "for real" mapping:

- /dev/ttyAMA0:/dev/ttyAMA0

With that in place a flow using the node-red-node-serialport add-on node can access the serial port on the Raspberry Pi (left hand side of the above mapping) by communicating with the container's serial port (right hand side of the above mapping).

It doesn't matter whether any node or flow is or isn't using /dev/ttyAMA0. The mapping makes the serial port available inside the container in case a node or flow wants to use it. It's a subtle difference.

Octoprint and Zigbee2MQTT are examples of "placeholder" usage. Until you connect your 3D printer or Zigbee adapter, you don't know how it is going to show up in /dev. Each of those service definitions maps:

- /dev/ttyAMA0:/dev/ttyACM0

Because Docker-Compose can find the left hand side of the mapping, it will at least start both the stack as a whole and any containers using that mapping.

The process running inside the container may well get upset and go into a restart loop (Zigbee2MQTT does) but that's a separate matter.

Anyway, in the case of Node-RED, you can solve this problem by doing one of the following:

  1. Delete or comment-out the line containing /dev/ttyAMA0; or

  2. For your particular hardware, figure out which device connects to your serial port and substitute it. For example, if /dev/ttyS0 leads to your UART, change the line to be:

    - /dev/ttyS0:/dev/ttyAMA0
    

The approach you take depends on whether you have plans to communicate with the serial port - assuming that exists on your hardware.

I hope this makes sense?

@tester277
Copy link
Author

Phill Thanks for the detailed explanation. With this it makes sense.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants