solmoller / eversolar-monitor

Script to capture data and create statistics from Eversolar/zeversolar Solar Inverters. Includes easy install image files for Raspberry Pi. Working edition since 2012 :-)
https://github.com/solmoller/eversolar-monitor/blob/wiki/Introduction.md
MIT License
30 stars 20 forks source link

pi running eversolar monitor loses connection #58

Closed LeighAS closed 1 year ago

LeighAS commented 2 years ago

https://pvoutput.org/list.jsp?p=0&id=67748&sid=60211&v=0&o=date&d=desc

I have been running this script on an early pi for years now. very recently I have added more panels and every few days or so my pi needs a reboot to re-establish connection to the inverter.

I wondered whether its a rs485 issue as I don't use any terminating resistors but the wire is only 1metre long and its is a cat5 cable with small jumper wires from a cat5 socket into an rs485 to usb dongle.

eventually id love to get this working flawlessly with 3 (or more) arrays. I have an 4.4kw dual string inverter and a 3.6kw single string inverter and an option to buy some smaller 2kw eversol inverters too.

I would also like to have my car (2011 muxsan leaf) alter its charge profile on the fly to soak up the total production by the car communicating with pi to use as much solar as possible without dipping into importing from the grid.

thanks for all your hard work here.

solmoller commented 2 years ago

Hi Leigh,

Did you use the SD card image? I ran that image for nine years on a Rpi model B almost flawlessly. I've started over on an RPi4, but the image did not transfer, so I started over. Maybe your database is too large for the old HW?

As for car integration, I'd look into getting the newer code to deliver to a Home Assistand, and make any automations to the Leaf from there.

Happy nerding!

Henrik

LeighAS commented 2 years ago

might be the database on a model A pi just becoming too big after a few days but then I wonder whether if that's true a bigger memory of a more recent pi would eventually fall over too? just take longer before it does?

Will defo grab a latest code to do the Hass stuff when doing the leaf work its something I've been meaning to get into. having some chargers for small mower batteries (i use for my ebikes) come on at lower solar outputs would be easy with the mqtt stuff. currently using tuya but I have some tasmotized sonoff switches which I can use so this job too.

solmoller commented 2 years ago

Do you reset the entire database? Can't be true. The database should hold all your production data.

LeighAS commented 2 years ago

I just turn it (the pi) off and on again and it works for a few more days. Also yes i used the sd card image

LeighAS commented 2 years ago

altered my ini last night to increase logging to level 4 from 1 and at the same time I changed the strings number to 2 as the tl4600 I have actually has a second dc input than its predecessor which I'm now using with the second array. Unfortunately I couldn't test till this morning and then when I checked the watts and the ac frequency were all wrong so I've reverted that change to the ini and kept the logging level at 4.

once I've got a few days logging and it falls over again can I send you the logs for you to tell me what I might be doing wrong? + setup ini, redacted, thanks.

Also a curious thing, the time always seems to be an hour forward like a British summer time issue. I looked in the pl code to see where this is set and its a getlocaltime(time) in the gettimestamp() method. No idea where the method for the localtime call is so couldn't dig any further.

solmoller commented 2 years ago

1 Yes I'll look at the log 2 how big is the database? 3 the SD card image is very old and uses Danish local time

LeighAS commented 2 years ago

Thanks Henrik, I tried to attach the logs, the source and configuration(redacted). the database is 427,906kb so not sure whether you want that or not. If there is an email I could send those files to let me know.

My inverter didn't want to come on today. I disconnected it, opened it up and looked for damage. There is a very slight mark on the 12v 400v contactors. Remembering what Johannes hubner did to get his ev contactors working with a hammer i gave them a slight flick with my fingers and noted the replacement number to possibly buy some new ones. The inverter is back up now and running fine again. I don't know for how long though.

It's possible that because i'm using two array on it now and by the looks of the pcb they are not on separate actual circuit since the second pv2 is unpopulated, that the amount of solar is being hard on these switched when big clouds go over. Or they may just be pitted and flakey after years of use. the rest of the inverter looked very clean and tidy.

Kind regards Andy.

I think I shall hunt around for a better raspberry pi but I feel it's a bit of a waste since it can manage well most of the time.

On Mon, 13 Jun 2022 at 20:39, Henrik Møller Jørgensen < @.***> wrote:

1 Yes I'll look at the log 2 how big is the database? 3 the SD card image is very old and uses Danish local time

— Reply to this email directly, view it on GitHub https://github.com/solmoller/eversolar-monitor/issues/58#issuecomment-1154355464, or unsubscribe https://github.com/notifications/unsubscribe-auth/AESC3HP3QXPOLG7UPDDJPUDVO6E7DANCNFSM5YSGSZ2Q . You are receiving this because you authored the thread.Message ID: @.***>

LeighAS commented 2 years ago

tried dragging and dropping files but doesn't appear to work

nagydavid commented 2 years ago

@solmoller @LeighAS I am using the a RPi Zero W, Raspian Lite, I am using the MQTT to deposit all information on my home assistant server /DB. That is a very lightweight solution and apart Mqtt , everything is disabled(including local Sqlite) and it works like a charm. My point is your rpi, should be able to handle what ever version you have.

LeighAS commented 1 year ago

Thanks all, learnt alot today. Managed to finally get my second inverter running entirely independently on another rpi ver A. It has the latest with all the mqqt goodies and only had one glitch which was the install of the dbd sqlite cpanm program. Fortunately Henriks advice was good enough to google an easier way of installing the sqlite on the pi.

next challenge was learning how to deal with the massive log file on my older instance from the image created years ago. I now know how to use logrotate.d but struggled to get the configuration file into the directory its needed in but in the end managed to configure winscp as super user on the sftp so then it was drag and drop. not sure when its next going to rotate the logs as it probably need the perl script to be stopped.

I will most likely flash my old pi with the new firmware too once I've had them running reliable side by side for a while. Ideally I would have my inverters physically next to each other so one pi on a daisy chained rs485 bus would server them both but for now I have just the one.

I was wondering whether to make a fork as eventually I might have a third inverter and the limit for the software appears to be 2 (which is probably plenty for most people)

Thanks for everybody's help here

LeighAS commented 1 year ago
pi@raspberrypi:~/eversolar-monitor` $ sudo perl eversolar.pl
mqtt_inverter_model expects an argument at eversolar.ini line 51
2022-07-14 10:57:53: Severity 1, Configfile is: eversolar.ini
Update old database version, or print 2 fail messages (part 1) :
Done updating old database version.
2022-07-14 10:57:55: Severity 3, Checking database
2022-07-14 10:57:55: Severity 1, Updating database with daily table, making data export and stats easy
SolarWebServer: You can connect to your server at http://localhost:3837/
2022-07-14 10:57:56: Severity 1, Connecting to the serial port
Can't open : No such file or directory at eversolar.pl line 561.
pi@raspberrypi:~/eversolar-monitor $ mqtt_inverter_model expects an argument at eversolar.ini line 51
2022-07-14 10:57:53: Severity 1, Configfile is: eversolar.ini
Update old database version, or print 2 fail messages (part 1) :
Done updating old database version.
2022-07-14 10:57:55: Severity 3, Checking database
2022-07-14 10:57:55: Severity 1, Updating database with daily table, making data export and stats easy
SolarWebServer: You can connect to your server at http://localhost:3837/
2022-07-14 10:57:56: Severity 1, Connecting to the serial port
Can't open : No such file or directory at eversolar.pl line 561.

This is the output now at putty's terminal through ssh when I run the perl script. my suspicion is that the serial to usb device may not be working but its was initially. I have killed the process a few times to attempt to solve this issue but I wonder whether I have aggravated the issue by maybe corrupting the sql lite db.

still having issues on both setups it appears and haven't managed to narrow down the source of the instability.

LeighAS commented 1 year ago

affirmed my suspicion of the hardware issues by switching the usb to rs485 adapters between my two working pi (one old software, one new software). The newest software got past the above issue at line 561 now and as started seeing the inverter again. Strangely the old software pi seem to be okay too. I am starting to think this might be a really silly issue like insufficiently capable 5v psu or temperamental usb to rs485 chips.

would really like to get past these instability issues so i can work on the rest of my system.

LeighAS commented 1 year ago

https://pvoutput.org/intraday.jsp?id=67748&sid=92094

This is my newly aggregated system, I have both inverters separately pushing the data via two different pi. One has the old bug of being an hour forward but this doesn't seem to be there in the newer software. I don't mind, today was good in that I now have a simple way of seeing the daily production in one place and if I find another eversol inverter, a way of adding more systems in the future. The aggregation and multiple systems feature cost a donation or minimum $15australian but that is pretty good value.

I could update the old firmware now but equally i will soon move the inverter next to the other one and run them both off a single pi with chained rs485 bus. This will have to wait as corona has got me grabbing low hanging software fruit jobs.

wotid commented 1 year ago

Leigh,

I have my Eversol on PVOutput running this software too. https://pvoutput.org/intraday.jsp?id=2154&sid=12337&dt=20220716 I use MySQL rather than SQlite. (I also turned off the frontend).

Regards,

Steve

LeighAS commented 1 year ago

I like the front end @wotid. Just moved the inverters to their final resting places side by side physically yesterday. This morning I temporarily shutdown the smaller array and opened the rs485 port on the bottom and have run the first cat5 cable from the larger array into the smaller ones second port. Then I made the newer software/firmware pi the main/only pi and changed the ini appropriately to upload both systems to pvoutput.org. Very happy with the result. In other news i found an energy monitor the shelly EM which will do 120a and is bidirectional i am informed so together with the mqtt from the eversol monitor, home assistant (which im yet to dive into), stuart pittaway's diy v4 bms (which also uses mqtt) and my lifepo4 batterys from my old Emoped (emax 110s now retired) i should be able to recreate powerwall functionality. (need a hybrid inverter for this too). Yet to build my pergola for the smaller array but it is currently facing east getting great morning sun.

a bonus of having one pi to look after is also that a) there is a spare easy straight swap b) when/if the stats go down for the pi it will be entirely obvious and force me to investigate both systems running on one pi .

wotid commented 1 year ago

I liked the front end too, but run one that's closer (sort of) to PVOutput. Screenshot_20220719-195116_Chrome Screenshot_20220719-195108_Chrome

LeighAS commented 1 year ago

Pi seems to be stable now running two inverters on newest firmware. as this is the case i will close this issue and open a new one specifically to deal with the totals not being output correctly for dual inverters