gioblu / PJON

PJON (Padded Jittering Operative Network) is an experimental, arduino-compatible, multi-master, multi-media network protocol.
Other
2.73k stars 239 forks source link

AVR Tx -> ESP32 Rx bad reply rate #401

Open sephalon opened 2 years ago

sephalon commented 2 years ago

I would like to establish bidirectional communication between an ESP32 and an AVR ATmega. If the ESP32 is transmitting and the AVR receiving, everything is fine:

Packet Overhead: 10B - Total: 590B
Bandwidth: 1770B/s
Data throughput: 1180B/s
Packets sent: 59
Fail (no acknowledge from receiver): 0
Busy (Channel is busy or affected by interference): 0
Delivery success rate: 100.00 %
---------------------
Packet Overhead: 10B - Total: 570B
Bandwidth: 1710B/s
Data throughput: 1140B/s
Packets sent: 57
Fail (no acknowledge from receiver): 2
Busy (Channel is busy or affected by interference): 4
Delivery success rate: 96.49 %
---------------------
Packet Overhead: 10B - Total: 580B
Bandwidth: 1740B/s
Data throughput: 1160B/s
Packets sent: 58
Fail (no acknowledge from receiver): 1
Busy (Channel is busy or affected by interference): 2
Delivery success rate: 98.28 %
---------------------

image ESP32 Tx -> AVR Rx. One can clearly see the higher voltage level of the AVR during the reply.

image ESP32 Tx -> AVR Rx reply in more detail.

The NetworkAnalysis example looks completely different however when the roles are inversed, i.e. AVR is transmitting and ESP32 is receiving:

Packet Overhead: 10B - Total: 270B
Bandwidth: 810B/s
Data throughput: 540B/s
Packets sent: 27
Fail (no acknowledge from receiver): 31
Busy (Channel is busy or affected by interference): 0
Delivery success rate: -14.81 %
---------------------
Packet Overhead: 10B - Total: 190B
Bandwidth: 570B/s
Data throughput: 380B/s
Packets sent: 19
Fail (no acknowledge from receiver): 39
Busy (Channel is busy or affected by interference): 0
Delivery success rate: -105.26 %
---------------------
Packet Overhead: 10B - Total: 140B
Bandwidth: 420B/s
Data throughput: 280B/s
Packets sent: 14
Fail (no acknowledge from receiver): 44
Busy (Channel is busy or affected by interference): 0
Delivery success rate: -214.29 %
---------------------

image AVR Tx -> ESP32 Rx. On this record only one packet actually got a reply from the ESP32.

image AVR Tx -> ESP32 Rx reply in more detail.

Some things I have tried, but did not improve the situation:

I have been using PJON 13.0 and I do not use a level shifter since the ESP32 is 5 V tolerant.

I am a bit at a loss now – from the description in the spec, I cannot really wrap my head around how the protocol actually works and therefore do not know what to look for on the scope; on the surface everything looks fine. Any ideas on how to continue debugging?