Simple test rig for RFM12Bs

Hi all,

I'm trying to get some communication between a pair of RF units, but currently getting nowhere.  My two units are:

1. A standard Arduino Uno R3. with a RFM12B unit connected with dropper resistors as per the Building Blocks diagram.

2. A sub-equipped EmonTx unit which has the RF unit on board and can run sketches.  Both RF units are 868 Mhz.

My main difficulty at present is that I have very little idea of what to do next.  Two forum members have kindly sent me their code, but neither has worked for me.  Either there are header files which I don't have, or there appear to be complications with different hardware platforms. 

To start with, I don't mind which way the comms link goes.  Once I've got something which works end-to-end, e.g. making an LED turn on/off or a print statement equivalent, I can then proceed by changing one thing at a time.  

But at the moment I'm still at the unhappy stage where "it doesn't work".

A pair of simple sketches for Tx and Rx would be just wonderful!

TIA, Robin

MartinR's picture

Re: Simple test rig for RFM12Bs

The RFM12B is difficult to debug because the commands are just written blindly without any feedback so it's very hard to debug.

Do you have a logic probe or just an LED and resistor so you can probe the signals to the RFM12B to see if anything is happening?

 

calypso_rae's picture

Re: Simple test rig for RFM12Bs

I don't have a logic probe, Martin, but could no doubt manage to rig up an LED and resistor. 

What I'm currently lacking is a simple sketch to go at either end.  Something akin to blink.ino.  Then I would feel confident that my setup should work if the hardware is correct.  I've tried to run a version of your base-station code but it needs several header files that I don't have available.

I wonder if any of the example sketches in the JeeLib library may be suitable?  

 

 

MartinR's picture

Re: Simple test rig for RFM12Bs

I 'think' the only non-standard files my sketch needs is the OneWire library from here

It might actually be a good test for the transmitter as it will freeze if it doesn't get any response from the RFM12B so if you run it on the emonTx and the LED flashes that's a good sign that the transmitter is at least generating data rqeuests.

There are lots of examples in the Jeelib library. I haven't tried any of them but tinyTest and RFM12demo sound promising.

calypso_rae's picture

Re: Simple test rig for RFM12Bs

It might actually be a good test for the transmitter as it will freeze if it doesn't get any response from the RFM12B so if you run it on the emonTx and the LED flashes that's a good sign that the transmitter is at least generating data rqeuests.

I'm running your code now on my EmonTx and the LED is not flashing.  It seems to be hanging at rfm_send().  That would appear to mean that the RFM12B on my emonTx board is not working.  Time to get the eyeglass out again and check those connections.  Maybe I should check a few voltages too ...

The RFM12demo example looked way OTT for my needs.  I've not looked at tinyTest.  But if my Tx hardware isn't working, then all sketches will presumably fail in the same way.

Thanks, Martin, I feel I'm starting to make some progress now.

calypso_rae's picture

Re: Simple test rig for RFM12Bs

I'm finally in business, thanks to various people who have sent me PMs over this.

Here's a couple of sketches which may help anyone else who is struggling to get started with an RF link.  The Tx code repeatedly sends a one-byte on/off command which is displayed by the Rx code at the far end.  Activity can be seen via the Serial monitors, and an LED is supported at each end.

Both sketches run on the Uno R3 or emonTx platforms without any modifications.  The only header file required is JeeLib.h

My 868 MHz link has not yet been range-tested but seems robust enough from one side of the room to the other.

calypso_rae's picture

Re: Simple test rig for RFM12Bs

The Building Blocks page at

RFM12B - Part 2 - Sending Data Between Modules (e.g emonTx, emonBase, emonGLCD etc.) 

has a link to an ideal pair of sketches.  In the Summary section on that page it says:

For a simple example of Arduino > Arduino (or emonTx to emonBase) RFM12B transmission sketch see:

 https://github.com/openenergymonitor/RFM12B_Simple

Pity I didn't read this article in more detail earlier :(

jonbev's picture

Re: Simple test rig for RFM12Bs

Has anyone used these on a Arduino Mini Pro? I wasn't sure what pins to use or where they can be defined in the code?

Jon

calypso_rae's picture

Re: Simple test rig for RFM12Bs

If it supports Serial, then you can see what the RF link is doing via the monitor.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.