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]Radio Error on Sensor

[Solved]Radio Error on Sensor

Scheduled Pinned Locked Moved Troubleshooting
17 Posts 3 Posters 4.1k Views 3 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.
  • mfalkviddM mfalkvidd

    @martim

    
    #define NODE_ID 123
    

    must be done before

    #include <MySensors.h>
    
    M Offline
    M Offline
    martim
    wrote on last edited by
    #7

    @mfalkvidd said:

    @martim

    
    #define NODE_ID 123
    

    must be done before

    #include <MySensors.h>
    

    thanks. But still same error!?!

    mfalkviddM 1 Reply Last reply
    0
    • M martim

      @mfalkvidd said:

      @martim

      
      #define NODE_ID 123
      

      must be done before

      #include <MySensors.h>
      

      thanks. But still same error!?!

      mfalkviddM Offline
      mfalkviddM Offline
      mfalkvidd
      Mod
      wrote on last edited by
      #8

      @martim and you followed tekka's recommendation on adding capacitors?

      M 1 Reply Last reply
      0
      • mfalkviddM mfalkvidd

        @martim and you followed tekka's recommendation on adding capacitors?

        M Offline
        M Offline
        martim
        wrote on last edited by martim
        #9

        @mfalkvidd

        Yes I did. 47uF
        0_1481544342485_image1.JPG

        T 1 Reply Last reply
        0
        • M martim

          @mfalkvidd

          Yes I did. 47uF
          0_1481544342485_image1.JPG

          T Offline
          T Offline
          tekka
          Admin
          wrote on last edited by tekka
          #10

          @martim Please post the full debug log from your GW and node.

          1 Reply Last reply
          0
          • M Offline
            M Offline
            martim
            wrote on last edited by
            #11

            GW:

            0;255;3;0;9;TSM:INIT
            0;255;3;0;9;TSM:RADIO:OK
            0;255;3;0;9;TSM:GW MODE
            0;255;3;0;9;TSM:READY
            scandone
            f 0, scandone
            state: 0 -> 2 (b0)
            state: 2 -> 3 (0)
            state: 3 -> 5 (10)
            add 0
            aid 11
            cnt 
            
            connected with CycloneIT, channel 11
            dhcp client start...
            ...ip:192.168.10.218,mask:255.255.255.0,gw:192.168.10.1
            .IP: 192.168.10.218
            0;255;3;0;9;No registration required
            0;255;3;0;9;Init complete, id=0, parent=0, distance=0, registration=1
            pm open,type:2 0
            0;255;3;0;9;TSP:MSG:READ 255-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0:
            0;255;3;0;9;TSP:MSG:BC
            0;255;3;0;9;TSP:MSG:FPAR REQ (sender=255)
            0;255;3;0;9;TSP:CHKUPL:OK
            0;255;3;0;9;TSP:MSG:GWL OK
            0;255;3;0;9;TSP:MSG:SEND 0-0-255-255 s=255,c=3,t=8,pt=1,l=1,sg=0,ft=0,st=bc:0
            0;255;3;0;9;TSP:MSG:READ 255-255-0 s=255,c=3,t=3,pt=0,l=0,sg=0:
            0;255;3;0;9;TSP:MSG:READ 255-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0:
            0;255;3;0;9;TSP:MSG:BC
            0;255;3;0;9;TSP:MSG:FPAR REQ (sender=255)
            0;255;3;0;9;TSP:CHKUPL:OK
            0;255;3;0;9;TSP:MSG:GWL OK
            0;255;3;0;9;TSP:MSG:SEND 0-0-255-255 s=255,c=3,t=8,pt=1,l=1,sg=0,ft=0,st=bc:0
            0;255;3;0;9;TSP:MSG:READ 255-255-0 s=255,c=3,t=3,pt=0,l=0,sg=0:
            0;255;3;0;9;TSP:SANCHK:OK
            0;255;3;0;9;TSP:MSG:READ 255-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0:
            0;255;3;0;9;TSP:MSG:BC
            0;255;3;0;9;TSP:MSG:FPAR REQ (sender=255)
            0;255;3;0;9;TSP:CHKUPL:OK
            0;255;3;0;9;TSP:MSG:GWL OK
            0;255;3;0;9;TSP:MSG:SEND 0-0-255-255 s=255,c=3,t=8,pt=1,l=1,sg=0,ft=0,st=bc:0
            0;255;3;0;9;TSP:MSG:READ 255-255-0 s=255,c=3,t=3,pt=0,l=0,sg=0:
            0;255;3;0;9;TSP:SANCHK:OK
            0;255;3;0;9;TSP:MSG:READ 255-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0:
            0;255;3;0;9;TSP:MSG:BC
            0;255;3;0;9;TSP:MSG:FPAR REQ (sender=255)
            0;255;3;0;9;TSP:CHKUPL:OK
            0;255;3;0;9;TSP:MSG:GWL OK
            0;255;3;0;9;TSP:MSG:SEND 0-0-255-255 s=255,c=3,t=8,pt=1,l=1,sg=0,ft=0,st=bc:0
            0;255;3;0;9;TSP:MSG:READ 255-255-0 s=255,c=3,t=3,pt=0,l=0,sg=0:
            0;255;3;0;9;TSP:MSG:READ 255-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0:
            0;255;3;0;9;TSP:MSG:BC
            0;255;3;0;9;TSP:MSG:FPAR REQ (sender=255)
            0;255;3;0;9;TSP:CHKUPL:OK
            0;255;3;0;9;TSP:MSG:GWL OK
            0;255;3;0;9;TSP:MSG:SEND 0-0-255-255 s=255,c=3,t=8,pt=1,l=1,sg=0,ft=0,st=bc:0
            0;255;3;0;9;TSP:SANCHK:OK
            0;255;3;0;9;TSP:MSG:READ 255-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0:
            0;255;3;0;9;TSP:MSG:BC
            0;255;3;0;9;TSP:MSG:FPAR REQ (sender=255)
            0;255;3;0;9;TSP:CHKUPL:OK
            0;255;3;0;9;TSP:MSG:GWL OK
            0;255;3;0;9;TSP:MSG:SEND 0-0-255-255 s=255,c=3,t=8,pt=1,l=1,sg=0,ft=0,st=bc:0
            0;255;3;0;9;TSP:MSG:READ 255-255-0 s=255,c=3,t=3,pt=0,l=0,sg=0:
            

            Node:

            Starting sensor (RNNNA-, 2.0.0)
            TSM:INIT
            TSM:RADIO:OK
            TSM:FPAR
            TSP:MSG:SEND 255-255-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc:
            TSM:FPAR
            TSP:MSG:SEND 255-255-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc:
            Starting sensor (RNNNA-, 2.0.0)
            TSM:INIT
            TSM:RADIO:OK
            TSM:FPAR
            TSP:MSG:SEND 255-255-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc:
            TSM:FPAR
            TSP:MSG:SEND 255-255-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc:
            TSM:FPAR
            TSP:MSG:SEND 255-255-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc:
            TSP:MSG:READ 0-0-255 s=255,c=3,t=8,pt=1,l=1,sg=0:0
            TSP:MSG:FPAR RES (ID=0, dist=0)
            TSP:MSG:PAR OK (ID=0, dist=1)
            TSM:FPAR:OK
            TSM:ID
            TSP:MSG:SEND 255-255-0-0 s=255,c=3,t=3,pt=0,l=0,sg=0,ft=0,st=ok:
            TSM:ID
            TSP:MSG:SEND 255-255-0-0 s=255,c=3,t=3,pt=0,l=0,sg=0,ft=0,st=ok:
            TSM:ID
            TSP:MSG:SEND 255-255-0-0 s=255,c=3,t=3,pt=0,l=0,sg=0,ft=0,st=ok:
            TSM:ID
            TSP:MSG:SEND 255-255-0-0 s=255,c=3,t=3,pt=0,l=0,sg=0,ft=0,st=ok:
            !TSM:CHKID:FAIL (ID=255)
            !TSM:FAILURE
            TSM:PDT
            TSM:INIT
            TSM:RADIO:OK
            TSM:FPAR
            TSP:MSG:SEND 255-255-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc:
            TSP:MSG:READ 0-0-255 s=255,c=3,t=8,pt=1,l=1,sg=0:0
            TSP:MSG:FPAR RES (ID=0, dist=0)
            TSP:MSG:PAR OK (ID=0, dist=1)
            TSM:FPAR:OK
            TSM:ID
            TSP:MSG:SEND 255-255-0-0 s=255,c=3,t=3,pt=0,l=0,sg=0,ft=0,st=ok:
            TSM:ID
            TSP:MSG:SEND 255-255-0-0 s=255,c=3,t=3,pt=0,l=0,sg=0,ft=0,st=ok:
            TSM:ID
            TSP:MSG:SEND 255-255-0-0 s=255,c=3,t=3,pt=0,l=0,sg=0,ft=0,st=ok:
            TSM:ID
            TSP:MSG:SEND 255-255-0-0 s=255,c=3,t=3,pt=0,l=0,sg=0,ft=0,st=ok:
            !TSM:CHKID:FAIL (ID=255)
            !TSM:FAILURE
            TSM:PDT
            TSM:INIT
            TSM:RADIO:OK
            TSM:FPAR
            TSP:MSG:SEND 255-255-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc:
            TSM:FPAR
            TSP:MSG:SEND 255-255-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc:
            TSM:FPAR
            TSP:MSG:SEND 255-255-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc:
            TSP:MSG:READ 0-0-255 s=255,c=3,t=8,pt=1,l=1,sg=0:0
            TSP:MSG:FPAR RES (ID=0, dist=0)
            TSP:MSG:PAR OK (ID=0, dist=1)
            TSM:FPAR:OK
            TSM:ID
            TSP:MSG:SEND 255-255-0-0 s=255,c=3,t=3,pt=0,l=0,sg=0,ft=0,st=ok:
            TSM:ID
            TSP:MSG:SEND 255-255-0-0 s=255,c=3,t=3,pt=0,l=0,sg=0,ft=0,st=ok:
            TSM:ID
            TSP:MSG:SEND 255-255-0-0 s=255,c=3,t=3,pt=0,l=0,sg=0,ft=0,st=ok:
            TSM:ID
            TSP:MSG:SEND 255-255-0-0 s=255,c=3,t=3,pt=0,l=0,sg=0,ft=0,st=ok:
            !TSM:CHKID:FAIL (ID=255)
            !TSM:FAILURE
            TSM:PDT
            
            
            mfalkviddM 1 Reply Last reply
            0
            • M martim

              GW:

              0;255;3;0;9;TSM:INIT
              0;255;3;0;9;TSM:RADIO:OK
              0;255;3;0;9;TSM:GW MODE
              0;255;3;0;9;TSM:READY
              scandone
              f 0, scandone
              state: 0 -> 2 (b0)
              state: 2 -> 3 (0)
              state: 3 -> 5 (10)
              add 0
              aid 11
              cnt 
              
              connected with CycloneIT, channel 11
              dhcp client start...
              ...ip:192.168.10.218,mask:255.255.255.0,gw:192.168.10.1
              .IP: 192.168.10.218
              0;255;3;0;9;No registration required
              0;255;3;0;9;Init complete, id=0, parent=0, distance=0, registration=1
              pm open,type:2 0
              0;255;3;0;9;TSP:MSG:READ 255-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0:
              0;255;3;0;9;TSP:MSG:BC
              0;255;3;0;9;TSP:MSG:FPAR REQ (sender=255)
              0;255;3;0;9;TSP:CHKUPL:OK
              0;255;3;0;9;TSP:MSG:GWL OK
              0;255;3;0;9;TSP:MSG:SEND 0-0-255-255 s=255,c=3,t=8,pt=1,l=1,sg=0,ft=0,st=bc:0
              0;255;3;0;9;TSP:MSG:READ 255-255-0 s=255,c=3,t=3,pt=0,l=0,sg=0:
              0;255;3;0;9;TSP:MSG:READ 255-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0:
              0;255;3;0;9;TSP:MSG:BC
              0;255;3;0;9;TSP:MSG:FPAR REQ (sender=255)
              0;255;3;0;9;TSP:CHKUPL:OK
              0;255;3;0;9;TSP:MSG:GWL OK
              0;255;3;0;9;TSP:MSG:SEND 0-0-255-255 s=255,c=3,t=8,pt=1,l=1,sg=0,ft=0,st=bc:0
              0;255;3;0;9;TSP:MSG:READ 255-255-0 s=255,c=3,t=3,pt=0,l=0,sg=0:
              0;255;3;0;9;TSP:SANCHK:OK
              0;255;3;0;9;TSP:MSG:READ 255-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0:
              0;255;3;0;9;TSP:MSG:BC
              0;255;3;0;9;TSP:MSG:FPAR REQ (sender=255)
              0;255;3;0;9;TSP:CHKUPL:OK
              0;255;3;0;9;TSP:MSG:GWL OK
              0;255;3;0;9;TSP:MSG:SEND 0-0-255-255 s=255,c=3,t=8,pt=1,l=1,sg=0,ft=0,st=bc:0
              0;255;3;0;9;TSP:MSG:READ 255-255-0 s=255,c=3,t=3,pt=0,l=0,sg=0:
              0;255;3;0;9;TSP:SANCHK:OK
              0;255;3;0;9;TSP:MSG:READ 255-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0:
              0;255;3;0;9;TSP:MSG:BC
              0;255;3;0;9;TSP:MSG:FPAR REQ (sender=255)
              0;255;3;0;9;TSP:CHKUPL:OK
              0;255;3;0;9;TSP:MSG:GWL OK
              0;255;3;0;9;TSP:MSG:SEND 0-0-255-255 s=255,c=3,t=8,pt=1,l=1,sg=0,ft=0,st=bc:0
              0;255;3;0;9;TSP:MSG:READ 255-255-0 s=255,c=3,t=3,pt=0,l=0,sg=0:
              0;255;3;0;9;TSP:MSG:READ 255-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0:
              0;255;3;0;9;TSP:MSG:BC
              0;255;3;0;9;TSP:MSG:FPAR REQ (sender=255)
              0;255;3;0;9;TSP:CHKUPL:OK
              0;255;3;0;9;TSP:MSG:GWL OK
              0;255;3;0;9;TSP:MSG:SEND 0-0-255-255 s=255,c=3,t=8,pt=1,l=1,sg=0,ft=0,st=bc:0
              0;255;3;0;9;TSP:SANCHK:OK
              0;255;3;0;9;TSP:MSG:READ 255-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0:
              0;255;3;0;9;TSP:MSG:BC
              0;255;3;0;9;TSP:MSG:FPAR REQ (sender=255)
              0;255;3;0;9;TSP:CHKUPL:OK
              0;255;3;0;9;TSP:MSG:GWL OK
              0;255;3;0;9;TSP:MSG:SEND 0-0-255-255 s=255,c=3,t=8,pt=1,l=1,sg=0,ft=0,st=bc:0
              0;255;3;0;9;TSP:MSG:READ 255-255-0 s=255,c=3,t=3,pt=0,l=0,sg=0:
              

              Node:

              Starting sensor (RNNNA-, 2.0.0)
              TSM:INIT
              TSM:RADIO:OK
              TSM:FPAR
              TSP:MSG:SEND 255-255-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc:
              TSM:FPAR
              TSP:MSG:SEND 255-255-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc:
              Starting sensor (RNNNA-, 2.0.0)
              TSM:INIT
              TSM:RADIO:OK
              TSM:FPAR
              TSP:MSG:SEND 255-255-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc:
              TSM:FPAR
              TSP:MSG:SEND 255-255-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc:
              TSM:FPAR
              TSP:MSG:SEND 255-255-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc:
              TSP:MSG:READ 0-0-255 s=255,c=3,t=8,pt=1,l=1,sg=0:0
              TSP:MSG:FPAR RES (ID=0, dist=0)
              TSP:MSG:PAR OK (ID=0, dist=1)
              TSM:FPAR:OK
              TSM:ID
              TSP:MSG:SEND 255-255-0-0 s=255,c=3,t=3,pt=0,l=0,sg=0,ft=0,st=ok:
              TSM:ID
              TSP:MSG:SEND 255-255-0-0 s=255,c=3,t=3,pt=0,l=0,sg=0,ft=0,st=ok:
              TSM:ID
              TSP:MSG:SEND 255-255-0-0 s=255,c=3,t=3,pt=0,l=0,sg=0,ft=0,st=ok:
              TSM:ID
              TSP:MSG:SEND 255-255-0-0 s=255,c=3,t=3,pt=0,l=0,sg=0,ft=0,st=ok:
              !TSM:CHKID:FAIL (ID=255)
              !TSM:FAILURE
              TSM:PDT
              TSM:INIT
              TSM:RADIO:OK
              TSM:FPAR
              TSP:MSG:SEND 255-255-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc:
              TSP:MSG:READ 0-0-255 s=255,c=3,t=8,pt=1,l=1,sg=0:0
              TSP:MSG:FPAR RES (ID=0, dist=0)
              TSP:MSG:PAR OK (ID=0, dist=1)
              TSM:FPAR:OK
              TSM:ID
              TSP:MSG:SEND 255-255-0-0 s=255,c=3,t=3,pt=0,l=0,sg=0,ft=0,st=ok:
              TSM:ID
              TSP:MSG:SEND 255-255-0-0 s=255,c=3,t=3,pt=0,l=0,sg=0,ft=0,st=ok:
              TSM:ID
              TSP:MSG:SEND 255-255-0-0 s=255,c=3,t=3,pt=0,l=0,sg=0,ft=0,st=ok:
              TSM:ID
              TSP:MSG:SEND 255-255-0-0 s=255,c=3,t=3,pt=0,l=0,sg=0,ft=0,st=ok:
              !TSM:CHKID:FAIL (ID=255)
              !TSM:FAILURE
              TSM:PDT
              TSM:INIT
              TSM:RADIO:OK
              TSM:FPAR
              TSP:MSG:SEND 255-255-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc:
              TSM:FPAR
              TSP:MSG:SEND 255-255-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc:
              TSM:FPAR
              TSP:MSG:SEND 255-255-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc:
              TSP:MSG:READ 0-0-255 s=255,c=3,t=8,pt=1,l=1,sg=0:0
              TSP:MSG:FPAR RES (ID=0, dist=0)
              TSP:MSG:PAR OK (ID=0, dist=1)
              TSM:FPAR:OK
              TSM:ID
              TSP:MSG:SEND 255-255-0-0 s=255,c=3,t=3,pt=0,l=0,sg=0,ft=0,st=ok:
              TSM:ID
              TSP:MSG:SEND 255-255-0-0 s=255,c=3,t=3,pt=0,l=0,sg=0,ft=0,st=ok:
              TSM:ID
              TSP:MSG:SEND 255-255-0-0 s=255,c=3,t=3,pt=0,l=0,sg=0,ft=0,st=ok:
              TSM:ID
              TSP:MSG:SEND 255-255-0-0 s=255,c=3,t=3,pt=0,l=0,sg=0,ft=0,st=ok:
              !TSM:CHKID:FAIL (ID=255)
              !TSM:FAILURE
              TSM:PDT
              
              
              mfalkviddM Offline
              mfalkviddM Offline
              mfalkvidd
              Mod
              wrote on last edited by
              #12

              @martim the node is still requesting an ID. Are you sure you moved the #define NODE_ID 123 ?

              1 Reply Last reply
              0
              • M Offline
                M Offline
                martim
                wrote on last edited by
                #13

                My Sensor code:

                /**
                   The MySensors Arduino library handles the wireless radio link and protocol
                   between your home built sensors/actuators and HA controller of choice.
                   The sensors forms a self healing radio network with optional repeaters. Each
                   repeater and gateway builds a routing tables in EEPROM which keeps track of the
                   network topology allowing messages to be routed to nodes.
                
                   Created by Henrik Ekblad <henrik.ekblad@mysensors.org>
                   Copyright (C) 2013-2015 Sensnology AB
                   Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors
                
                   Documentation: http://www.mysensors.org
                   Support Forum: http://forum.mysensors.org
                
                   This program is free software; you can redistribute it and/or
                   modify it under the terms of the GNU General Public License
                   version 2 as published by the Free Software Foundation.
                
                 *******************************
                
                   REVISION HISTORY
                   Version 1.0 - Henrik EKblad
                
                   DESCRIPTION
                   This sketch provides an example how to implement a distance sensor using HC-SR04
                   http://www.mysensors.org/build/distance
                */
                
                #define MY_BAUD_RATE 115200
                
                // Enable debug prints
                #define MY_DEBUG
                
                #define OPEN 1
                #define CLOSE 0
                
                
                // Enable and select radio type attached
                #define MY_RADIO_NRF24
                //#define MY_RADIO_RFM69
                
                #define NODE_ID 123
                
                #include <MySensors.h>
                
                MyMessage msg(NODE_ID, V_TRIPPED);
                
                uint8_t value = OPEN;
                
                void setup()
                {
                }
                
                void presentation() {
                  // Send the sketch version information to the gateway and Controller
                  sendSketchInfo("Dummy sensor", "1.0");
                
                   present(NODE_ID, S_DOOR);
                }
                
                void loop()
                {
                    value = value == OPEN ? CLOSE : OPEN;
                    send(msg.set(value));
                    sleep(10000);
                }
                
                T 1 Reply Last reply
                0
                • M martim

                  My Sensor code:

                  /**
                     The MySensors Arduino library handles the wireless radio link and protocol
                     between your home built sensors/actuators and HA controller of choice.
                     The sensors forms a self healing radio network with optional repeaters. Each
                     repeater and gateway builds a routing tables in EEPROM which keeps track of the
                     network topology allowing messages to be routed to nodes.
                  
                     Created by Henrik Ekblad <henrik.ekblad@mysensors.org>
                     Copyright (C) 2013-2015 Sensnology AB
                     Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors
                  
                     Documentation: http://www.mysensors.org
                     Support Forum: http://forum.mysensors.org
                  
                     This program is free software; you can redistribute it and/or
                     modify it under the terms of the GNU General Public License
                     version 2 as published by the Free Software Foundation.
                  
                   *******************************
                  
                     REVISION HISTORY
                     Version 1.0 - Henrik EKblad
                  
                     DESCRIPTION
                     This sketch provides an example how to implement a distance sensor using HC-SR04
                     http://www.mysensors.org/build/distance
                  */
                  
                  #define MY_BAUD_RATE 115200
                  
                  // Enable debug prints
                  #define MY_DEBUG
                  
                  #define OPEN 1
                  #define CLOSE 0
                  
                  
                  // Enable and select radio type attached
                  #define MY_RADIO_NRF24
                  //#define MY_RADIO_RFM69
                  
                  #define NODE_ID 123
                  
                  #include <MySensors.h>
                  
                  MyMessage msg(NODE_ID, V_TRIPPED);
                  
                  uint8_t value = OPEN;
                  
                  void setup()
                  {
                  }
                  
                  void presentation() {
                    // Send the sketch version information to the gateway and Controller
                    sendSketchInfo("Dummy sensor", "1.0");
                  
                     present(NODE_ID, S_DOOR);
                  }
                  
                  void loop()
                  {
                      value = value == OPEN ? CLOSE : OPEN;
                      send(msg.set(value));
                      sleep(10000);
                  }
                  
                  T Offline
                  T Offline
                  tekka
                  Admin
                  wrote on last edited by
                  #14

                  @martim uupps, my bad - should be MY_NODE_ID instead of NODE_ID

                  M 1 Reply Last reply
                  0
                  • T tekka

                    @martim uupps, my bad - should be MY_NODE_ID instead of NODE_ID

                    M Offline
                    M Offline
                    martim
                    wrote on last edited by martim
                    #15

                    @tekka

                    That was indeed the trick :joy: :thumbsup: This is really awesome.

                    Final question. The Node register know with the GW if I am correct. And when I change a port how fast is this send to the gateway?

                    I would like to connect a doorbell and use an interrupt when someone is pressing on the doorbell.

                    mfalkviddM 1 Reply Last reply
                    0
                    • M martim

                      @tekka

                      That was indeed the trick :joy: :thumbsup: This is really awesome.

                      Final question. The Node register know with the GW if I am correct. And when I change a port how fast is this send to the gateway?

                      I would like to connect a doorbell and use an interrupt when someone is pressing on the doorbell.

                      mfalkviddM Offline
                      mfalkviddM Offline
                      mfalkvidd
                      Mod
                      wrote on last edited by
                      #16

                      @martim the current code sleeps 10 seconds. So it might take up to 10 seconds before a press is registered. The sleep can be modified to wake on interrupt instead. See https://www.mysensors.org/download/sensor_api_20#sleeping for general i formation about the sleep function and https://www.mysensors.org/build/motion for an example that wakes on interrupt.

                      M 1 Reply Last reply
                      0
                      • mfalkviddM mfalkvidd

                        @martim the current code sleeps 10 seconds. So it might take up to 10 seconds before a press is registered. The sleep can be modified to wake on interrupt instead. See https://www.mysensors.org/download/sensor_api_20#sleeping for general i formation about the sleep function and https://www.mysensors.org/build/motion for an example that wakes on interrupt.

                        M Offline
                        M Offline
                        martim
                        wrote on last edited by
                        #17

                        @mfalkvidd

                        Thanks! Some study to do :)

                        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


                        68

                        Online

                        12.0k

                        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