Programming the M5Stack core basic + PoE LAN module to Modbus TCP ethernet. #Arduino



  • ![0_1596101931562_20200730.jpg](Uploading 100%) I'd like to know if anyone's ever programmed the M5Stack core basic + PoE LAN module as a modbus tcp ethernet slave on arduino.
    If so, which library did you use? Could I get a sample code?
    I'm new to arduino programming and I'm just discovering the M5Stack.
    thanks for your feedback
    ![0_1596101896132_20200730_1134041-ConvertImage.jpg](Uploading 100%)



  • Hi Johnny241

    there is an Arduino library called ArduinoModbus which might work for you. It includes example code for a modbus slave (and master). The examples use WiFi but hopefully replacing WiFi with Ethernet isn't too hard.

    https://github.com/arduino-libraries/ArduinoModbus

    Best of luck
    Felix



  • Hello Felix, Thank you for your feedback.

    I am new to the subject, but I still tried to modify the Wifi library but nothing to do. I do not see how to do with the Ethenet.
    really if someone has a solution I am interested in doing tests



  • Hello @Johnny241

    Yes, from what I am reading Ethernet seems to be a bit tricky. I assume you were able to flash and run the Arduino Modbus WiFi example, correct? If so, I'd continue with a simple Ethernet example (not Modbus related) to get familiar with Ethernet and the LAN module. Only then I'd try to modify the Arduino Modbus WiFi example and replace WiFi with Ethernet.

    Felix