Page 1 of 1

%sysday% not working?

Posted: 07 Nov 2017, 09:39
by rayE
Hi All,
%systime% works OK and returns HH:MM:SS but i get nothing back with %sysday% or %sysmonth%

GIT version: v2.0.0-dev12

Triggered from timer1 in system boot. Rule below.

Code: Select all

On Rules#Timer=1 do                                // When Timer1 expires, do
    GPIO,5,1                                              // Turn SerialIRQ ON 
    $Time=%systime%                                 // Send this comment out to serial
    $Day=%sysday%                                    // Send this comment out to serial 
    $Month=%sysmonth%                            // Send this comment out to serial  
    Delay 100                                            // Delay 100mS                             
    GPIO,5,0                                             // Turn SerialIRQ OFF
    timerSet,1,10                                     // Set Timer 1 for the next event in 60 second
endon
TIA
Ray

Re: %sysday% not working?

Posted: 07 Nov 2017, 11:17
by vader
Tested and works. Returns 07 and 11 today. See source code...

newString.replace(F("%sysname%"), Settings.Name);
newString.replace(F("%systime%"), getTimeString(':'));
newString.replace(F("%syshour%"), getHourString());
newString.replace(F("%sysmin%"), getMinuteString());
newString.replace(F("%syssec%"), getSecondString());
newString.replace(F("%sysday%"), getDayString());
newString.replace(F("%sysmonth%"), getMonthString());
newString.replace(F("%sysyear%"), getYearString());
newString.replace(F("%sysyears%"), getYearStringShort());
newString.replace(F("%uptime%"), String(wdcounter / 2));

Re: %sysday% not working?

Posted: 07 Nov 2017, 12:11
by rayE
Hi Vadar,
Are you using v2.0.0-dev12?

Thanks
Ray

Re: %sysday% not working?

Posted: 07 Nov 2017, 13:09
by vader
Yep. Self-compiled version with sources from GIT.

%sysday%.%sysmonth%.%sysyear%
HELLO

on OLED shows this:

Re: %sysday% not working?

Posted: 07 Nov 2017, 13:43
by rayE
newString.replace(F("%sysname%"), Settings.Name);
newString.replace(F("%systime%"), getTimeString(':'));
newString.replace(F("%syshour%"), getHourString());
newString.replace(F("%sysmin%"), getMinuteString());
newString.replace(F("%syssec%"), getSecondString());
newString.replace(F("%sysday%"), getDayString());
newString.replace(F("%sysmonth%"), getMonthString());
newString.replace(F("%sysyear%"), getYearString());
newString.replace(F("%sysyears%"), getYearStringShort());
newString.replace(F("%uptime%"), String(wdcounter / 2));
All that works on mine from the list above is............
sysname
systime
uptime

I have searched all the source files in V2.0.0 dev12 and can find no reference to the non working sys names. Is the code snippet you posted in the Misc.ino file?

Cheers
Ray

Re: %sysday% not working?

Posted: 07 Nov 2017, 13:46
by rayE
AH self compiled version :-)

i don't suppose you could be a real star and share your compiled version with me? im a newby and have not gone down the "build road" yet. If you could id send you a "virtual" cold beer :-)

Ray

Re: %sysday% not working?

Posted: 07 Nov 2017, 14:48
by jjansen
Are you sure a date is present in the system? Is NTP-time enabled in settings?

Re: %sysday% not working?

Posted: 07 Nov 2017, 14:59
by rayE
Hi,
Yes NTP is enabled and i can get %systime%. I have searched all the source files in V2.0.0 dev12 and can find no reference to the non working sys names. Im guessing %sysdate% etc is supposed to be in Misc.ino file?

Ray

Re: %sysday% not working?

Posted: 07 Nov 2017, 16:32
by jjansen
Yes, misc.ino line 1726
https://github.com/letscontrolit/ESPEas ... .ino#L1726


But only submitted so long ago... https://github.com/letscontrolit/ESPEasy/pull/485
So I guess it is not included in your version.

Re: %sysday% not working?

Posted: 07 Nov 2017, 18:36
by vader
jjansen wrote:
07 Nov 2017, 16:32
Yes, misc.ino line 1726
https://github.com/letscontrolit/ESPEas ... .ino#L1726


But only submitted so long ago... https://github.com/letscontrolit/ESPEasy/pull/485
So I guess it is not included in your version.
1. That's the same as I already posted in #2!
2. How would you explain, that it works with my version from GIT? See #4
3. You wrote: Are you sure a date is present in the system? Is NTP-time enabled in settings?
Read #1: %systime% works OK and returns HH:MM:SS

You should read all posts first before answering!

Re: %sysday% not working?

Posted: 07 Nov 2017, 20:35
by jjansen
vader wrote:
07 Nov 2017, 18:36
jjansen wrote:
07 Nov 2017, 16:32
Yes, misc.ino line 1726
https://github.com/letscontrolit/ESPEas ... .ino#L1726


But only submitted so long ago... https://github.com/letscontrolit/ESPEasy/pull/485
So I guess it is not included in your version.
1. That's the same as I already posted in #2!
2. How would you explain, that it works with my version from GIT? See #4
3. You wrote: Are you sure a date is present in the system? Is NTP-time enabled in settings?
Read #1: %systime% works OK and returns HH:MM:SS

You should read all posts first before answering!
Oh, I did.
1. rayE responded to that with
I have searched all the source files in V2.0.0 dev12 and can find no reference to the non working sys names. Im guessing %sysdate% etc is supposed to be in Misc.ino file?
Apparently it is not in his source files.
2. I guess rayE uses the dev12 release downloaded from https://github.com/letscontrolit/ESPEas ... .0.0-dev12. You use the last source from github?
3. Fair enough, just to be sure...

Re: %sysday% not working?

Posted: 07 Nov 2017, 21:31
by vader
Yep, that's the same source I compiled my version from. It's in the Misc.ino, as you already know... ;)

Re: %sysday% not working?

Posted: 07 Nov 2017, 23:56
by rayE
Thanks for the help from you BOTH. I will go down the "build" road today and fix the issue.

@ Vandar, Having never used GTI or compiled my own version of ESP Easy the question i posted may have seemed DUMB but we have all been there at one point, correct!

Anyway thanks again.
Ray

Re: %sysday% not working?

Posted: 08 Nov 2017, 00:39
by adval40
I have found my problem

i didn't have the mega version

Re: %sysday% not working?

Posted: 08 Nov 2017, 08:29
by rayE
Hi,
Well i went down the build path and followed the instructions exactly................Atom/Platformio is the MOST BUGGY and HORRIBLE installation i have EVER performed (Win7 64). It took 3 attempts before it "felt" like it "may" be working, Even the uninstall procedure is pretty "wild". BUT after much swearing and at least 6 computer "CRASHES" and 4 hours it now somehow seems to work and i just performed my first successful build :-)

And by the way i now have the system vars i was originally looking for. If anyone wants a copy of the build 2.0.0 V12_Normal_4096 with the added system vars then just ask.

Ray

Re: %sysday% not working?

Posted: 20 Nov 2017, 18:41
by bthome
rayE wrote:
08 Nov 2017, 08:29
Hi,
Well i went down the build path and followed the instructions exactly................Atom/Platformio is the MOST BUGGY and HORRIBLE installation i have EVER performed (Win7 64). It took 3 attempts before it "felt" like it "may" be working, Even the uninstall procedure is pretty "wild". BUT after much swearing and at least 6 computer "CRASHES" and 4 hours it now somehow seems to work and i just performed my first successful build :-)

And by the way i now have the system vars i was originally looking for. If anyone wants a copy of the build 2.0.0 V12_Normal_4096 with the added system vars then just ask.

Ray
@rayE Would appreciate a link to your build or your best instructions on how to build. Would be nice if this could be put together in a Docker. :-)

Re: %sysday% not working?

Posted: 20 Nov 2017, 19:32
by TD-er
In my experience it is best to disable the virusscanner during install of PlatformIO

Re: %sysday% not working?

Posted: 23 Nov 2017, 11:35
by speedie
Ray can you share your working copy of the build 2.0.0 V12?