Control your PicoBorg car remotely with the keyboard

Having assembled the robot I am now up to the stage of coding the robot so it will move over the wireless network in school, however I am struggling with how to do this and was wondering if anyone on here could assist with this.

I have got an 8GB memory card and have got the 2 python files ready to put on the card. Before I put them on the card do I need to install an operating system onto the card?

Once the files are on the Pi how do I get the keyboard from another computer to move the Pi?

Sorry if these are basic questions, new to this so dont want to unintentionally break anything.

Thanks

Dan

piborg's picture

No problem, things are only easy if you already know how to do them :)

The SD card will need to have an operating system installed to run the Raspberry Pi itself.
We recommend downloading the Raspbian distribution (version of Linux) from the Raspberry Pi downloads page here.
You can find instructions on how to copy the image on to the SD card here.

After you have copied the image on to the SD card you will want to attach a monitor, the PicoBorg, keyboard and mouse.
Start the Raspberry Pi by connecting the power supply and follow the on screen menus to setup the Raspberry Pi.

You will next need to setup the WiFi dongle for the Raspberry Pi, you may want a USB hub to do this as you will probably want a keyboard and mouse to setup the dongle (there is a WiFi setup icon on the desktop), but you must have the dongle plugged in before starting the Raspberry Pi to set it up correctly.
You may need configuration details for the WiFi to setup the network properly, if you are not sure talk with the IT administrators at the school.

Once the Raspberry Pi is connected to the network you can find the IP address by opening a terminal (icon on desktop, looks like a black screen) and typing the following command:
sudo ifconfig
A block of text should come back, on the line below the one starting with wlan0 there should be inet addr: followed by four numbers separated by three dots, e.g. 192.168.0.12, this sequence is the IP address.
Write the IP address down we will need it later.

Now you should copy the RemoteKeyBorgS.py script onto the Raspberry Pi and make it executable.
Assuming the Raspberry Pi can access the internet this can be easily done from the terminal with the following commands:

cd ~
wget -O RemoteKeyBorgS.py https://www.piborg.org/downloads/RemoteKeyBorgS.txt
chmod +x RemoteKeyBorgS.py

you can then run the Raspberry Pi side of the script using
sudo ~/RemoteKeyBorgS.py
Press Enter when prompted.

Now you need to download the RemoteKeyBorgC.py script onto the machine you wish to run the PicoBorg robot from, this can be any computer connected to the same network, running Python and pygame.
Next edit the RemoteKeyBorgC.py script so that line 10 has the correct IP address you wrote down earlier, e.g.
broadcastIP = '192.168.0.12'
You should now be able to run the script and use the , and keys to control the PicoBorg motors.

Hi! Have you explored replacing keyboard commands with voice commands? Thanks!

piborg's picture

We have not, but it can be done ^_^

There is a good blog post here which talks about the bits required to get a Raspberry Pi to turn speach into commands for a robot:
http://makezine.com/projects/use-raspberry-pi-for-voice-control/

Thanks for the link. I'll try it out. By the way, can I use a servo on PicoBorg?

piborg's picture

Unfortunately no, the output produced by PicoBorg is not compatible with the signal line used to control a servo.

So can I buy a TriBorg to expand my GPIO pins and plug my current PicoBorg as well as get an UltraBorg and plug it in the TriBorg. Will everything work? Thanks for your patience!

piborg's picture

Yes, you can have both an UltraBorg and a PicoBorg attached to the same Raspberry Pi using a TriBorg.

All of the software will owrk together, it should also leave you with a spare set of GPIO pins for connecting other boards as well.

That's cool! Have you considered creating an iOS app to easily control all these modules? Including the RPi Camera? That'll be great!

piborg's picture

We do not have a phone app for controlling any of our boards at the moment, but we do have some web apps.

We have one for DiddyBorg / PicoBorg Reverse as well as the camera here:
https://github.com/piborg/diddyborg-web

We have another for just the UltraBorg here:
https://github.com/piborg/ultraborg-web

We do not have one for PicoBorg, however it would be possible.
What you can do is use WebIOPi to control the GPIO pins connected to the PicoBorg outputs:
http://trouch.com/2012/08/21/webiopi-control-your-pis-gpio-with-a-browser/

Subscribe to Comments for "Control your PicoBorg car remotely with the keyboard"