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. [SOLVED (but can somebody explain why)]Not getting any incoming messages...

[SOLVED (but can somebody explain why)]Not getting any incoming messages...

Scheduled Pinned Locked Moved Troubleshooting
9 Posts 3 Posters 2.4k 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.
  • Steve CasterS Offline
    Steve CasterS Offline
    Steve Caster
    wrote on last edited by Steve Caster
    #1

    Hi all

    I am trying to make a controller for my blinds using a 2 channel relay. I am using MySensors 1.5 and arduino 1.6.5b as dev env.

    I am using the following sketch

    #include <MySensor.h>
    #include <SPI.h>
    
    #define UP_PIN  3 
    #define DOWN_PIN  4
    #define CHILD_ID 250 
    
    MySensor gw;
    void setup()  
    {   
      gw.begin(incomingMessage, AUTO, false);
      gw.sendSketchInfo("Blinds", "1.0");
      gw.present(CHILD_ID, S_COVER,"Blinds",true);
      pinMode(UP_PIN, OUTPUT);   
      pinMode(DOWN_PIN, OUTPUT);   
      digitalWrite(UP_PIN, 0);
      digitalWrite(DOWN_PIN, 0);
      Serial.println( "Node ready to receive messages..." );
    }
    
    void loop() 
    {
      gw.process();
    }
    
    void incomingMessage(const MyMessage &message) {
      Serial.println(message.data);
      if (message.type==V_UP) {
         digitalWrite(UP_PIN,1);
         gw.sleep(15000);
         digitalWrite(UP_PIN,0);
         Serial.println("opening up covers");
       } 
       else if (message.type==V_DOWN) {
         digitalWrite(DOWN_PIN,1);
         gw.sleep(15000);
         digitalWrite(DOWN_PIN,0);
         Serial.println("closing up covers");
       } 
       else if (message.type==V_STOP) {
         digitalWrite(UP_PIN,0);
         digitalWrite(DOWN_PIN,0);
         Serial.println("stopping covers");
       }
    }
    
    

    In the gateway I get

    0;0;3;0;9;read: 250-250-0 s=255,c=0,t=17,pt=0,l=3,sg=0:1.5
    250;255;0;0;17;1.5
    0;0;3;0;9;read: 250-250-0 s=255,c=3,t=6,pt=1,l=1,sg=0:0
    250;255;3;0;6;0
    0;0;3;0;9;read: 250-250-0 s=255,c=3,t=11,pt=0,l=6,sg=0:Blinds
    250;255;3;0;11;Blinds
    0;0;3;0;9;read: 250-250-0 s=255,c=3,t=12,pt=0,l=3,sg=0:1.0
    250;255;3;0;12;1.0
    0;0;3;0;9;read: 250-250-0 s=250,c=0,t=5,pt=0,l=6,sg=0:Blinds
    0;0;3;0;9;send: 0-0-250-250 s=250,c=0,t=5,pt=0,l=6,sg=0,st=ok:Blinds
    
    250;250;0;0;5;Blinds
    

    I can see the blinds coming up in Domoticz and I can even send data to it (vtype 30,29 and 31) yet nothing is receiving the incoming message (The controller is still connected to my laptop so I can monitor them)

    Any clues why this goes wrong?

    Kind regards

    Steve

    1 Reply Last reply
    0
    • hekH Offline
      hekH Offline
      hek
      Admin
      wrote on last edited by
      #2

      How does the node log look like?

      1 Reply Last reply
      0
      • Steve CasterS Offline
        Steve CasterS Offline
        Steve Caster
        wrote on last edited by Steve Caster
        #3

        Hek I just updated the first post a bit (had some issues there I noticed)

        this is the node log

        send: 250-250-0-0 s=255,c=0,t=17,pt=0,l=3,sg=0,st=ok:1.5
        send: 250-250-0-0 s=255,c=3,t=6,pt=1,l=1,sg=0,st=ok:0
        sensor started, id=250, parent=0, distance=1
        send: 250-250-0-0 s=255,c=3,t=11,pt=0,l=6,sg=0,st=ok:Blinds
        send: 250-250-0-0 s=255,c=3,t=12,pt=0,l=3,sg=0,st=ok:1.0
        send: 250-250-0-0 s=250,c=0,t=5,pt=0,l=6,sg=0,st=ok:Blinds
        Node ready to receive messages...
        read: 0-0-250 s=250,c=0,t=5,pt=0,l=6,sg=0:Blinds
        Blinds

        UPDATE: I am a bit further. I can now send one command to the sensor, yet after that it fails. The relay will be enable, but another command fails.

        0;0;3;0;9;send: 0-0-250-250 s=10,c=1,t=30,pt=0,l=0,sg=0,st=ok:
        0;0;3;0;9;read: 1-3-0 s=0,c=1,t=0.0
        0;0;3;0;9;send: 0-0-250-250 s=10,c=1,t=29,pt=0,l=0,sg=0,st=fail:
        

        As you can see the V_CLOSE works, but the next command fails when I use gw.sleep. When I reset the sensor or use gw.wait they work again.

        I copied the latest sketch below

        #include <MySensor.h>
        #include <SPI.h>
        
        #define UP_PIN  3 
        #define DOWN_PIN  4
        #define CHILD_ID 250 
        
        MySensor gw;
        void setup()  
        {   
          gw.begin(incomingMessage, AUTO, false);
          gw.sendSketchInfo("Blinds", "1.0");
          gw.present(CHILD_ID, S_COVER,"Blinds",true);
          pinMode(UP_PIN, OUTPUT);   
          pinMode(DOWN_PIN, OUTPUT);   
          digitalWrite(UP_PIN, 0);
          digitalWrite(DOWN_PIN, 0);
          Serial.println( "Node ready to receive messages..." );
        }
        
        void loop() 
        {
          gw.process();
        }
        
        void incomingMessage(const MyMessage &message) {
          Serial.println(message.data);
          if (message.type==V_UP) {
            Serial.println("opening up covers");
             digitalWrite(UP_PIN,1);
             gw.wait(15000);
             digitalWrite(UP_PIN,0);
           } 
           else if (message.type==V_DOWN) {
             Serial.println("closing up covers");
             digitalWrite(DOWN_PIN,1);
             gw.wait(15000);
             digitalWrite(DOWN_PIN,0);
           } 
           else if (message.type==V_STOP) {
             Serial.println("stopping covers");
             digitalWrite(UP_PIN,0);
             digitalWrite(DOWN_PIN,0);
           }
        }
        
        1 Reply Last reply
        0
        • hekH Offline
          hekH Offline
          hek
          Admin
          wrote on last edited by
          #4

          You are taking out too much power from the Arduino. Power relays separately.

          1 Reply Last reply
          0
          • Steve CasterS Offline
            Steve CasterS Offline
            Steve Caster
            wrote on last edited by
            #5

            Hey Hek,

            there is currently nothing connected to them. How come the wait works but the sleep doesn't? Does it mean it does no longer wake up?

            Kind regards

            fetsF 1 Reply Last reply
            0
            • Steve CasterS Steve Caster

              Hey Hek,

              there is currently nothing connected to them. How come the wait works but the sleep doesn't? Does it mean it does no longer wake up?

              Kind regards

              fetsF Offline
              fetsF Offline
              fets
              wrote on last edited by
              #6

              @Steve-Caster how many time do you have between the V_DOWN and V_UP. Is it lower than 15s ?

              1 Reply Last reply
              0
              • Steve CasterS Offline
                Steve CasterS Offline
                Steve Caster
                wrote on last edited by
                #7

                Hi, I am waiting for the relay to stop and next try to use V_UP or V_DOWN. When I use gw.wait, it works fine and I can interrupt the motion by using V_STOP.

                fetsF 1 Reply Last reply
                0
                • Steve CasterS Steve Caster

                  Hi, I am waiting for the relay to stop and next try to use V_UP or V_DOWN. When I use gw.wait, it works fine and I can interrupt the motion by using V_STOP.

                  fetsF Offline
                  fetsF Offline
                  fets
                  wrote on last edited by
                  #8

                  @Steve-Caster so is everything good or do you have another question/issue ?

                  1 Reply Last reply
                  0
                  • Steve CasterS Offline
                    Steve CasterS Offline
                    Steve Caster
                    wrote on last edited by
                    #9

                    @fets I am good :) Thank for the support :)

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


                    17

                    Online

                    11.7k

                    Users

                    11.2k

                    Topics

                    113.1k

                    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