Manual Control

I saw recantha’s post pointing people at Brian Corteil’s post on how to control your robot and was surprised to see that the method I used for Metabot last year wasn’t listed.  So the obvious thing to do is to document it here, right? 🙂

Our method:

  • Connect a cheap USB wifi dongle to the Pi
  • Set the Pi up as a WiFi access point
  • Connect a laptop to the Pi’s access point
  • Connect an xbox 360 joypad to the laptop
  • Write the robot’s controlling python script – it listens for TCP on a port
  • The laptop runs a very simple pygame script which listens for joystick inputs:
    • These come into the script from the Pygame library as a dictionary.
    • The script then converts this dictionary to JSON (using the python json library)
    • and sends the JSON over TCP to the IP address/port that the robot is listening on
    • The robot then converts the JSON back into a dictionary and reads the joystick values out of it.

Note that if you want an easy control method, I do NOT recommend our one – it can be a pain to set up the wifi access point and the method you use depends on the chipset of the WiFi dongle you have.

Instead, I recommend the bluetooth/wiimote methodthis tutorial explains it better than I can and with code examples too.  My experience with bluetooth dongles and wiimotes is that Genuine Nintendo wiimotes are required – I tried using a cheap knockoff wiimote and it wouldn’t pair with the dongle, but my genuine ones worked fine.


3 thoughts on “Manual Control”

  1. Unfortuntely this did not work if you have a genuine Nintendo wiimote with motionplus inside. Any suggestions how to get this wiimote to work or are there any other options for cntrolling the robot with bluetooth and and other portable device?

    1. That’s odd – sorry to hear you’re having trouble. I don’t know what the cause of the problem is, but I can see others reporting it online, e.g: see the comments on

      But not everyone seems to have the problem – the guy in that video seems to be using one!

      If I had to guess, I would say that the likely cause of the problem is the bluetooth dongle – if we assume that all nintendo wiimotes are the same, and the raspberry Pi USB interface is acting as standard, then the most likely thing to be different between people is the bluetooth dongle.

      Perhaps you could ask on that video and find out the chipset of the bluetooth dongle that works? Or search ebay for an older wiimote without motionplus?

      I realise that’s not much help, sorry.

Leave a Reply

Your email address will not be published. Required fields are marked *