Project

General

Profile

Resolved: Crash and freeze with a RFM69

Added by jeromelebel over 5 years ago

Hello,

I have a arduino mega with a RFM12b. I wanted to move to RFM69. I bought 2. I updated my software with the latest version of jeelib. With my arduino mega, my code never returns from rf12_initialize(). I also tried it with the demo and an arduino uno. But I have several reboots until the code freezes too.
Since I bought 2 RFM69, I tried with both. But I have the exact same problems.

I’m not sure what is wrong and how to debug that issue.

Thanks for the help


Replies (69)

RE: Crash and freeze with a RFM69 - Added by JohnO over 5 years ago

Hi jeromelebel,

Could you consider loading up the following library:
https://github.com/jcw/jeelib/tree/RFxConsole

Then load up the sketch RFxConsole and use that as a baseline to progress your issue.

RE: Crash and freeze with a RFM69 - Added by jeromelebel over 5 years ago

With my uno and with this branch, it is always stuck.

It is sucked in rf12_initialize() waiting in the while (I’m not sure which while since they are 2).

RE: Crash and freeze with a RFM69 - Added by JohnO over 5 years ago

I’m afraid I need more words to key into.

Have you loaded up the RFxDemo tree as your sole jeelib library and restarted the IDE?
Are you trying the jeelib\examples\rf12\RFxConsole\RFxConsole.ino sketch?

RE: Crash and freeze with a RFM69 - Added by JohnO over 5 years ago

jeromelebel wrote:
> With my uno and with this branch, it is always stuck.

how are you connecting to the Uno, could you post a photograph or schematic?

Is the Uno running 3.3 volts?

RE: Crash and freeze with a RFM69 - Added by jeromelebel over 5 years ago

My uno is in 5V, I bought : http://www.digitalsmarties.net/products/rfm-board and I added the resistors. I didn’t plug those board directly on the uno. I’m using a breadboard. I connected the 5V (near the GND pin). I didn’t connect the 3.3V (the opposite pin).

Sorry I made a mistake with git and branches. Now I’m using RFxConsole branch, and I’ve tried the RFxConsole sketch.

My uno doesn’t reboot like crazy anymore. On my uno with the RFM69, I’m able to send data several times and I get the ACK (to a jeelink with RFM12). But as soon as I send a data from the jeelink, my uno stop working.

[RFxConsole.0]00 power down, needs a reset to start up again
Current configuration:
_ i31 g122 @ 868 MHz q1 x3
settings
123z - total power down, needs a reset to start up again
Current configuration:
_ i31 g122 @ 868 MHz q1 x3
settings
123z - total power down, needs a reset to start up again
Current configuration:
_ i31 g122 @ 868 MHz q1 x3

[RFxConsole.0]00
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
if using group 0 then sticky group number is used
…,s - send data packet to node , no ack
… - space character is a valid delimiter
128,,n - release group/node index number entry in eeprom
n - set group as sticky. Group 0 only, see p command
l - turn activity LED on PB1 on or off
…,m - add message string to ram, see p command
,,p post semaphore for group node , to be
sent with its next ack. Group number becomes sticky
q - set quiet mode (1 = don’t report bad packets)
x - set reporting format (0: decimal, 2: decimal+ascii
- 1: hex, 3: hex+ascii)
v - return firmware version and current settings
123z - total power down, needs a reset to start up again
Current configuration:
_ i31 g122 @ 868 MHz q1 x3
> 44,0003a
~~> 01 b
0000,Key=0D 500
> 45,0003a
~~> 01 b
0000,Key=0D 500
> 0004i
D i4 g122 @ 868 MHz q1 x3
0000,Key=0D 500

[RFxConsole.0]00

RE: Crash and freeze with a RFM69 - Added by jeromelebel over 5 years ago

If I close the serial window, and open it again, I see “[RFxConsole.0]00” and nothing else. To make my uno working again, I have to unplug it and plug it again.

Thanks for your time!

RE: Crash and freeze with a RFM69 - Added by JohnO over 5 years ago

Umh, lots going on.

Are you using the enter key, that is what produces the “0000,Key=0D 500” reaction. RFxConsole in common with RF12Demo doesn’t use the enter key - the command letter is the line terminator. Can you get two nodes up and running with this library & RFxConsole?

Perhaps you could issue the “1700o” command to shift the operating frequency away from your other RFM12B devices.

My gut is saying hardware - have you tried rewiring the breadboard?

RE: Crash and freeze with a RFM69 - Added by JohnO over 5 years ago

Issuing “0x” would make it easier on my eye for now.

RE: Crash and freeze with a RFM69 - Added by JohnO over 5 years ago

and, “0q” please.

RE: Crash and freeze with a RFM69 - Added by JohnO over 5 years ago

jeromelebel wrote:
> If I close the serial window, and open it again, I see “[RFxConsole.0]00” and nothing else. To make my uno working again, I have to unplug it and plug it again.

Which terminal emulator are you using?

What is your PC platform, MAC, Windows etc.

RE: Crash and freeze with a RFM69 - Added by JohnO over 5 years ago

How are you powering the Uno?

RE: Crash and freeze with a RFM69 - Added by JohnO over 5 years ago

We need to move this thread to the Support board instead of this Weblog board - jcw is this possible?

RE: Crash and freeze with a RFM69 - Added by jeromelebel over 5 years ago

I’m using a mac 10.10.2, with arduino 1.5.8. I talk with the uno with the serial window of the arduino application (now I’m not sending the end of lines characters anymore). I talk with the jeelink using the screen command in the terminal.

I’ve upgraded my jeelink with the RFxConsole sketch. Now the jeelink doesn’t receive anymore data from my uno. And when I try to send a data from the jeelink, I see the blue led turning on, and staying on. My jeelink is stuck now :

the screen stays like this for ever:

[RFxConsole.0]40
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
if using group 0 then sticky group number is used
…,s - send data packet to node , no ack
… - space character is a valid delimiter
128,,n - release group/node index number entry in eeprom
n - set group as sticky. Group 0 only, see p command
l - turn activity LED on PB1 on or off
…,m - add message string to ram, see p command
,,p post semaphore for group node , to be
sent with its next ack. Group number becomes sticky
q - set quiet mode (1 = don’t report bad packets)
x - set reporting format (0: decimal, 2: decimal+ascii
- 1: hex, 3: hex+ascii)
v - return firmware version and current settings
123z - total power down, needs a reset to start up again
Current configuration:
C i3 g122 @ 868 MHz
> 0x
C i3 g122 @ 868 MHz
> 0q
C i3 g122 @ 868 MHz
> 60,4a
->

RE: Crash and freeze with a RFM69 - Added by jeromelebel over 5 years ago

I have another jeelink somewhere. I can try to find it to see if it behaves the same way, if you think that could be useful.

RE: Crash and freeze with a RFM69 - Added by JohnO over 5 years ago

Is the Jeelink equipped with RFM69 hardware?

If not you need to change a few flags:
In the first few lines of RF12.cpp & also in RF69_avr.h

#define PINCHG_IRQ  0    // Set this true to use pin-change interrupts
#define RF69_COMPAT 0    // Set this true to use the RF69 driver

Also in RFxConsole:

#define RF69_COMPAT      0   // define this to use the RF69 driver i.s.o. RF12 

RE: Crash and freeze with a RFM69 - Added by jeromelebel over 5 years ago

I have an old jeelink with a RFM12b. I did change the flag in RFxConsole, but not in the other files. Do I need to change PINCHG_IRQ? If so, which value should I put for a jeelink?

RE: Crash and freeze with a RFM69 - Added by JohnO over 5 years ago

PINCHG_IRQ should be 0.

RE: Crash and freeze with a RFM69 - Added by jeromelebel over 5 years ago

So my jeelink works again.

But my jeelink doesn’t receive data from my uno, and my uno doesn’t receive data from my jeelink.

RE: Crash and freeze with a RFM69 - Added by JohnO over 5 years ago

I take it they are configured compatibly?

The Jeelink is a RFM12B? I guess it can interact with your other devices other than the Uno which has the RFM69CW on the digital smarties board via a breadboard.

RE: Crash and freeze with a RFM69 - Added by JohnO over 5 years ago

The RFM69 is a powerful transmitter and can swamp receivers, if you have all this confined on a bench then http://jeelabs.net/boards/7/topics/5921?r=5940\#message-5940
describes how to drop the transmit power on the RFM69 only.

RE: Crash and freeze with a RFM69 - Added by jeromelebel over 5 years ago

Yes, both are correctly setup:

In the following example, the uno is now stuck…

for the jeelink:
[RFxConsole.0]40
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
if using group 0 then sticky group number is used
…,s - send data packet to node , no ack
… - space character is a valid delimiter
128,,n - release group/node index number entry in eeprom
n - set group as sticky. Group 0 only, see p command
l - turn activity LED on PB1 on or off
…,m - add message string to ram, see p command
,,p post semaphore for group node , to be
sent with its next ack. Group number becomes sticky
q - set quiet mode (1 = don’t report bad packets)
x - set reporting format (0: decimal, 2: decimal+ascii
- 1: hex, 3: hex+ascii)
v - return firmware version and current settings
123z - total power down, needs a reset to start up again
Current configuration:
H i8 g122 @ 868 MHz
> 0q
H i8 g122 @ 868 MHz
> 0x
H i8 g122 @ 868 MHz
> 60,9a
~~> 1 b

Uno:
[RFxConsole.0]FB
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
if using group 0 then sticky group number is used
…,s - send data packet to node , no ack
… - space character is a valid delimiter
128,,n - release group/node index number entry in eeprom
n - set group as sticky. Group 0 only, see p command
l - turn activity LED on PB1 on or off
…,m - add message string to ram, see p command
,,p post semaphore for group node , to be
sent with its next ack. Group number becomes sticky
q - set quiet mode (1 = don’t report bad packets)
x - set reporting format (0: decimal, 2: decimal+ascii
- 1: hex, 3: hex+ascii)
v - return firmware version and current settings
123z - total power down, needs a reset to start up again
Current configuration:
I i9 g122 @ 868 MHz
> 0q
I i9 g122 @ 868 MHz
> 0x
I i9 g122 @ 868 MHz
> 1700o
I i9 g122 @ 868 MHz o1700
868.5000 MHz
> 60,8a
-> 1 b

RE: Crash and freeze with a RFM69 - Added by JohnO over 5 years ago

I think the Jeelink is missing the “1700o” command.

RE: Crash and freeze with a RFM69 - Added by jeromelebel over 5 years ago

So there is a progress. The jeelink can receive data from the uno. But if the jeelink sends data back, the uno crash.

uno:
[RFxConsole.0]FB
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
if using group 0 then sticky group number is used
…,s - send data packet to node , no ack
… - space character is a valid delimiter
128,,n - release group/node index number entry in eeprom
n - set group as sticky. Group 0 only, see p command
l - turn activity LED on PB1 on or off
…,m - add message string to ram, see p command
,,p post semaphore for group node , to be
sent with its next ack. Group number becomes sticky
q - set quiet mode (1 = don’t report bad packets)
x - set reporting format (0: decimal, 2: decimal+ascii
- 1: hex, 3: hex+ascii)
v - return firmware version and current settings
123z - total power down, needs a reset to start up again
Current configuration:
I i9 g212 @ 868 MHz o1700
> 1700o
I i9 g212 @ 868 MHz o1700
868.5000 MHz
> 0q
I i9 g212 @ 868 MHz o1700
> 0x
I i9 g212 @ 868 MHz o1700
> 60,8s
> 1 b
> 61,8s
~~> 1 b
> 62,8a
~~> 1 b
[RFxConsole.0]FB
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
if using group 0 then sticky group number is used
…,s - send data packet to node , no ack
… - space character is a valid delimiter
128,,n - release group/node index number entry in eeprom
n - set group as sticky. Group 0 only, see p command
l - turn activity LED on PB1 on or off
…,m - add message string to ram, see p command
,,p post semaphore for group node , to be
sent with its next ack. Group number becomes sticky
q - set quiet mode (1 = don’t report bad packets)
x - set reporting format (0: decimal, 2: decimal+ascii
- 1: hex, 3: hex+ascii)
v - return firmware version and current settings
123z - total power down, needs a reset to start up again
Current configuration:
I i9 g212 @ 868 MHz o1700
Radio is absent

jeelink:
[RFxConsole.0]40
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
if using group 0 then sticky group number is used
…,s - send data packet to node , no ack
… - space character is a valid delimiter
128,,n - release group/node index number entry in eeprom
n - set group as sticky. Group 0 only, see p command
l - turn activity LED on PB1 on or off
…,m - add message string to ram, see p command
,,p post semaphore for group node , to be
sent with its next ack. Group number becomes sticky
q - set quiet mode (1 = don’t report bad packets)
x - set reporting format (0: decimal, 2: decimal+ascii
- 1: hex, 3: hex+ascii)
v - return firmware version and current settings
123z - total power down, needs a reset to start up again
Current configuration:
H i8 g212 @ 868 MHz o1700
> 1700o
H i8 g212 @ 868 MHz o1700
868.5000 MHz
> 0q
H i8 g212 @ 868 MHz o1700
> 0x
H i8 g212 @ 868 MHz o1700
OK 72 60
OK 72 61
OK 104 62
-> ack i8
?212 151 240 187 63 193 254 184 97 23 56 150 235 251 255 26 142 130 47 7 255 59 220

RE: Crash and freeze with a RFM69 - Added by JohnO over 5 years ago

The message:

Radio is absent

Indicates problems with the SPI. Does this happen each time you restart?

RE: Crash and freeze with a RFM69 - Added by jeromelebel over 5 years ago

no, but the problem is before : why does it restart? I guess that’s a crash.

(1-25/69)