LowPowerLab Forum

Software support => Pi Gateway => Topic started by: SanG on August 25, 2017, 01:10:56 PM

Title: CSV data timestamps off by 5 hours [bug]
Post by: SanG on August 25, 2017, 01:10:56 PM
I recently downloaded the data (battery voltage and soil moisture) using moteino dashboard "Export all data(CSV)" feature provided by nginx web server. But I got all the data time off by exactly 5 hours. All the data values look okay except the time they are recorded. For instance, I recorded the 4.8V for battery and 33.99% for soil moisture at 4:16 PM but the CSV file is showing they are recorded at 9:16 PM. I doubled check this issue by carrying out the test again another day for more than 24 hours but same result. But the time it is showing in the dashboard graph is correct. Only the downloaded CSV file has this issue. Anyone knows what's going on..Please help..
(Note: I am using Raspberry Pi 3 and the web server is nginx)
Title: Re: downloaded CSV data recorded time issue moteino dashboard..
Post by: Felix on August 25, 2017, 02:05:27 PM
Sounds like some GMT time/offset.
Is your server time set correctly (same as your desktop where you view the page)?
Title: Re: downloaded CSV data recorded time issue moteino dashboard..
Post by: SanG on August 25, 2017, 03:51:48 PM
Thanks for the info Felix..Could you also guide me how to set the nginx server time? Just want to make sure again that its the nginx server time issue. Like I mentioned earlier, the date/time showing in the graph in the moteino dashboard is accurately correct. Do you still think it's a GMT time offset. By the way, I did try to set the server time by following the link (http://www.oneminuteinfo.com/2013/06/how-to-change-timezone-of-nginx-web-log.html (http://www.oneminuteinfo.com/2013/06/how-to-change-timezone-of-nginx-web-log.html)). But now the CSV data is worse..I mean the timestamps are more weird..

Title: Re: downloaded CSV data recorded time issue moteino dashboard..
Post by: Felix on August 25, 2017, 03:57:34 PM
It's your *Pi* system time.
nginx uses the system time.....

sudo date
Title: Re: downloaded CSV data recorded time issue moteino dashboard..
Post by: SanG on August 25, 2017, 04:08:15 PM
Thanks Felix but I did check my Pi's (or nginx server) time. It's correct and never had an issue with it. That's the reason why the graph has always been showing the correct time I guess. The only issue is the data timestamp of the CSV file after I download and open it with MS Excel 2013. Any suggestion what could be the reason that the CSV file is showing 5 hours OFF time..?
Title: Re: downloaded CSV data recorded time issue moteino dashboard..
Post by: Felix on August 25, 2017, 05:00:50 PM
Maybe its not compensated for the GMT offset.
Are you running the latest gateway files? Can you actually do a diff to check? There were minor changes to fix some of that CSV export functionality that were not included in an official release yet.
Title: Re: downloaded CSV data recorded time issue moteino dashboard..
Post by: SanG on October 27, 2017, 03:45:08 PM
Sorry for late reply..I just updated the gateway files today with the latest ones but no luck. Everything else is good except the 5 hours OFF in CSV data file.
Title: Re: CSV data timestamps off by 5 hours [bug]
Post by: Felix on October 27, 2017, 04:06:42 PM
Ok I will try to take a look at this when I work on gateway bugs.