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. Sending from node fails first time, but second is ok

Sending from node fails first time, but second is ok

Scheduled Pinned Locked Moved Troubleshooting
4 Posts 2 Posters 614 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.
  • A Offline
    A Offline
    Alex Garcia
    wrote on last edited by
    #1

    Hello,
    First mysensors build here,
    I set up a Wemos D1 mini + nrf24 gateway and an Arduino Uno + nrf24 node, its only a test setup. Both use a 47uf capacitor between radio vcc and gnd.
    On the gateway Im using ESP8266 Ethernet gateway, On the arduino Im using the motion sensor sketch.

    Presentation of the node looks fine, so it seems communication is ok.
    I tried for a few hours to send a message to gateway and it was giving error all the time

    !TSF:MSG:SEND,1-1-0-0,s=1,c=1,t=16,pt=0,l=1,sg=0,ft=0,st=NACK:0
    

    no acknowledge it seems.

    After hours of fiddling discovered if I send the message twice, the first time fails but the second is sent and received by the gateway ok.

    45351 !TSF:MSG:SEND,1-1-0-0,s=1,c=1,t=16,pt=0,l=1,sg=0,ft=0,st=NACK:0
    45360 TSF:MSG:SEND,1-1-0-0,s=1,c=1,t=16,pt=0,l=1,sg=0,ft=1,st=OK:0
    

    It is totally consistent so I can reliably send messages but I dont know why I have to send the messages twice

    void loop()
    {
    	// Read digital motion value
    	bool tripped = digitalRead(DIGITAL_INPUT_SENSOR) == HIGH;
    
    	Serial.println(tripped);
    	send(msg.set(tripped?"1":"0"));  // Send tripped value to gw
            send(msg.set(tripped?"1":"0"));  // Send tripped value to gw     <----------Second time ¿?
    
    	// Sleep until interrupt comes in on motion sensor. Send update every two minute.
    	sleep(digitalPinToInterrupt(DIGITAL_INPUT_SENSOR), CHANGE, SLEEP_TIME);
    }
    

    Any idea why is this happening?

    mfalkviddM 1 Reply Last reply
    0
    • A Alex Garcia

      Hello,
      First mysensors build here,
      I set up a Wemos D1 mini + nrf24 gateway and an Arduino Uno + nrf24 node, its only a test setup. Both use a 47uf capacitor between radio vcc and gnd.
      On the gateway Im using ESP8266 Ethernet gateway, On the arduino Im using the motion sensor sketch.

      Presentation of the node looks fine, so it seems communication is ok.
      I tried for a few hours to send a message to gateway and it was giving error all the time

      !TSF:MSG:SEND,1-1-0-0,s=1,c=1,t=16,pt=0,l=1,sg=0,ft=0,st=NACK:0
      

      no acknowledge it seems.

      After hours of fiddling discovered if I send the message twice, the first time fails but the second is sent and received by the gateway ok.

      45351 !TSF:MSG:SEND,1-1-0-0,s=1,c=1,t=16,pt=0,l=1,sg=0,ft=0,st=NACK:0
      45360 TSF:MSG:SEND,1-1-0-0,s=1,c=1,t=16,pt=0,l=1,sg=0,ft=1,st=OK:0
      

      It is totally consistent so I can reliably send messages but I dont know why I have to send the messages twice

      void loop()
      {
      	// Read digital motion value
      	bool tripped = digitalRead(DIGITAL_INPUT_SENSOR) == HIGH;
      
      	Serial.println(tripped);
      	send(msg.set(tripped?"1":"0"));  // Send tripped value to gw
              send(msg.set(tripped?"1":"0"));  // Send tripped value to gw     <----------Second time ¿?
      
      	// Sleep until interrupt comes in on motion sensor. Send update every two minute.
      	sleep(digitalPinToInterrupt(DIGITAL_INPUT_SENSOR), CHANGE, SLEEP_TIME);
      }
      

      Any idea why is this happening?

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

      Welcome to the forum @alex-garcia!
      The problem is probably the same as discussed in https://forum.mysensors.org/topic/9655/delay-after-tsf-tri-tsb/14

      Solution: use development version of MySensors or wait for the next release.

      1 Reply Last reply
      0
      • A Offline
        A Offline
        Alex Garcia
        wrote on last edited by
        #3

        Indeed it looks like the same problem.

        Thank you!

        mfalkviddM 1 Reply Last reply
        1
        • A Alex Garcia

          Indeed it looks like the same problem.

          Thank you!

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

          @alex-garcia you're welcome :)
          In case you need a workaround: add wait(200) after the sleep.

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


          24

          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