Skip to main content

You are here

Nodes losing their ID

12 posts / 0 new
Last post
jon bondy
Nodes losing their ID

From time to time, I have to reset the node numbers. Given that the node numbers should be stored in non-volatile memory, this is puzzling. I got everything working and went to show it to my client, and some of the nodes had the same numbers. All I had done was plug and unplug batteries.

Any thoughts?

JohnO

There is the capability to store node numbers in NV memory but this has to coded into the sketch - like RFMdemo does.

jon bondy

I know. I'm using a variant on the RFM Demo.

JohnO

I see, could you post the sketch where node numbers were lost?

jon bondy

Attached. I just hooked some extra code in when a string is received over the radio.

AttachmentSize
Peter_1.pde4.37 KB
jon bondy

I set up Nodes 1, 2, 3, and 4. Sometimes one of them ends up back at 1, which is somewhat understandable, if the saved value cannot be found. One time, a node reset to 7, which is fairly unfathomable, given the code in the Setup routine.

JohnO

Hello Jon,

I'm confused as I don't see any code to handle the RFM12B in the sketch you posted.

jon bondy

I screwed up. The code I uploaded previously was for a single Arduino proof-of-concept. I have attached the correct source code. Sorry.

AttachmentSize
RF12DemoJLB.pde28.47 KB
JohnO

That looks closer to what I was expecting.

Since the code in question is mostly @jcw's it is going to be very solid! I wonder if you may be having issues with terminal answer-back triggering changes to the config. It is incredibly easy to change things with a couple of appropriate characters at the wrong time. I frequently screw up the config when I run RFM12demo from Putty. Would it be worth adding a message to saveConfig which says "Are you sure?" and expects a positive response - like "Yes"?

jon bondy

Thanks for your help!

Under normal operating conditions, in my version of the program, the serial port is not used at all: just the radio receiver. So how could the Config be triggered that way? I'm wondering if repeated powering on and off (inserting and removing batteries) could create a state where the saveConfig was called improperly (or the program fails to detect that the configuration was already saved, and over-writes it with the default [node number of 1])

padvinder95

The only thing I can think of is that you're by accident sending uppercase letters through serial, since that also changes the node ID..

jon bondy

I never have Caps Lock on, so upper case characters are unlikely. And each time I change the Node ID, a confirmation appears on the screen, so I know that the node was correct when I stopped typing. I then test it using the radio. Then, after a few insertions and removals of the battery, the Node ID changes, without my typing via the terminal.

Premium Drupal Themes by Adaptivethemes