Just got some free time to look back into this
It appears once every so often it errors trying to call the home.cgi
I get this warning below
PHP Warning: file_get_contents(http://192.168.1.12/home.cgi): failed to open stream: HTTP request failed! 1
i have added a retry loop so hopefully that fixes that part.
now just need to work on getting the zero added in.
Adding a zero in front doesn’t work, I get an undefined variable for $kwh
ok so not really sure what’s going on but i retyped the adding a zero code all out manually (rather than copy paste) into a new script and works fine so pasted it into my script and it works fine… there is no difference in code that i can see…
im guessing it has some character issue that has copied across.
will have to see how it goes now.
if all goes well i would love to add a log feature so i can see what its doing and what went wrong if there is an issue.
Ok first day was good apart from the morning. Alot less dropouts during the day but worse in the morning.
I got it logging the outputs to a file aswell but now i know how it works i probably didnt need to. As it literally doesnt connect to the inverter so wont output anything… atleast i have a local copy. Just need to tidy that up aswell
Im thinking the wifi is probably a bit far away and sometimes it just wont connect and thats causing the problems. Just tidy up my code and can put it up somewhere for someone else to test if they want.
For some reason i cant connect to my wifi AP so have to go direct to my router and its not as good a signal
so here’s my log file. the number on the left is how many retries it had before being successful. It stops after 5 so if it has 5 it means it didn’t connect. strange it is mostly always first go a few 2,3 and 4 yet after a 5 it can go back to first go… I figured if after 50 seconds if it hasn’t connected I’ll let it drop it.
anyone else have any ideas other than maybe poor wifi why its dropping out?