How to read data direct from Zeversolar Inverter


#21

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

EDIT:
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.
looks promising

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.

EDIT2:
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

EDIT:3

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.

1,20190519,07:45,80,290
1,20190519,07:50,110,317
2,20190519,07:55,130,311
3,20190519,08:00,160,194
1,20190519,08:05,170,164
1,20190519,08:10,180,157
1,20190519,08:15,200,147
1,20190519,08:20,210,194
1,20190519,08:25,230,282
1,20190519,08:30,260,386
3,20190519,08:35,330,549
1,20190519,08:40,370,541
2,20190519,08:45,410,452
2,20190519,08:50,450,483
1,20190519,08:55,500,561
2,20190519,09:00,540,587
2,20190519,09:05,600,786
4,20190519,09:10,650,689
1,20190519,10:35,2600,992
1,20190519,10:40,2690,1181
1,20190519,10:45,2790,1158
1,20190519,10:50,2900,2181
1,20190519,10:55,3040,3520
2,20190519,11:00,3190,1510
1,20190519,11:05,3300,1171
1,20190519,11:10,3380,829
1,20190519,11:15,3440,579
1,20190519,11:20,3480,374
1,20190519,11:25,3510,365
1,20190519,11:30,3540,364
1,20190519,11:35,3570,361
3,20190519,11:40,3610,496
1,20190519,11:45,3650,558
2,20190519,11:50,3700,547
1,20190519,11:55,3740,612
1,20190519,12:00,3790,605
1,20190519,12:05,3850,672
1,20190519,12:10,3910,766
1,20190519,12:15,3970,623
1,20190519,12:20,4020,623
1,20190519,12:25,4080,837
1,20190519,12:30,4160,1036
5,20190519,12:35, ,
1,20190519,12:40,4290,469
1,20190519,12:45,4320,398

anyone else have any ideas other than maybe poor wifi why its dropping out?

https://pvoutput.org/intraday.jsp?id=29186&sid=61410&dt=20190517&gs=3&m=1


#22

Hi B-Man,

It’s possible that the inverter, or at least the WiFi module within it, goes into some sort of low power state to conserve energy(?) after a certain timeout. Could you script in some ping(s) to generate some ICMP traffic before you try to pull data from the inverter. Logging the ICMP traffic might also reveal some other pattern ( of interference ) that is forcing the retries.