Reputation: 1
I'm trying to get data from an Aims Power Pure Sine Inverter but I couldn´t connect directly with the inverter so now I'm using an external panel that show some information of the inverter. This panel has a RS232 TTL connector so I'm using my Raspberry Pi 4 with an USB to RS232 TTL adapter to extract the data stored in the registers of the panel. I have a code in Python using minimalmodbus library (I tryied pymodbus but it didn´t work) but I get the error that I put in the title of the question when I run it.
This is the code I'm trying:
import serial
import minimalmodbus
instrument = minimalmodbus.Instrument('/dev/ttyUSB0',1)
instrument.serial.port = '/dev/ttyUSB0'
instrument.serial.baudrate = 9600
instrument.serial.bytesize = 8
instrument.serial.parity = serial.PARITY_NONE
instrument.serial.timeout = 10
instrument.address = 1
instrument.mode = minimalmodbus.MODE_RTU
instrument.debug = True
data = instrument.read_register(registeraddress = 1, functioncode = 3)
try:
print(data)
except:
print(data)
The main problem I have is that I don´t have so much information about the inverter or the panel I'm using so I don´t know if I'm using the correct parameters I need to use. For example I don´t know about the registers I need to use or the baudrate, etc.
I have looked a lot for that information but I cannot fine something usefull for me.
I will really appreciate any help.
Thanks.
Upvotes: 0
Views: 182
Reputation: 11
Are you using termination resistors on the bus? I recently started using minimalmodbus and had a heck of a time getting the device to respond. In my case the bus was very short, just one sensor and the pi. I had a termination resistor on the bus which was giving me this issue. If you have a resistor, maybe try it without, or vice-versa.
Upvotes: 0