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.
Other
534 stars 188 forks source link

Update ModbusTCPTemplate.h #199

Closed johonline1 closed 2 years ago

johonline1 commented 2 years ago

[modbus-esp8266/tree/master/examples/TLS/client ] will not work with [esp8266/Arduino/3.0.2]! it only works with [esp8266/Arduino/master] and the change below.

template <class SERVER, class CLIENT> int8_t ModbusTCPTemplate<SERVER, CLIENT>::getSlave(IPAddress ip) { for (uint8_t i = 0; i < MODBUSIP_MAX_CLIENTS; i++) if (tcpclient[i] && tcpclient[i]->connected() && !BIT_CHECK(tcpServerConnection, i)) return i; return -1; }

tcpclient[i]->remoteIP() returns no IP address!!!!!!!!