Minimalmodbus - RS485 shield for Raspberry Pi

I am trying to interface Seeed Studio’s RS485 shield for Raspberry Pi along with the Python Minimalmodbus library on Raspberry Pi 2B - NOT WORKING!!!

shield :

I tested following on Raspberry Pi:

  • It worked fine if I send data using Python serial library. It turns on a relay on a slave device and responds correctly.


  • It is not working if I use Minimalmodbus library for Python

minimalmodbus.NoResponseError: No communication with the instrument (no answer)

note: I used the same Minimalmodbus python code using another USB-to-RS485 converter on same RPi and it worked fine.

Python Code:

import minimalmodbus

import time

import serial 

instrument = minimalmodbus.Instrument('/dev/ttyAMA0', 255)

instrument.serial.baudrate = 9600      
instrument.serial.bytesize = 8
instrument.serial.stopbits = 1
instrument.serial.timeout  = 1          
instrument.mode = minimalmodbus.MODE_RTU  
instrument.clear_buffers_before_each_transaction = True
instrument.debug = True

while 1:

**error:**  minimalmodbus.NoResponseError: No communication with the instrument (no answer)

Can anybody help if I can use this specific rs485-shield with Minimalmodbus library? Thank you in advance


We haven’t tried Minimalmodbus, but we’ve tested Pyserial and it works.

Yes it worked with Pyserial Library in Python. But we need to use Minimalmodbus or any other similar library in our application. Can you propose any solution? Because we are planning to use this board in some numbers. Thanks