modbus-esp8266
modbus-esp8266 copied to clipboard
strange code received by ESP32
Hi,
I tried to run esp32 as modbus slave.
MASTER send:
01 03 00 00 00 0A C5 CD
SLAVE (esp32 with basic RTU sketch) send back:
7F 7E FF FF EB 75 19
This is really strange and I tried to modify the slave address and other parameter but with no success. Do you have any idea about this code, thanks!!!
here the part of the code:
#define RX 36 #define TX 37 #define SLAVE_ID 1 //#define MODBUSRTU_REDE ModbusRTU mb;
void setup() { Serial.begin(9600,SERIAL_8N1,RX,TX);
after some tests I found that changing the PIN number (rx, tx) doesn't change the output. So it looks like the hardware pin I have assigned are not used by the software.
I don't have idea where the problem can be.
https://github.com/emelianov/modbus-esp8266/blob/master/documentation/README.md#modbusrtu