More than a few years ago, I bought myself a Remote Control boat, a Kyosho Wave Master:
The WaveMaster is a semi scale model of an F-1 tunnel hull racing boat. Tunnel hulls work by trapping a cushion of air between the hull and water to reduce friction which allows the boat to travel even faster. The WaveMaster’s hull and upper decking is made of lightweight, tough and glossy ABS plastic, and is largely pre-assembled to help reduce build time. Power is supplied by Kyosho’s new design outboard motor. This compact power plant utilizes an 550 class motor and drives the propeller via a wire type drive shaft.
I mostly sailed/controlled it of a Friday evening at Bowmoor Lake while out with First Swindon Sea Scouts, for the last few years it has mostly been sat in my parents loft, however with wanting a test bed for K9 and ROV stuff it seemed like a good development platform for using to test software and hardware. especially as being a boat, I can use it while at home.
I came across a RC Car Controller thing for the Arduino / Raspberry Pi on Github “rc-car-controller” – Operate a RC car over the internet via node.js using socket.io and johnny-five, using an Arduino connected via USB, however I have a RPi-UNO-HAT – Raspberry Pi Arduino Extension from Watterott electronics (github link) to play with.
I have been unable to get the rc-car-controller software to work, however it has given me a starting point to play with.
Getting the Raspberry Pi Ready
- Grab the Latest Rasbian Image from http://downloads.raspberrypi.org/raspbian_latest
- Burn the image to an SD card
- Change the Host name by editing these two files /etc/hosts and /etc/hostname.
- Update/upgrade OS, then restart:
sudo apt-get update sudo apt-get upgrade sudo rpi-update sudo ldconfig sudo shutdown -r now
Then use rpi-config as normal to expand the file system and enable the camera
- There are some additional things to install once the storage has been expanded:
sudo apt-get install minicom g++ curl pkg-config libv4l-dev libjpeg-dev build-essential libssl-dev cmake git-core build-essential libjpeg8-dev imagemagick subversion netatalk mosh arduino <code class="bash plain">tightvncserver</code>
- Set up the UART on the GPIO pins (instructions here).
- To make using the RPi-UNO-HAT it is worth now installing and setting up VNC, and then setting up the Arduino IDE:
wget //raw.github.com/watterott/RPi-UNO-HAT/master/docu/autoreset wget //raw.github.com/watterott/RPi-UNO-HAT/master/docu/avrdude-autoreset chmod +x autoreset chmod +x avrdude-autoreset sudo mv autoreset /usr/bin sudo mv avrdude-autoreset /usr/bin sudo mv /usr/bin/avrdude /usr/bin/avrdude-original sudo ln -s /usr/bin/avrdude-autoreset /usr/bin/avrdude
Test that the above has worked by running
sudo avrdude -c arduino -p m328p -P /dev/ttyAMA0 -b 57600 -v
- Link ttyAMA with a serial port that the Arduino IDE can see by creating the file
sudo nano /etc/udev/rules.d/80-arduinopi.rules
to it, then rebooting.
Dial into the Raspberry Pi via VNC, you will need to run vncserver :1 to start the server (will work out why at some point), Connect RPi-UNO-HAT, and open the Arduino IDE.
Open the Firmata sketch via the menu:
- File > Examples > Firmata > StandardFirmata
- Select your Arduino board type (Arduino Uno) via Tools > Board
- Select the port for your board via Tools > Serial Port > (/dev/ttyS0)
- Upload the program by selecting File > Upload
Close the VNC connection.
- Install node modules:
npm install socket.io express johnny-five body-parser
- Install python libraries:
sudo apt-get install libopencv-dev python-pip python-opencv python-dev python-picamera
I will be working on part two soon 🙂