REXYGEN Community Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Login

    ESP8266_ESP32_REST_API

    IoT
    2
    2
    795
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • R
      RexPeter
      last edited by

      Re: 0302-11_ESP8266_REST_API_example

      Hi all,

      I factually succeeded to use the ESP32 with a digital Temp. / RH sensor connecting to my Raspberry Pi.
      However I'm wondering if I also would easily be able to get a kind of "Status" signal from the ESP32 (created in the Sketch) that is giving me feedback if there was a reply received, just like a "Modbus connected" signal.
      If the ESP32 is no longer updating the various parameters because there is no communication anymore, it would become handy to be aware of it.

      I assume it would not take much programming in the sketch, but so far I'm not vary familiar with the arduino IDE programming of an ESP32 (or ESP8266).

      Any feedback would be appreciated.

      Regards,
      Peter

      1 Reply Last reply Reply Quote 0
      • jaroslav_sobotaJ
        jaroslav_sobota
        last edited by

        Hi Peter,
        you can use the MP block for such a purpose. Set the MP:pwidth parameter to e.g. 5 seconds and set the MP:RPTF parameter to ON.

        From your ESP32, you'll periodically write ON to MP:BSTATE parameter (e.g. once per second) via REST API of REXYGEN. As long as the ESP32 keeps communicating, the output MP:Y will be ON. If there is no communication from ESP32 for more than 5 seconds, the MP:Y output will turn OFF.

        In other words, the MP block acts as a communication watchdog in this case.

        Hope it helps, let me know.

        Kind regards,
        Jaroslav

        1 Reply Last reply Reply Quote 0
        • First post
          Last post

        This is a community forum for REXYGEN users and fans. Detailed information can be found at REXYGEN homepage.

        There is also an outdated REXYGEN community forum.

        Powered by NodeBB.