I have been playing around with the XRF wireless module from CISECO. They come with firmware which makes the XRF act like a serial link (ie. serial data sent in one end will come out of another XRF in range). This is a typical set-up and how I have used them before.
Other firmware has also been developed which allows the XRF to do different things. One version of the firmware is used along with a relay board to turn the XRF into a remote controlled switch (using the relay board from CISECO). This uses the aProtocol, details of which are here. For one project I needed to do this. This post is basically my notes on how I went about uploading the new firmware onto the XRF, which might be useful to other folk doing something similar. Note: This if for the newer XRF v1.5 and on a Windows 7 machine (sorry, open source folk…)
The XRF is based on the Texas Instruments CC1110 microcontroller. Like all microcontrollers this can be re-programmed with different code. The XRF has a bootloader on it which allows the easy upload of different firmware. As already mentioned the standard firmware is the serial link.
To reprogram the XRF you will need an FTDI to XRF connector. This is basically a USB to TTL connector, similar to that used for the Arduino (‘proper’ Arduinos have this on-board). But the Arduino runs at 5V, whereas the XRF runs at 3.3V, so you must use the correct connector. I bought this one from CISECO.
To use this you need the XCM (XRF Config Manager), following the instructions here:
Running the setup.exe installs the XCM to the program list and also runs the program.
I then plugged in the USB interface for the XRF. This installed the device driver successfully.
To do an initial test I clicked the ‘Search’ button on the XCM, which should find all XRF modules on any COM port. It found the device I had connected.
I then clicked ‘Download Config’ to find the config parameters already programme onto the XRF.
Everything seemed to be working ok. I now wanted to upload the XRF relay firmware. Instructions to do this for the previous version of the XRF were available at:
According to CISECO the instructions are the same, but rather than uploading a .hex file you are uploading a .bin file.
I had been sent the .bin file for the XRF relay firmware from CISECO. I do not think this easily available for download at the moment – I will change this and add the link when it is. The files are now available from: http://openmicros.org/index.php/articles/84-xrf-basics/180-all-xrf-firmware-updates.
I followed the instructions above and everything seemed to go OK. I committed the code to the XRF and the version number changed.
On worrying thing was that when I clicked the ‘general’ tab and clicked the ‘Download Config’ it did come back with the version details, but it also said on the message section that ‘No valid response received’…. Edit: This is normal and there is no problem with this.
Lets see what happens…
I plugged in the re-programmed XRF RELAY to an active break out board (i.e gave it 3.3V power). I had a ‘normal’ XRF connected to my computer to see any serial commands being sent. When I powered up the XRF RELAY then I saw the message a–STARTED– repeated a few times. This looks promising.
Details on the XRF relay firmware control commands are here:
All commands start with an ‘a’ and are 12 bytes long. So I typed “a–APVER—-” and sent it via the serial monitor. The XRF RELAY returned the string “a–APVER1.0-“. So it looks like it has worked. Typing ‘a–DEVTYPE–” returns the line “a–RLY000001”, so the XRF RELAY definitely has the correct code.
More info on getting started with the XRF RELAY and the relay board is here: http://www.ciseco.co.uk/content/?p=2041
I want to control a number of relays in different places, hence I need to give the XRF RELAY a device ID.To quote the above post:
“It is good practise to change your DeviceID right at the start. To do this is easy. First decide what ID you’d like it to have, this can be two capital letters (eg TT, FG or YY) you cannot use numbers. When you have chosen, we send as a single packet (paste in hyperterminal) the command CHDEVID. To issue the command and to set (for example the device to RB) we use a–CHDEVIDRB, the device will reply to you with the same message to verify it heard you. To apply the settings send a–REBOOT—. The device will now restart by transmitting aRBSTARTED. That’s it your device is now called RB.”
I chose the device ID to be AA, BB, CC etc for the different relays. So following the above instructions I named my first XRF RELAY ‘AA’.
Sending the command ‘aAARELAYATOG’ toggles the relay on and off. I put an LED on pin 8 of the XRF and watched it switch on and off as I sent the toggle command.
Great stuff. It works through 3 floors of my workshop and out onto the street so has great range. I can now use it in my project….