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. Dallas DS18B20 Parasite Mode

Dallas DS18B20 Parasite Mode

Scheduled Pinned Locked Moved Hardware
19 Posts 8 Posters 8.5k 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.
  • K Offline
    K Offline
    kapperi
    wrote on last edited by
    #8

    Hello, sorry about loaning this question but...

    I have similar network than original writer and mine works fine. Only problem is that I want to make child id for every sensors and I just cant figure it out how to? I have already checked addresses of sensors but how can I address these in different id's.

    Sorry about my english but hopefully somebody understood my question.

    DwaltD 1 Reply Last reply
    0
    • K kapperi

      Hello, sorry about loaning this question but...

      I have similar network than original writer and mine works fine. Only problem is that I want to make child id for every sensors and I just cant figure it out how to? I have already checked addresses of sensors but how can I address these in different id's.

      Sorry about my english but hopefully somebody understood my question.

      DwaltD Offline
      DwaltD Offline
      Dwalt
      wrote on last edited by
      #9

      @kapperi From the Temperature Sensor sketch on the 'build' page:

      // Present all sensors to controller
      for (int i=0; i<numSensors && i<MAX_ATTACHED_DS18B20; i++) {
      gw.present(i, S_TEMP);
      }

      This should create child devices of each dallas sensor.

      Veralite UI5 :: IBoard Ethernet GW :: MyS 1.5

      1 Reply Last reply
      0
      • K Offline
        K Offline
        kapperi
        wrote on last edited by
        #10

        Yes it does, but I tried to ask that how can I define known sensor address to specific child_id. Or does the sketch always put same sensor to same child_id?

        DwaltD Moshe LivneM 2 Replies Last reply
        0
        • K kapperi

          Yes it does, but I tried to ask that how can I define known sensor address to specific child_id. Or does the sketch always put same sensor to same child_id?

          DwaltD Offline
          DwaltD Offline
          Dwalt
          wrote on last edited by
          #11

          @kapperi I do not know exactly. I assume the child ids are assigned in the same order as the Dallas sensors are called, likely in numerical order.

          Veralite UI5 :: IBoard Ethernet GW :: MyS 1.5

          AWIA 1 Reply Last reply
          0
          • DwaltD Dwalt

            @kapperi I do not know exactly. I assume the child ids are assigned in the same order as the Dallas sensors are called, likely in numerical order.

            AWIA Offline
            AWIA Offline
            AWI
            Hero Member
            wrote on last edited by
            #12

            like @Dwalt said, the child_id's are numbered the same as the dallas sensor addresses.

            gw.send(msg.setSensor(i).set(temperature,1));
            
            1 Reply Last reply
            0
            • K Offline
              K Offline
              kapperi
              wrote on last edited by
              #13

              @AWI But this does lead to another kind of problem. If I want to add another sensor to net and its address is between two another sensors, the sketch will change child_ids to new order.

              In the controller head it means that controller thinks that child_id is same sensor and charts gets confused..

              This means too that i cannot put sensors one by one.

              How should I do this so I can say for real that my sensor one is in livingroom and three sensors are in different bedrooms and so on...

              It was easy when I had plaine arduino and lcd witch showed temps one by one...

              DwaltD 1 Reply Last reply
              1
              • K kapperi

                @AWI But this does lead to another kind of problem. If I want to add another sensor to net and its address is between two another sensors, the sketch will change child_ids to new order.

                In the controller head it means that controller thinks that child_id is same sensor and charts gets confused..

                This means too that i cannot put sensors one by one.

                How should I do this so I can say for real that my sensor one is in livingroom and three sensors are in different bedrooms and so on...

                It was easy when I had plaine arduino and lcd witch showed temps one by one...

                DwaltD Offline
                DwaltD Offline
                Dwalt
                wrote on last edited by Dwalt
                #14

                @kapperi If you add another sensor node to your network, the original node and child id#s will not be affected. The Controller does not reorder the individual Dallas sensors because it never knows their serial numbers, the controller will only know them by their assigned child ids when they are first included. If you, however, add more Dallas sensors to an existing node (hardwired) it could confuse the controller. In that case it would be best to delete the node and re-introduce the node and all its children to the controller.

                Veralite UI5 :: IBoard Ethernet GW :: MyS 1.5

                1 Reply Last reply
                0
                • K kapperi

                  Yes it does, but I tried to ask that how can I define known sensor address to specific child_id. Or does the sketch always put same sensor to same child_id?

                  Moshe LivneM Offline
                  Moshe LivneM Offline
                  Moshe Livne
                  Hero Member
                  wrote on last edited by
                  #15

                  @kapperi There is no real problem IMHO with adding another layer of abstraction.
                  just add an array

                  int child_ids[] = {1, 2, 4, 3};
                  

                  and in the sketch use:

                  gw_present(child_ids[i], S_TEMP);
                  .
                  .
                  .
                  .
                  gw_send(msg.setSensor(child_ids[i])....);
                  

                  (code is unchecked but you should get the gist of it)
                  The child ids are logical so you can set whatever you like as long as you are consistent in using it. You might have to delete the node and re-include it to get it to work right the first time you change things around.

                  1 Reply Last reply
                  0
                  • K Offline
                    K Offline
                    kapperi
                    wrote on last edited by kapperi
                    #16

                    @Dwalt sorry I meant that if I add another sensor in same node.

                    Thats the problem, I wanted to hardcode the sensors address to specific child_id so that it can never change.

                    @Moshe-Livne I didn't understand what thats supposed to do?

                    Moshe LivneM 1 Reply Last reply
                    0
                    • K Offline
                      K Offline
                      kapperi
                      wrote on last edited by
                      #17

                      Okey, after reading the different examles, I realized that it is pretty easy to hardcode sensors addresses to specific node_ids but if I do it my way, I have to send and fetch temperatures one by one. I´ll prefer if it can be done in same sentence...

                      I have tested my setup again, and still can´t get any order to child_ids. If i put sensors to node one by one, I can name the child_id in the controller, but as soon as I put third sensor it will steal the first sensors place.

                      But best is to put every sensors at the same time so the child_ids remain the same all the time, only problem is that I can´t know which sensors is which.

                      1 Reply Last reply
                      0
                      • K kapperi

                        @Dwalt sorry I meant that if I add another sensor in same node.

                        Thats the problem, I wanted to hardcode the sensors address to specific child_id so that it can never change.

                        @Moshe-Livne I didn't understand what thats supposed to do?

                        Moshe LivneM Offline
                        Moshe LivneM Offline
                        Moshe Livne
                        Hero Member
                        wrote on last edited by
                        #18

                        @kapperi this code is supposed to attach a specific child id (the numbers in the array) to a specific order of sensor discovery. so, if your order gets mixed up you can still sort it out. its not the best solution but if this is not a very common problem and you do not add and remove sensors all the time it should solve your problem.

                        1 Reply Last reply
                        0
                        • R Offline
                          R Offline
                          robertober
                          wrote on last edited by
                          #19

                          I had to use a smaller pull up resistor (2.2k) to make my system work.

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


                          12

                          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