Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. Troubleshooting
  3. Node request temperature from gateway

Node request temperature from gateway

Scheduled Pinned Locked Moved Troubleshooting
3 Posts 2 Posters 691 Views 2 Watching
  • 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.
  • D Offline
    D Offline
    Daniel Rus
    wrote on last edited by
    #1

    Hi guys,

    I am trying for the last days to make the gateway to send data to node.
    Till now i dont have any luck , i am using an Arduino Nano for the node and and Arduino Mega with Ethernet adapter.
    Below is my gateway code:

    
    #define MY_RADIO_NRF24
    #define MY_RF24_CE_PIN 6
    #define MY_RF24_CS_PIN 4
    #define MY_SOFTSPI
    #define MY_GATEWAY_SERIAL
    #include <SPI.h>
    #include <MySensors.h>
    #define CHILD_ID 4   // Id of the sensor child
    MyMessage msg(CHILD_ID, V_TEMP);
    
    void setup()
    {  }
    
    void presentation()  {
      present(CHILD_ID, S_TEMP);
    }
    
    void loop()
    { float temperature = 99; // dht.getTemperature();
      send(msg.set(temperature, 1));
    
    }
    
    void receive(const MyMessage &message) {
    
    }
    

    and the code for the node is :

    
    #include <SPI.h>
    #define MY_RADIO_NRF24
    #define MY_RF24_CE_PIN 10
    #define MY_RF24_CS_PIN 9
    #define MY_NODE_ID 2
    #include <MySensors.h>
    
    void setup()
    }
    void presentation()
    {
    }
    
    void loop()
    { request(4, V_TEMP, 0);
    }
    
    void incomingMessage(const MyMessage &message) {
      if (message.type == V_TEMP) {
        Serial.print("Incoming change for sensor:");
        Serial.print(message.sensor);
        Serial.print("\n");
        Serial.print(", New status: ");
        Serial.println(message.getFloat());
    
      }
    }
    

    The serial from the node:

    0;4;1;0;0;99.0
    2;4;2;0;0;
    2;4;2;0;0;
    0;4;1;0;0;99.0
    2;4;2;0;0;
    2;4;2;0;0;
    0;4;1;0;0;99.0
    2;4;2;0;0;
    0;4;1;0;0;99.0
    0;4;1;0;0;99.0
    2;4;2;0;0;
    0;4;1;0;0;99.0
    

    In the serial from the node with debug activated:

    __  __       ____
    |  \/  |_   _/ ___|  ___ _ __  ___  ___  _ __ ___
    | |\/| | | | \___ \ / _ \ `_ \/ __|/ _ \| `__/ __|
    | |  | | |_| |___| |  __/ | | \__ \  _  | |  \__ \
    |_|  |_|\__, |____/ \___|_| |_|___/\___/|_|  |___/
            |___/                      2.3.0
    
    16 MCO:BGN:INIT NODE,CP=RNNNA---,VER=2.3.0
    25 TSM:INIT
    26 TSF:WUR:MS=0
    33 TSM:INIT:TSP OK
    35 TSM:INIT:STATID=2
    37 TSF:SID:OK,ID=2
    39 TSM:FPAR
    75 TSF:MSG:SEND,2-2-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    585 TSF:MSG:READ,0-0-2,s=255,c=3,t=8,pt=1,l=1,sg=0:0
    589 TSF:MSG:FPAR OK,ID=0,D=1
    2082 TSM:FPAR:OK
    2083 TSM:ID
    2084 TSM:ID:OK
    2086 TSM:UPL
    2089 TSF:MSG:SEND,2-2-0-0,s=255,c=3,t=24,pt=1,l=1,sg=0,ft=0,st=OK:1
    2096 TSF:MSG:READ,0-0-2,s=255,c=3,t=25,pt=1,l=1,sg=0:1
    2101 TSF:MSG:PONG RECV,HP=1
    2103 TSM:UPL:OK
    2105 TSM:READY:ID=2,PAR=0,DIS=1
    2109 TSF:MSG:SEND,2-2-0-0,s=255,c=3,t=15,pt=6,l=2,sg=0,ft=0,st=OK:0100
    2116 TSF:MSG:READ,0-0-2,s=255,c=3,t=15,pt=6,l=2,sg=0:0100
    2123 TSF:MSG:SEND,2-2-0-0,s=255,c=0,t=17,pt=0,l=5,sg=0,ft=0,st=OK:2.3.0
    2131 TSF:MSG:SEND,2-2-0-0,s=255,c=3,t=6,pt=1,l=1,sg=0,ft=0,st=OK:0
    4140 TSF:MSG:SEND,2-2-0-0,s=4,c=0,t=6,pt=0,l=0,sg=0,ft=0,st=OK:
    4146 MCO:REG:REQ
    4149 TSF:MSG:SEND,2-2-0-0,s=255,c=3,t=26,pt=1,l=1,sg=0,ft=0,st=OK:2
    4155 TSF:MSG:READ,0-0-2,s=255,c=3,t=27,pt=1,l=1,sg=0:1
    4160 MCO:PIM:NODE REG=1
    4163 MCO:BGN:STP
    ok
    4164 MCO:BGN:INIT OK,TSP=1
    4168 TSF:MSG:SEND,2-2-0-0,s=4,c=2,t=0,pt=0,l=0,sg=0,ft=0,st=OK:
    4176 TSF:MSG:SEND,2-2-0-0,s=4,c=2,t=0,pt=0,l=0,sg=0,ft=0,st=OK:
    4186 TSF:MSG:SEND,2-2-0-0,s=4,c=2,t=0,pt=0,l=0,sg=0,ft=0,st=OK:
    4194 TSF:MSG:SEND,2-2-0-0,s=4,c=2,t=0,pt=0,l=0,sg=0,ft=0,st=OK:
    4201 TSF:MSG:SEND,2-2-0-0,s=4,c=2,t=0,pt=0,l=0,sg=0,ft=0,st=OK:
    4208 TSF:MSG:SEND,2-2-0-0,s=4,c=2,t=0,pt=0,l=0,sg=0,ft=0,st=OK:
    4216 TSF:MSG:SEND,2-2-0-0,s=4,c=2,t=0,pt=0,l=0,sg=0,ft=0,st=OK:
    4224 TSF:MSG:SEND,2-2-0-0,s=4,c=2,t=0,pt=0,l=0,sg=0,ft=0,st=OK:
    4232 TSF:MSG:SEND,2-2-0-0,s=4,c=2,t=0,pt=0,l=0,sg=0,ft=0,st=OK:
    4239 TSF:MSG:SEND,2-2-0-0,s=4,c=2,t=0,pt=0,l=0,sg=0,ft=0,st=OK:
    4246 TSF:MSG:SEND,2-2-0-0,s=4,c=2,t=0,pt=0,l=0,sg=0,ft=0,st=OK:
    4254 TSF:MSG:SEND,2-2-0-0,s=4,c=2,t=0,pt=0,l=0,sg=0,ft=0,st=OK:
    4261 TSF:MSG:SEND,2-2-0-0,s=4,c=2,t=0,pt=0,l=0,sg=0,ft=0,st=OK:
    4269 TSF:MSG:SEND,2-2-0-0,s=4,c=2,t=0,pt=0,l=0,sg=0,ft=0,st=OK:
    
    mfalkviddM 1 Reply Last reply
    0
    • D Daniel Rus

      Hi guys,

      I am trying for the last days to make the gateway to send data to node.
      Till now i dont have any luck , i am using an Arduino Nano for the node and and Arduino Mega with Ethernet adapter.
      Below is my gateway code:

      
      #define MY_RADIO_NRF24
      #define MY_RF24_CE_PIN 6
      #define MY_RF24_CS_PIN 4
      #define MY_SOFTSPI
      #define MY_GATEWAY_SERIAL
      #include <SPI.h>
      #include <MySensors.h>
      #define CHILD_ID 4   // Id of the sensor child
      MyMessage msg(CHILD_ID, V_TEMP);
      
      void setup()
      {  }
      
      void presentation()  {
        present(CHILD_ID, S_TEMP);
      }
      
      void loop()
      { float temperature = 99; // dht.getTemperature();
        send(msg.set(temperature, 1));
      
      }
      
      void receive(const MyMessage &message) {
      
      }
      

      and the code for the node is :

      
      #include <SPI.h>
      #define MY_RADIO_NRF24
      #define MY_RF24_CE_PIN 10
      #define MY_RF24_CS_PIN 9
      #define MY_NODE_ID 2
      #include <MySensors.h>
      
      void setup()
      }
      void presentation()
      {
      }
      
      void loop()
      { request(4, V_TEMP, 0);
      }
      
      void incomingMessage(const MyMessage &message) {
        if (message.type == V_TEMP) {
          Serial.print("Incoming change for sensor:");
          Serial.print(message.sensor);
          Serial.print("\n");
          Serial.print(", New status: ");
          Serial.println(message.getFloat());
      
        }
      }
      

      The serial from the node:

      0;4;1;0;0;99.0
      2;4;2;0;0;
      2;4;2;0;0;
      0;4;1;0;0;99.0
      2;4;2;0;0;
      2;4;2;0;0;
      0;4;1;0;0;99.0
      2;4;2;0;0;
      0;4;1;0;0;99.0
      0;4;1;0;0;99.0
      2;4;2;0;0;
      0;4;1;0;0;99.0
      

      In the serial from the node with debug activated:

      __  __       ____
      |  \/  |_   _/ ___|  ___ _ __  ___  ___  _ __ ___
      | |\/| | | | \___ \ / _ \ `_ \/ __|/ _ \| `__/ __|
      | |  | | |_| |___| |  __/ | | \__ \  _  | |  \__ \
      |_|  |_|\__, |____/ \___|_| |_|___/\___/|_|  |___/
              |___/                      2.3.0
      
      16 MCO:BGN:INIT NODE,CP=RNNNA---,VER=2.3.0
      25 TSM:INIT
      26 TSF:WUR:MS=0
      33 TSM:INIT:TSP OK
      35 TSM:INIT:STATID=2
      37 TSF:SID:OK,ID=2
      39 TSM:FPAR
      75 TSF:MSG:SEND,2-2-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
      585 TSF:MSG:READ,0-0-2,s=255,c=3,t=8,pt=1,l=1,sg=0:0
      589 TSF:MSG:FPAR OK,ID=0,D=1
      2082 TSM:FPAR:OK
      2083 TSM:ID
      2084 TSM:ID:OK
      2086 TSM:UPL
      2089 TSF:MSG:SEND,2-2-0-0,s=255,c=3,t=24,pt=1,l=1,sg=0,ft=0,st=OK:1
      2096 TSF:MSG:READ,0-0-2,s=255,c=3,t=25,pt=1,l=1,sg=0:1
      2101 TSF:MSG:PONG RECV,HP=1
      2103 TSM:UPL:OK
      2105 TSM:READY:ID=2,PAR=0,DIS=1
      2109 TSF:MSG:SEND,2-2-0-0,s=255,c=3,t=15,pt=6,l=2,sg=0,ft=0,st=OK:0100
      2116 TSF:MSG:READ,0-0-2,s=255,c=3,t=15,pt=6,l=2,sg=0:0100
      2123 TSF:MSG:SEND,2-2-0-0,s=255,c=0,t=17,pt=0,l=5,sg=0,ft=0,st=OK:2.3.0
      2131 TSF:MSG:SEND,2-2-0-0,s=255,c=3,t=6,pt=1,l=1,sg=0,ft=0,st=OK:0
      4140 TSF:MSG:SEND,2-2-0-0,s=4,c=0,t=6,pt=0,l=0,sg=0,ft=0,st=OK:
      4146 MCO:REG:REQ
      4149 TSF:MSG:SEND,2-2-0-0,s=255,c=3,t=26,pt=1,l=1,sg=0,ft=0,st=OK:2
      4155 TSF:MSG:READ,0-0-2,s=255,c=3,t=27,pt=1,l=1,sg=0:1
      4160 MCO:PIM:NODE REG=1
      4163 MCO:BGN:STP
      ok
      4164 MCO:BGN:INIT OK,TSP=1
      4168 TSF:MSG:SEND,2-2-0-0,s=4,c=2,t=0,pt=0,l=0,sg=0,ft=0,st=OK:
      4176 TSF:MSG:SEND,2-2-0-0,s=4,c=2,t=0,pt=0,l=0,sg=0,ft=0,st=OK:
      4186 TSF:MSG:SEND,2-2-0-0,s=4,c=2,t=0,pt=0,l=0,sg=0,ft=0,st=OK:
      4194 TSF:MSG:SEND,2-2-0-0,s=4,c=2,t=0,pt=0,l=0,sg=0,ft=0,st=OK:
      4201 TSF:MSG:SEND,2-2-0-0,s=4,c=2,t=0,pt=0,l=0,sg=0,ft=0,st=OK:
      4208 TSF:MSG:SEND,2-2-0-0,s=4,c=2,t=0,pt=0,l=0,sg=0,ft=0,st=OK:
      4216 TSF:MSG:SEND,2-2-0-0,s=4,c=2,t=0,pt=0,l=0,sg=0,ft=0,st=OK:
      4224 TSF:MSG:SEND,2-2-0-0,s=4,c=2,t=0,pt=0,l=0,sg=0,ft=0,st=OK:
      4232 TSF:MSG:SEND,2-2-0-0,s=4,c=2,t=0,pt=0,l=0,sg=0,ft=0,st=OK:
      4239 TSF:MSG:SEND,2-2-0-0,s=4,c=2,t=0,pt=0,l=0,sg=0,ft=0,st=OK:
      4246 TSF:MSG:SEND,2-2-0-0,s=4,c=2,t=0,pt=0,l=0,sg=0,ft=0,st=OK:
      4254 TSF:MSG:SEND,2-2-0-0,s=4,c=2,t=0,pt=0,l=0,sg=0,ft=0,st=OK:
      4261 TSF:MSG:SEND,2-2-0-0,s=4,c=2,t=0,pt=0,l=0,sg=0,ft=0,st=OK:
      4269 TSF:MSG:SEND,2-2-0-0,s=4,c=2,t=0,pt=0,l=0,sg=0,ft=0,st=OK:
      
      mfalkviddM Offline
      mfalkviddM Offline
      mfalkvidd
      Mod
      wrote on last edited by mfalkvidd
      #2

      Welcome to the MySensors community @daniel-rus

      A gateway does not store any data. You need to use a controller. It looks like there is no controller in your system?

      If you haven’t already, see https://www.mysensors.org/about/network for an overview of how MySensors works.

      D 1 Reply Last reply
      0
      • mfalkviddM mfalkvidd

        Welcome to the MySensors community @daniel-rus

        A gateway does not store any data. You need to use a controller. It looks like there is no controller in your system?

        If you haven’t already, see https://www.mysensors.org/about/network for an overview of how MySensors works.

        D Offline
        D Offline
        Daniel Rus
        wrote on last edited by Daniel Rus
        #3

        @mfalkvidd Hi, I manage to make an MQTT gateway with home assistant as controller .
        The serial from gateway i can see that the gateway send data out from MQTT, but the node still not receive anything

        870503 TSF:MSG:READ,2-2-0,s=3,c=2,t=0,pt=0,l=0,sg=0:
        870508 GWT:TPS:TOPIC=mygateway1-out/2/3/2/0/0,MSG SENT
        870569 GWT:TPS:TOPIC=mygateway1-out/0/4/1/0/47,MSG SENT
        870587 GWT:TPS:TOPIC=mygateway1-out/0/3/1/0/0,MSG SENT
        871604 TSF:MSG:READ,2-2-0,s=3,c=2,t=0,pt=0,l=0,sg=0:
        871609 GWT:TPS:TOPIC=mygateway1-out/2/3/2/0/0,MSG SENT
        871670 GWT:TPS:TOPIC=mygateway1-out/0/4/1/0/47,MSG SENT
        871687 GWT:TPS:TOPIC=mygateway1-out/0/3/1/0/0,MSG SENT
        
        1 Reply Last reply
        1

        Hello! It looks like you're interested in this conversation, but you don't have an account yet.

        Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

        With your input, this post could be even better 💗

        Register Login
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        17

        Online

        12.1k

        Users

        11.2k

        Topics

        113.4k

        Posts


        Copyright 2025 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • MySensors
        • OpenHardware.io
        • Categories
        • Recent
        • Tags
        • Popular