@synman if you read the code, you will see that the UDP is not where it is doing connect. It is doing connect on the TCP port with the handshake, which is what is required.
@sletts021 I would suspect that you just need to reconnect. I have seen several times where it thinks it is connected but it really isn’t. I reconnect to the wifi and then I wait a few seconds and then run the code and it is fine. Or I just re-run if it gives me that error. It has to do with the initial TCP handshake with the drone. If that fails, nothing else will work.
I didn’t debug it myself… took a quick glance at the WifiConnection class and saw the improper usage of connect() on a UDP packet within various exception blocks. Just trying to help
Ha, there is an old connect hanging around there. On the other hand, it isn’t what is causing the error (it doesn’t cause any issues). The error is that the handshake didn’t work. Not my code’s fault. The Mambo either replies back or it doesn’t and it doesn’t show why. I always just re-try it and it works. That’s why it prints that out at the top of the error
Hmmm, not sure what I’m doing wrong.
I’ve tried two different mambos/FPV; disconnecting and reconnecting wifi; two different computers with different wifi adapters.
The mambo FPV works in the freefly app.
Here’s a thought: have you updated to the latest firmware? I wonder if that is the difference between our mambos? I’m running the latest one. Perhaps the handshake is different?
Hey, I am one of @sletts021 's Students here…
He did ask me to look at this problem… So I am going to try and use pyparrot instead… Would that be a good idea?
I’m confused. You are using pyparrot. Have you checked the firmware btw? I’ve used this on 3 separate mambos and whenever I see the issue you are seeing, I simply re-run the program and it works. Your initial connection to the drone is what is failing. Sometimes (in my experience from testing), it takes ~2-3 minutes on the wifi before it actually will talk to the mambo.
Apologies for my student’s response. I gave our IT trainee the task of giving it a go with a fresh laptop, however, he may have been confused about pymambo vs pyparrot.
Yes, PyParrot has been what I have been using (see the image above). I will give it another go tonight and leave it connected for 3 minutes, however, I have tried re-running, disconnecting/reconnecting etc. I will also boot up a linux distro and see if I have success with linux.
Thanks for all your work
Thank you! I hope it works. I don’t have any windows laptops to test with so I truly hope this isn’t a windows problem. I only have Mac & linux in my house so that’s what I used to test. Please let me know if things don’t work. If it is windows, I’ll try to find a windows laptop and test and fix! I’m sure I can find one at work to borrow.
In a different thread, I think we have resolved that this is a windows issue and they know how to solve it. If I can test it on my Mac tonight, I will check in the fix (assuming it doesn’t break the Mac!)
Awesome! I believe it would be a Windows thing… I’ve had it working on a Rasbpian Pixel USB (which might end up being easier than Windows anyway).
Please keep me updated Thanks so much for all your work!
Had a bit more of a play with Rasbpian for PC’s Stretch. Works flawlessly (protip, use pip3 for the zeroconf install). The kids are going to love it.
Is there any chance you could provide a quick example script of FPV?
I’ve mostly been looking at the FPV stuff using VLC. I have it so you can save out frames and ask for frames but I haven’t really done any processing (it’s on my long term agenda to get blob tracking working easily for the kids). How do you want to see it used? Also, know that it will fail miserably on a real Raspberry Pi. I’m assuming yours is ok since it is really running on a PC. The PI can’t handle the 30 FPS that the camera wants to send.
That’s exciting. Yea the PC’s are i5 with on-board graphics and 8gb ram so should handle it no worries I’d imagine.
Really just streaming to start with? And then looking in to OpenCV to do object recognition/tracking similar to https://www.youtube.com/watch?v=RiIMSGQSSvA
You should be able to do that demo with the images. As for streaming, just open the URL that is in MamboVision in VLC. That’s how I’ve been watching. VLC seems to build in a 2 second delay (for buffering) but it otherwise is an easy way to see the vision. I’ll play with some code to fly and take pictures. I’ve got a full weekend but it will come soon
I put an example online for mambo vision but the caveat is that I’m having trouble getting RTSP to work on my Mac (it works in VLC but not inside python 3, I assume I have a missing library and will hunt it down). I was able to verify that all the code to save images works by recording from my laptop webcam (it’s a one line change in MamboVision, available via a commented out line). Until I can verify it on my Mac, I won’t make a new release but I did check the code in so you can see it on GitHub if you want. it’s in examples and called demoMamboVision.py.
A bit of a reboot @captainsaviik!
School’s back and I am keen to start with our students Perhaps getting them to create a GUI for controlling it.
Have you had any luck with OpenCV, Python 3 and PyParrot? If so, could you please step me through it?
Hi @sletts021. I have some progress to report. I can get opencv working in Python 2 but not Python 3 but it also drops a lot of frames. This seems to be a problem specifically with opencv. I have a student who is using it for research and he got it working in a python based VLC library and he has promised to send me his code this week so I intend to release that shortly. In the meantime, I have been working on BebopVision using the same interface same issues in opencv.
That’s really exciting! Here’s hoping your students comes through with the goods
Is the issue with OpenCV? (i.e. if it was on a high specced machine would it also drop frames?) I ask because we use Raspberry Pi Desktop on i5/8gb with SSDs.