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. Hardware
  3. Gateway/sensor Range Advice

Gateway/sensor Range Advice

Scheduled Pinned Locked Moved Hardware
13 Posts 6 Posters 5.9k 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.
  • Dan S.D Offline
    Dan S.D Offline
    Dan S.
    Hero Member
    wrote on last edited by
    #1

    Now that I have a very stable ethernet gateway, I am beginning to expand my sensors. The gateway is in the basement level of the house next to my VeraLite and communicates very well with a humidity/temp sensor on that level and a light sensor on the next level above.

    Looking for advice on the best way to get coverage on all levels of the house (2 living levels above the basement plus the attic). I don't think I can get that coverage without at least one repeater. Did have a little trouble communicating to the next level above till I tilted the gateway radio antenna from vertical to about a 45 degree angle. Maybe should have it horizontal to increase up/down range.

    Looking for any suggestions/advice/ideas on how best to get whole house coverage with minimum extra hardware and also antenna positioning advice

    Thanks in advance.

    1 Reply Last reply
    0
    • BulldogLowellB Offline
      BulldogLowellB Offline
      BulldogLowell
      Contest Winner
      wrote on last edited by
      #2

      You cannot move the gateway to the middle floor? That's the nice part of iethernet vs. serial gateway... Just run a wire.

      Did you already add repeater capability to your existing sensors?

      Dan S.D 1 Reply Last reply
      0
      • BulldogLowellB BulldogLowell

        You cannot move the gateway to the middle floor? That's the nice part of iethernet vs. serial gateway... Just run a wire.

        Did you already add repeater capability to your existing sensors?

        Dan S.D Offline
        Dan S.D Offline
        Dan S.
        Hero Member
        wrote on last edited by
        #3

        @BulldogLowell Don't think I can move gateway to middle floor--the only internet connections (other than wireless) that I have are in the basement and everything including most of the basement is finished.

        Did not add repeater capability to existing sensors. I thought repeater has to be separate from sensors since they can never sleep?

        1 Reply Last reply
        0
        • daulagariD Offline
          daulagariD Offline
          daulagari
          Hero Member
          wrote on last edited by
          #4

          @Dan-S. What kind of walls/floors do you have?

          Here in Holland, concrete is quite standard and concrete contains metal; I see that typically it is not possible to cross two walls/floors reliable with WiFi, so that should also count for MySensors. Range is best if antennas can "see" each other directly (through a door/stairwell).

          Yes, a repeater can not sleep and can therefore not really be battery operated.

          Can you run a cable from your basement to the middle floor?

          1 Reply Last reply
          0
          • tbowmoT Offline
            tbowmoT Offline
            tbowmo
            Admin
            wrote on last edited by
            #5

            You can combine sensor and relay into a single node, however, as the radio can't sleep, batteries won't last long. So they need to be powered externaly

            if you have nodes that can be used as actuators, then they also need to be on at all time, as they should be able to receive commands from the GW, so they could in theory be made as repeaters as well..

            1 Reply Last reply
            0
            • Dan S.D Offline
              Dan S.D Offline
              Dan S.
              Hero Member
              wrote on last edited by
              #6

              My house is wooden frame with plasterboard walls so cross floor/wall commo is OK. My one sensor on the main floor is a light sensor and is not battery powered. But don't you still need it to sleep between light readings? How do you make a combination sensor/repeater? The sketch for the repeater indicates that the repeater has a unique node declaration. that is different from the sensor node declaration

              tbowmoT 1 Reply Last reply
              0
              • Dan S.D Dan S.

                My house is wooden frame with plasterboard walls so cross floor/wall commo is OK. My one sensor on the main floor is a light sensor and is not battery powered. But don't you still need it to sleep between light readings? How do you make a combination sensor/repeater? The sketch for the repeater indicates that the repeater has a unique node declaration. that is different from the sensor node declaration

                tbowmoT Offline
                tbowmoT Offline
                tbowmo
                Admin
                wrote on last edited by
                #7

                @Dan-S. said:

                My house is wooden frame with plasterboard walls so cross floor/wall commo is OK. My one sensor on the main floor is a light sensor and is not battery powered. But don't you still need it to sleep between light readings? How do you make a combination sensor/repeater? The sketch for the repeater indicates that the repeater has a unique node declaration. that is different from the sensor node declaration

                It's not necessary to sleep between node status messages. You can implement the delays between messages, with millis() instead.

                so something like this would work: (will send measurements every 60 seconds)
                void loop()
                {
                gw.process();
                if (millis() - lastMeasurement > 60000) {
                lastMeasurement = millis();
                sendMeasurements();
                }

                Also have a look at http://mysensors.org/build/sensor_api#sensor-nodes, there are descriptions on how to enable repeater mode, in normal sensor nodes.

                Ps. the code above is made purely from memory, and there might be some parts left out, or spelling errors :)

                Dan S.D 1 Reply Last reply
                1
                • tbowmoT tbowmo

                  @Dan-S. said:

                  My house is wooden frame with plasterboard walls so cross floor/wall commo is OK. My one sensor on the main floor is a light sensor and is not battery powered. But don't you still need it to sleep between light readings? How do you make a combination sensor/repeater? The sketch for the repeater indicates that the repeater has a unique node declaration. that is different from the sensor node declaration

                  It's not necessary to sleep between node status messages. You can implement the delays between messages, with millis() instead.

                  so something like this would work: (will send measurements every 60 seconds)
                  void loop()
                  {
                  gw.process();
                  if (millis() - lastMeasurement > 60000) {
                  lastMeasurement = millis();
                  sendMeasurements();
                  }

                  Also have a look at http://mysensors.org/build/sensor_api#sensor-nodes, there are descriptions on how to enable repeater mode, in normal sensor nodes.

                  Ps. the code above is made purely from memory, and there might be some parts left out, or spelling errors :)

                  Dan S.D Offline
                  Dan S.D Offline
                  Dan S.
                  Hero Member
                  wrote on last edited by
                  #8

                  @tbowmo Sounds like that would work. Will try it out.

                  Is it best to use the radio with the separate antenna for the repeater?

                  hekH 1 Reply Last reply
                  0
                  • Dan S.D Dan S.

                    @tbowmo Sounds like that would work. Will try it out.

                    Is it best to use the radio with the separate antenna for the repeater?

                    hekH Offline
                    hekH Offline
                    hek
                    Admin
                    wrote on last edited by
                    #9

                    @Dan-S.

                    Should work fine with the vanilla version.

                    1 Reply Last reply
                    0
                    • Dan S.D Offline
                      Dan S.D Offline
                      Dan S.
                      Hero Member
                      wrote on last edited by
                      #10

                      Revised my light sensor sketch to give it repeater capability. The key is in the millis() function which keeps track of processing time. Did some research and learned that because it is an unsigned long data type it will rollover to zero after 49 days! So unless you write the comparison statement in the if clause a certain way it will fail after 49 days. If you do a search on how do you reset millis() you will learn how to set up the if clause to take care of rollover (you can't easily reset millis and you shouldn't since it will cause major problems for other libraries that use it).

                      I could not find any description in http://mysensors.org/build/sensor_api#sensor-nodes on how to do this. I do think a sample combined sensor/gateway sketch would be very useful.

                      I have not tested my revised light sensor/repeater sketch (it does compile). Will report back on results of testing.

                      BulldogLowellB 1 Reply Last reply
                      0
                      • raditvR Offline
                        raditvR Offline
                        raditv
                        wrote on last edited by
                        #11

                        Interesting about millis(), is there anyone here running mysensors more than 50 days?

                        1 Reply Last reply
                        0
                        • Dan S.D Dan S.

                          Revised my light sensor sketch to give it repeater capability. The key is in the millis() function which keeps track of processing time. Did some research and learned that because it is an unsigned long data type it will rollover to zero after 49 days! So unless you write the comparison statement in the if clause a certain way it will fail after 49 days. If you do a search on how do you reset millis() you will learn how to set up the if clause to take care of rollover (you can't easily reset millis and you shouldn't since it will cause major problems for other libraries that use it).

                          I could not find any description in http://mysensors.org/build/sensor_api#sensor-nodes on how to do this. I do think a sample combined sensor/gateway sketch would be very useful.

                          I have not tested my revised light sensor/repeater sketch (it does compile). Will report back on results of testing.

                          BulldogLowellB Offline
                          BulldogLowellB Offline
                          BulldogLowell
                          Contest Winner
                          wrote on last edited by BulldogLowell
                          #12

                          @Dan-S. said:

                          unsigned long data type it will rollover to zero after 49 days! So unless you write the comparison statement in the if clause a certain way it will fail after 49 days. If you do a search on how do you reset millis() you will learn how to set up the if clause to take care of rollover (you can't easily reset millis and you shouldn't since it will cause major problems for other libraries that use it).

                          I could not find any description in http://mysensors.org/build/sensor_api#sensor-nodes on how to do this. I do think a sample combined sensor/gateway sketch would be very useful.

                          I have not tested my revised light sensor/repeater sketch (it does compile). Will report back on results of testing.

                          The millis() rollover problem is sort of a red herring. You will never have a problem if you are strictly using unsigned long integer SUBTRACTION like this:

                          unsigned long lastRunMoment; // the timeStamp you use to constantly check vs the current time (millis() returns an unsigned long timestamp)
                          
                          unsigned long myInterval = 10000; // the frequency that this timer will execute here... 10 seconds.
                          
                          void setup()
                          {
                            Serial.begin(115200);
                          }
                          
                          void loop()
                          {
                            if (millis() - lastRunMoment > myInterval) // this unsigned subtraction works...
                            {
                              Serial.println("This works");
                              lastRunMoment = millis();
                            }
                          }
                          
                          /*
                          // NOT Like This:
                          void loop()
                          {
                            if (millis() > lastRunMoment + myInterval) // this unsigned addition will not survive the millis() 49day rollover.
                            {
                              Serial.println("This doesn't work");
                              lastRunMoment = millis();
                            }
                          }
                          */
                          

                          you can learn why here

                          Dan S.D 1 Reply Last reply
                          0
                          • BulldogLowellB BulldogLowell

                            @Dan-S. said:

                            unsigned long data type it will rollover to zero after 49 days! So unless you write the comparison statement in the if clause a certain way it will fail after 49 days. If you do a search on how do you reset millis() you will learn how to set up the if clause to take care of rollover (you can't easily reset millis and you shouldn't since it will cause major problems for other libraries that use it).

                            I could not find any description in http://mysensors.org/build/sensor_api#sensor-nodes on how to do this. I do think a sample combined sensor/gateway sketch would be very useful.

                            I have not tested my revised light sensor/repeater sketch (it does compile). Will report back on results of testing.

                            The millis() rollover problem is sort of a red herring. You will never have a problem if you are strictly using unsigned long integer SUBTRACTION like this:

                            unsigned long lastRunMoment; // the timeStamp you use to constantly check vs the current time (millis() returns an unsigned long timestamp)
                            
                            unsigned long myInterval = 10000; // the frequency that this timer will execute here... 10 seconds.
                            
                            void setup()
                            {
                              Serial.begin(115200);
                            }
                            
                            void loop()
                            {
                              if (millis() - lastRunMoment > myInterval) // this unsigned subtraction works...
                              {
                                Serial.println("This works");
                                lastRunMoment = millis();
                              }
                            }
                            
                            /*
                            // NOT Like This:
                            void loop()
                            {
                              if (millis() > lastRunMoment + myInterval) // this unsigned addition will not survive the millis() 49day rollover.
                              {
                                Serial.println("This doesn't work");
                                lastRunMoment = millis();
                              }
                            }
                            */
                            

                            you can learn why here

                            Dan S.D Offline
                            Dan S.D Offline
                            Dan S.
                            Hero Member
                            wrote on last edited by
                            #13

                            @BulldogLowell That's exactly right. You stated it more clearly than I did. It's not a problem if you're careful in how you set up your if test but its does warrant a warning to be careful in that regard to anyone using mills() for timing their sensor reads.

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


                            11

                            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