API Update Issues
Posted: Sat May 08, 2021 7:00 pm
After running fine for 6 months on my new WebHost I noticed in the last few days my Meteotemplate DB was not updating every 5 mins as normal. There would often be gaps of 25/30/35 minutes.
I have WD updating every minute.
I first checked the meteotemplatelive.txt and this seemed to be updating but maybe not constantly
Though there is an issue with the values the API is writing, i.e. a snippet
Not sure what is going on with the bizarre 'anti-rounding'
However the APIcache and APILog are not updating every minute as you would expect.
Sometimes they won't update for 5 or 10 minutes or more.
Then you might see issues like this:
Maybe WD isn't sending every minute? so after a bit of digging I found the WD sentcustomhttget file
which is where I saw that WD is trying every minute and found this reported:
Aha, though i'm not sure if this a connectivity issue, a server response etc.
I'm guessing it must be an issue with my webhost that is stopping the called API PHP code from either running or writing files (though the meteotemplatelive.txt is updating more frequently than the API files which is odd). My connectivity seems fine.
Any ideas?
I have WD updating every minute.
I first checked the meteotemplatelive.txt and this seemed to be updating but maybe not constantly
Though there is an issue with the values the API is writing, i.e. a snippet
Code: Select all
{"U":1620497296,"T":15.9000000000000003552713678800500929355621337890625,"TMX":15.9000000000000003552713678800500929355621337890625,However the APIcache and APILog are not updating every minute as you would expect.
Sometimes they won't update for 5 or 10 minutes or more.
Then you might see issues like this:
Code: Select all
Time to update the database, preparing query.
Timestamp first cached record: 2021-05-08 18:42:16
Timestamp last cached record: 2021-05-08 18:44:16
Timestamp last received record: 2021-05-08 19:04:16
Timestamp new database record: 2021-05-08 18:45:00
No new day, currentRain=11.0
Preparing extra sensor query...
The extra database table is updated with the following query:
INSERT INTO alldataExtra
(TIN,HIN,UV,SS,DateTime)
values (23.2,51,0.5,0,'2021-05-08 18:45:00')
Cache file deleted.
Saving first new data to cache/apiCache.txt, timestamp=2021-05-08 19:04:16
Generating log file cache/apiLog.txt
ERRORS:
Meteotemplate MySQL Error: Duplicate entry '2021-05-08 18:45:00' for key 'PRIMARY' with query:
INSERT INTO alldata
(DateTime,T,Tmax,Tmin,H,P,W,G,B,R,RR,S,D,A)
values ('2021-05-08 18:45:00',15.9,15.9,15.9,77.0,1001.8,13.8,23.0,275,11.0,0.0,83.3,11.8,12.
which is where I saw that WD is trying every minute and found this reported:
Code: Select all
Error receiving data: (12002) The operation timed outI'm guessing it must be an issue with my webhost that is stopping the called API PHP code from either running or writing files (though the meteotemplatelive.txt is updating more frequently than the API files which is odd). My connectivity seems fine.
Any ideas?