Is it possible to issue commands?
Forums:
Hey all, I'm interested in building a Raspberry Pi app, most likely in Python, that would send predefined commands to the software that controls DiddyBorg. Commands like forward slow, stop, turn left, spin right, etc, much like the web based-interface.
Would this be possible? Any info, places to start, etc, would be appreciated. :)
Nuzzle
Mon, 04/04/2016 - 21:54
Permalink
Edit: sorry, it double-posted
Edit: sorry, it double-posted for some reason.
piborg
Tue, 04/05/2016 - 13:38
Permalink
DiddyBorg remote control app
Yes, it would be possible to control DiddyBorg remotely.
If you are happy to use WiFi then I have two suggestions that would work.
1. Use the Web UI script
You could run the normal Web UI script on the DiddyBorg and have your app use HTTP GET requests to command the movement of the robot.
There are a few libraries which can make this easy in Python, a few are mentioned here:
http://stackoverflow.com/questions/645312/what-is-the-quickest-way-to-ht...
2. Use socket communications
Put simply you can send messages over the network without the HTTP layer used by the Web UI.
This would require writing a script for both the DiddyBorg and the app.
There are a few examples on our website for different boards which would make a good starting point.
These two are probably the easiest to understand:
https://www.piborg.org/comment/4683#comment-4683
https://www.piborg.org/remotekeyborg
In both cases you can use an IP address of
127.0.0.1
to run both scripts on the same Raspberry Pi with the PicoBorg Reverse attached for testing the code if you wanted.