General Raspberry Pi

DFR0824 with pymodbus

userHead gregorij89 2024-09-25 11:28:12 110 Views0 Replies

Hi,

 

I've just received DFR0824 and I want to use it for communication from Raspberry Pi to my PV inverter utilizing ModBus RTU. On the WIKI page (https://wiki.dfrobot.com/SKU_DFR0824_RS485_Expansion_HAT_for_Raspberry_Pi) I can find an example how to use this HAT with modbus_tk library. As I already have the code to interact with the inverter, that is utilizing pymodbus library, I would rather use it. But in contrast with modbus_tk, the pymodbus serial client is not taking serial.Serial object to its constructor, but rather expecting the string defining the port i.e. /dev/ttyAMA0. Does anybody here used this HAT with pymodbus (or any other client that is taking serial device as an source) succesfully? Is it somehow possible to propagate the HATs channels as serial devices? Maybe via some udev rules?

 

Thank you for any help here.

 

Jiri