I just got a Wemos ESP 8266, with integrated oled display and battery. I was able to flash several images to keep confidence with it.
I installed also platformio and tried to play with it.
I am really interested to integrate modbus tcp slave into the device, because it can be used as low cost device for several sensors, and connect it to scada applications where wiring is difficult to be used.
I am new with this device and ESPEasy, so I found here (h.t.t.p://en.trialcommand.com/blog/esp8266-slave-modbus-tcpip-no-libraries/) a working code for modbus tcp slave and I tried to put it into ESPEasy.ino using platformio, and deleting some rows not useful or already present into ESPEasy.ino. I started putting all the code into the main loop, and I was successful to create a working image, but when I connect with a modbus master, I get all the modbus values, but clock on the display and I think most of the operations stop. Webserver keeps working. If I disconnect, clock on the display works fine. I think this happens because the code:
Code: Select all
while (client.connected()) {
If I try to execute the code only one time and replacing an "if" to the "while", I get only one data and the ESPEasy disconnects the master.
I could use the device with only modbus funtions, but I like Espeasy and I would keep all the features.
Is there any way to have the additional added code working as a daemon like the webserver?
Thank you.