`Checksum error in rtu mode` reading from Rover on Rpi4

Hello!  Following some of the other threads I was able to get some communication with my Rover via a Raspberry Pi, but I can't seem to get past the python error `minimalmodbus.InvalidResponseError: Checksum error in rtu mode:`

I get this using the solarshed module, or just a simple script directly with the minimalmodbus module (which solarshed uses).  Reading any register does some variation on this error (differ hex(?) output etc):

I found that solarshed is pinned to an earlier version of minimalmodbus.  I forced pip to upgrade to the newest of it (which now has the debug functionality) but still no change.

Here is one full example:

root@raspberrypi:~# python 

MinimalModbus debug mode. Create serial port /dev/ttyUSB0

MinimalModbus debug mode. Will write to instrument (expecting 7 bytes back): '\x01\x03\x01\x01\x00\x01\xd46' (01 03 01 01 00 01 D4 36)

MinimalModbus debug mode. Clearing serial buffers for port /dev/ttyUSB0

MinimalModbus debug mode. No sleep required before write. Time since previous read: 1590615347279.03 ms, minimum silent period: 4.01 ms.

MinimalModbus debug mode. Response from instrument: '\x01\x03\x01\x01\x00\x01\xd4' (01 03 01 01 00 01 D4) (7 bytes), roundtrip time: 7.6 ms. Timeout for reading: 50.0 ms.

Traceback (most recent call last):

 File "", line 12, in <module>

 test = instrument.read_register(257, 1)

 File "/usr/local/lib/python2.7/dist-packages/", line 447, in read_register


 File "/usr/local/lib/python2.7/dist-packages/", line 1170, in _generic_command

 payload_from_slave = self._perform_command(functioncode, payload_to_slave)

 File "/usr/local/lib/python2.7/dist-packages/", line 1244, in _perform_command

 response, self.address, self.mode, functioncode

 File "/usr/local/lib/python2.7/dist-packages/", line 1756, in _extract_payload

 raise InvalidResponseError(text)

minimalmodbus.InvalidResponseError: Checksum error in rtu mode: '\x01\xd4' instead of 'I\xd4' . The response is: '\x01\x03\x01\x01\x00\x01\xd4' (plain response: '\x01\x03\x01\x01\x00\x01\xd4')

  • @Josh Gray, Great thank you for sharing this!

    Thank you,

  • This question is not answered
  • I take that back, I'm good now :)

  •  Josh, I am hitting a similar error.  Can you please share the fix and/or sample code?


  • I was able to read data by switching to the other data port and using a different python library.   I'll post a summary soon.

    1 persona le gusta
  • When you say 'other port' are you talking about hooking the USB cable up to the RS485 instead of the RS232?

  • Yeah, the one on the left.   Sorry I haven't gotten a chance to get my code off the pi.  Hopefully soon.

  • Sorry to bother you about this but I'd like to get the data feed from the Renogy into my EmonPi so I can use NodeRed to demandshape.  When you get a moment would you be so kind as to post the code and/or some more details?  Thank you!

  •  Josh, could you please tell me what Python Library you were using for this?


  • Sorry it took so long!    Here is some of the code I'm using.   I haven't spent much time on it so the code is a bit rough, and some of the metrics may be mislabeled. 

    I'm using the pymodbus library.

  •  Thank you very much!  I'll start messing with this tomorrow and see what I can't get going.  Thanks again!

Iniciar sesión o registrarse para publicar un comentario