amymcgovern / pyparrot

Python interface for Parrot Drones
MIT License
275 stars 129 forks source link

Unable to fetch stable video data at Ubuntu 18.04 ( solved, vlc network handling) #137

Closed aelthalyste closed 5 years ago

aelthalyste commented 5 years ago

Hi, first of all, thank you for such a great project but I have some issues :

I have edited your DroneVisionGUI.py for special purposes, simply I needed another UI for controlling bebop, and had no problem while designing it on PyQt. But the real problem isn't editing UI, the problem is fetching video stream from bebop(I have similar streaming problems at the original repository)

I can connect bebop, it's okay, and get success from callbacks. I didn't touch VLC player settings, video stream code is still same. But neither the player generating any 'visionStream.jpg' file nor video_take_snapshot() function returns success report(it is -1 all the time).

I have been working on this issue about two full days, just connected with successful video stream like 4-5 times in that time. Got some images, but after restarting the app, the problem raised again.

I have tried your original DroneVision.py and GUI.py codes also

Got this error at DroneVision.py

Things I tried:

aelthalyste commented 5 years ago

Update:

I have closed drone for two hours, then started it then I was able to get video data again. Then forced to close from the terminal. Then restarted app but it didn't work. Probably it's about closing procedures. I'm trying to write secure closing procedure(like crash handler, or forcing to close from outside ).

aelthalyste commented 5 years ago

SOLVED IT I just want to say WOW. Found it!

When I tried to close the computer, error message raised and said "There are unfinished jobs" and blah blah and VLC player icon. But it was impossible, I have had closed all apps and terminals, then it rang.

When the program crashed early in the day and probably yesterday, it wasn't properly closed. The error wasn't about drone or @amymcgovern 's code. VLC couldn't handle crashes and force stops. As soon as I saw "there are unfinished jobs and background workers" text, I did below:

  1. Closed all terminals and active python apps
  2. Opened new terminal from stratch
  3. Run gnome-system-monitor
  4. Select processes tab
  5. Ctrl + F and type python
  6. Killed all active python works.
  7. Then re-run app

and worked!

You can do 6th step without closing all active python apps at step 1. But at this time you have to choose which python process to kill with looking which script ran it(You can do it with moving the cursor over the python3 text at gnome system monitor, less than a second it shows you which script owns

Edit: I got some other network error a month ago(connection refused Error 98), fixed it, maybe somebody struggling with the same problem, going to pull a request as soon as possible.