RFM12b Packet Generator - Structure definition-using NanodeRF?

Exceptional work, well done.

Hope this is possible and is not the reason why I am receiving strange values

I use a NanodeRF SMT to upload data to a debian server. I have uploaded the example code from my RFM12b Packet Generator page (bottom section) to a emonTX and it is receiving data but not as expected. I assume that I need to include the top section ( labled Structure definition) to somewhere in the NanodeRF SMT? Or is this code specific to using a Rpie? (Hm, paket gen..gues that is what it means -  for the Rpie to generate RF packets?) Would it be possible to edit the decode section of the NanodeRF to achive a useable reply? or would it be more likely a case of seting up a response from the server similar to how the time is done? if so any direction would help..

Here is a example of what the emonTX recives (Time is correct but the rest of the values do not relate to the setpoints):

glcdspace: 116
hour: 21
minute: 18
second: 6
radiatorA_setpoint: 2599
radiatorB_setpoint: 0
radiatorC_setpoint: 28
lightA: 4
lightB: 61
lightC: 156
lightD: 9

Thanx, Help is appreciated..
 

Robert Wall's picture

Re: RFM12b Packet Generator - Structure definition-using NanodeRF?

I'm not sure that I understand your question, nor what you are trying to achieve. I think you need to explain a little more about what you have and what you want to do.

gmza's picture

Re: RFM12b Packet Generator - Structure definition-using NanodeRF?

Thanx for trying to help.

I want to modify the packet generator control example to work with a nanodeRF.

I am just not sure of the approach,  I could (just my lack of coding skills )  use  dials and / or set points to update feeds, then have the nanodeRF poll those feeds and when that feed value changes it (the nanodeRF) could action whatever the perimeter is (some grat examples on polling and reacting for the nanodeRF).

I am also trying to avoid using the nanodeRF as a relay, first price would be to pass the data to a dedicated relay node.

With this approach I am already stuck at how the nanodeRF could send data to another node.

It would be great get direction on how use the nanodeRf instead of the Raspberry Pie or in a simpler sense how  to set up the nanodeRF to relay feed values to a listening node similarly on how it relays the time to the GLCD.

Robert Wall's picture

Re: RFM12b Packet Generator - Structure definition-using NanodeRF?

The Nanode is, as you appreciate, already receiving data in the form of the time, and broadcasting it to the GLCD. You want to do exactly the same thing, and with an only slightly different packet of data.

What you need to do is to extract the received data packet in the correct format. The blog post about the Packet Generator says "the module generates example Arduino code" so you need to take that code and merge it into the NanodeRF sketch in a similar way to the way it receives the time. You can then retransmit the data, again in much the same way as the time is transmitted.

You will do all that inside my_callback(...)  Where you have "else if(line_buf[0]=='t')" you will need to find something unique to detect the packet of data and change the "if (....)" to detect that, then the block that follows will pack the data into a structure (like the emonTx code does) and finally you send it with rf12_sendStart(...) exactly as it is done now.

At the listener (relays) node, you will use the same structure to get the individual items of data, and you will have a sketch that looks like the GLCD sketch but without any of the GLCD components. Inside the block that follows "if (rf12_recvDone())" you will extract the data items and process them however you wish, in much the same way as the GLCD does.

Comment viewing options

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