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. Controllers
  3. Vera
  4. Changing sensor arduino board

Changing sensor arduino board

Scheduled Pinned Locked Moved Vera
9 Posts 4 Posters 2.5k 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

    As a trial I set up a light sensor with a arduino uno board. Plugged the gateway (with Nano) into the vera USB and tested it. Having verified that everything is working properly--sensor is posted and reporting values in Vera and the gateway and sensor board are communicated. Now I would like to replace the sensor Uno board with a nano for actual use. However, I would like for the gateway/Vera not to see this as a new sensor (with new id), but to see it as the same light sensor that previously operated with the Uno board. How do I do that?

    1 Reply Last reply
    0
    • Z Offline
      Z Offline
      Zeph
      Hero Member
      wrote on last edited by
      #2

      You'll probably get a more definitive answer, but if you want to test it sooner - I'm guessing that if you give the nano a static node id matching the one perviously assigned to the uno (and run the same sketch), there won't be much that the Vera do to tell them apart.

      (Assuming the Uno will be off the network, or will have it's node id erased)

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

        Zeph, thanks for your quick reply. I think that should work. Will try it and report back.

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

          The answer @zeph gave will do for sure.
          Another option is to write the value to the EEPROM yourself before uploading the sketch.
          Both work I guess...

          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
          • Dan S.D Offline
            Dan S.D Offline
            Dan S.
            Hero Member
            wrote on last edited by
            #5

            As a start I read the EEprom value in the UNO board and the values were:

            byte 0 = 1
            2 = 0
            3 = 1

            All the rest were 255 (default values)

            I assume if I write those values to bytes 1,2,and 3 of the nano board before I upload the sensor sketch, that should accomplish what I want?

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

              The debug statement on the sensor with the UNO board says the radio id stored in EEPROM is 1. I assume this is the same as the byte values I posted above. If so will write those values to bytes 0,1,and 2 of the nanao board and set those on the UNO back to 255.

              To dio the way Zeph suggests, how do I set a static node id for the sensor. I think it has to do with the sensor's begin statement?

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

                The debug statement on the sensor with the UNO board says the radio id stored in EEPROM is 1. I assume this is the same as the byte values I posted above. If so will write those values to bytes 0,1,and 2 of the nanao board and set those on the UNO back to 255.

                To dio the way Zeph suggests, how do I set a static node id for the sensor. I think it has to do with the sensor's begin statement?

                hekH Online
                hekH Online
                hek
                Admin
                wrote on last edited by
                #7

                @Dan-S.

                http://www.mysensors.org/build/sensor_api#the-full-api
                Set static id with second argument to gw.begin() (just NULL first if you don't use callback).

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

                  Decided the easiest way (for me anyway) was just to write the first 3 different byte values (1,0,1) of the UNO board to the NANO board I wanted to use. Ran an EEPROM write utility to verify the operation and uploaded my sensor sketch. Need to wire it up for final test. Also wrote 255 to first 3 bytes of the UNO board for future use in testing.

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

                    Wrote the 1st 3 bytes (1,0,1) to the new Nano sensor board and uploaded the sensor sketch. Was recognized as sensor id 1, same as previous UNO board which was the desired result.

                    Probably could have gotten the same result by only writing the number 1 (the sensor-id) to the first byte or calling gw.begin() with the sensor-id set to 1.

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


                    28

                    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