After having run my emonGLCD, emonTX and emonbase for the past 8+ weeks without as much as a reset, yesterday I found the emonbase not updating emoncms (online version) so I thought it'd be a good time to update to the latest sketch versions while fixing it. All went well after making personal tweaks, except for the emonGLCD hour now continually showing 0. When I upload the old sketch the time displays correctly so I know the emonbase is working as it should. The minutes are showing correct.
While trying to fix it I had considered swapping the hours,and minutes around in the bit of sketch:
{
RTC.adjust(DateTime(2012, 1, 1, rf12_data[1], rf12_data[2], rf12_data[3]));
last_emonbase = millis();
but I wasn't sure which of these referred to what - the older sketch had emonbase.hour emonbase.mins to help me out. Also the emonbase doesn't appear to send seconds now either (not an issue) so does the three entries as above require this?
My assumption is that I must be doing something wrong as this must be working for everyone else, so any pointers in what to look for would be appreciated.
Thanks
Dennis
Re: RESOLVED - emonGLCD clock error
Hi Dennis,
Trystan has recently overhauled how we retrieve the current time from emoncms. Previously we were extracting the time from the http server responce header everytime data was posted. This worked well but is not ideal if the server is not set to local time. The latest version of emoncms had a local time API. The user can set their local time in emoncms then this time is requested from the emonBase with the following:
if ((millis()-time60s)>60000)
The time is then extracted and sent to the emonGLCD with the following (the RF transmission format has been changed):
else if(line_buf[0]=='t')
This code has been integrated into the latest nanodeRF example. Make sure your posting to the latest verson of emoncms for this new time API to work
Re: RESOLVED - emonGLCD clock error
Hi,
I am using the latest version of emoncms, but I can't find the time setting. Where can I set the time in emoncms? And how can I test the time output? On my emonglcd the time is not displayed.
Remco
Re: RESOLVED - emonGLCD clock error
Thanks Glyn
I've now updated all the system to latest sketches and the clock is working perfectly. I think the issue may have been that I was still using an old emonbase sketch and it would have been posting to vis.openenergymonitor.org.
Dennis