Open pomplesiegel opened 2 weeks ago
I'm wondering if this could somehow be an issue of a pin being left low/high, hogging the bus? Weird that it eventually resets. Any ideas of some things to try, and can anyone else try this as well to replicate?
Hi @martinez20m and @aentinger, hope you're both doing well! Based on your past experience with this library, any idea what could be going on here to lead to the differing behavior between platforms on the same exact hardware?
Hello! FYI, I switched to this library instead (below) and for me it is working much more reliably for the RP2040 on this platform. Thank you!
Hello! Strange issue for you all:
I have been running code successfully on a Adafruit Feather RP2040 with PlatformIO's standard Raspberry Pi pico platform. However, once I changed over to using earlephilhower's arudino-pico on the same exact board, a strange behavior began:
Everything seems totally fine when testing 1 ModbusRTUServer physical device at a time. However, if the same code is run on two slaves connected on the same bus (for example, with modbus address/id 1 and 2, respectively) I can only read from 1 device. The requests from the second device will time out unless I wait a few seconds to issue the new request.
Here's an illustration of the setup
Result
If I just poll one device at a time, the responses happen within a few milliseconds, and I can poll constantly for days without a comms issue. It is only when two devices are introduced that the issue occurs.
Any thoughts on what could be going on here? Thank you!
MVP main.cpp example code for Adafruit Feather RP2040:
platform.ini file for PlatformIO compilation:
FYI: For RS485.h to compile I had to make a couple
#define
and pinmapping changes, which may be necessary depending on your pinout as well for testing