berwinter / uvr1611

UVR1611 Data Logger Pro
GNU General Public License v3.0
31 stars 22 forks source link

cron job read data from blnet does not work anymore #30

Closed svenp closed 6 years ago

svenp commented 6 years ago

Hi, since end of Feb 2017 i can not get data from blnet. Last entry in database ist Feb.18 Now the cold time ist comming and i have searched where the problem coud be.
System is centos 7.4 with php56 and nginx webserver. Today master git version.

Live view of data is ok, but no log data can be download from blnet.

wget 'http://192.168.10.5:81/uvr1611/analogChart.php' -O /dev/null --2017-11-08 19:21:35-- http://192.168.10.5:81/uvr1611/analogChart.php Verbindungsaufbau zu 192.168.10.5:81... verbunden. HTTP-Anforderung gesendet, warte auf Antwort... 200 OK Länge: nicht spezifiziert [application/json] In »»/dev/null«« speichern.

[ <=>                                                                                                                   ] 2           --.-K/s   in 0s      

2017-11-08 19:21:35 (181 KB/s) - »/dev/null« gespeichert [2]

Can i do something to find out where is the problem located? Activate any debug info.

Hope you can help. Regards Sven

berwinter commented 6 years ago

Hi Sven,

first you can try to just load the http://192.168.10.5:81/uvr1611/analogChart.php script in the browser and see if it returns any error message. Furthermore you can set the debug switch in the config.ini to true and reload the analogChart.php to see if there is more information:

[app]
...
debug = true
...

BR Bertram

svenp commented 6 years ago

Hi Bertram, debug = true, but no debug information only [ ] ist the answer analogchart

berwinter commented 6 years ago

Ok, this is expected (the empty array indicate that the script finished successfully). Is there still no data inserted in the database? If so you can check the date/time settings at the uvr1611 and reset the data storage of the Bl-net.

svenp commented 6 years ago

Time Settings in both uvr1611 are correct. I have do a reset on the blnet. I also have do a test with a new Database where i delete all entrys in t_data. With a clean Database i have 24 entrys after first analogChart connect. But no more data when i do next analogChart connect. Date and Time of some entrys are not correct. I dont know why? Can the problem come from the faulty time? database

berwinter commented 6 years ago

Yes, this is possible the cause of the issue. The datalogger searches for the latest date in t_data and only reads values which are more recent from the BL-Net. If there are datasets from 2021 then of course the logger will not read anything anymore. Which configuration do you have? BL-net or CMI? 2x UVR1611 or something different?

svenp commented 6 years ago

Which configuration do you have? BL-net or CMI? 2x UVR1611 or something different? My config is 2xUVR1611, 1X CANIO44 and 1x BL-net. Now i have another BL-net for testing. I have changed the bl-net 30 minutes ago. So maby the Storrage chip in the bl-net have some fault after ten years of 24/7 working.

berwinter commented 6 years ago

Yes, I guess after 10 years of 24/7 operation the memory chip is pretty much death ;) Just out of curiosity: have you had your BL-net configured to reset after every read or did you keep the data stored and let it overwrite old data when it is filled?

svenp commented 6 years ago

The most time of operation in the ten years there was no reset after read. I have a php script witch read every 4 minutes the blnet, store data in csv files and php arrays to generate a image file and then store it on external webserver. So i only call the image file with a lot of information include pv power data and much more from mobile or everywhere. Fast and small data file. Now with the new testing blnet from yesterday, i call the php script every 4 minutes and at the end of the script i call your analogChart.php with reset option. Look like working ok. But one Problem is available when i call schema.svg and script is reading the blnet i see the "another process" message. Can you make a option in config file or somewhere else to enable or disable aktual reading the bl-net when calling the schema.svg. Maby read latest sql entry and sign date and time of latest SQL Data. I think this is a feature request ;-)

berwinter commented 6 years ago

Sounds good! But I wouldn't reset the BL-Net every 4 minutes (360 times per day, >100.000 times per year). This will kill the memory chip pretty fast. I just committed a small change to latest.php. If you set latestcache=false in config.ini, it should read latest data just from SQL. You just need to replace the latest.php with the current version from the repository. I couldn't test is yet. So let me know if it is not working correcly ;-)

svenp commented 6 years ago

OK, now i do no reset after reading the bl-net. The new change in latest.php work perfect. All Data But the timestamp (date and time) of latest sql entry, that is shown in schema.svg or kollektor.svg would be meaningful. I dont know why the 'text4895' in schema.svg is showing a time from SQL entry.....

svenp commented 6 years ago

Without the bl-net reset there are some entry with nothing then 0 0 0 0 ..... null_entry null_kurve

Can the analogCharts.php check the data before writing to SQL Database? Sorry for the lot of work with my special problems ;-)

svenp commented 6 years ago

I think the spikes ar only there when i stay longer on schema.svg..... Forgot to close the Browser an leave the computer... then i can see the spikes in plot.