Closed AlirezaSalehy closed 2 years ago
Ciao @A-R-S-D I am sorry for the very late response.
I suspect you are experiencing a very common issue. The problem is the following. To understand if a collision occurred the device has only the chance to check the rx buffer to see if any communication occurred, or is occurring. To reduce the amount of PJON_BUSY
you need to receive for a small time before attempting any transmission, that would discard data in the rx buffer and let you transmit freely. Collisions may occur, although the system should work thanks to retransmissions.
Hi there! First i think that i have to appreciate this great open source network library, high regard for contributors. I'm working on a project in which i'm trying to establish a multi-master network over RS485 physical layer, with bus topology. I have noticed that the documentation of ThroughSerial says multi-master is supported using slotted ALOHA as MAC sublayer and that is really great. So i tried to test how collisions are handled and measure network reliability. The test consists of 3 nano boards. one that broadcasts a message periodically (say every 3 secs.) and two other nanos that reply to first nano as soon as they received the broadcasted message (which happens simultaneously for 2) . This way i deliberately generated a collision case, hoping that collision will be handled and the first nano will receive response of two others after some retransmission. But the bus failed completely that even first nano could hardly transmit periodic broadcast message at the right time, and second and third nanos could not send response even once.
bus.send_packet_blocking()
most of the times (say 90%) returnsPJON_BUSY
when called in theloop()
at first nano. Also i receivePJON_BUSY
error for both other nanos.Here is the code for first nano:
And code for two others:
So i need to know whether you guys can regenerate this case and see if same problem arise or i am doing something wrong that face this problem.
Thank you for your attentions. Best regards!
Ali R. Salehy