solarmon icon indicating copy to clipboard operation
solarmon copied to clipboard

SPF-5000TL -SyntaxError: invalid syntax and ModbusIOException: Modbus Error

Open dawiemaartens opened this issue 5 years ago • 2 comments

Hi

I have got a growatt SPF-5000TL, I run the script on the Raspberry,

I receive a syntax error File "solarmon.py", line 23 print('Setup InfluxDB Client... ', end='') ^ SyntaxError: invalid syntax

and when commenting out " print('Setup InfluxDB Client... ', end='')" and print('Setup Serial Connection... ', end='') I I can get past the error, but receive the following error, I have double check that the RS485A and RS485B pins are correct as per Growatt inverter as well that I can see /ttyUSB0 as the device to use.

Loading inverters... Traceback (most recent call last): File "solarmon.py", line 47, in growatt = Growatt(client, name, unit) File "/home/pi/solarmon/growatt.py", line 58, in init self.read_info() File "/home/pi/solarmon/growatt.py", line 63, in read_info raise row pymodbus.exceptions.ModbusIOException: Modbus Error: [Input/Output] Modbus Error: [Invalid Message] Incomplete message received, expected at least 2 bytes (0 received)

Any assistance will be greatly appreciated. Thanks Dawie

dawiemaartens avatar Jul 02 '20 14:07 dawiemaartens

Hi

I have got a growatt SPF-5000TL, I run the script on the Raspberry,

I receive a syntax error File "solarmon.py", line 23 print('Setup InfluxDB Client... ', end='') ^ SyntaxError: invalid syntax

My only guess to this issue would be Python 2 vs Python 3, whats the output of python --version? Maybe try using python3 growatt.py instead if its installed under that alias.


and when commenting out " print('Setup InfluxDB Client... ', end='')" and print('Setup Serial Connection... ', end='') I I can get past the error, but receive the following error, I have double check that the RS485A and RS485B pins are correct as per Growatt inverter as well that I can see /ttyUSB0 as the device to use.

Loading inverters... Traceback (most recent call last): File "solarmon.py", line 47, in growatt = Growatt(client, name, unit) File "/home/pi/solarmon/growatt.py", line 58, in init self.read_info() File "/home/pi/solarmon/growatt.py", line 63, in read_info raise row pymodbus.exceptions.ModbusIOException: Modbus Error: [Input/Output] Modbus Error: [Invalid Message] Incomplete message received, expected at least 2 bytes (0 received)

Any assistance will be greatly appreciated. Thanks Dawie

The modbus error seems to just be that it failed to read data for some reason. I guess just ensure there are no other USB devices if you do ls /dev/ttyUSB* and that the port in the config is correct. If not that then maybe it could be setup with a different unit number? Could try changing the unit number in the config to see if it changes anything. Other than that I'm not too sure what I can do to help, perhaps if there is some other software that can be used to confirm if its a bug with the script or the serial connection.

ZeroErrors avatar Jul 02 '20 19:07 ZeroErrors

Hi

I have got a growatt SPF-5000TL, I run the script on the Raspberry,

I receive a syntax error File "solarmon.py", line 23 print('Setup InfluxDB Client... ', end='') ^ SyntaxError: invalid syntax

and when commenting out " print('Setup InfluxDB Client... ', end='')" and print('Setup Serial Connection... ', end='') I I can get past the error, but receive the following error, I have double check that the RS485A and RS485B pins are correct as per Growatt inverter as well that I can see /ttyUSB0 as the device to use.

Loading inverters... Traceback (most recent call last): File "solarmon.py", line 47, in growatt = Growatt(client, name, unit) File "/home/pi/solarmon/growatt.py", line 58, in init self.read_info() File "/home/pi/solarmon/growatt.py", line 63, in read_info raise row pymodbus.exceptions.ModbusIOException: Modbus Error: [Input/Output] Modbus Error: [Invalid Message] Incomplete message received, expected at least 2 bytes (0 received)

Any assistance will be greatly appreciated. Thanks Dawie

Wondering if you ever managed to get this to work with the SPF5000TL. Have the same inverter and been pulling my hair out on this for a a couple days now.

Joeyhza avatar Sep 25 '21 12:09 Joeyhza