- Category: Raspberry Pi
- Last Updated on Wednesday, 07 May 2014 11:18
GUIDE TO SLICE OF RADIO
In this guide we aim to tell you how to
- set up the Raspberry Pi to work with Slice of Radio (step 1 below)
- communicate between the Raspberry Pi with Slice of Radio and other Ciseco radio nodes (step 2 and 3 below)
- use remote programming, so you can program a remote Arduino based radio node over the air, right from the Raspberry Pi.
STEP 1: prepare Raspberry Pi
Please first carefully follow this guide to ensure your Raspberry Pi is set up correctly to work with Ciseco hardware. In particular you should follow the instructions to get access to the serial port,. If you don't already have a program that allows easy access to the serial port, you should install minicom as explained in the guide.
STEP 2: prepare a second radio node
To test your Slice of radio you will need another radio enabled computer. This could be a second Raspberry Pi with it's own slide of Radio, a Linux machine, a Mac, or a Windows PC with a USB radio, such as the Plug and Play SRF USB from Ciseco available here: SRF USB Radio
If you have another Raspberry Pi and a Slice of Radio, you need to go through STEP 1 above for that unit also.
If you have a Windows machine, please follow these instructions to install the drivers for the SRF USB Radio on Windows, as well as a Windows terminal for easy access to the serial port that is connected to the SRF USB Radio.
If you have a Mac or Linux machine, simply plug in the SRF USB Radio and look for the new serial port.
You should use your Slide of Radio and any other node you communicate with using the default settings created in the factory. That way you can be certain that the two will communicate.
As you get more comfortable with our technology you can start to experiment with different settings, but for now, keep things simple.
First you can establish if the Slice of Radio is present by typing the following in the minicom window:
without a carriage return. You should see a response from the radio:
This means that the connection between minicom and the radio is OK. If you don't get this, there is no point going any further. Check carefully that you have carried out all the previous instructions and try again.
Once you have the OK response from the Slice of Radio to +++ on the Raspberry Pi, go to the other node (e.g. a Windows machine with Putty and an SRF USB Radio) and do the same there. Make sure the other machine is correctly talking to the radio there, again by issueing +++ and getting OK in response.
Once we are certain that the radios at both ends are correctly connected to their respective computers, serial ports, and serial terminal programs, we can take the next step:
Go ahead and type some text in one terminal emulator and see it appear on the terminal emulator on the other side.
With the Slice of Radio it is possible to wirelessly program a radio equiped Arduino node, right from the Arduino IDE installed on your Raspberry Pi. In this scenario, the radio link has the functionality of an FTDI connection between the Arduino IDE on the Raspberry Pi and the (remote) Arduino with Ciseco radio on board (e.g. XinoRF or RFu-328).
To achieve Over The Air Micro Programming (OTAMP), you need to first set up the Raspberry Pi for Arduino programming, as explained in the Programming a Ciseco Arduino from the Raspberry Pi guide. make sure to go through this guide first before continuing with the instructions below.
OK, so now you have a Raspberry Pi that works with Ciseco hardware and that has the Arduino IDE that is capable of programming via GPIO installed and configured.
Next we need to set up both ends of the connection so that over the air micro programming (OTAMP) works.
On the Raspberry Pi start minicom with:
minicom -b 9600 -o -D /dev/ttyAMA0
Use <CONTROL>a followed by capital E to set local echo on in minicom.
Use <CONTROL>a followed by capital A to add line endings.This will make it easier to see what you have typed and the AT command replies.
We are first going to make changes to the settings of the SRF on the Slice of Radio.
Each time we do, we first type +++ (without a carriage return) and wait for Slice of Radio to respond with OK. Then we have a few seconds to send it a etting. You will see:
on your screen and the cursor will be at the beginning of the line. So when you type your command to change a setting, it will overwrite +++OK.
First enable remote reset:
this time followed by a carriage return. You should see the response: OK
Next set the remote ID:
(We have chosen GW, but you can pick any two capital letters, as long as they are the same on the target we are aiming to program.)
Next we set the channel offset:
And finally we alter the baud rate to 115200 baud, appropriate for OTAMP:
This last command will be acknowledged but will not take effect until we write the changes to backing store. We do this in two stages:
This will apply the changes. And because the baud rate has now changed, we can no longer use minicom at 9600 baud. So exit minicom (<CONTROL>A x) and restart it, this time with the right baud rate:
minicom -b 115200 -o -D /dev/ttyAMA0
Once reconnected we need to make the changes permanent otherwise we have to go through this node configuration game again after we power cycle the Slice of Radio. The command to use is:
Now remember that Slice of Radio from now on will always use the new settings (particularly the baud rate), so always connect with minicom using -B 115200
You need to make sure that you have set the remote node to the following corresponding settings:
- Baud rate 115200 ATBD 1C200
- Enable Remote Reset 1 (on) ATRP 1
- Node ID GW ATMY GW
- Channel offset 3 ATRC 3
Once you have arranged all that, start the Arduino IDE on the Raspberry Pi, select a sketch and hit the upload button. Your sketch should be uploaded to the remote Arduino processor over the air.
Reseting the Slice of Radio to factory settings
Short the two pins labeled reset during power up, this will load default setting including baud rate of 9600.
To make the changes permenat you will need to enter AT command mode and issue ATWR
Please share your experience on our Forum!