Yes.  that was the same response I got with a faulty connection.dmesg | grep tty displays the system’s serial support, but I think the actual connection can still be faulty.  There is really not much else to do than to hook it up to a PC and see if you can connect to you Pi using the serial port with e.g. Putty.  When you can write in the command line of the Pi and see the message on you PC screen you know it works. 

You are sure that your inverter is Modbus?  Mine is firmware 1.8 but I have been in contact with a guy who had 1.7 and he claimed that this is standard serial and got some perl script running to do the same stuff as the python code on my page.  Knock through the menus of the inverter to see. 

There might be slight differences in the Growatt protocol between versions I guess.  But you should be pretty close to getting something working now 🙂

Are you running as root and have ensured that root is member of dialout group (as pr.  description in the blog)? 

FYI my initial try was also to connect via TTL/serial over the Pi’s GPIO’s.  But I never got that working.  Not the same as it is not possible though 🙂 I just grew tied of worrying about questioning if RX/TX were being connected correctly. 

Hello Great Work…It Helped me a lot..I have 1 doubt and 1 problem with my setup…
Doubt : Here u are reading 44 registers starting from 1.i.e (rr = client.read_input_registers(1,44)).  Now i would like to read 100 registers starting from 1.  i.e. (rr = client.read_input_registers(1,100))…Is it possible?  I tried but i was not able to read it….Pls guide me in this case
Problem : In my set-up, when i run my script it shows serial port open error…After that i physically connect – disconnect my cable from USB port and after some trial i am able to get data…whay such thing happen?  How to solve this problem…