Closed MarcFinetRtone closed 5 months ago
Thank you for your detailed investigation. I also did come across this issue when testing with two ESP32s. There should be no issue when you only use one ESP32 (AP or client) in combination with a regular PC connecting via Wifi to the ESP.
I have a few best guesses that I could not test so far:
TRANS_RD_BYTES_NUM
(that is how many bytes we try to read with every call)My tests without flow control showed even worse results with a packet loss of up to 90%. I think the ESP32 HW can do much more so there must be an issue with the implementation here.
I just set the max wait time of uart_read_bytes
to zero and it had quite some impact. My loss rate is down to <1% now!
200ms was very unreasonable. I think the issue did not pop up till now since the upstream from the GCS is rather low and thus waiting that long for data did not happen too often.
Now with the ticks to wait set to zero, I think it would also make sense to replace TRANS_RD_BYTES_NUM
with the transparent packet size TRANSPARENT_BUF_SIZE
. I haven't tested that but this should improve throughput even further.
Waiting for your results
The issue should be gone/improved with the new v1.5 release
Thanks for great project. We tested it with a modified version of
bw-test.py
from mavlink's project. I did not created the MR yet so here's the gist: https://gist.github.com/MarcFinetRtone/0d2732034f2a6a863614d37d7c6ed782I added support for flow-control (I will open a MR here for this to fix #57), branch: https://github.com/MarcFinetRtone/dronebridge-esp32/tree/feat/add-flow-control).
The setup:
./bw-test.py --baud 460_800 --lat --device /dev/serial/by-id/… > >(ts %H:%M:%S | tee -a $(date +%Y-%m-%d-%H%M%S.log))& pid=$!; doit(){ trap "kill $pid; return 0;" INT; while true; do read -t 10; kill -USR1 "$pid"; done;}; doit
configuration (AP here):
The results:
The issues:
--delay=10
on the peer (that lowered the throughput, but also the error down to 0). Even the flow control does not help here.--no-tx
on one device). Since it's what will be live, we wanted to test this situation (in order to see if throughput (rover→ground-station) increases)Any idea ?