EmonTX2 + AD5206 Newbie Help Robert....

I have been trying to fudge glcd code into an emontx2 but cant seem to get the rf side to produce the correct values.

I have attached the sketch.

essentially I am trying to get the emontx2 board to listen for data via the rfm12b which is received from the emontx3

when the value of power2+4 is greater than 2000w the arduino talks to the ad5206 and sets a digital pot value.

The data doesnt make sense in the serial

Any Ideas?

 

 

 

 

Robert Wall's picture

Re: EmonTX2 + AD5206 Newbie Help Robert....

I think I'm missing part of the story here. What are your node numbers, what are the data structures that are carrying the data? What is the RPi doing to the data on the way past - is it indeed going through the RPi?

"essentially I am trying to get the emontx2 board to listen for data via the rfm12b which is received from the emontx3"

Unless the emontx3 is out of range of the emontx2, I wouldn't bother going through the RPi. Just use the packet that's transmitted by the emontx3.  That is what the GLCD actually does.

Have you read the Building Blocks article about the RFM12B - part 2 in particular?  If your emonTx3 is using the default sketch, you're actually using power1, power2 & power3 from the emonTx3.

I think there's evidence of some muddle going on here, you're printing emontx.power2+emontx.power3 twice then comparing emontx.power2+emontx.power4 to a constant, so you're not even looking at what you're comparing. To start with, print ALL the values that come across just so that you can verify that you are getting the basic data correctly. 

dod's picture

Re: EmonTX2 + AD5206 Newbie Help Robert....

Hi Robert thanks for the reply.

yes, I'm going directly or trying to.

so essentially using the emontx2 hardware as a glcd stripping out the LCD & Rtc code.

the emontx3 is node 9 group 212 868Mhz

the raspberry pi is node 15, I don't care about the pi, I simple want the tx2 to listen to tx3

on a iPad now, but will re-read

dod's picture

Re: EmonTX2 + AD5206 Newbie Help Robert....

I read part 2 properly and have tried to use the receiver only code but I only get data if I comment out

if (rf12_crc == 0 && (rf12_hdr & RF12_HDR_CTL) == 0)

 

Does this mean I have poor comms ?

Robert Wall's picture

Re: EmonTX2 + AD5206 Newbie Help Robert....

It might mean that. It could also be that the serial print in the lines before is screwing up the RFM12B. Put a few milliseconds delay in after those prints before you check the radio. An outside possibility is that the packet you are sending is illegal - not having the correct checksum for example.
 

 

dod's picture

Re: EmonTX2 + AD5206 Newbie Help Robert....

Hmm, its an unmodified emontx3 doing the trasmitting and the emonglcd picks it all up and the Rpi sends it to emoncms.

its just the emontx2 as a receiver im having issues with, that said in my other post oem_gateway image and basefail I do get basefail messages despite the clock being set correctly on the glcd etc.

 

dod's picture

Re: EmonTX2 + AD5206 Newbie Help Robert....

I will try and add some delay and see what happens

dod's picture

Re: EmonTX2 + AD5206 Newbie Help Robert....

Here is the latest version of code loaded into the unit and a screen shot with the following hashed out

if (rf12_crc == 0 && (rf12_hdr & RF12_HDR_CTL) == 0)

If I leave that in then no data arrives at all.

the power1 looks correct and Vrms but the rest is wrong.

The Raspberry Pi is picking up ok as seen in the emoncms shot.

 

dod's picture

Re: EmonTX2 + AD5206 Newbie Help Robert....

I think it is RF based, a dect phone, switching that off and it seems ok now !

Thank you for your help, now to the AD5206 !

 

 

Comment viewing options

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