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

Support hot-pluggable serial USB ports #749

Closed
vortex314 opened this issue Feb 21, 2024 · 2 comments · Fixed by #770
Closed

Support hot-pluggable serial USB ports #749

vortex314 opened this issue Feb 21, 2024 · 2 comments · Fixed by #770
Labels
new feature Something new is needed

Comments

@vortex314
Copy link

vortex314 commented Feb 21, 2024

Describe the feature

I like a lot the concepts and the connectivity of zenoh , it solves a lot of challenges when you try to build a robotic model around pub/sub.
One of the things I try is to use an embedded linux server where the sensors and actuators are connected via USB. This makes it modular and easy composable. So the idea is to use the serial across USB. In linux these devices come and go as "/dev/ttyUSBx" or "/dev/ttyACMx". When I configure zenohd with a serial interface like below.

  listen: {
    endpoints: [
        "serial//dev/ttyUSB0#baudrate=115200"
      // "<proto>/<address>"
    ],
  },

The zenohd daemon fails to start as the device is not there yet.

[2024-02-21T18:52:13Z DEBUG mio_serial] opening serial port in synchronous blocking mode
[2024-02-21T18:52:13Z WARN  zenoh_link_serial::unicast] Can not create a new Serial link bound to "/dev/ttyUSB0": No such file or directory at io/zenoh-links/zenoh-link-serial/src/unicast.rs:297.
[2024-02-21T18:52:13Z ERROR zenoh::net::runtime::orchestrator] Unable to open listener serial//dev/ttyUSB0#baudrate=115200: Can not create a new Serial link bound to "/dev/ttyUSB0": No such file or directory at io/zenoh-links/zenoh-link-serial/src/unicast.rs:297.
Can not create a new Serial link bound to "/dev/ttyUSB0": No such file or directory at io/zenoh-links/zenoh-link-serial/src/unicast.rs:297.. Exiting...

Is there a way to address this. As I want to avoid writing unnecessary proxies for zenoh.
Hope you can guide me further.

@vortex314 vortex314 added the new feature Something new is needed label Feb 21, 2024
@vortex314
Copy link
Author

Could be related - #712

@vortex314 vortex314 changed the title Support USB serials that come and go Support hot-pluggable serial USB ports Feb 22, 2024
@Mallets Mallets linked a pull request Mar 8, 2024 that will close this issue
@vortex314
Copy link
Author

The issue doesn´t look to be solved :

   Compiling zenohd v0.11.0-dev (/home/lieven/workspace/zenoh/zenohd)
    Finished release [optimized] target(s) in 3m 37s
[2024-03-23T09:32:11Z INFO  zenohd] zenohd v0.11.0-dev-167-g3a264558 built with rustc 1.72.0 (5680fa18f 2023-08-23)
[2024-03-23T09:32:11Z INFO  zenohd] Initial conf: {"adminspace":{"permissions":{"read":true,"write":false}},"aggregation":{"publishers":[],"subscribers":[]},"connect":{"endpoints":[],"exit_on_failure":null,"retry":null,"timeout_ms":null},"downsampling":[],"id":"a12895a76d55c393f66b288ff6763619","listen":{"endpoints":["serial//dev/ttyUSB1#baudrate=115200","serial//dev/ttyUSB2#baudrate=115200","tcp/localhost:7447"],"exit_on_failure":null,"retry":null,"timeout_ms":null},"metadata":{"location":"Penny Lane","name":"strawberry"},"mode":"router","plugins":{},"plugins_search_dirs":[],"queries_default_timeout":10000,"routing":{"peer":{"mode":"peer_to_peer"},"router":{"peers_failover_brokering":true}},"scouting":{"delay":200,"gossip":{"autoconnect":{"peer":"router|peer","router":""},"enabled":true,"multihop":false},"multicast":{"address":"224.0.0.224:7446","autoconnect":{"peer":"router|peer","router":""},"enabled":true,"interface":"auto","listen":true},"timeout":3000},"timestamping":{"drop_future_timestamp":false,"enabled":{"client":false,"peer":false,"router":true}},"transport":{"auth":{"pubkey":{"key_size":null,"known_keys_file":null,"private_key_file":null,"private_key_pem":null,"public_key_file":null,"public_key_pem":null},"usrpwd":{"dictionary_file":null,"password":null,"user":null}},"link":{"protocols":null,"rx":{"buffer_size":65535,"max_message_size":1073741824},"tls":{"client_auth":false,"client_certificate":null,"client_private_key":null,"root_ca_certificate":null,"server_certificate":null,"server_name_verification":null,"server_private_key":null},"tx":{"batch_size":65535,"keep_alive":4,"lease":3000,"queue":{"backoff":100,"congestion_control":{"wait_before_drop":1000},"size":{"background":4,"control":1,"data":4,"data_high":2,"data_low":4,"interactive_high":1,"interactive_low":1,"real_time":1}},"sequence_number_resolution":"32bit","threads":2},"unixpipe":{"file_access_mask":null}},"multicast":{"compression":{"enabled":false},"join_interval":2500,"max_sessions":1000,"qos":{"enabled":false}},"shared_memory":{"enabled":true},"unicast":{"accept_pending":100,"accept_timeout":3000,"compression":{"enabled":false},"lowlatency":false,"max_links":10,"max_sessions":1000,"qos":{"enabled":true}}}}
[2024-03-23T09:32:11Z INFO  zenoh::net::runtime] Using PID: a12895a76d55c393f66b288ff6763619
[2024-03-23T09:32:11Z WARN  zenoh_link_serial::unicast] Can not create a new Serial link bound to "/dev/ttyUSB2": No such file or directory at io/zenoh-links/zenoh-link-serial/src/unicast.rs:303.
[2024-03-23T09:32:11Z WARN  zenoh::net::runtime::orchestrator] Unable to open listener serial//dev/ttyUSB2#baudrate=115200: Can not create a new Serial link bound to "/dev/ttyUSB2": No such file or directory at io/zenoh-links/zenoh-link-serial/src/unicast.rs:303.
Can not create a new Serial link bound to "/dev/ttyUSB2": No such file or directory at io/zenoh-links/zenoh-link-serial/src/unicast.rs:303.. Exiting...

even with config settings of retry , did I miss something ?

  listen: {
    endpoints: [
        "serial//dev/ttyUSB1#baudrate=115200;retry_period_init_ms=20000;retry_period_max_ms=10000",
        "serial//dev/ttyUSB2#baudrate=115200;retry_period_init_ms=20000;retry_period_max_ms=10000",
        "tcp/localhost:7447",
      // "<proto>/<address>"
    ],
  },

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new feature Something new is needed
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

1 participant