Trying to get GLCD to display date rather than time

Hello, i am Italian.

Apologize for my english.

It is also possible to transmit the full date the Raspberry?

I would like to display it on emonglcd.

This is the string to be changed, right?

self._ser.write("00,%02d,%02d,00,s" % (now.hour, now.minute))

Many Thanks!

cybergibbons's picture

Re: Trying to get GLCD to display date rather than time

If you are using the GLCD to display daily kWh readings, you really need to still send the time to the GLCD for it to keep track of when midnight is to reset the values.

You could extend the string out to include a date, but this would also require a change to the sketch on the GLCD to adapt to this.

Robert Wall's picture

Re: Trying to get GLCD to display date rather than time

In the GLCD code, the time is parsed here:

  if (node_id == 15)   //Assuming 15 is the emonBase node ID
  {
        RTC.adjust(DateTime(2012, 1, 1, rf12_data[1], rf12_data[2], rf12_data[3]));
        last_emonbase = millis();
  }

You will need to extend that to include the date. This http://openenergymonitor.org/emon/buildingblocks/rfm12b2 might help you.

You will also need to adjust the display to show the date in a suitable way, of course.

michelino1977's picture

Re: Trying to get GLCD to display date rather than time

Hello,

Tanks for your reply.

My problem is send the full date from Raspberry, now.day, now.mounth, now.year are available in oemgatewaylistener.py

How do I change this string to insert them for add now.day, now.mount and now.year ?

self._ser.write("00,%02d,%02d,00,s" % (now.hour, now.minute))

 

Many thanks

 

Michele

Comment viewing options

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