-
-
Notifications
You must be signed in to change notification settings - Fork 88
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
stream spits garbage when used with high rate uart 921600 #32
Comments
I was able to conduct an experiment and collect some more information. I was able to dig-in and dust-off an old Raspberry with HA core-2022.7.0 and ESPHome 2022.6.2. I compiled my ADSB project (same yaml code) there and installed it. I strongly believe the issue is with the latest stream-server version. Issue #34 seems related and proves the issue with the steam-serer is present even with much lower baud rate of 115k. So I think the hardware is not overloaded. @oxan can you please help? |
To summarize my findings so far. |
I checked the TCP receiver buffer is 256kb by default. |
Good day gentlemen,
I'm having a blocking issue with the latest ESPHome and latest version of the stream-server. All was working good and stable with my initial setup I did an year ago (spring of 2022). I upgraded the other day my HomeAssistant (2023.3.1) with latest ESPHome 2023.2.4 and the issue popped-up. Hence, I am attributing it to the version of ESPHome framework and the stream-server component.
My use case is: ADSB receiver decoding airplane positions and providing data as uart stream (one direction Tx only) at 921600 bps. The UART is hardwired to GPIO1 and 3 on ESP8266 (nodemcuv2) and oxan/esphome-stream-server serving the data as TCP stream. Then I have a client app READSB connecting to ESP over WiFi and taking the data for further processing. HomeAssistant has nothing to do with the stream-server, I just use ESPhome framework as a handy tool for programming the ESP.
The issue:
I observe a lot of garbage in the stream, which does not come from the ADSB receiver uart, but definitely comes from the esp8266 memory. The garbage is predominantly full of zeros but it has fragments of SSID list of nearby WiFi networks (heard by the ESP).
I suspect something's wrong with the buffer handling. The issue is directly related to the amount of data coming from the UART. When there is no data or small amount of data - everything is OK (clean TCP stream), but when the UART data is huge the garbage is very pronounced leading to impossibility to further processing. The other observation is that when I increase the UART rx_buffer_size from the default 256 to 512 or 1024 the TCP stream is almost full of garbage and when I decrease it to 64 it gets almost clean, but lots of incoming data gets dropped (so not usable either).
The other observation is: I reboot the ESP, connect to the TCP stream and the stream is clean. Then I disconnect and reconnect and the stream is immediately garbled.
Oxan, Joshua, Bojan, can you help me investigate the issue and diagnose it, please?
Here is my config:
ADSB.txt
And here is a capture of the TCP stream.
capture.txt
Lines 1-6 are normal ADSB messages.
Lines 7-18 are garbage.
Lines 19-22 are normal ADSB messages.
I am available to provide further information or give you access to my system for live investigation.
Thank you in advance,
Kiril
The text was updated successfully, but these errors were encountered: