Getting Ardh@t installed and ready-to-go should only take a few minutes.
The Optiboot bootloader is already installed on Ardh@t ’s processor, but we need to make sure the Raspberry Pi is setup correctly, and has the necessary software in place.
The easiest way to do this is from the command line, and the best way to do that, is to ssh into the Raspberry Pi so that you can copy and paste the commands below into your terminal (you can use PuTTY if you are not on a Unix based system like Linux or OS X).
By default, Raspberry Pi copies its shell and kernel messages to the serial port. As Ardh@t uses this channel to communicate with the host, we need to disable that. This is most easily done with the in-built utility raspi-config.
Setup Pi Hardware
~ $ sudo raspi-config
From the menu, select
and disable shell and kernel messages on serial
Back at the
Advanced Options menu you’ll also want to enable I2C, so that you can access the Ardh@t
peripherals directly if required
Enable both the
ARM I2C interface …
…and the loading of kernel modules
Now we need to load a few software pre-requisites…
First make sure you have up-to-date packages installed
~ $ sudo apt-get update
~ $ sudo apt-get upgrade
Then install some essential packages, including a modified version of avrdude.
Install a few essentials
~ $ sudo aptitude install git arduino i2c-tools
~ $ git clone git://github.com/Ardhat/avrdude-rpi.git
In order for the Arduino IDE to work properly with Ardh@t , it needs to perform a reset during code upload. It does this using the modified avrdude we just cloned, so enter the following commands:
~ $ cd avrdude-rpi/
~ $ sudo cp autoreset /usr/bin
~ $ sudo cp avrdude-autoreset /usr/bin
~ $ sudo mv /usr/bin/avrdude /usr/bin/avrdude-original
~ $ sudo ln -s /usr/bin/avrdude-autoreset /usr/bin/avrdude
Finally, so that the Arduino IDE can ‘see’ the Ardh@t serial port, we need to create a symlink between the Raspberry Pi ttyAMA0 port and ttyS0.
Create a link to ttyS0
~ $ sudo -i
~ # echo 'KERNEL=="ttyAMA0", SYMLINK+="ttyS0",GROUP="dialout",MODE:=0666' > /etc/udev/rules.d/80-ardhat.rules
~ # udevadm trigger
Start the Arduino IDE…
…and you’re all set!!