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

[Bug] Serial transport gets closed after 1 connection on router, client side also doesn´t do any retry #357

Closed
vortex314 opened this issue Feb 26, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@vortex314
Copy link
Contributor

Describe the bug

When connecting via serial port to zenohd, it accepts the session , transports data and the closes the connection.

From that point on it ignores any new connection attempts.

]
[2024-02-26T21:00:09Z TRACE z_serial] Frame after COBS encoding [2B, 00, 05, 63, DD, 01, 21, 0D, 01, 23, 5B, 20, 20, 39, 38, 5D, 20, 5B, 45, 53, 50, 49, 44, 46, 5D, 7B, 45, 53, 50, 33, 32, 7D, 20, 20, 5A, 65, 6E, 6F, 68, 2D, 50, 69, 63, 6F, 21, AC, F2, 19, FF]
[2024-02-26T21:00:09Z TRACE z_serial] Received CRC FF19F2AC  Computed CRC FF19F2AC
[2024-02-26T21:00:09Z TRACE zenoh_transport::unicast::universal::rx] Received: TransportMessage { body: Frame(Frame { reliability: BestEffort, sn: 99, ext_qos: QoSType { inner: 5 }, payload: [NetworkMessage { body: Push(Push { wire_expr: 1:Sender:, ext_qos: QoS { priority: Data, congestion: Block, express: false }, ext_tstamp: None, ext_nodeid: NodeIdType { node_id: 0 }, payload: Put(Put { timestamp: None, encoding: Exact(Empty), ext_sinfo: None, ext_attachment: None, ext_unknown: [], payload: ZBuf { slices: [[5b, 20, 20, 39, 38, 5d, 20, 5b, 45, 53, 50, 49, 44, 46, 5d, 7b, 45, 53, 50, 33, 32, 7d, 20, 20, 5a, 65, 6e, 6f, 68, 2d, 50, 69, 63, 6f, 21]] } }) }) }] }) }
[2024-02-26T21:00:10Z TRACE z_serial] Read 51 bytes COBS [02, 2B, 30, 05, 64, DD, 01, 21, 0D, 01, 23, 5B, 20, 20, 39, 39, 5D, 20, 5B, 45, 53, 50, 49, 44, 46, 5D, 7B, 45, 53, 50, 33, 32, 7D, 20, 20, 5A, 65, 6E, 6F, 68, 2D, 50, 69, 63, 6F, 21, FA, B4, F0, F9, 00]
[2024-02-26T21:00:10Z TRACE z_serial] Frame after COBS encoding [2B, 00, 05, 64, DD, 01, 21, 0D, 01, 23, 5B, 20, 20, 39, 39, 5D, 20, 5B, 45, 53, 50, 49, 44, 46, 5D, 7B, 45, 53, 50, 33, 32, 7D, 20, 20, 5A, 65, 6E, 6F, 68, 2D, 50, 69, 63, 6F, 21, FA, B4, F0, F9]
[2024-02-26T21:00:10Z TRACE z_serial] Received CRC F9F0B4FA  Computed CRC F9F0B4FA
[2024-02-26T21:00:10Z TRACE zenoh_transport::unicast::universal::rx] Received: TransportMessage { body: Frame(Frame { reliability: BestEffort, sn: 100, ext_qos: QoSType { inner: 5 }, payload: [NetworkMessage { body: Push(Push { wire_expr: 1:Sender:, ext_qos: QoS { priority: Data, congestion: Block, express: false }, ext_tstamp: None, ext_nodeid: NodeIdType { node_id: 0 }, payload: Put(Put { timestamp: None, encoding: Exact(Empty), ext_sinfo: None, ext_attachment: None, ext_unknown: [], payload: ZBuf { slices: [[5b, 20, 20, 39, 39, 5d, 20, 5b, 45, 53, 50, 49, 44, 46, 5d, 7b, 45, 53, 50, 33, 32, 7d, 20, 20, 5a, 65, 6e, 6f, 68, 2d, 50, 69, 63, 6f, 21]] } }) }) }] }) }
[2024-02-26T21:00:10Z TRACE z_serial] Read 13 bytes COBS [02, 05, 0A, 05, 65, 1E, 01, 01, 08, FA, 37, FA, 00]
[2024-02-26T21:00:10Z TRACE z_serial] Frame after COBS encoding [05, 00, 05, 65, 1E, 01, 01, 08, FA, 37, FA]
[2024-02-26T21:00:10Z TRACE z_serial] Received CRC FA37FA08  Computed CRC FA37FA08
[2024-02-26T21:00:10Z TRACE zenoh_transport::unicast::universal::rx] Received: TransportMessage { body: Frame(Frame { reliability: BestEffort, sn: 101, ext_qos: QoSType { inner: 5 }, payload: [NetworkMessage { body: Declare(Declare { ext_qos: QoS { priority: Data, congestion: Drop, express: false }, ext_tstamp: None, ext_nodeid: NodeIdType { node_id: 0 }, body: UndeclareKeyExpr(UndeclareKeyExpr { id: 1 }) }) }] }) }
[2024-02-26T21:00:10Z TRACE z_serial] Read 10 bytes COBS [02, 02, 02, 23, FD, 53, 76, 8F, F9, 00]
[2024-02-26T21:00:10Z TRACE z_serial] Frame before COBS encoding [01, 00, 04, BA, 6C, 6A, F8]
[2024-02-26T21:00:10Z TRACE z_serial] Wrote 9bytes COBS [02, 01, 06, 04, BA, 6C, 6A, F8, 00]
[2024-02-26T21:00:13Z TRACE z_serial] Frame before COBS encoding [01, 00, 04, BA, 6C, 6A, F8]
[2024-02-26T21:00:13Z TRACE z_serial] Wrote 9bytes COBS [02, 01, 06, 04, BA, 6C, 6A, F8, 00]
[2024-02-26T21:00:15Z TRACE z_serial] Frame before COBS encoding [01, 00, 04, BA, 6C, 6A, F8]
[2024-02-26T21:00:15Z TRACE z_serial] Wrote 9bytes COBS [02, 01, 06, 04, BA, 6C, 6A, F8, 00]
[2024-02-26T21:00:18Z TRACE z_serial] Frame before COBS encoding [01, 00, 04, BA, 6C, 6A, F8]
[2024-02-26T21:00:18Z TRACE z_serial] Wrote 9bytes COBS [02, 01, 06, 04, BA, 6C, 6A, F8, 00]
[2024-02-26T21:00:20Z DEBUG zenoh_transport::unicast::universal::link] serial//dev/ttyUSB2 => serial/958225c9-cda3-46c8-b947-5d2aa165a666:BatchConfig { mtu: 1500, is_streamed: false }: expired after 10000 milliseconds at io/zenoh-transport/src/unicast/universal/link.rs:290.
[2024-02-26T21:00:20Z DEBUG zenoh_transport::unicast::universal::transport] [8aa074711b0ec1ae659c86d14886d757] Closing transport with peer: c4aa8876ec0c09676d6071a6def58a03
[2024-02-26T21:00:20Z TRACE zenoh_transport::unicast::universal::link] serial//dev/ttyUSB2 => serial/958225c9-cda3-46c8-b947-5d2aa165a666: closing
[2024-02-26T21:00:25Z TRACE zenoh_transport::unicast::manager] Accepting link... serial//dev/ttyUSB2 => serial/958225c9-cda3-46c8-b947-5d2aa165a666
[2024-02-26T21:00:25Z TRACE z_serial] Read 5 bytes COBS [28, F9, E1, FB, 00]
[2024-02-26T21:00:35Z DEBUG zenoh_transport::unicast::manager] future has timed out

Also from client side on the serial port , there is no retry attempt if the setup of the session fails.
It keep hanging on a read and never times out.

I (312) cpu_start: Chip rev:         v1.0
I (317) heap_init: Initializing. RAM available for dynamic allocation:
I (324) heap_init: At 3FFAE6E0 len 00001920 (6 KiB): DRAM
I (330) heap_init: At 3FFB3190 len 0002CE70 (179 KiB): DRAM
I (336) heap_init: At 3FFE0440 len 00003AE0 (14 KiB): D/IRAM
I (342) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
I (349) heap_init: At 4008CFE8 len 00013018 (76 KiB): IRAM
I (356) spi_flash: detected chip: winbond
I (360) spi_flash: flash io: dio
I (365) cpu_start: Starting scheduler on PRO CPU.
I (0) cpu_start: Starting scheduler on APP CPU.
 >>> Starting Zenoh-Pico Publisher...
 Opening Zenoh Session...  
I (485) uart: queue free spaces: 100
[1970-01-01T00:00:00Z INFO ::_z_unicast_open_client] Sending Z_INIT(Syn)
[1970-01-01T00:00:00Z DEBUG ::_z_init_encode] Encoding _Z_MID_T_INIT

Restarting the client doesn´t help also as the zenohd completely ignores the port.

What am I missing ? The way server and client handle a serial unreliable connection simply cannot work.

To reproduce

  • start zenohd zith serial listen port
  • start client serial on esp32
  • first session successful
  • second session fails at server and client side

System info

@jean-roland
Copy link
Contributor

Related to #355
Solved in #383

@Mallets Mallets closed this as completed Apr 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants