I took the time tonight, and I'm glad I did.
Using the Arduino IDE, I flashed a "sketch" onto the Huzzah, that not only gives me the ability to run Arduino libraries, but I found a Modbus Server library that works with it from here:
https://github.com/andresarmento/modbus-esp8266
It worked! I was able to set up a Modbus client on the Codesys running on the Pi, and could poll a running counter coming in on register 0.
Adafruit ESP8266 Huzzah running Arduino sketch with Modbus server library |
Heres a screenshot. Note the latency difference in numbers... I can speed this up somewhat, but I will have to tweak it.
Codesys online displaying values from Huzzah connected over Wifi via Modbus TCP |
3 comments:
James, my name is Alejandro. I am trying to connect a RASPBERRY PI through wifi by modbus TCP / IP, with a NODECPU ESP8266. How would you configure both devices, the idea is to use the ESP8266 as a remote IO of 5 readings and 5 outputs.
From already thank you very much!
Sorry Rapberry PI whit Codesys!!
Sorry, just saw this. Go to my github repository here
https://github.com/fixstuff/MDRobot
I have a project there with codesys on the pi, and i2c on a Teensy. Ill add the sourve code for the huzzah if its nit on that.
Post a Comment