Project

General

Profile

No connection between two RFM12B

Added by firlefranz about 4 years ago

Hi,

some time ago I bought this nice six pack of RFM12B modules (433MHz) from the JeeLabs Shop. I’d like to use two of the modules for a Arduino based thermometer. The outside sensor uses the TinyTX PCB from Nathan Chandrell including a Attiny84 and a DS18B20 temperature sensor. At the receiver side I’m using a Atmega328 and the common connection to the RFM12B as specified in this picture:

The antennas are 165mm long silver wire.

I could burn the bootloader on the Attiny using the Arduino Uno without a problem and also the upload of the code works fine as specified on the TinyTX page. For the first test I’m using the DS18B20 test sketch from the TinyTX page (https://github.com/nathanchantrell/TinyTX/blob/master/TinyTX\_DS18B20/TinyTX\_DS18B20.ino). Since it’
s been an old script and the TinyTX has become popular I’m not expecting any error here. On the receiver side I’m using a simple receiving example from the same website (https://github.com/nathanchantrell/TinyTX/blob/master/TinyTX\_RX\_Simple/TinyTX\_RX\_Simple.ino). But the problem is that I don’
t get any temperature values submitted.
The first thing I tested was the DS18B20 but it works they way it should. Also the power for the TinyTX board is stable at 3.3V. The receiver shows in the console just the Serial.println commads specified in the setup() part of the program, but it’s not receiving any data.

At the transmitter side I used another TinyTX board with another RFM12B (since I bought 6 of them), but nothing worked. I really need some help.

Cheers
Cornelius


Replies (79)

RE: No connection between two RFM12B - Added by JohnO about 4 years ago

Could you perhaps try loading up Arduino/libraries/jeelib/examples/RF12/RF12demo.ino as your receiver?

RE: No connection between two RFM12B - Added by firlefranz about 4 years ago

Ok, done. In the console I see the following things:

[RF12demo.12] A i1 g212 @ 868 MHz q1

Available commands:
i - set node ID (standard node ids are 1..30)
b - set MHz band (4 = 433, 8 = 868, 9 = 915)
o - change frequency offset within the band (default 1600)
96..3903 is the range supported by the RFM12B
g - set network group (RFM12 only allows 212, 0 = any)
c - set collect mode (advanced, normally 0)
t - broadcast max-size test packet, request ack
…, a - send data packet to node , request ack
…, s - send data packet to node , no ack
q - set quiet mode (1 = don’t report bad packets)
x - set reporting format (0: decimal, 1: hex, 2: hex+ascii)
123 z - total power down, needs a reset to start up again
Remote control commands:
,,, f - FS20 command (868 MHz)
,, k - KAKU command (433 MHz)
Current configuration:
A i1 g212 @ 868 MHz q1

RE: No connection between two RFM12B - Added by JohnO about 4 years ago

OK, you will need a “4b” command to go into 433MHz mode.
if you don’t see anything then try a “0q” to take a look at the noise and check if you have any almost packets.

If still no job then try “1595o” and take a look then “1605o” and take a look. These last two commands shift the centre frequency slightly to accommodate crystal tolerances.

RE: No connection between two RFM12B - Added by JohnO about 4 years ago

I forgot to mention “210g” to match the group you have configured on your Tiny84.

RE: No connection between two RFM12B - Added by firlefranz about 4 years ago

Nothing to see in the console. I have two transmitters in 50cm distance to the receiver. Both should send a package.

RE: No connection between two RFM12B - Added by firlefranz about 4 years ago

I tried it again after the 210g - nothing :-(

RE: No connection between two RFM12B - Added by JohnO about 4 years ago

Do you see anything with “0q” you should at least see noise. If not we need to take a look at the connections, particularly the IRQ.

// ATmega168, ATmega328, etc.
#define RFM_IRQ 2 // 2=JeeNode, 18=JeeNode pin change
#define SS_DDR DDRB
#define SS_PORT PORTB
#define SS_BIT 2 // for PORTB: 2 = d.10, 1 = d.9, 0 = d.8

#define SPI_SS 10 // PB2, pin 16
#define SPI_MOSI 11 // PB3, pin 17
#define SPI_MISO 12 // PB4, pin 18
#define SPI_SCK 13 // PB5, pin 19

RE: No connection between two RFM12B - Added by firlefranz about 4 years ago

The IRQ is connected to Pin2 of the Atmega328. The other connections are also correct. Could the RFM12B be damaged? I just took it out of the sealed plastic bag and soldered it to the PCB.

RE: No connection between two RFM12B - Added by JohnO about 4 years ago

Could you post a close up photograph?

RE: No connection between two RFM12B - Added by firlefranz about 4 years ago

Here are some pictures. The receiver is soldered to my thermometer PCB. You can trust me, that the pin configuration is correct. The additional wires at the transmitter site are just connected to the Attiny to upload a new firmware.

RE: No connection between two RFM12B - Added by firlefranz about 4 years ago

A i1 g210 @ 433 MHz o1595
? 0 193 127 160 204 102 3 208 63 131 92 193 127 194 63 111 77 126 192 37 59

This message I got after changing the module to another one.

RE: No connection between two RFM12B - Added by JohnO about 4 years ago

The antenna is some way away from the radio on IMG_1472.jpg.

Could you adjust the offset back to “1600o”.

Do you have a second ATMega328 that could get another copy of RF12demo running? It is also possible to load RF12demo onto the Tiny84.

RE: No connection between two RFM12B - Added by firlefranz about 4 years ago

> 1600o
A i1 g210 @ 433 MHz
434.0000 MHz
? 0 232 195 59 152 121 196 115 125 136 111 88 208 124 241 24 237
? 23 242 27 10 201 121 192 111 129 67 160 59 62 224 127 148 134 111 216 59 224
? 0
? 1 192 108 129 125 225 62 128 33 227 10 7 232 33 216 95 122 225 95 201 126
? 0 160 113 137 63 144 127 96 208 52 129 27 168 6 16 224 3 193 44 116 128
? 0 193 71 198 240 49 6 110 123 200 76 55 162 128 165 133 208 63 72 59 130
? 0 208 226 74 9 144 97 240 224 13 129 63 194 93 137 176 118 128 116 172 12
? 5 56 129 146 66 124 192 200 224 101 236 47 224 99 192 64 136 39 95 240 76
? 0
? 0 63 117 126 4 55 22 160 116 71 204 57 40 228 26 110 177 63 192 196 195
? 31 241 15 153 205 176 34 224 73 168 30 208 126 193 99 0 228 94 208 35 132
? 0 192 207 63 128 136 126 208 23 241 192 82 31 37 146 121 128 66 7 127 162
? 0 249 55 184 124 208 15 31 232 205 192 132 65 63 65 224 127 127 238 216 96
? 34 29 192 115 54 95 204 140 102 210 126 28 194 38 128 126 208 35 106 52 78

This is what I get now. I have another Atmega328 here, but first I have to take of one of the RFM12B modules from the transmitter PCB carefully.

RE: No connection between two RFM12B - Added by firlefranz about 4 years ago

I tried uploading the RFM12B demo sketch to the Attiny, but how to check the function while the console is not available?

So for me it looks like the receiver finally receives some packages with a bad crc, but since the period is roughly a minute the signal seams to come from the TinyTX. So how we gonna fix this crc problem and finally get some temperatures and battery voltage values at the receiver?

RE: No connection between two RFM12B - Added by JohnO about 4 years ago

There is a console available:

#if TINY
// Serial support (output only) for Tiny supported by TinyDebugSerial
// http://www.ernstc.dk/arduino/tinycom.html
// 9600, 38400, or 115200
// hardware\jeelabs\avr\cores\tiny\TinyDebugSerial.h Modified to
// moveTinyDebugSerial from PB0 to PA3 to match the Jeenode Micro V3 PCB layout
// Connect Tiny84 PA3 to USB-BUB RXD for serial output from sketch.
// Jeenode AIO2
//
// With thanks for the inspiration by 2006 David A. Mellis and his AFSoftSerial
// code. All right reserved.
// Connect Tiny84 PA2 to USB-BUB TXD for serial input to sketch.
// Jeenode DIO2
// 9600 or 38400 at present.

RE: No connection between two RFM12B - Added by firlefranz about 4 years ago

So, I tried to get a serial connection to the Attiny board, but there is nothing written in the console. I uploaded the RFM12B demo sketch to the Attiny84 and connected the PA3 to RXD, PA2 to TXD and GND to GND. I also checked different serial speeds (9600, 38400, 115200) with no result.

Any ideas?

RE: No connection between two RFM12B - Added by JohnO about 4 years ago

The code currently builds at 38400. Because of space limitation there isn’t a menu and one needs to know the commands “4b” will do a CRLF as I recall. The probably cause is the IDE you installed for the Tiny series. Could you take a look at this: http://jeelabs.net/boards/7/topics/3229?r=3268\#message-3268

RE: No connection between two RFM12B - Added by JohnO about 4 years ago

It looks as if using PB0 instead of PA3 would work for the TinyTX. Sorry about that - turning into quite a chase this.

RE: No connection between two RFM12B - Added by JohnO about 4 years ago

The key commands are ‘t’ to send a message requesting an ACK and “1,2,3,4,s” which I thinks transmits three bytes to node 4 - no ack requested.

RE: No connection between two RFM12B - Added by firlefranz about 4 years ago

Using the program posted in the other post from valentin I could prove that the serial connection to the console is working. But using the RFM12B demo non of your posted commands show any change in the console window.

RE: No connection between two RFM12B - Added by JohnO about 4 years ago

Umh, so no line feeds when you enter commands?

I must admit it is a long time since I tried the master branch code - I will take a look later.

RE: No connection between two RFM12B - Added by firlefranz about 4 years ago

Nope. What should happen with these commands? Do I need another RFM12B as transmitter? Since I needed the USB BUB for the connection to the TinyTX, I cut the connection to the thermometer PCB.

RE: No connection between two RFM12B - Added by JohnO about 4 years ago

You need two devices, I was imagining transmitting between your central ATMega328 and a Tiny84 using the ‘t’ command. Sent from one node and ACK’ed by the other and then visa-versa.

RE: No connection between two RFM12B - Added by firlefranz about 4 years ago

Sounds like a good idea, but therefor I should open two console windows (one for the Tiny and another one for the Atmega), am I right? As far as I can see it here, that is not possible.

Is there a demo sketch for the Atmega, which I could use, which automatically sends a constant data?

RE: No connection between two RFM12B - Added by JohnO about 4 years ago

Sorry that took so long, it took a while to dig out the appropriate kit to check this for myself.

jeelib/examples/RF12/radioBlip.ino does send out packets regularly. I suggest you install this on the Tiny84. I suggest the following code changes:

Line 28 to:

    rf12_initialize(22, RF12_433MHZ, 5);

To reflect your radio differences.

Line 42 to:

    Sleepy::loseSomeTime(1000);

to get a packet every second.

Then setup your ATMega328 as “5g” and “4b” and you should see output like this:

[24/03/15 - 21:12:17:060] > 5g
[24/03/15 - 21:12:17:125]  ^ i30 g5 @ 868 MHz q1
[24/03/15 - 21:12:33:540] OK 22 1 0 0 0
[24/03/15 - 21:12:34:594] OK 22 2 0 0 0
[24/03/15 - 21:12:35:634] OK 22 3 0 0 0
[24/03/15 - 21:12:36:689] OK 22 4 0 0 0
[24/03/15 - 21:12:37:745] OK 22 5 0 0 0
[24/03/15 - 21:12:38:785] OK 22 6 0 0 0
[24/03/15 - 21:12:39:841] OK 22 7 0 0 0
[24/03/15 - 21:12:40:882] OK 22 8 0 0 0
[24/03/15 - 21:12:41:937] OK 22 9 0 0 0
(1-25/79)