cyoung / stratux

Aviation weather and traffic receiver based on RTL-SDR.
BSD 3-Clause "New" or "Revised" License
1.06k stars 363 forks source link

Traffic WebSocket Intermittently Stops Sending Updates #759

Open JohnMarzulli opened 5 years ago

JohnMarzulli commented 5 years ago
  1. Stratux version: 1.4r5

  2. Stratux config:

    SDR

    • [ ] single
    • [x ] dual

    GPS

    • [x ] yes
    • [ ] no type:

    AHRS

    • [x ] yes
    • [ ] no

    power source: 5v USB power socket AND Anker PowerCore 26800

    usb cable: Anker

  3. EFB app and version: (e.g., WingX Pro7 8.6.2) StratuxHud, 1.3 EFB platform: (e.g., iOS 9.2) Stratux 1.4r5 (Custom Image) EFB hardware: (e.g., iPad Mini 2) Raspberry Pi 3

  4. Description of your issue: The StratuxHud implements an ICMP Ping protocol. This sends Ping/Pong requests/responses to the Stratux.

When the software is running on the Stratux unit, after about 10 minutes messages from the WebSocket are no longer received. When the ping is coming from a dedicated unit (separate Raspberry Pi), the websocket stops receiving data after about 20 minutes.

Inspection of the Stratux code shows that receiving a ICMP RESPONSE should keep the client out of sleep mode. The HUD is making sure that a ICMP_ECHO_REPY is being sent, and sends one every two seconds "just to be sure".

Inspection of the Stratux code (I'm not fluent in Go...) looks like a timeout/sleep should happen within 15 seconds.

Additionally, I can not reproduce this behavior "on the ground".

cyoung commented 5 years ago

John, I think this is an issue in the websocket library. Can you try writing to the websocket every so often to keep it alive? The content you send doesn't matter, it will be discarded. If that keeps the socket alive indefinitely, it's the same issue as another app integrator had at one time.

JohnMarzulli commented 5 years ago

I'll give it a try. I am already sending Ping/Pong back to the Stratux per ICMP.

To be clear, you are suggesting writing to the same socket that is already open and I am receiving the traffic updates on?

cyoung commented 5 years ago

To be clear, you are suggesting writing to the same socket that is already open and I am receiving the traffic updates on?

Yes, exactly.

JohnMarzulli commented 5 years ago

I have been able to give this several tests with blindly writing to the socket and the pick. The connection will still appear to go to sleep.

OEZWONKP commented 5 years ago

I have the same issue with v1.5b2, the WebSocket goes to sleep, so no traffic updates. Refreshing the page does'nt bring it back up, however clicking on any other menue item will, at least for some time. Eventually you will need to reconnect the WiFi altogheter to get the WedUi to respond. Has there been any progress on this lately?