• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Problems with the communication of the RS485 interface
#1
Hello,
I use NIOT-E-NPI3-51-EN-RE with RS485 Interface NIOT-E-NPIX-RS485 Rev#2
The basic software on the netPI is balena with debian container and python3.

For enabling the RS485 interface GPIO17 is set to '1'.

I used the following python script for checking the communication:
Code:
import logging
from pymodbus.client.sync import ModbusSerialClient as ModbusClient #initialize a serial RTU client instance

client= ModbusClient(method = "RTU", port = "/dev/ttyS0", stopbits = 1, bytesize = 8, parity = 'N', baudrate = 9600, timeout=0.1)
connection = client.connect()

FORMAT = ('%(asctime)-15s %(threadName)-15s'
' %(levelname)-8s %(module)-15s:%(lineno)-8s %(message)s')
logging.basicConfig(format=FORMAT)
log = logging.getLogger()
log.setLevel(logging.DEBUG)

def processResponse(result):
   log.debug(result)

rr = client.read_holding_registers(0, 1, unit=0x01)
assert(not rr.isError())     # test that we are not an error
log.debug(rr)

client.close()


Now I have the problem that the communication with the device (in this case a temperature sensor) is not stable. Only every 3rd-5th read out is successful.
See attachment.

.txt   check_client_S0.txt (Size: 14.2 KB / Downloads: 5)


To check the correct operation of the installation, I checked the communication with the device using a normal USB-Modbus-Adapter on the same netPI.
In this case every read out is successful.

.txt   check_client_usb0.txt (Size: 11.67 KB / Downloads: 2)

May be someone has an idea, why the communication with the internal RS485 interface is not stable?

I checked the orginal node-red image for the nedPI. In this case 'rtu-buffered' must be used to get stable values. Otherwise the same problem occurs.

Thanks.
Peter
  Reply


Messages In This Thread
Problems with the communication of the RS485 interface - by PeterL. - April-28th-2020, 07:53 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  NPIX-RS485 with auto direction control now available Armin@netPI 11 8,060 May-15th-2020, 10:46 PM
Last Post: EnergyKonnex
  connecting Mitsubishi via RS485 COswald 11 7,983 January-14th-2020, 10:58 AM
Last Post: Armin@netPI
  Dual RS485 Ports primmer 2 2,972 September-25th-2019, 09:43 AM
Last Post: primmer
  Is there a demand for a RS422 interface? Armin@netPI 0 1,672 April-29th-2019, 10:58 AM
Last Post: Armin@netPI
  Communication between BCM2837 and netX51 on netPI RTE 3 Armin@netPI 0 1,981 December-3rd-2017, 01:19 PM
Last Post: Armin@netPI

Forum Jump:


Users browsing this thread: 1 Guest(s)