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. Return value of gw.send is false but gateway receives value anyway

Return value of gw.send is false but gateway receives value anyway

Scheduled Pinned Locked Moved Troubleshooting
3 Posts 3 Posters 1.0k Views 1 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.
  • W Offline
    W Offline
    wengerp
    wrote on last edited by wengerp
    #1

    Hi

    We have a pressure sensor which sends a message upon a change event. Most of the time this works very well. However, from time to time there is the problem, that the return value of the gw.send method is false although the gateway received the value in question properly. Why can this happen?

    We tried to solve this problem with some kind of retry-mechanism: we are now resending a message as long as the return value of gw.send() is false (or a deadlock-counter is < 10). However, this didn't solve the problem in all cases. There are still some cases when all retries == false (although all sent messages including all the retries are received by the gateway and of status "ok").

    One point that seems to be of interest is that the problem mostly arises if we have a lot of traffic from multiple concurrent nodes. May this have something to do with collision detection?

    Please see the following log information form more details:

    relevant part of sketch:

            bool success = false;
            int cntTries = 0;
           
            while (!success && cntTries++ < NB_RETRIES){
              success = gw.send(msg.set(convertedValue,3));
              if (!success)
                gw.wait(1000);
            }
    

    Thanks for your support and best regards,
    Patrick

    Log of Gateway:

    0;0;3;0;9;read: 5-5-0 s=1,c=1,t=16,pt=7,l=5,sg=0:0.748
    5;1;1;0;16;0.748
    0;0;3;0;9;read: 5-5-0 s=1,c=1,t=16,pt=7,l=5,sg=0:0.748
    5;1;1;0;16;0.748
    0;0;3;0;9;read: 5-5-0 s=1,c=1,t=16,pt=7,l=5,sg=0:0.748
    5;1;1;0;16;0.748
    0;0;3;0;9;read: 5-5-0 s=1,c=1,t=16,pt=7,l=5,sg=0:0.748
    5;1;1;0;16;0.748
    0;0;3;0;9;read: 5-5-0 s=1,c=1,t=16,pt=7,l=5,sg=0:1.000
    5;1;1;0;16;1.000
    
    

    Log of Node:

    send: 5-5-0-0 s=1,c=1,t=16,pt=7,l=5,sg=0,st=fail:0.748
    send: 5-5-0-0 s=1,c=1,t=16,pt=7,l=5,sg=0,st=fail:0.748
    send: 5-5-0-0 s=1,c=1,t=16,pt=7,l=5,sg=0,st=fail:0.748
    send: 5-5-0-0 s=1,c=1,t=16,pt=7,l=5,sg=0,st=fail:0.748
    send: 5-5-0-0 s=1,c=1,t=16,pt=7,l=5,sg=0,st=ok:0.748
    send: 5-5-0-0 s=1,c=1,t=16,pt=7,l=5,sg=0,st=ok:1.000
    
    1 Reply Last reply
    0
    • hekH Online
      hekH Online
      hek
      Admin
      wrote on last edited by
      #2

      This would happen from time to time when your node doesn't receive the ack sent by the receiving node.

      1 Reply Last reply
      0
      • D Offline
        D Offline
        doblanch
        wrote on last edited by
        #3

        HEllo,

        I have the same issue... did you fix your problem ?
        your peace of code is nice.. but on the controller you received 4 times the same message, which is not very convenient ? right ?

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


        23

        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