emelianov / modbus-esp8266

Most complete Modbus library for Arduino. A library that allows your Arduino board to communicate via Modbus protocol, acting as a master, slave or both. Supports network transport (Modbus TCP) and Serial line/RS-485 (Modbus RTU). Supports Modbus TCP Security for ESP8266/ESP32.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

strange code received by ESP32

marcovilla118 opened this issue · comments

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.