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. Gateway sends NACK to node

Gateway sends NACK to node

Scheduled Pinned Locked Moved Troubleshooting
gateway
15 Posts 5 Posters 137 Views 5 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.
  • electrikE Offline
    electrikE Offline
    electrik
    wrote on last edited by
    #5

    You have a delay(10000); in the loop() function. To start I would comment that out and see if the issue is solved.
    During the delay() nothing can be done. You should use the millis() function to perform time based tasks, that won't block the loop.

    1 Reply Last reply
    1
    • M Offline
      M Offline
      mariusl
      wrote on last edited by
      #6

      Thanks I will give that a try.

      1 Reply Last reply
      0
      • M Offline
        M Offline
        mariusl
        wrote on last edited by
        #7

        This is very strange but could indicate where to look for similar problems. I dumped the mysensors gateway and node and programed the arduinos with the standard arduino Lora libary to establish a serial device on HA. This worked first time and I could get messages through, no problem. This means that the radios was at least working. Then I reprogramed the gateway and the node with mysensors serial GW and node options. The radios connected first time and I don't think I received a single NACK for two days now.
        So I can only think that there must be some radio setup parameters that are stuck in memory or something like that.

        Any ideas from someone on this?

        Y 1 Reply Last reply
        0
        • C Offline
          C Offline
          ctodor
          wrote on last edited by
          #8

          same issue here. i can not pair a gw and a node.
          there are a lot of "open issues" regarding gw/node paring => something is wrong in this design, it tries to cover too many platorms but it doesn t do it in simple/good way for neither one

          1 Reply Last reply
          0
          • M Offline
            M Offline
            mariusl
            wrote on last edited by
            #9

            I think what is required is maybe an option to erase all memory or config if a flag is set. This will make sure that the chosen radio config will be correct.

            1 Reply Last reply
            0
            • M mariusl

              This is very strange but could indicate where to look for similar problems. I dumped the mysensors gateway and node and programed the arduinos with the standard arduino Lora libary to establish a serial device on HA. This worked first time and I could get messages through, no problem. This means that the radios was at least working. Then I reprogramed the gateway and the node with mysensors serial GW and node options. The radios connected first time and I don't think I received a single NACK for two days now.
              So I can only think that there must be some radio setup parameters that are stuck in memory or something like that.

              Any ideas from someone on this?

              Y Offline
              Y Offline
              yury
              wrote on last edited by
              #10

              @mariusl said in Gateway sends NACK to node:

              Any ideas from someone on this?

              #define MY_TRANSPORT_STATE_TIMEOUT_MS (5*1000ul)

              //#define MY_RFM95_MODEM_CONFIGRUATION RFM95_BW125CR45SF1288
              #define MY_RFM95_MODEM_CONFIGRUATION RFM95_BW125CR48SF4096

              These lines can affect. the TRANSPORT_STATE_TIMEOUT may be less than a actual message sending time. you will get constant NACK's.

              M 1 Reply Last reply
              1
              • Y yury

                @mariusl said in Gateway sends NACK to node:

                Any ideas from someone on this?

                #define MY_TRANSPORT_STATE_TIMEOUT_MS (5*1000ul)

                //#define MY_RFM95_MODEM_CONFIGRUATION RFM95_BW125CR45SF1288
                #define MY_RFM95_MODEM_CONFIGRUATION RFM95_BW125CR48SF4096

                These lines can affect. the TRANSPORT_STATE_TIMEOUT may be less than a actual message sending time. you will get constant NACK's.

                M Offline
                M Offline
                mariusl
                wrote on last edited by
                #11

                @yury said in Gateway sends NACK to node:

                These lines can affect. the TRANSPORT_STATE_TIMEOUT may be less than a actual message sending time. you will get constant NACK's.

                I have it working fine now but I would like to make it as robust as possible. What would you suggest as a good value for the timeout?

                1 Reply Last reply
                0
                • Y Offline
                  Y Offline
                  yury
                  wrote on last edited by
                  #12

                  @mariusl said in Gateway sends NACK to node:

                  good value for the timeout?

                  here are the delay examples in the docs
                  https://www.mysensors.org/apidocs/group__RFM95grp.html#ga23a30185cbd40984e65d5269983bf840

                  for yours #define MY_RFM95_MODEM_CONFIGRUATION RFM95_BW125CR48SF4096

                  I would use #define RFM95_RETRY_TIMEOUT_MS (2000ul)

                  any reason for the Spread factor SF4096 ?

                  M 1 Reply Last reply
                  0
                  • Y yury

                    @mariusl said in Gateway sends NACK to node:

                    good value for the timeout?

                    here are the delay examples in the docs
                    https://www.mysensors.org/apidocs/group__RFM95grp.html#ga23a30185cbd40984e65d5269983bf840

                    for yours #define MY_RFM95_MODEM_CONFIGRUATION RFM95_BW125CR48SF4096

                    I would use #define RFM95_RETRY_TIMEOUT_MS (2000ul)

                    any reason for the Spread factor SF4096 ?

                    M Offline
                    M Offline
                    mariusl
                    wrote on last edited by
                    #13

                    @yury said in Gateway sends NACK to node:

                    any reason for the Spread factor SF4096 ?

                    Not at all. It is from example code that I found online. I don't really know what it does to be honest.

                    1 Reply Last reply
                    0
                    • Y Offline
                      Y Offline
                      yury
                      wrote on last edited by
                      #14

                      @mariusl said in Gateway sends NACK to node:

                      what it does

                      SF number is chips (chirps) needed to code each bit. SF4096 is maximum range especially in urban area, but very long delay . I tried different combinations and found below MY_RFM95_MODEM_CONFIGRUATION is pretty much good. 20 - 30% less in terms of distance and delay #define RFM95_RETRY_TIMEOUT_MS (300ul) is enoght. Much faster.

                      #define MY_RFM95_MODEM_CONFIGRUATION RFM95_BW_500KHZ | RFM95_CODING_RATE_4_5, RFM95_SPREADING_FACTOR_2048CPS | RFM95_RX_PAYLOAD_CRC_ON, RFM95_AGC_AUTO_ON

                      1 Reply Last reply
                      0
                      • M Offline
                        M Offline
                        mariusl
                        wrote on last edited by
                        #15

                        Aah ok that makes sense. My application is for rural use and I need the max distance possible. The slow response will not be a problem as the sensors don't send a lot of data at all. So maybe I will stay with the SF4096 for now but I will do some experimenting with the settings. Just to understand them a bit better.

                        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