I am trying to us pymodbus to read data from a temperature and pressure device, but it seems the output from my readings is always None.

Here is my code

import pymodbus
import serial
from pymodbus.pdu import ModBusRequest
from pymodbus.client.sync import ModbusSerialClient as MC
from pymodbus.client.sync import ModbusRtuFramer

c = MC(method='rtu',port='/dev/ttyUSB1',stopbits=1,
con = c.connect()
print con

r = c.read_input_registers(0056,4,unit=0x0a)
print r

c. close()

print r always returns None. Did anyone ever get this working? If so, do you have any advice?

  • I'm having the same issue, but not with a raspberry pi. – otmezger Jul 7 '15 at 1:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.