Reading message from principal sketch.



  • I'm watching to program from the same gateway program some basic functions (without using other external controller).
    Anyone know how to read the messages as they arrive .


  • Admin

    😕

    Read that a few times but couldn't understand what you want to do.



  • I want to write a function in a esp8266 gateway that allows to act directly on a sensor.
    EXAMPLE:

    READ temperature sensor data 0;0;3;0;9;read: 10-10-0 s=0,c=1,t=0,pt=7,l=5,sg=0:24.6
    ------- If greater than 25 temp send 10; 10; x; x; X


  • Admin

    Ok, the use the development branch. And something like:

    MyMessage msg(1,V_TEMP);
    int temp; 
    
    void presentation() {
       present(1,S_TEMP);
    }
    
    void loop() {
       temp = READ_TEMP_FROM_SOME_SOURCE;
       if (temp>25) 
         send(msg.set(temp));
    
       wait(10000);
    }
    
    

Log in to reply
 

Suggested Topics

  • 1
  • 1
  • 1
  • 2
  • 6
  • 5

10
Online

11.4k
Users

11.1k
Topics

112.7k
Posts