-
Notifications
You must be signed in to change notification settings - Fork 100
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
Unable to detect loss of signal/input from Python program #23
Comments
I am also running into this problem.
Unfortunately, this is a pretty bad solution - during testing, if I unplug the batteries to my wiimote all of a sudden while the robot's motors (wheels) are running, the request_status() function won't error out for over 20 seconds. The robot could have run into all sorts of things in 20 seconds. Is there a better way to do this? |
Hi folks, I think I have solved this problem. The underlying issue is that bluetooth is a pretty tolerant protocol - it expects people with bluetooth devices to wander away and come back and find everything reconnects happily. This is fine if you're playing music or using a keyboard, but not so great if you're controlling a robot car (which I am also implementing 👍 ). I can't find an easy way to change the timeout in However, the command line tool
So, I have devised a connection strategy:
We can then implement @terminator14 's strategy of having a background thread to monitor the response from the wiimote. I have implemented all the above for my project and everything stops within a couple of seconds of removing the batteries Hope this helps, Phil |
@furbrain this thread is two years old already but great to hear you found a potential solution. I'd like to try it out next time I fire up my robot. http://blog.alexellis.io/piwars-v2-0/ |
@furbrain That worked really well, you're a life saver! |
Hi, I'm using this library on a Raspberry PI with Python 2.7 to control a robot/car. This works brilliantly with a high range until the range is too far at which point I can't detect loss of signal/input and the car continues off into the distance etc.
Is there a way to resolve this?
Thanks
The text was updated successfully, but these errors were encountered: