Emoncms 3 issues

Hello

Currently trying to upload elapsed power consumption to emoncms3 (local installation)

Storing using the log to feed works ok. Although the timstamp is several hours ahead of my time. The time is correct on my NAS at which the emoncms is running. Is emoncms doing any interpretation of the time ?

when activating the "kwh to kwh/d " input procesor nothing is stored for that feed. Have tried using the the "kwhinc to kwh/d " input procesor and that stores data when i look in the tables using phpmyadmin. But the "kwh to kwh/d " input procesor is best for my task. Also have problems with getting the "update feed @ time " input procesor to work.

Anyone seing the same issues or is just my setup ?

Best regards Søren

 

smi73's picture

Re: Emoncms 3 issues

Also get the following error text when i create a new data input.

Warning: Cannot modify header information - headers already sent by (output started at /share/MD0_DATA/Web/Controllers/process_controller.php:72) in /share/MD0_DATA/Web/Controllers/process_controller.php on line 65

But it works...

Note this is based on the latest emoncms3 release.

 

/Søren

TrystanLea's picture

Re: Emoncms 3 issues

Hello Søren

First as regard to time, emoncms gets the server time using php time() (line 25 api_controller.php) and converts it into date time format using: $time = date("Y-n-j H:i:s", $time); (line 119 feed_model.php). This is then stored in the mysql database. It is then retrieved using strtotime() which converts it back into a unix timestamp. The initial idea with storing it as a datetime string was that it was easy to analyze when browsing the database manually, however it may be that it isn't actually the best/most efficient format to store it in.

Sorry for the kwh to kwhd issue I had forgotten to include automatic setup for the database table needed for that processor to work. I've fixed it and committed the changes to the github repo.

I cant seem to replicate the "Cannot modify header information" warning, 

Thanks

Trystan

 

 

 

smi73's picture

Re: Emoncms 3 issues

Hello Trystan

Thanks for the feedback, highly appriciated.

Applied your newest release to my NAS server. Now the Kwh to Kwhd input processor works.

Still getting the "Cannot modify header information" warning.

Regarding the time issue. I am not an PHP expert,but I created a small test script containing the time function that you use. From that output I can see that the time reported from PHP to the database is pure UTC time without any timezone offset.

But my mySQL database is interpreting this somehow, because the time that gets in is not the one I can read out.

This is probaly for the new feature wish list. Set timezone info for each account. This would be a nice feature especially for the hosted version of EmonCMS, where people don't have the possibility to set the timezone for the mySQL database.

Best regards

Søren

Comment viewing options

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