Ankermgmt / ankermake-m5-protocol

Ankermake M5 protocol specifications and libraries *NOT AFFILIATED WITH ANKER*
GNU General Public License v3.0
164 stars 36 forks source link

[BUG] PPPP connection drops out after a short delay on webserver startup. #127

Open austinrdennis opened 1 year ago

austinrdennis commented 1 year ago

Describe the bug A similar problem to the one described in #49. I'm having connection problems over PPPP, but only after it works flawlessly for anywhere from 5-45 seconds(ish). Then the video stream freezes and the printer stops responding to PPPP commands.

To Reproduce Steps to reproduce the behavior:

  1. Install prerequisites from requirements.txt.
  2. Run the webserver via python.
  3. Open the webpage and allow it to load.
  4. Wait for the video stream to freeze.

Expected behavior The PPPP connection continues to function once established.

Screenshots Screenshots gallery.

Desktop (please complete the following information):

Additional context

jk-andersen commented 1 year ago

I am having the same issue running on docker. need to hard kill the process or restart the container

HakonHarnes commented 1 year ago

I've also been encountering the same issue where the PPPP connection drops out after a short delay. Restarting the ankerctl service resolves the issue temporarily for me. However, after a few service restarts, the PPPP connection stops working completely, and the Ankermake app displays an "Unable to play real-time video (10000)" error. This error is resolved when the printer is turned off and back on.

This behavior suggests that the PPPP connection might not be properly released by ankerctl, effectively resulting in a build-up of active connections. It seems plausible that the printer might have a limit on the number of active PPPP connections it can handle at a time. If these connections are not released correctly, we may exhaust this limit, which would explain why the connection drops and why the issue resolves upon restarting the printer (which would forcibly close these connections).

@chrivers, would you be able to provide some insight into the process of terminating PPPP connections in ankerctl? My current understanding is that restarting ankerctl might leave these connections open, unless there's a mechanism like persistent storage (e.g., a file recording the connections) to track and properly close them before opening new ones. Or perhaps the PPPP connection times out after a while. I'm not familiar with this kind of stuff but I might look into resolving the issue.

z-master42 commented 10 months ago

I also have a problem with PPPP. However, when I upload my login.json, the wrong IP address and MAC address are extracted. What could be the reason for this? MQTT and CTRL are green.