cbalint13 / tinnymodbus

RS485 ModBus tiny multi-sensor module
Other
102 stars 31 forks source link

Change "endian" settings #3

Closed ZigFisher closed 5 years ago

ZigFisher commented 5 years ago

Hi !

Now i run python script and give message:

./sensors-i2c-read.py Traceback (most recent call last): File "./sensors-i2c-read.py", line 80, in <module> decoder = BinaryPayloadDecoder.fromRegisters(result.registers, endian=Endian.Big) TypeError: fromRegisters() got an unexpected keyword argument 'endian'

I change some strings in script code:

decoder = BinaryPayloadDecoder.fromRegisters(result.registers, endian=Endian.Big)

to

decoder = BinaryPayloadDecoder.fromRegisters(result.registers, byteorder=Endian.Big, wordorder=Endian.Big)

Now all work OK !

cbalint13 commented 5 years ago

@ZigFisher ,

Updated , also changed some additional bits to work with python3 too.

Thank you for the report !