datenschuft / SMA-EM

SMA Energymeter measurement
GNU General Public License v2.0
92 stars 38 forks source link

Updated min_update= no more data, even after daemon reload, and reboot (only then I see a few datapoints which stop again) #62

Closed broke23 closed 3 years ago

broke23 commented 3 years ago

Sorry guys for this spamming, but the tool worked, untill I updated config, works only few times after reboot, but not for long ...

I updated the min_update setting from influxdb in config file to see more outputs in grafana, but this stopped logging, which makes sense imho, daemon reload: no solution sudo reboot: it works a few seconds, and then stops again untill i reboot again?

here you see i did 2x sudo reboot, it works a few times, and then stops again Capture

can we go lower than default 20 seconds ?

edit: could it be that due to the sun shining it's too "heavy loaded" ? I was curious to edit my outputs in order to see the PV

debug info:

pi@ElectricPI:~ $ sudo /opt/smaemd/sma-daemon.py run
config
import influxdb.py
influxdb: feature enabled
except - no sma - inverter

inverter was there last night , why all of a sudden it's asking for my inverter now, because now it's live due to good pv readings ? And now not working

broke23 commented 3 years ago

from what i see in syslog, the same error was there last night as well, it writes multiple times the same each timestamp... before continuing ...

Sep  6 23:27:30 raspberrypi sma-daemon.py[7592]: except - no sma - inverter

Sep  7 01:13:52 raspberrypi sma-daemon.py[7592]: except - no sma - inverter

Sep  7 03:00:15 raspberrypi sma-daemon.py[7592]: except - no sma - inverter

Sep  7 04:46:37 raspberrypi sma-daemon.py[7592]: except - no sma - inverter

Sep  7 06:33:00 raspberrypi sma-daemon.py[7592]: except - no sma - inverter
broke23 commented 3 years ago

And now it starts showing again as we speak without any change from my part?! And that's when the pv stops working?! So it stopped when the pv was starting (too much power) this morning and now starts again with when the pv slowly stops working (power generated lower than 400w)...

The daemon is working and sending to influxdb it seems but that's not registering it seems? (I see all the same commands coming back in syslog)

How is this possible?

fields=pconsume,psupply,p1consume,p2consume,p3consume,p1supply,p2supply

Yet when I check the fields in grafana it shows pvpower field? While it's not in my config? Could this be the reason?

datenschuft commented 3 years ago

Yes, you could run min_update lower than 20. I'm running it with min_update=3. The influxdb feature trys to populate also data from the inverter. if you have an sma inverter, you should enable the feature pvdata.py. Otherwise you could try to adopt the pvdata_kostal_json.py, to query your inverter (like in my setup). I have never tried to run the feature influxdb without inverter-data. Maybe this is a problem

broke23 commented 3 years ago

I have an sma inverter indeed here. But not hooked up with udp (read out with Bluetooth Sbfspot and uploaded to pvoutput.org)

Let's see in the morning to hook it up

broke23 commented 3 years ago

hooked up the sma on my network, filled out the IP in pvdata feature: installed modbus version like required

[FEATURE-pvdata]
#Reads data from SMA inverter via Modbus.
#Enable the mqtt feature to publish the data to a mqtt broker (features=pvdata mqtt),
#and/or stored the data to a influx database (features=pvdata influxdb), and/or symcom ...

# How frequently to send updates over (defaults to 20 sec)
min_update=3
# debug output
debug=0

# inverter connection
# ['host', 'port', 'modbus_id', 'manufacturer']
inverters = [
    ['192.168.1.51', '502', '3', 'SMA']
 ]
....

changed config features=pvdata influxdb

I reloaded the daemon, am I missing something ?

@Tommi2Day pvdata is your module, or you edited it ?

Tommi2Day commented 3 years ago

yes, i contributed originaly this module, but there was more changes afterwards from others. For me its absolutly stable. You should have your raspberry within the same network as the inverter image

Your config looks a little bit different than mine, maybe i am running an older version than now. My config for SMA STL-10000

[FEATURE-influxdb]
# influx
host=influxdb
port=8086
db=SMA
measurement=SMAEM
timeout=5
user=
password=
ssl=
#fields=pregard,psurplus,p1regard,p2regard,p3regard,p1surplus,p2surplus,p3surplus
fields=pconsume,psupply,p1consume,p2consume,p3consume,p1supply,p2supply,p3supply

# How frequently to send updates over (defaults to 20 sec)
min_update=30

debug=0

pvmeasurement=SMAWR
pvfields=AC Power,AC Voltage,grid frequency,DC Power,DC input voltage,daily yield,total yield,Power L1,Power L2,Power L3

[FEATURE-pvdata]

# How frequently to send updates over (defaults to 20 sec)
min_update=30

#debug output
debug=0

#inverter connection
inv_host = 192.168.120.120
inv_port = 502
inv_modbus_id = 3
inv_manufacturer = SMA

registers = [
    ['30057', 'U32', 'RAW', 'serial', ''],
    ['30201','U32','ENUM','Status',''],
    ['30051','U32','ENUM','DeviceClass',''],
    ['30053','U32','ENUM','DeviceID',''],
    ['40631', 'STR32', 'UTF8', 'Device Name', ''],
    ['30775', 'S32', 'FIX0', 'AC Power', 'W'],
    ['30813', 'S32', 'FIX0', 'AC apparent power', 'VA'],
    ['30977', 'S32', 'FIX3', 'AC current', 'A'],
    ['30783', 'S32', 'FIX2', 'AC voltage', 'V'],
    ['30803', 'U32', 'FIX2', 'grid frequency', 'Hz'],
    ['30773', 'S32', 'FIX0', 'DC power', 'W'],
    ['30771', 'S32', 'FIX2', 'DC input voltage', 'V'],
    ['30777', 'S32', 'FIX0', 'Power L1', 'W'],
    ['30779', 'S32', 'FIX0', 'Power L2', 'W'],
    ['30781', 'S32', 'FIX0', 'Power L3', 'W'],
    ['30953', 'S32', 'FIX1', u'device temperature', u'\xb0C'],
    ['30517', 'U64', 'FIX3', 'daily yield', 'kWh'],
    ['30513', 'U64', 'FIX3', 'total yield', 'kWh'],
    ['30521', 'U64', 'FIX0', 'operation time', 's'],
    ['30525', 'U64', 'FIX0', 'feed-in time', 's'],
    ['30975', 'S32', 'FIX2', 'intermediate voltage', 'V'],
    ['30225', 'S32', 'FIX0', 'Isolation resistance', u'\u03a9']
    ]
broke23 commented 3 years ago

i have everything in the same network yes, so no issue there...

Do we need to edit anything in pvdata.py itsself or not? Inverter ip?

broke23 commented 3 years ago

testing with debug gets me nowhere either:

pi@ElectricPI:/opt/smaemd/features $ sudo /opt/smaemd/sma-daemon.py run
config
import pvdata.py
pvdata: feature enabled
import influxdb.py
influxdb: feature enabled
^CTraceback (most recent call last):
  File "/opt/smaemd/sma-daemon.py", line 162, in <module>
    daemon.run()
  File "/opt/smaemd/sma-daemon.py", line 132, in run
    emparts=decode_speedwire(sock.recv(608))
KeyboardInterrupt

but no input after that ...

I can't even use measurements script anymore now ? heck what did I do wrong

Tommi2Day commented 3 years ago

of course, you need to provide our own inverter ip. Make sure this ip will not be changed by dhcp. Maybe min_update=3 is too fast for sma inverters. There are some other tools which may help to check, if there are really multicast packet coming from inverter, but usually the smaemd run mode is sufficient All changes should go to the config only. If you have to change the python code, this should be an issue here

broke23 commented 3 years ago

Okay. Reinstalled again. Couldn't even run sma-em-measurement.py... Changed switch. Now it runs 🙄

Still configuring it all but maybe I found the problem?

So no one editing of pvdata.py file itsself?

inverter connection
    inv_host = <inverter ip> LIKE IP HERE? 
    inv_port = 502
    inv_modbus_id = 3
    inv_manufacturer = SMA
broke23 commented 3 years ago

okay, got it back up and running, now I'm curious in the morning if it will work along with the PV system

broke23 commented 3 years ago

It works now! So it was coding at first. Then the switch I used ☺️