What library did you end up using? I'm fighting a similar issue with trying to read modbus regs on a Wattnode with my Tracker SoM and getting an E2.
Neither the modbus-master or the modbus-master-particle libs did it for me.
I'm getting the correct serial out via my tx, but when I try interfacing with
my 485 breakout board options, nothing intelligible comes out of the 485 end. Option 1) SparkFun Transceiver Breakout - RS-485 - BOB-10124 - SparkFun Electronics
or 2)Amazon.com
I've even hooked up a usb 485 receiver to the 485 end. Ultimately, the stuff coming off the 485 bus is gibberish, which is what I've been really frustrated with. I'm thinking about picking up a chip that doesn't use the rst piece.
Are you using your own Tracker SoM board, the eval board, or a Tracker One?
If it's a Tracker One and connecting by the M8 port, you need to enable CAN_5V in order to enable the GPIO on the M8.
The breakout RX-I goes to the Tracker TX pin. The breakout TX-O goes to the Tracker RX pin.
If you are using the Tracker One you need to use A3 as the direction pin (connect to RTS on the breakout). Be sure to set pinMode(A3, OUTPUT) for it. It should be 1 to transmit and 0 to receive. Make sure you configure the modbus library to use this pin for direction control.
The Monitor One with the I/O card has built-in support for Modbus.
Are you using the Monitor Edge software and controlling it from the console, or did you write your own code?
If you did write your own code, did you base it off Monitor Edge which already includes the Modbus library, or did you write your own firmware from scratch?
If you did write it from scratch, did you follow the steps in the other post for setting D4 in the preTransmission and postTransmission steps? That is required, otherwise you will get the E2 error.
I'm using the Tracker SoM, but will inevitably likely be transitioning to the Tracker One if I can get the wiring layouts trimmed down. The comment on the One will save me some time potentially.
After trying to muck around with the sparkfun and MAX chip, I actually got a HW-519 chip over the weekend and hooked it up today with Zero issues. Apparently, it's smart enough to automatically detect transmit and receiving. It doesn't require a RST pin, which is also a big plus with the limited pins on the Tracker One.
The chip probably has 10x labels people jam on it, but on amazon, it was labeled as a Automatic Flow Control UART to RS485 Converter RS485 to TTL.
I used the ModbusMaster-particle library. I probably could have also used the same ModbusMaster one, but I already switched most of my code from the latter to the former, so stay it does.