RFLink up and running, scanning 433.92 MHz

Today I soldered up the RFLink (tricky!) and it actually works...

When I plugged it into my Mac, everything lit up - hurrah. Now to flash the RFLink code into the Arduino... For this I had to use the avrdude program, rather than the Arduino IDE - I only have the Arduino hex file, not the source. I wrote a script to save typing it all in wrongly multiple times :-)... Bits in bold are specific to my installation.

loadArduino.sh:

# Script to load a file into Arduino
/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avrdude -v -p atmega2560 -c stk500 -P /dev/cu.usbmodem411 -b 115200 -D -U flash:w:/Users/john/Downloads/RFLink_v1/RFLink.cpp.hex:i -C /Applications/Arduino.app/Contents/Java/hardware/tools/avr/etc/avrdude.conf

And here's the output from running it, pretty interesting stuff actually! I assume the same thing happens with the Arduino IDE, except the output is swallowed up and thrown away.

Macintosh-Gouk:~ john$ ./loadArduino.sh 

avrdude: Version 6.3, compiled on Dec 16 2016 at 13:32:25
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2014 Joerg Wunsch

         System wide configuration file is "/Applications/Arduino.app/Contents/Java/hardware/tools/avr/etc/avrdude.conf"
         User configuration file is "/Users/john/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port                    : /dev/cu.usbmodem411
         Using Programmer              : stk500
         Overriding Baud Rate          : 115200
         AVR Part                      : ATmega2560
         Chip Erase delay              : 9000 us
         PAGEL                         : PD7
         BS2                           : PA0
         RESET disposition             : dedicated
         RETRY pulse                   : SCK
         serial program mode           : yes
         parallel program mode         : yes
         Timeout                       : 200
         StabDelay                     : 100
         CmdexeDelay                   : 25
         SyncLoops                     : 32
         ByteDelay                     : 0
         PollIndex                     : 3
         PollValue                     : 0x53
         Memory Detail                 :

                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           eeprom        65    10     8    0 no       4096    8      0  9000  9000 0x00 0x00
           flash         65    10   256    0 yes    262144  256   1024  4500  4500 0x00 0x00
           lfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           hfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           efuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           lock           0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00
           signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00

         Programmer Type : STK500V2
         Description     : Atmel STK500
         Programmer Model: AVRISP
         Hardware Version: 15
         Firmware Version Master : 2.10
         Vtarget         : 0.0 V
         SCK period      : 0.1 us

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.01s

avrdude: Device signature = 0x1e9801 (probably m2560)
avrdude: safemode: hfuse reads as D8
avrdude: safemode: efuse reads as FD
avrdude: reading input file "/Users/john/Downloads/RFLink_v1/RFLink.cpp.hex"
avrdude: writing flash (199364 bytes):

Writing | ################################################## | 100% 31.98s

avrdude: 199364 bytes of flash written
avrdude: verifying flash memory against /Users/john/Downloads/RFLink_v1/RFLink.cpp.hex:
avrdude: load data flash data from input file /Users/john/Downloads/RFLink_v1/RFLink.cpp.hex:
avrdude: input file /Users/john/Downloads/RFLink_v1/RFLink.cpp.hex contains 199364 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 25.55s

avrdude: verifying ...
avrdude: 199364 bytes of flash verified

avrdude: safemode: hfuse reads as D8
avrdude: safemode: efuse reads as FD
avrdude: safemode: Fuses OK (E:FD, H:D8, L:FF)

avrdude done.  Thank you.

Interesting to see that the program reads back and verifies the contents of flash memory. This is a Good Plan!

Sample samplings!!

20;00;Nodo RadioFrequencyLink - RFLink Gateway V1.1 - R48;
20;01;Drayton;ID=ba00;SWITCH=0f;CMD=ON;
20;02;Drayton;ID=ba00;SWITCH=0f;CMD=ON;
20;03;Drayton;ID=f560;SWITCH=1e;CMD=ON;
20;04;Drayton;ID=f560;SWITCH=1e;CMD=ON;
20;05;Drayton;ID=f560;SWITCH=1e;CMD=ON;
20;06;Friedland;ID=59a89aa6;SWITCH=1;CMD=ON;CHIME=01;
20;07;Drayton;ID=ba00;SWITCH=0f;CMD=OFF;
20;08;Drayton;ID=ba00;SWITCH=0f;CMD=OFF;
20;09;Drayton;ID=ba00;SWITCH=0f;CMD=OFF;
20;01;Eurodomest;ID=425082;SWITCH=01;CMD=OFF;

The above messages were received on the usbmodem411 device. Note
  • Someone around here has a Drayton thermostat (!)
  • The front door bell shows up nicely!
  • There's another device around too, not sure what it is

Here's the structure of the messages RFLink produces - <Name> is protocol-specific, and coded inside the Arduino.


Structure:

<Nodeno>;<Name>;<Label>=<value>,…

Just for the hell of it, I tried sending a doorbell command, which didn't work - then I noticed the manual says only receive is supported!

Doorbell command:

10;Friedland;59a89aa6;1;ON;01;

doesn’t work :-( - manual says only receive is supported!

However, you can get RFLink to echo whatever received command you like, to test downstream code, using the "11" command e.g. 

Echo command:

11;20;06;Friedland;ID=59a89aa6;SWITCH=1;CMD=ON;CHIME=01;

And you can ask to see the radio packet information, which is pretty useful if you're trying to work out a protocol I guess, I haven't seen any that it doesn't know. I wonder if it would send anything if it received a signal from a device it didn't already know?

RFDebug output:

20;22;RFDEBUG=ON;
20;23;DEBUG;Pulses=38;Pulses(uSec)=480,930,900,900,900,930,900,420,420,900,420,420,420,420,420,420,900,900,390,420,420,420,420,420,420,420,930,390,420,390,420,420,420,420,420,930,420,6990;
20;24;DEBUG;Pulses=58;Pulses(uSec)=390,390,420,420,420,420,420,420,420,420,420,420,930,1410,900,420,420,420,420,420,420,900,900,900,930,900,900,420,420,930,420,390,420,420,420,420,900,900,420,390,450,360,420,420,420,390,930,420,420,420,420,420,420,420,420,900,420,6990;
20;25;Drayton;ID=560;SWITCH=1e;CMD=ON;
20;26;DEBUG;Pulses=58;Pulses(uSec)=360,390,420,390,420,390,450,390,420,390,420,420,900,1410,900,390,420,390,420,420,420,900,930,900,900,900,900,420,420,900,420,420,420,420,420,420,930,900,420,420,420,390,420,390,420,390,930,420,420,420,390,420,420,420,420,900,420,6990;
20;27;Drayton;ID=f560;SWITCH=1e;CMD=ON;


Comments

Popular posts from this blog

Replacing Coffee Machine Pump (Dualit Espressivo)

Multiple SHT30 sensors on a single I2C bus with Sonoff-Tasmota

NodeMCU + Tasmota code + SHT30