Closed Maikel-K closed 3 years ago
sorry, figured something out... i needed to uncomment some stuff in the following section:
`[meter1] dst_address = 2 src_address = 1 type = sdm120 serial_number = 987654
now i get the following error
Traceback (most recent call last): File "semp-rtu.py", line 172, in <module> extended=confparser[meter].get("extended", fallback=default_config["extended"]) KeyError: 'extended'
so i added
extended = False
to the [meter1] section. This doesnt seem to fix it.
So i changed the following line extended=confparser[meter].get("extended",` fallback=default_config["extended"])
to include [meters] extended=confparser[meter].get("extended",` fallback=default_config["meters"]["extended"])
Now the script seems to run but with following output:
pi@raspberrypi4:~/eastronsolaredge $ python3 semp-rtu.py 2020-11-19 08:45:50 INFO: Created <Thread(t_update_2, initial)>: meter1 sdm120 SDM120(False:False, connectionType.TCP: timeout=1, retries=3, unit=0x1) 2020-11-19 08:45:51 CRITICAL: t_update_2: getaddrinfo() argument 1 must be string or None 2020-11-19 08:45:51 INFO: Starting <Thread(t_update_2, started 3053249632)> 2020-11-19 08:45:56 CRITICAL: t_update_2: getaddrinfo() argument 1 must be string or None
Could you paste your config file?
tried running the code again, i did change somethings later today. so i have removed all files from my RPI and uploaded it again.
Running: python3 semp-rtu.py
results in:
Traceback (most recent call last):
File "semp-rtu.py", line 172, in
config looks like this now:
meters = meter1
[meter1] dst_address = 2 src_address = 1 type = sdm120 serial_number = 987654
if i add ["meters"] on line 172 in semp-rtu.py if get this output
2020-11-19 19:01:13 INFO: Created <Thread(t_update_2, initial)>: meter1 sdm120 SDM120(False:False, connectionType.TCP: timeout=1, retries=3, unit=0x1) 2020-11-19 19:01:14 CRITICAL: t_update_2: getaddrinfo() argument 1 must be string or None 2020-11-19 19:01:14 INFO: Starting <Thread(t_update_2, started 3053745248)> 2020-11-19 19:01:19 CRITICAL: t_update_2: getaddrinfo() argument 1 must be string or None 2020-11-19 19:01:24 CRITICAL: t_update_2: getaddrinfo() argument 1 must be string or None
i updated the meter1 section: [meter1] dst_address = 2 src_address = 1 type = sdm120 serial_number = 987654 device = /dev/ttyUSB0 stopbits = 1 parity = e baud = 2400 timeout = 1
result:
Traceback (most recent call last):
File "semp-rtu.py", line 172, in
Excellent! Looks like you ran into two bugs I would never have seen. I connect to a SDM120 over ModbusTCP via a Modbus to Ethernet gateway. Both problems should be fixed now, please try again!
Also, you mentioned that you have a SDM630 unit. If so, you should change the type
configuration to SDM630
in your config file.
Hi,
Thanks will try again tomorrow!
Yes I have a SDM120C too with which I'm testing it first. It's still connected to that RPI which I'm testing it on.
What are you using for the ModbusTCP comms? Mind sharing that too? I got a lot of Wemos D1 Mini laying around and got the SDM630 connected to one running Tasmota... but it doesn't update any faster then 10 seconds... I want it to send data every 1 second.
I always want to connect the SDM120C with a Wemos d1 mini and place my RPI in a different location.
I have the SDM120 connected to a PoE powered tGW-715. It handles multiple requests per second without issue. I then run the solaredge_meterproxy script on an openwrt powered mini router which is connected to the inverter with a RS485 to USB dongle. Another device on the network also polls the SDM120 through the tGW-715 and dumps the results into an InfluxDB database, which could also be used as a source for solaredge_meterproxy if I find the time to make a suitable device script.
I just changed the baud line as I already figured extended out(was also thinking of removing the rate in baudrate but didn't do it)
Now I got this:
2020-11-19 22:49:43 CRITICAL: t_update_2: Not a valid parity: 'e' pi@raspberrypi4:~/eastronsolaredge$ python3 semp-rtu.py 2020-11-19 22:50:41 INFO: Created <Thread(t_update_2, initial)>: meter1 sdm120 SDM120(/dev/ttyUSB1, connectionType.RTU: stopbits=1, parity=e, baud=2400, timeout=1, retries=3, unit=0x1)2020-11-19 22:50:42 CRITICAL: t_update_2: Not a valid parity: 'e' 2020-11-19 22:50:42 INFO: Starting <Thread(t_update_2, started 3053675616)>
Hi,
Tried to run your script and setup meters = meter1 in de conf file.
Get the following error:
Traceback (most recent call last): File "semp-rtu.py", line 158, in <module> address = confparser[meter].getint("dst_address", fallback=default_config["meter"]["dst_address"]) File "/usr/lib/python3.7/configparser.py", line 958, in __getitem__ raise KeyError(key) KeyError: 'meter1'