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. Problems getting sensorID

Problems getting sensorID

Scheduled Pinned Locked Moved Troubleshooting
sensor sensorid
22 Posts 9 Posters 13.1k 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.
  • klimK Offline
    klimK Offline
    klim
    wrote on last edited by
    #7

    Hi, i fully agree with your statement "We all have different views... / There is no right or wrong here"

    **My personal opinion to this: **

    • To manage the network is a gateway part
    • Fully control of the network from the controller side should be possible too. But the controller sends the network topology changes to the interface of the gateway, not directly to the nodes.

    In that case of have all the time a fully working network without a controller, just my point of view.

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

      To manage the network is a gateway part

      Within the forum there are people who think the gateway should be light and therefore as @hek wrote zero "intelligence" stateless.

      I can follow that, it is nice to have an Arduino Nano run as low layer radio interface to the MySensor network and that meas limited space/functionality.

      But yes, I also like to see also some more functionality move out of the controller towards (but not necessary in) the gateway. See also the Another way of organizing variables discussion.

      1 Reply Last reply
      0
      • klimK Offline
        klimK Offline
        klim
        wrote on last edited by
        #9

        Hi again. Today i spent again 6 full hours by searching for a solution for my new problem regarding nodeIDs.

        After i got the information from hek, that a controller is needed to get a nodeID, i build up the hardware at my working place today and sent the nodeID manually by entering 255;255;3;0;4;1. Node accepted the ID sent by the gateway via terminal console input. It was great luck that i used the serial terminal program CuteCom under Linux at work, as it was running from scratch. I took the hardware with me. At home i'm working under windows where i was not able to give the node an ID by sending the same command on the gateways serial console (eeprom was cleared before). I was measuring voltage levels again and checking hardware, replaced hardware, checked wires, compiling, reading forum, etc, it was not working at all. I was very disappointing. Why the hell it is not working anymore, i thought. I was on the way to give it up, then i tried to send the node ID request answer from my girlfriends mac book. I needed to look for arduino serial port drivers and a serial terminal program for mac. A search brought up a few programs and i tried each after another while i was playing with settings of those programs until i had success. The node was receiving an ID from the gateway, at last. Now i had the information what special serial port communication setting must be used to get it working. It is "Transmit Delay" and "Termination String". The good was, that the program running under Mac was available for Windows, it's named "CoolTerm".

        I tell you my whole story to save you time and trouble.
        Below you can find programs and settings, running on the operating systems i called before.

        Linux: CuteCom
        CuteCom.png

        Mac: CoolTerm
        CoolTermMac.png

        Windows: CoolTerm
        2014-10-18 00_24_45-CoolTermWin.png

        Hope this was useful for you.

        YveauxY 1 Reply Last reply
        0
        • klimK klim

          Hi again. Today i spent again 6 full hours by searching for a solution for my new problem regarding nodeIDs.

          After i got the information from hek, that a controller is needed to get a nodeID, i build up the hardware at my working place today and sent the nodeID manually by entering 255;255;3;0;4;1. Node accepted the ID sent by the gateway via terminal console input. It was great luck that i used the serial terminal program CuteCom under Linux at work, as it was running from scratch. I took the hardware with me. At home i'm working under windows where i was not able to give the node an ID by sending the same command on the gateways serial console (eeprom was cleared before). I was measuring voltage levels again and checking hardware, replaced hardware, checked wires, compiling, reading forum, etc, it was not working at all. I was very disappointing. Why the hell it is not working anymore, i thought. I was on the way to give it up, then i tried to send the node ID request answer from my girlfriends mac book. I needed to look for arduino serial port drivers and a serial terminal program for mac. A search brought up a few programs and i tried each after another while i was playing with settings of those programs until i had success. The node was receiving an ID from the gateway, at last. Now i had the information what special serial port communication setting must be used to get it working. It is "Transmit Delay" and "Termination String". The good was, that the program running under Mac was available for Windows, it's named "CoolTerm".

          I tell you my whole story to save you time and trouble.
          Below you can find programs and settings, running on the operating systems i called before.

          Linux: CuteCom
          CuteCom.png

          Mac: CoolTerm
          CoolTermMac.png

          Windows: CoolTerm
          2014-10-18 00_24_45-CoolTermWin.png

          Hope this was useful for you.

          YveauxY Offline
          YveauxY Offline
          Yveaux
          Mod
          wrote on last edited by
          #10

          @klim Sorry to hear it cost you such much time (again) to get things running, but I'm glad you figured it out eventually!
          The serial API documentation (http://mysensors.org/build/serial_api) mentions the command string should be terminated by a '\n' character. The actual place where this character is being processed depends on the communication direction of the serial command: from gateway to serial it is added by the MySensors library code (MyGateway.cpp) and the other way around it is parsed in the serial gateway sketch (SerialGateway.ino).

          If I'm right, your problem starts in the serial gateway sketch, which waits for the '\n' character.
          The sketch waits for a '\n' string terminator character (See http://en.wikipedia.org/wiki/Escape_sequences_in_C#Table_of_escape_sequences and especially the notes below).
          The compiler expands '\n' to a linefeed character 0x0a and so te sketch will only pass on the serial string received when it is terminated with a 0x0a byte.

          I suspect the terminal program that doesn't lead to a working serial command (which one did you use btw?) does not send the 0x0a terminating byte when you press enter in the console; probably it only sends a carriage return 0x0d.

          I hardly doubt the transmit delay is required for te communication to work. On windows I use TeraTerm with transmit delay configured to a default value of 0 ms.

          In TeraTerm the linefeed /carriage return issue is nicly illustrated by a configuration entry:

          teraterm.png

          Every LF (linefeed) entered in the serial console window is transmit as a CR+LF (carriage return + linefeed)

          @hek Maybe a short statement could be added somewhere to the docs to prevent such issues in the future...

          http://yveaux.blogspot.nl

          1 Reply Last reply
          0
          • klimK Offline
            klimK Offline
            klim
            wrote on last edited by
            #11

            Hi Yveaux, and thanks for your answer. Because i dream about wireless sensors since years, i don't want to give up to early, even if there are problems and much work to do. I already knows about the '\n' terminator and really took care to send LF (0x0A) in each of my tested programs, but thanks to name it as possible failure cause.
            By the way, i've tested your suggested terminal program 'Tera Term', configured it like in your previous post, but also without success.

            This is the config which is working in my case:

            upload-b519c7aa-88c0-4481-b28a-30b5d5e173d4
            upload-6c40f1c7-2722-4dc6-9d8d-2721f0a6e2a4

            I'm not sure why my environment needs a 'Transmission delay > 0', but I've an idea, so please tell me your opinion to this. I use the Arduino Pro mini 3.3V Version with just 8Mhz as Gateway and Node, could this be the root cause of my problem?
            Slower operating speed = different timing (on time critical operations)

            YveauxY 1 Reply Last reply
            0
            • klimK klim

              Hi Yveaux, and thanks for your answer. Because i dream about wireless sensors since years, i don't want to give up to early, even if there are problems and much work to do. I already knows about the '\n' terminator and really took care to send LF (0x0A) in each of my tested programs, but thanks to name it as possible failure cause.
              By the way, i've tested your suggested terminal program 'Tera Term', configured it like in your previous post, but also without success.

              This is the config which is working in my case:

              upload-b519c7aa-88c0-4481-b28a-30b5d5e173d4
              upload-6c40f1c7-2722-4dc6-9d8d-2721f0a6e2a4

              I'm not sure why my environment needs a 'Transmission delay > 0', but I've an idea, so please tell me your opinion to this. I use the Arduino Pro mini 3.3V Version with just 8Mhz as Gateway and Node, could this be the root cause of my problem?
              Slower operating speed = different timing (on time critical operations)

              YveauxY Offline
              YveauxY Offline
              Yveaux
              Mod
              wrote on last edited by
              #12

              @klim If it only works with this configuration, then it must indeed be transmit delay related :)

              I google'd a bit and see some more Arduino serial communication issues which seem to be solved by adding a serial delay (e.g. http://electronics.stackexchange.com/questions/28739/arduino-delay-of-1ms-necessary-between-serial-read-and-serial-write)
              There also seems to be variation over different Arduino versions.

              I use 1.5.7. Which version of the IDE do you use?

              http://yveaux.blogspot.nl

              marceltrapmanM 1 Reply Last reply
              0
              • klimK Offline
                klimK Offline
                klim
                wrote on last edited by
                #13

                Hi, interesting thread you have linked above. I use latest stable IDE 1.0.6. By the way, can you prefer using the Beta IDE for mySensors developing?

                1 Reply Last reply
                0
                • YveauxY Yveaux

                  @klim If it only works with this configuration, then it must indeed be transmit delay related :)

                  I google'd a bit and see some more Arduino serial communication issues which seem to be solved by adding a serial delay (e.g. http://electronics.stackexchange.com/questions/28739/arduino-delay-of-1ms-necessary-between-serial-read-and-serial-write)
                  There also seems to be variation over different Arduino versions.

                  I use 1.5.7. Which version of the IDE do you use?

                  marceltrapmanM Offline
                  marceltrapmanM Offline
                  marceltrapman
                  Mod
                  wrote on last edited by
                  #14

                  @Yveaux said:

                  @klim If it only works with this configuration, then it must indeed be transmit delay related :)

                  I google'd a bit and see some more Arduino serial communication issues which seem to be solved by adding a serial delay (e.g. http://electronics.stackexchange.com/questions/28739/arduino-delay-of-1ms-necessary-between-serial-read-and-serial-write)
                  There also seems to be variation over different Arduino versions.

                  I use 1.5.7. Which version of the IDE do you use?

                  Hmm, this could explain an issue I am having as well.
                  Lately I started using 1.5.7 (and 1.5.8 since yesterday). I am not really sure but I fear that I have an issue with two sensors that I can't get to communicate properly. Will try 1.0.6 this week to see what happens...

                  Fulltime Servoy Developer
                  Parttime Moderator MySensors board

                  I use Domoticz as controller for Z-Wave and MySensors (previously Indigo and OpenHAB).
                  I have a FABtotum to print cases.

                  1 Reply Last reply
                  0
                  • klimK Offline
                    klimK Offline
                    klim
                    wrote on last edited by
                    #15

                    I'm curious for your results.

                    1 Reply Last reply
                    0
                    • marceltrapmanM Offline
                      marceltrapmanM Offline
                      marceltrapman
                      Mod
                      wrote on last edited by
                      #16

                      @klim @Yveaux Well, it could be a coincidence because I also moved to the latest git version but, apart from the fact that there is an issue with setting the id of the sensor, it sure looks like I have (better) communication between the repeater and the sensor now that I uploaded the sketch using 1.0.5. With 1.5.x there was virtually no communication between these two...

                      Fulltime Servoy Developer
                      Parttime Moderator MySensors board

                      I use Domoticz as controller for Z-Wave and MySensors (previously Indigo and OpenHAB).
                      I have a FABtotum to print cases.

                      1 Reply Last reply
                      0
                      • A Offline
                        A Offline
                        app-z.net
                        wrote on last edited by
                        #17

                        Try this

                        // gw.begin();
                        gw.begin(NULL, 15);

                        DdawmeD 1 Reply Last reply
                        0
                        • klimK klim

                          Hi guys, first a big thanks for your great work. I spend lot of hours (~15h) to get your examples running, but without success. So i ask kindly for your help please.

                          I build up a gateway and a sensor node. All code is untouched example code from git or mysensors.com.
                          The problem i've, that the node does not get a sensorID from the gateway.
                          The sensor sends a request to the gateway, the gateway receives the request and that's it.

                          gateway log:
                          *0;0;3;0;14;Gateway startup complete.
                          0;0;3;0;9;read: 255-255-0 s=255,c=3,t=3,pt=0,l=0:
                          255;255;3;0;3;
                          0;0;3;0;9;read: 255-255-0 s=255,c=3,t=3,pt=0,l=0:
                          255;255;3;0;3;
                          0;0;3;0;9;read: 255-255-0 s=255,c=3,t=3,pt=0,l=0:
                          255;255;3;0;3;
                          0;0;3;0;9;read: 255-255-0 s=255,c=3,t=3,pt=0,l=0:
                          255;255;3;0;3;
                          0;0;3;0;9;read: 255-255-0 s=255,c=3,t=3,pt=0,l=0:
                          255;255;3;0;3;
                          0;0;3;0;9;read: 255-255-0 s=255,c=3,t=3,pt=0,l=0:
                          255;255;3;0;3;
                          *

                          sensor log
                          eq node id
                          send: 255-255-0-0 s=255,c=3,t=3,pt=0,l=0,st=ok:
                          sensor started, id 255
                          req node id
                          send: 255-255-0-0 s=255,c=3,t=3,pt=0,l=0,st=ok:
                          req node id
                          send: 255-255-0-0 s=255,c=3,t=3,pt=0,l=0,st=ok:
                          req node id
                          send: 255-255-0-0 s=255,c=3,t=3,pt=0,l=0,st=ok:
                          req node id
                          send: 255-255-0-0 s=255,c=3,t=3,pt=0,l=0,st=ok:
                          req node id
                          send: 255-255-0-0 s=255,c=3,t=3,pt=0,l=0,st=ok:
                          req node id
                          send: 255-255-0-0 s=255,c=3,t=3,pt=0,l=0,st=ok:

                          As the eeprom of both was filled up with 0xFF (255), the sensor starts with id 255. As all MySensor code examples are configured to work with AUTO ID, the sensor should get an ID and hold that in the eeprom, but this does not happen in my environment. Am i right until here?

                          After reading some parts of source code, i've tried manually to write the sensorID to the sensor eeprom and sensor starts with sending out his presentation and sensor data. Gateway was receiving sensor data too.
                          Maybe the communication is only working in one way: sensor-->gateway, but not in the other way: gateway-->sensor. But why??

                          A listing what i've already tried:

                          • hardware:

                          • gateway:

                            • type:
                              • serial
                              • ethernet
                            • arduino:
                              • pro mini 5V (m328)
                              • pro mini 3.3V (m328)
                              • uno (m328)
                              • mega 2560
                          • node:

                            • arduino:
                              • pro mini 5V (m328)
                              • pro mini 3.3V (m328)
                              • uno (m328)
                          • nrf24l01:

                            • capacitors:
                            • foil 100nF
                            • and electrolytic capacitor (1µ - 470µ)
                            • power supply
                              • arduino powered and external power supply
                              • 3.3v stable, yes
                            • connection
                              • verified 100 times, it must be correct
                              • breadboard and flying wires
                            • tried 10 different nrf24l01 modules
                            • modules looks like this:
                              Wireless_RF_2.4G_RFM01_01.jpg
                          • software:

                          • ide

                            • 1.0.5-r2 (windows)
                            • 1.0.5 (linux)
                            • 1.5.7 beta (windows)
                          • mySensors

                            • 1.4 stable
                            • 1.4 dev
                            • 1.3 stable
                            • eeprom clear, yes - many times

                          I've read a lot of forum posts, but without any answer that fixed my problem.
                          I have no idea anymore what i can try as next.
                          So please, i need you help.

                          ? Offline
                          ? Offline
                          A Former User
                          wrote on last edited by
                          #18

                          @klim . well so how did you solve this problem ? Urgently need help with this , I am time bound with my project

                          1 Reply Last reply
                          0
                          • hekH hek

                            The gateway does not hand out any ids. It's done by the controller behind it.

                            ? Offline
                            ? Offline
                            A Former User
                            wrote on last edited by
                            #19

                            @hek so how do I get the controller to hand out the I'd please?

                            1 Reply Last reply
                            0
                            • hekH hek

                              The gateway does not hand out any ids. It's done by the controller behind it.

                              ? Offline
                              ? Offline
                              A Former User
                              wrote on last edited by
                              #20

                              @hek how do I go about this ?

                              Moshe LivneM 1 Reply Last reply
                              0
                              • ? A Former User

                                @hek how do I go about this ?

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

                                @odark007 It would help if you specify what your problem is, include log and sketch. Repeating yourself will not get you anywhere....

                                1 Reply Last reply
                                0
                                • A app-z.net

                                  Try this

                                  // gw.begin();
                                  gw.begin(NULL, 15);

                                  DdawmeD Offline
                                  DdawmeD Offline
                                  Ddawme
                                  wrote on last edited by
                                  #22

                                  @app-z.net where does this code need to be entered?

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


                                  15

                                  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