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. Can't get the void receive() to work, on Repeater and Node's

Can't get the void receive() to work, on Repeater and Node's

Scheduled Pinned Locked Moved Troubleshooting
6 Posts 2 Posters 2.7k 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.
  • delinendD Offline
    delinendD Offline
    delinend
    wrote on last edited by
    #1

    Hi.

    I use the last 2.0.1-beta dev. version (from last night), and I can't get the function void receive(const MyMessage &message) to work.
    It works fine on a Gateway setup.

    Have tryed 2 types of setups.

    1. Node(ID6) to a Repeater(ID7). I see the debug data on the repeater, but can't get any data via the void receive().
    2. Node(ID6) to Node(ID7). Also here, I see the data on Node(ID7), but can't get any data via the void receive() funktion.

    Any ideas?
    Node(ID6) has a Static parent to Node-ID7, and Node(ID7) has a Static parent to Node-ID6

    The void receive(const MyMessage &message) funktion, now works fine, from version 2.0.1-beta, on at GatewaySerial setup.

    AWIA 1 Reply Last reply
    0
    • delinendD delinend

      Hi.

      I use the last 2.0.1-beta dev. version (from last night), and I can't get the function void receive(const MyMessage &message) to work.
      It works fine on a Gateway setup.

      Have tryed 2 types of setups.

      1. Node(ID6) to a Repeater(ID7). I see the debug data on the repeater, but can't get any data via the void receive().
      2. Node(ID6) to Node(ID7). Also here, I see the data on Node(ID7), but can't get any data via the void receive() funktion.

      Any ideas?
      Node(ID6) has a Static parent to Node-ID7, and Node(ID7) has a Static parent to Node-ID6

      The void receive(const MyMessage &message) funktion, now works fine, from version 2.0.1-beta, on at GatewaySerial setup.

      AWIA Offline
      AWIA Offline
      AWI
      Hero Member
      wrote on last edited by
      #2

      @delinend Can you post the sketch.

      delinendD 1 Reply Last reply
      0
      • AWIA AWI

        @delinend Can you post the sketch.

        delinendD Offline
        delinendD Offline
        delinend
        wrote on last edited by
        #3

        @AWI
        Here the Node6, that sends temperatur, from a IR sensor to Parent-ID7

        // Enable debug prints to serial monitor
        #define MY_DEBUG 
        
        // Enable and select radio type attached
        #define MY_RADIO_NRF24
        //#define MY_RADIO_RFM69
        
        #define MY_NODE_ID 6
        //#define MY_DEFAULT_ERR_LED_PIN 4
        #define MY_RF24_CHANNEL 123
        #define MY_RF24_PA_LEVEL RF24_PA_HIGH
        
        #define MY_PARENT_NODE_ID 7
        #define MY_PARENT_NODE_IS_STATIC
        
        //#define MY_REGISTRATION_FEATURE
        #define MY_TRANSPORT_DONT_CARE_MODE
        
        //#define MY_REPEATER_FEATURE
        
        #include <SPI.h>
        #include <MySensors.h>
        #include <Wire.h>
        #include <Adafruit_MLX90614.h>
        
        Adafruit_MLX90614 mlx = Adafruit_MLX90614();
        
        unsigned long SLEEP_TIME = 500; // Sleep time between reads (in milliseconds)
        
        // Initialize temperature message
        MyMessage msg(0,V_TEMP);
        
        float temperature;
        
        
        
        void setup()  
        { 
         mlx.begin();
        }
        
        void presentation() {
          // Send the sketch version information to the gateway and Controller
          sendSketchInfo("Temperature Sensor", "1.1");
          present(0, S_TEMP);
        }
        
        void loop()     
        {     
        
        //  Serial.print("Ambient = "); Serial.print(mlx.readAmbientTempC()); 
        //  Serial.print("*C\tObject = "); Serial.print(mlx.readObjectTempC()); Serial.println("*C");
        
         temperature = mlx.readObjectTempC();
         Serial.println(temperature,1);
              // Send in the new temperature
              send(msg.setSensor(0).set(temperature,1));
        
           
          
          sleep(SLEEP_TIME);
        }
        

        Ande here Node7, from where I can see the temperatur data, via MY_DEBUG, but not via the void receive() function,

        // Enable debug prints to serial monitor
        #define MY_DEBUG
        //#define MY_SPECIAL_DEBUG
        //#define MY_DEBUG_VERBOSE_SIGNING
        //#define MY_DISABLED_SERIAL
        
        
        
        
        // Enable and select radio type attached
        #define MY_RADIO_NRF24
        //#define MY_RADIO_RFM69
        
        #define MY_NODE_ID 7
        //#define MY_DEFAULT_ERR_LED_PIN 4
        #define MY_RF24_CHANNEL 123
        #define MY_RF24_PA_LEVEL RF24_PA_HIGH
        
        
        #define MY_PARENT_NODE_ID 6
        #define MY_PARENT_NODE_IS_STATIC
        #define MY_TRANSPORT_DONT_CARE_MODE
        
        // Set LOW transmit power level as default, if you have an amplified NRF-module and
        // power your radio separately with a good regulator you can turn up PA level.
        //#define MY_RF24_PA_LEVEL RF24_PA_LOW
        
        // Enable serial gateway
        //#define MY_GATEWAY_SERIAL
        //#define MY_GATEWAY_W5100
        //#define MY_REPEATER_FEATURE
        
        
        
        
        #include <MySensors.h>
        
        
        
        
        void setup() {
        //  Serial.begin(19200);
        //  Serial.begin(MY_BAUD_RATE);
          Serial.println("Started . Please wait...");
          // Setup locally attached sensors
        }
        
        void presentation() {
         // Present locally attached sensors
         //sendSketchInfo("Temperature Sensor", "1.1");
        }
        
        void loop() {
          // Send locally attached sensor data here
        //Serial.println(tempp,1);
        delay(10);
        
        }
        
        void receive(const MyMessage &message) {
        //wait(10);
          Serial.println("received something: ");
        //Serial.println(message.type);
          Serial.println(message.sender);
        //  Serial.println(message.sensor);
        //  Serial.println(message.getBool());
        
        }
        
        AWIA 1 Reply Last reply
        0
        • delinendD delinend

          @AWI
          Here the Node6, that sends temperatur, from a IR sensor to Parent-ID7

          // Enable debug prints to serial monitor
          #define MY_DEBUG 
          
          // Enable and select radio type attached
          #define MY_RADIO_NRF24
          //#define MY_RADIO_RFM69
          
          #define MY_NODE_ID 6
          //#define MY_DEFAULT_ERR_LED_PIN 4
          #define MY_RF24_CHANNEL 123
          #define MY_RF24_PA_LEVEL RF24_PA_HIGH
          
          #define MY_PARENT_NODE_ID 7
          #define MY_PARENT_NODE_IS_STATIC
          
          //#define MY_REGISTRATION_FEATURE
          #define MY_TRANSPORT_DONT_CARE_MODE
          
          //#define MY_REPEATER_FEATURE
          
          #include <SPI.h>
          #include <MySensors.h>
          #include <Wire.h>
          #include <Adafruit_MLX90614.h>
          
          Adafruit_MLX90614 mlx = Adafruit_MLX90614();
          
          unsigned long SLEEP_TIME = 500; // Sleep time between reads (in milliseconds)
          
          // Initialize temperature message
          MyMessage msg(0,V_TEMP);
          
          float temperature;
          
          
          
          void setup()  
          { 
           mlx.begin();
          }
          
          void presentation() {
            // Send the sketch version information to the gateway and Controller
            sendSketchInfo("Temperature Sensor", "1.1");
            present(0, S_TEMP);
          }
          
          void loop()     
          {     
          
          //  Serial.print("Ambient = "); Serial.print(mlx.readAmbientTempC()); 
          //  Serial.print("*C\tObject = "); Serial.print(mlx.readObjectTempC()); Serial.println("*C");
          
           temperature = mlx.readObjectTempC();
           Serial.println(temperature,1);
                // Send in the new temperature
                send(msg.setSensor(0).set(temperature,1));
          
             
            
            sleep(SLEEP_TIME);
          }
          

          Ande here Node7, from where I can see the temperatur data, via MY_DEBUG, but not via the void receive() function,

          // Enable debug prints to serial monitor
          #define MY_DEBUG
          //#define MY_SPECIAL_DEBUG
          //#define MY_DEBUG_VERBOSE_SIGNING
          //#define MY_DISABLED_SERIAL
          
          
          
          
          // Enable and select radio type attached
          #define MY_RADIO_NRF24
          //#define MY_RADIO_RFM69
          
          #define MY_NODE_ID 7
          //#define MY_DEFAULT_ERR_LED_PIN 4
          #define MY_RF24_CHANNEL 123
          #define MY_RF24_PA_LEVEL RF24_PA_HIGH
          
          
          #define MY_PARENT_NODE_ID 6
          #define MY_PARENT_NODE_IS_STATIC
          #define MY_TRANSPORT_DONT_CARE_MODE
          
          // Set LOW transmit power level as default, if you have an amplified NRF-module and
          // power your radio separately with a good regulator you can turn up PA level.
          //#define MY_RF24_PA_LEVEL RF24_PA_LOW
          
          // Enable serial gateway
          //#define MY_GATEWAY_SERIAL
          //#define MY_GATEWAY_W5100
          //#define MY_REPEATER_FEATURE
          
          
          
          
          #include <MySensors.h>
          
          
          
          
          void setup() {
          //  Serial.begin(19200);
          //  Serial.begin(MY_BAUD_RATE);
            Serial.println("Started . Please wait...");
            // Setup locally attached sensors
          }
          
          void presentation() {
           // Present locally attached sensors
           //sendSketchInfo("Temperature Sensor", "1.1");
          }
          
          void loop() {
            // Send locally attached sensor data here
          //Serial.println(tempp,1);
          delay(10);
          
          }
          
          void receive(const MyMessage &message) {
          //wait(10);
            Serial.println("received something: ");
          //Serial.println(message.type);
            Serial.println(message.sender);
          //  Serial.println(message.sensor);
          //  Serial.println(message.getBool());
          
          }
          
          AWIA Offline
          AWIA Offline
          AWI
          Hero Member
          wrote on last edited by
          #4

          @delinend said:
          send(msg.setSensor(0).set(temperature,1));

          shouldn't that be

          send(msg.setDestination(7).setSensor().set(temperature,1));

          in order to have messages delivered at the right destination == 7

          delinendD 1 Reply Last reply
          0
          • AWIA AWI

            @delinend said:
            send(msg.setSensor(0).set(temperature,1));

            shouldn't that be

            send(msg.setDestination(7).setSensor().set(temperature,1));

            in order to have messages delivered at the right destination == 7

            delinendD Offline
            delinendD Offline
            delinend
            wrote on last edited by
            #5

            @AWI
            You hare a Hero :-) That works!
            Btw. Is the setting #define MY_TRANSPORT_DONT_CARE_MORE the right setting, when in a 2 Node's only setup ? I can't else get the Node6 beginning transmitting data.

            AWIA 1 Reply Last reply
            1
            • delinendD delinend

              @AWI
              You hare a Hero :-) That works!
              Btw. Is the setting #define MY_TRANSPORT_DONT_CARE_MORE the right setting, when in a 2 Node's only setup ? I can't else get the Node6 beginning transmitting data.

              AWIA Offline
              AWIA Offline
              AWI
              Hero Member
              wrote on last edited by
              #6

              @delinend The "royal way" is to have one node be a gateway. Else you need the "don't care"

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              13

              Online

              11.7k

              Users

              11.2k

              Topics

              113.0k

              Posts


              Copyright 2019 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