-
Notifications
You must be signed in to change notification settings - Fork 129
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
Serial interface #INTERFACE_NAME: Connection Failed: ENOENT : No such file or directory @ rb_sysopen - /dev/ttyACM0 #1498
Comments
The host serial interfaces are not available to containers (generally). If you are on a linux host, it is possible to make them available, but you still will probably run into permissions issues to work through. The bridge solution that you referenced was created to solve this (connecting to the serial port directly on the host and then serving the data to COSMOS through a TCP connection). Just connecting to the serial port you are referencing on the host is the first debugging step. Can you access /dev/ttyACM0 from any application? |
Thanks for the quick reply, how it works? how to connect? how to make sure that it works? |
Unfortunately we don't have great documentation for this yet. If you run:
That should setup the bridge for you. Edit the values in that file to match your local settings. Then run
To run the bridge. Note this will just sit there running. You'll want to setup your local plugin (see https://cosmosc2.com/docs/v5/gettingstarted for more info) to connect to the local machine on port 2950 (by default) and you can start COSMOS with:
To connect to it. |
After following the steps i get error: Connection Failed: ECONNREFUSED : Connection refused - connect(2) for 127.0.0.1:2950. INTERFACE INTERFACE_NAME tcpip_client_interface.rb localhost 2950 2950 10.0 nil BURST |
Is that the configuration inside your plugin.txt file? Change localhost to host.docker.internal Also, the bridge will need to be running before doing this or it also won't be able to connect. |
also when i changed to host.docker.internal i got the same error but different IP address: connection Failed: ECONNREFUSED : Connection refused - connect(2) for 172.17.0.1:2950 plugin.txt: INTERFACE INTERFACE_NAME tcpip_client_interface.rb host.docker.internal 2950 2950 10.0 nil BURST name_bridge.txt: ROUTER SERIAL_ROUTER tcpip_server_interface.rb 2950 2950 10.0 nil BURST |
INST_ROUTER is not the same as SERIAL_ROUTER. SERIAL_ROUTER is in the bridge. Is the bridge code running and connected to the serial port? |
The SERIAL_ROUTER is not running. and when I run the command (cosmos-control.sh cosmos bridge ACM0_bridge.txt {"time":1649267727456170894,"@timestamp":"2022-04-06T17:55:27.456+00:00","severity":"INFO","container_name":"eabe8281b9a3","log":"Processing Bridge configuration in file: /cosmos/local/ACM0_bridge.txt"} |
Can't use cosmos-control.sh cosmos cause that still runs in a container, not on the host system |
closing this ticket. See #1508 |
I am tring to connect serial interface on linux based machine I get those errors:
Plugin Interface:
INTERFACE INTERFACE_NAME serial_interface.rb /dev/ttyACM0 /dev/ttyACM0 115200 NONE 1 10.0 10.0 # no built-in protocol
INTERFACE_NAME: ENOENT : No such file or directory @ rb_sysopen - /dev/ttyACM0 /cosmos/lib/cosmos/io/posix_serial_driver.rb:55:in
'initialize' /cosmos/lib/cosmos/io/posix_serial_driver.rb:55:in
open' /cosmos/lib/cosmos/io/posix_serial_driver.rb:55:ininitialize' /cosmos/lib/cosmos/io/serial_driver.rb:67:in
new' /cosmos/lib/cosmos/io/serial_driver.rb:67:ininitialize' /cosmos/lib/cosmos/streams/serial_stream.rb:74:in
new' /cosmos/lib/cosmos/streams/serial_stream.rb:74:ininitialize' /cosmos/lib/cosmos/interfaces/serial_interface.rb:68:in
new' /cosmos/lib/cosmos/interfaces/serial_interface.rb:68:inconnect' interface_microservice.rb:477:in
connect' interface_microservice.rb:319:inblock in run' interface_microservice.rb:317:in
synchronize' interface_microservice.rb:317:inrun' /cosmos/lib/cosmos/microservices/microservice.rb:47:in
run' interface_microservice.rb:549:in `Also tried to follow up with this solution but problem didn't fixed.
The text was updated successfully, but these errors were encountered: