EmonGLCD does not read time nor Power


I have assembled an EMonGLCD and I cannot get it to read the time from the EMonPI and read the Power from the EMonTX.
When I load the tester.ino code, it works perfectly well. When I upload the final code HomeEnergyMonitor after adjusting the different nodes corectly (EMonTX Node = 8, EmonBase Node = 5 and set the node of my EMonGLCD to 15), it display correctly but never updates the Wattage, nor sync its time with the EMonBase.
On the other hand, I can see the node on my EmonPI but it only displays the rssi and not the Temperature.

Could you please help me.

Thanks a lot!!


For the emonPi to send the time to your GLCD, you also need to edit emonhub.conf

In the [[RFM2Pi]] interfacer, the “interval” needs to be a non-zero number. It doesn’t have to be very frequent, because the GLCD keeps time internally between time checks over the radio, but it should be frequent enough to not annoy you with the wrong time after a power failure.

For the other problems, you need to be clear which nodes send what to where.
The emonTx sends power to both the emonPi and the emonGLCD. Therefore these both need to know the NodeID of the emonTx.
The GLCD sends the temperature to the emonPi, so emonhub needs a node specifying to allow it to receive from the GLCD. The copy of emonhub I’m looking at doesn’t have one pre-programmed, so you need to add one. If your emonGLCD is node 15:

    nodename = emonGLCD
       names = temperature
       datacodes = h
       scales = 0.01
       units = C

For your GLCD to read the power, in the GLCD sketch you must make the struct that receives the data identical to the one in the emonTx that sends the data (though in the GLCD you should not change the names that are used unless you change them throughout the sketch).
This is it:
typedef struct { int power1, power2, power3, Vrms; } PayloadTX;
PayloadTX emontx;
Without checking, I can see that you need to add the elements for the temperatures. But that’s all you need to do - you don’t have to use them. The reason it doesn’t work is the checksum fails because there’s more data than the GLCD expects.
(There’s an article in ‘Learn’ that explains how the radio passes the data between modules.)

Thanks for your reply Robert.

I have been able to read the time correctly. Now I need to find a way to set it to my local time.
(GMT+2 - Brussels time). But I have not been able to read the data from my emonTx.

According to what I read about the emonPi, its ID should be 8. I used the following data struture in the sketch:

typedef struct {
int power1, power2, power3, power4, vrms, temp[6];
unsigned long pulseCount;} PayloadTX; // neat way of packaging data for RF comms
PayloadTX emontx;

The emonPi configuration is the following for my emonTx:

nodename = emontx3
names = power1, power2, power3, power4, vrms, temp1, temp2, temp3, temp4, temp5, temp6, pulse
datacodes = h,h,h,h,h,h,h,h,h,h,h,L
scales = 1,1,1,1,0.01,0.1,0.1, 0.1,0.1,0.1,0.1,1
units =W,W,W,W,V,C,C,C,C,C,C,p

I have aloso attached the log file from the emonPi

Again your help is very appreciated.

emonhub.txt (44.2 KB)

I believe you need to set the timezone in two places - in the emonPi operating system itself, and in emonCMS. See Setting clock on EmonPi - #4 by pb66

Where can you not read the data? The emonPi appears to be receiving it correctly. Do you mean your GLCD?

In your HomeEnergyMonitor.ino file, you need to change this line (line 69 possibly)

typedef struct { int power1, power2, power3, Vrms; } PayloadTX;

to be the same structure as the emonTx, but keeping the same names that it has:

typedef struct { int power1, power2, power3, power4, Vrms, temp[6]; unsigned long pulseCount;} PayloadTX;

You will never use (unless you change the sketch and redesign the display layout) power4 or the 6 temperatures, but that will not matter, the GLCD will receive but simply ignore those values.

Also a little further down in the sketch, you must change this line (line 121 ?)

if (node_id == 10) {emontx = *(PayloadTX*) rf12_data; last_emontx = millis();} //Assuming 10 is the emonTx NodeID

to become:

if (node_id == 8) {emontx = *(PayloadTX*) rf12_data; last_emontx = millis();}

because your emonTx is Node 8.

Thanks for your answer.

I did everything you mentionned but still the GLCD does not display the data.
The EmonTX send everything correctly to the EmonPI and I can see it in the Web interface.

Below is a frame received by the EmonPI;

2017-09-10 11:45:31,635 INFO RFM2Pi Publishing: emon/EmonGLCD/t 0
2017-09-10 11:45:31,641 INFO RFM2Pi Publishing: emon/EmonGLCD/rssi -27
2017-09-10 11:45:31,646 INFO RFM2Pi Publishing: emonhub/rx/15/values 0
2017-09-10 11:45:31,652 INFO RFM2Pi Publishing: emonhub/rx/15/rssi -27
2017-09-10 11:45:31,658 DEBUG RFM2Pi 68593 adding frame to buffer => [1505043931.613665, 15, 0, -27]
2017-09-10 11:45:31,660 DEBUG RFM2Pi 68593 Sent to channel(end)’ : ToEmonCMS
2017-09-10 11:45:34,222 DEBUG RFM2Pi 68594 NEW FRAME : OK 8 9 0 246 0 106 2 0 0 42 95 163 0 145 0 184 11 184 11 184 11 184 11 10 0 0 0 (-44)
2017-09-10 11:45:34,234 DEBUG RFM2Pi 68594 Timestamp : 1505043934.22
2017-09-10 11:45:34,236 DEBUG RFM2Pi 68594 From Node : 8
2017-09-10 11:45:34,239 DEBUG RFM2Pi 68594 Values : [9, 246, 618, 0, 243.62, 16.3, 14.5, 300, 300, 300, 300, 10]
2017-09-10 11:45:34,241 DEBUG RFM2Pi 68594 RSSI : -44
2017-09-10 11:45:34,243 DEBUG RFM2Pi 68594 Sent to channel(start)’ : ToEmonCMS
2017-09-10 11:45:34,246 INFO RFM2Pi Publishing: emon/emontx3/power1 9
2017-09-10 11:45:34,253 INFO RFM2Pi Publishing: emon/emontx3/power2 246
2017-09-10 11:45:34,258 INFO RFM2Pi Publishing: emon/emontx3/power3 618
2017-09-10 11:45:34,264 INFO RFM2Pi Publishing: emon/emontx3/power4 0
2017-09-10 11:45:34,269 INFO RFM2Pi Publishing: emon/emontx3/vrms 243.62
2017-09-10 11:45:34,275 INFO RFM2Pi Publishing: emon/emontx3/temp1 16.3
2017-09-10 11:45:34,307 INFO RFM2Pi Publishing: emon/emontx3/temp2 14.5
2017-09-10 11:45:34,351 INFO RFM2Pi Publishing: emon/emontx3/temp3 300
2017-09-10 11:45:34,369 INFO RFM2Pi Publishing: emon/emontx3/temp4 300
2017-09-10 11:45:34,409 INFO RFM2Pi Publishing: emon/emontx3/temp5 300
2017-09-10 11:45:34,422 INFO RFM2Pi Publishing: emon/emontx3/temp6 300
2017-09-10 11:45:34,431 INFO RFM2Pi Publishing: emon/emontx3/pulse 10
2017-09-10 11:45:34,436 INFO RFM2Pi Publishing: emon/emontx3/rssi -44
2017-09-10 11:45:34,478 INFO RFM2Pi Publishing: emonhub/rx/8/values 9,246,618,0,243.62,16.3,14.5,300,300,300,300,10
2017-09-10 11:45:34,551 INFO RFM2Pi Publishing: emonhub/rx/8/rssi -44
2017-09-10 11:45:34,595 DEBUG RFM2Pi 68594 adding frame to buffer => [1505043934.221479, 8, 9, 246, 618, 0, 243.62, 16.3, 14.5, 300, 300, 300, 300, 10, -44]
2017-09-10 11:45:34,598 DEBUG RFM2Pi 68594 Sent to channel(end)’ : ToEmonCMS
2017-09-10 11:45:38,758 DEBUG RFM2Pi Discarding RX frame ‘unreliable content’? 29 191 227 1 11 250 207 197 92 99 49 192 87 21 76 140 242 63 5 47 122 (-86)

Is there something I’m missing here in the compiled code of the EmonGLCD?


I cannot see why it does not show the data. It will of course only ever show power and energy from c.t.1.
If you want to display all 4 powers and energies, then you will need to modify the sketch and design a new display. There is some documentation with the SolarPV sketch that should help you.

I cannot try your sketch today because I am running a test on a 3-phase sketch. Later (possibly tomorrow), I can load the standard sketch into an emonTx and the HomeEnergyMonitor sketch with the changes into a GLCD and see if mine responds.

Thanks Robert.

Would you suggest me to re-deployed a fresh sketch into my EmonTx? If yes, would you mind to give the link to the recommanded one.


No, do not change that. The emonTx and the emonPi are working together correctly, so let us make the GLCD work with the emonTx. We do not want to make the emonTx and the emonPi work with the GLCD, that will be harder.

OK, understood.

I’m sure we will find a solution.


I’ve done the changes, and it works for me. So I’m not sure what you missed.

I did have to make two more changes: I use 868 MHz, and my GLCD has the old RFM12B radio, so I had to change those lines also. But I have put them back for you.

I have also added two “#defines” to make it easier for you to change the Node ID’s: (@glyn.hudson - please note. I think this should be done in the source on Github.)

#define MYNODE 15 // Should be unique on network, node ID 5 reserved for base station
#define EMONTXNODEID 8 // Set to the NODE ID of the emonTx sending the data
#define BASENODEID 5 // Set to the NODE ID of the emonBase sending the time

But as I warned you, it only displays power1.

HomeEnergyMonitor_Hoplite.zip (5.6 KB)

@TrystanLea or @glyn.hudson (again):
It also looks as if there are two bugs in emonHub (emonHub emon-pi variant v2.0.0.) In order for the Inputs page to display correctly, the entry in emonhub.conf needed to be:

nodename = GLCD
  names = temperature,
  datacodes = h
  scales= 0.01, 1
  units = C

Without the comma ‘,’ after “temperature”, it displayed “t”
Without the comma and the second factor in “scales”, it displayed “0” for the temperature reading; with only the comma, it fails to apply the scale factor.
I didn’t check to see whether the erroneous data is propagated into a feed. [Edit] Yes it is, predictably.

Hello Robert.

Thanks for all the help provided.
At least I got the temperature sent to the EmonBASE successfully.
Unfortunaly, no joy in getting the data from the EmonTX into the EmonGLCD.
The only thing odd is the time I’m getting displayed in the EmonGLCD is GMT time and not the current time - in other words, compare to the EmonPI time, it is 2 hr less. I do not think it really matters.
I have tried to read any of the different values broadcasted by the EmonTX without any success (VRMS, a temperature, any power), nothing does come up.

Any idea?

Thanks for advices.

I have run out of ideas. I have loaded the same emonTx sketch into my emonTx, and I have converted the emonGLCD sketch “HomeEnergyMonitor_Hoplite” for you, and I can see the value of power1 on the GLCD, and they both work with an emonPi. So I really cannot see where your problem is, unless the emonGLCD is simply too far away from the emonTx.

As a final attempt, you could try my GLCD ‘debugging’ sketch. This displays every message it receives, with the node ID, and using the buttons you can scroll through the numbers and interpret them as characters, integers or long integers.
You should see two different messages, one from the emonPi - Node 5 - giving the time, and one from the emonTx - Node 8 - with the powers and temperatures.
My GLCD has an RFM12B, so the sketch does not use and display the signal strength.

The time problem is most likely inside the emonPi. You need to set the time zone both in the Pi’s operating system and in emonCMS.

emonGLCD_Debug.ino (9.2 KB)

Thanks Robert.

The time issue is sorted by change the time zone in the Raspeberry - which I forgot to do in the past.
My EmonGLCD is clse to the PI at this time - just 2 ft away and as the Raspberry receive well all the info boradcasted, I would consider the EmonGLCD should do as well.
I will try your debugging program. Is there any I should change in the sketch before loading it? How do you change the node to track? (using the button?).


No, you do not change the node. It receives every node within range, and displays the NodeID. The top button must be pressed before and during startup to receive 868 MHz, otherwise it defaults to 433 MHz.
Read the notes in the sketch for more.
It can miss a message occasionally.

Does your emonGLCD have the RFM12B or the RFM69CW? If it is the RFM12B, it is said that this is not as good as the RFM69CW when receiving weak signals.

Sorry to bother you again on this topic.
I’ve restarted playing with the EMonGLCD and I face still issues reading my EMonTX data.
I have been able to read the time from my EMonPI and all the info’s from one of mine EMonTH but still no joçy for the EMonTX.
According to the EMonPI, it is on the node 8 and is sending perfectly its data to the EMonPI.
This EMonTX has also a set of temperature sensors connected to it and the setting on the EMonPI are defined like this:

nodename = emonpi
names = power1,power2,power1pluspower2,vrms,t1,t2,t3,t4,t5,t6,pulsecount
datacodes = h, h, h, h, h, h, h, h, h, h, L
scales = 1,1,1,0.01,0.1,0.1,0.1,0.1,0.1,0.1,1
units = W,W,W,V,C,C,C,C,C,C,p

nodename = emontxshield
names = power1, power2, power3, power4, vrms
datacode = h
scales = 1,1,1,1,0.01
units =W,W,W,W,V

nodename = emontx4
names = power1, power2, power3, power4, vrms, temp1, temp2, temp3, temp4, temp5, temp6, pulse
datacodes = h,h,h,h,h,h,h,h,h,h,h,L
scales = 1,1,1,1,0.01,0.1,0.1, 0.1,0.1,0.1,0.1,1
units =W,W,W,W,V,C,C,C,C,C,C,p

nodename = emontx3
names = power1, power2, power3, power4, vrms, temp1, temp2, temp3, temp4, temp5, temp6, pulse
datacodes = h,h,h,h,h,h,h,h,h,h,h,L
scales = 1,1,1,1,0.01,0.1,0.1, 0.1,0.1,0.1,0.1,1
units =W,W,W,W,V,C,C,C,C,C,C,p

Could you please help me to define the right structure to read this EMonTX into my EMonGLCD?
Is it possible to read from the EMonPI the same recorded data?

Thanks for your time and effort.


Don’t worry about that.

First, is your emonGLCD receiving the data - using the “debug” sketch, can you see data from Node 8? It does not need to know the data structure - it receives and displays the complete string of data as byte values. You can step through the data using the buttons to interpret the values in various number formats.

If you see Node 8 displayed and some data, then the GLCD is receiving it.

If you can ONLY see Node 5 (your emonPi), then the GLCD is not receiving the data. Try moving it closer to the emonTx.

To satisfactorily decode the data, you need exactly the same structure as in your emonTx. The easy way is to copy from the emonTx sketch. It should be this:

typedef struct {
  int power1, power2, power3, power4, Vrms, temp[6];
  unsigned long pulseCount;
} PayloadTX;

and that should be what you have in the HEM sketch HomeEnergyMonitor_Hoplite.zip

In theory, yes. In practice, no, because the emonPi is not set to send the data out by radio. The GLCD will receive the data direct from the emonTx, at the same time as the emonPi receives it.

Hello Robert.

Thanks for this super fast answer.
In fact, I’ve never been able to receive any data from thze EMonTX into the EMonGLCD but I receive it propoerly into my EMonPI since many years (as well as the multiple EmonTH’s I have).
So far, I’ve been able to receive perfectly all the data from the EmonTH into the GLCD but never any data from the EmonTX.

Do you think I should update the EmonTX software? (I’ve never done it and it is a version V3)


No, that is not the answer. The GLCD will receive the emonTx V2 and all versions following, provided that you use the correct sketch.

I cannot help you if you repeat information but do not answer my questions: I asked you “Is your emonGLCD receiving the data - using the “debug” sketch, can you see data from Node 8?”

Please upload to your emonGLCD my “debugger” sketch that I sent you a year ago.
What does the “debug” sketch display?
You should see a green flash from the LEDs each time it receives anything from anywhere. It should display a short block of data from Node 5 (the time from your emonPi), then a larger block from your emonTx.

If you cannot see anything from Node 8, what radio frequency are you using?
Are the RF modules all working on the same frequency, and what frequency is that?
Are all the RF modules the correct one for the frequency you are using? (See Learn | OpenEnergyMonitor)

I have run the DEBUG script to the GLCD but it remains “red”.
Just to be sure, I do not have to change anything in this sketch? just transfer it to the GLCD?

If that is correct the sketch results displays nothing more than zero’s.
This is strange because I receive data from the node 19 (EmonTH) & node 5. Or I miss something?

Regarding the freq : I’m using 433MHz modules on all the network.

Did you change this to the correct value?

#define RF69_COMPAT 0                                 // Set to 1 if using RFM69CW or 0 if using RFM12B

Do NOT press the “Enter” switch as you power up - if you do, that will change the frequency to 868 MHz.

You do now see a green flash when the emonPi sends the time?