Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
dawiemaartens opened this issue Jul 2, 2020 · 2 comments

Comments

@dawiemaartens
Copy link

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

@ZeroErrors
Copy link
Owner

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.

@Joeyhza
Copy link

Joeyhza commented Sep 25, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants