Skip to content

Cannot start service nodered /dev/ttyAMA0 #248

Open

Description

@tester277

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

Activity

  1. Paraphraser commented on Oct 2, 2022

    @Paraphraser
    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?

  2. tester277 commented on Oct 3, 2022

    @tester277
    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions