[Sovled] What is your favorite Mod bus library for ESP8266 / EPS32?

The Arduino NINAWiFi, Modbus, and RS-485 libraries are very clearly written and documented.

Does the group have a recommended modbus library for ESP8266 / ESP32?

My goal is to create a Modbus TCP server using Adafruit feathers as a source of data for Ignition SCADA.

Thanks,

Nick

I found this library which worked well for Adafruit feather Huzzah, ESP32 and ESP8266:

https://github.com/emelianov/modbus-esp8266

Here is a quick code snippet which uses the ESP32 with a temp sensor on A2 and a relay shield on D13.

<
#include <WiFi.h>
#include <ModbusIP_ESP8266.h>

const int relayCtrlPin = 13;
const int tempPin = A2;

const char ssid = " ";
const char password = " ";

ModbusIP modbusTCPServer;

void setup() {
Serial.begin(115200);
pinMode(relayCtrlPin, OUTPUT);
digitalWrite(relayCtrlPin, LOW);

Serial.print("Connecting to ");
Serial.println(ssid);
WiFi.begin(ssid, password);

while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}

Serial.println("");
Serial.println(“WiFi connected.”);
Serial.println("IP address: ");
Serial.println(WiFi.localIP());

modbusTCPServer.slave(502);
modbusTCPServer.addCoil(0x00);
modbusTCPServer.addHreg(0x00);
}

void loop() {
modbusTCPServer.task();
digitalWrite(relayCtrlPin, modbusTCPServer.Coil(0X00));
modbusTCPServer.Hreg(0X00, analogRead(tempPin));

delay(10);
}