Linking Arduino to the Raspberry Pi

I own, thanks to a competition, a Dreamer Nano v4. This is a micro clone of an Arduino Leonardo.

Having tried to get the Arduino IDE running on Windows 7 64-bit and failed with the serial monitor part, I decided to switch my development effort to the Raspberry Pi. Even on X Windows, I’m not a great fan of the Arduino IDE. I find it tends to crash horribly when you upload and then use the serial monitor. So, I’ve decided to get the Arduino working over USB via the command line.

Here’s the steps I took. Remember, this is my experience. Your mileage may vary if you are not using a Leonardo, or if you have different things installed.

Python should already be installed on your Pi.

For using an Arduino over the command line, I use something called ‘ino’. Visit http://inotool.org to find out more. Suffice to say, ino makes it a lot easier to compile your code and transfer it to your Arduino.

ino requires you to install something called picocom. So:

apt-get install picocom

You will also need to make sure you have a couple of Python libraries installed:

apt-get install python-pip
easy-install configobj
easy-install jinja2

If the last one doesn’t work (the website that hosts it was down when I tried). So, I found this webpage: http://pypi.python.org/pypi/Jinja2 and then got and installed it manually:

wget http://pypi.python.org/packages/source/J/Jinja2/Jinja2-2.6.tar.gz#md5=1c49a8825c993bfdcf55bb36897d28a2
cd Jinja2-2-6
make
python setup.py install

Now install ino itself:

easy_install ino

Now that lot’s done, I can create a new sketch. It has to be a new sketch as the ino commands fail if the folder is not empty.

So… create a folder then initialise it using ino.

mkdir tester
cd tester
ino init

I added my sketch to the src folder.

Now, in order for me to build the uploadable file, I need to set up a new file called ino.ini. This lets you configure the board you’re coding for and the port it’s on. Into ino.ini, I added:

board-model = leonardo
serial-port = /dev/ttyACM0

Then, to build I typed:

ino build

The first time this is run, a few other files get built too, so don’t worry about that. Hopefully, it will happen without error like it did with me.

Then you transfer it to the Arduino:

ino upload

Next you want to monitor the serial line:

ino serial

 

Mobile Phone Basestation created on Raspberry Pi

Basestation created on Raspberry Pi

Wireless experts from PA Consulting have used a Raspberry Pi to run a mobile phone basestation that operates a private network. The team hooked the Raspberry Pi up to a radio interface and, using Open Source software, implemented the functionality of a mobile basestation. Along with two mobile phones with sim cards, PA created all the functionality to make the phones talk to each other. PA set up its Raspberry Pi in a screened room to ensure no laws on frequency spectrum were broken.

Read their article and watch the video here.

Interface board for Olimex UEXT modules for Raspberry Pi

RPi-UEXT

Olimex have brought out a new board which allows the Raspberry Pi to have access to UEXT modules like Relay modules, Thermocouple sensor modules, 3-axis magnetometer and accelerometers, Zigbee, WiFi, GSM, GPS etc.

You can purchase one here: RPi-UEXT.

This is a fantastic little board that works not only to give access to UEXT but also breaks out the GPIO pins very neatly. At only a little under 4 euros, you can’t really go wrong – it’s cheaper than the similar Pi Cobbler boards.

The Olimex blog post announcing it can be found here and there is a post looking at the release announcement here.

A comprehensive look at what you can do with the board is contained in the original pre-release announcement.