Page 2 of 2

Re: Nonzerotime after few days empty?

Posted: Wed Sep 11, 2019 4:46 pm
by weatherist34
command: cat /var/run/meteohub/nonzerotime-rain0total
-------------
1567947449
-------------

Re: Nonzerotime after few days empty?

Posted: Wed Sep 11, 2019 4:47 pm
by weatherist34
Convert epoch to human-readable date and vice versa
1567947449

Timestamp to Human date 1567947449
Supports Unix timestamps in seconds, milliseconds, microseconds and nanoseconds.
Assuming that this timestamp is in seconds:
GMT: Sunday, 8 September 2019 12:57:29
Your time zone: Sunday, 8 September 2019 15:57:29 GMT+03:00
Relative: 3 days ago

Re: Nonzerotime after few days empty?

Posted: Wed Sep 11, 2019 4:52 pm
by admin
ok, so data is there. I will look into the code again.

Re: Nonzerotime after few days empty?

Posted: Wed Sep 11, 2019 4:53 pm
by weatherist34
cool :-)

Re: Nonzerotime after few days empty?

Posted: Thu Sep 12, 2019 10:46 pm
by WS Grave
For me there is no data, but I don't want to interrupt you.
I'm following your discussion with interest.

Re: Nonzerotime after few days empty?

Posted: Sat May 30, 2020 12:54 am
by ConligWX
sorry to reopen this thread but I have no nonzerotime-rain0total file present. is this file removed after a number of days?

24th of may was the last time it rained (now 29th May) but when I use the template in my website it was showing last rained 01/Jan/1970

when I read this thread I seen others having similar problems.

root@MeteoBridge:~# cat /var/run/meteohub/nonzerotime-rain0total
cat: can't open '/var/run/meteohub/nonzerotime-rain0total': No such file or directory

is this a bug or something broken in my MB?

how is this file created? what process?

Re: Nonzerotime after few days empty?

Posted: Tue Jun 02, 2020 11:10 pm
by admin
I dived a bit into this rather old code section. nonzerotime is held in RAM disk, so in general after a reboot it is gone. It is also stored on the Meteobridge server like min/max values but looks not to be used for restore on reboot. I changed that in the code.
For raintotal it registers increments so after applying the update you need a new rain event to have it working.

Please test and give me feedback.

Re: Nonzerotime after few days empty?

Posted: Wed Jun 03, 2020 1:58 pm
by ConligWX
Hi there thanks for looking at this. We have rain for the first time this morning which then created a new var/run/meteohub/nonzerotime-rain0total entry.

After a reboot, the values are still here. Will check in a moment that the file still exists...

Re: Nonzerotime after few days empty?

Posted: Wed Jun 03, 2020 3:51 pm
by ConligWX
ok got home checked the

/var/run/meteohub/nonzerotime-rain0total file but it is not there. there is however a update-rain0total file which I guess is the new "last rained file" ?

data on website is still showing correct last rained value.

Re: Nonzerotime after few days empty?

Posted: Thu Jun 04, 2020 9:19 am
by weatherist34
Good morning Simon

currently testing the newer firmware for the last rain measured time/date as in the past it would often not produce a valid timestamp output as the original OP had posted months ago . previous fixes or ideas did not produce any valid timestamp after 72 hours it would simply produce a -- using the meteobridge string [rain0total-nonzerotime:--]

currently can monitor it for the next few days in the template as the string as been present for over a year and as no rain is expected here can see if it produces a valid string after 72 hours.
lastrain.png
lastrain.png (22.66 KiB) Viewed 3690 times

Re: Nonzerotime after few days empty?

Posted: Sun Jun 07, 2020 9:53 pm
by admin
I applied a fix so that "rain0total-nonzerotime" should work fine now.

Re: Nonzerotime after few days empty?

Posted: Sun Jun 07, 2020 10:32 pm
by weatherist34
hi boris i forgot yes in last firmware upgrade earlier this week the value or timestamp wasnt present after 72hrs using the [rain0total-nonzerotime:--] output string , i also noticed when it was actually raining the month, year values were not incrementing realtime until the hour past .
i.e if the rain was 0.2mm at 10:20am the month,hour value did not update till 11:00am i have seen this in a past firmware release but seem to be fixed in a later release.

only way to test this is wait for a rain event and then hope there is no rain for the following 72hours .

hope it makes sense :D