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. Development
  3. Unload/Load EEPROM

Unload/Load EEPROM

Scheduled Pinned Locked Moved Development
9 Posts 4 Posters 4.3k 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.
  • jocke4uJ Offline
    jocke4uJ Offline
    jocke4u
    wrote on last edited by
    #1

    Hi,

    Wouldn't it be useful to have a "Unload EEPROM" sketch to print the values in a readable manner and similar "Load EEPROM" where you can configure values to be written to EEPROM?

    Sample scenario
    If I have a Arduino sensor chip (let say a Nano) in use and I want to replace that with another (assume Pro Mini) but I don't want to have the device created again (in Vera).

    Another scenario could be if the node failed (e.g. stroke of lightning) but you have the EEPROM value to load.

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

      Hi @jocke4u - Im assuming the only real data you need to retain is the allocated NodeID?? as the routing data will be rebuilt anyway.

      If so did you know you can specify the NODE id to use when you upload the sketch?

      Say you want to specify the NODE id as 69 - You can do this by
      gw.begin(NULL, 69, true);
      or gw.begin(incomingMessage, 69, true);

      by default it uses AUTO

      http://www.mysensors.org/build/sensor_api#create-repeating-nodes

      What im not sure of though is if you do specify in the sketch the NodeId - does MySensors then write that value to eeprom? ( and thus the sketch can be reverted back to AUTO for subsequent updates) ????

      HTH.

      You could of course dump out the values of the eeprom
      http://arduino.cc/en/Tutorial/EEPROMRead

      and if you really want to, write these values back....

      hekH 1 Reply Last reply
      0
      • greglG gregl

        Hi @jocke4u - Im assuming the only real data you need to retain is the allocated NodeID?? as the routing data will be rebuilt anyway.

        If so did you know you can specify the NODE id to use when you upload the sketch?

        Say you want to specify the NODE id as 69 - You can do this by
        gw.begin(NULL, 69, true);
        or gw.begin(incomingMessage, 69, true);

        by default it uses AUTO

        http://www.mysensors.org/build/sensor_api#create-repeating-nodes

        What im not sure of though is if you do specify in the sketch the NodeId - does MySensors then write that value to eeprom? ( and thus the sketch can be reverted back to AUTO for subsequent updates) ????

        HTH.

        You could of course dump out the values of the eeprom
        http://arduino.cc/en/Tutorial/EEPROMRead

        and if you really want to, write these values back....

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

        @gregl said:

        What im not sure of though is if you do specify in the sketch the NodeId - does MySensors then write that value to eeprom? ( and thus the sketch can be reverted back to AUTO for subsequent updates) ?

        No it does not write the static id to eeprom. You can safely revert to auto at a later stage.

        1 Reply Last reply
        0
        • jocke4uJ Offline
          jocke4uJ Offline
          jocke4u
          wrote on last edited by
          #4

          Thanks for clarification. I will try it to see how it works.

          1 Reply Last reply
          0
          • jocke4uJ Offline
            jocke4uJ Offline
            jocke4u
            wrote on last edited by jocke4u
            #5

            @hek said:

            No it does not write the static id to eeprom. You can safely revert to auto at a later stage.

            I have now replaced two sensors (from Uno -> Pro Mini) and used the begin(NULL, MY_CHILD_ID) to set the same Node Id and works fine.
            But I am not sure about what you wrote above.
            So if this won't be written to the EEPROM and if I change back the sketch to AUTO, how can it know the Node Id?

            hekH 1 Reply Last reply
            0
            • jocke4uJ jocke4u

              @hek said:

              No it does not write the static id to eeprom. You can safely revert to auto at a later stage.

              I have now replaced two sensors (from Uno -> Pro Mini) and used the begin(NULL, MY_CHILD_ID) to set the same Node Id and works fine.
              But I am not sure about what you wrote above.
              So if this won't be written to the EEPROM and if I change back the sketch to AUTO, how can it know the Node Id?

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

              @jocke4u said:

              So if this won't be written to the EEPROM and if I change back the sketch to AUTO, how can it know the Node Id?

              I doesn't. The node will try to fetch an id.

              1 Reply Last reply
              0
              • jocke4uJ Offline
                jocke4uJ Offline
                jocke4u
                wrote on last edited by
                #7

                @hek said:

                I doesn't. The node will try to fetch an id.

                Ok, thanks so then "You can safely revert to auto at a later stage." won't work if you previously had a static Node ID

                1 Reply Last reply
                0
                • hekH Offline
                  hekH Offline
                  hek
                  Admin
                  wrote on last edited by
                  #8

                  It won't work if you previously had AUTO enabled and have received an id. This id will be written to eeprom.

                  But If you always had a static id for a node this means no id has been written to eeprom and you can still go back to AUTO to fetch a new id.

                  For a node that HAS received an id and you want to receive a new id for some reason, you have to use the clear eeprom example which writes 0xFF to the id-position of eeprom again. This allows node to fetch a new fresh id from controller in AUTO mode.

                  m26872M 1 Reply Last reply
                  0
                  • hekH hek

                    It won't work if you previously had AUTO enabled and have received an id. This id will be written to eeprom.

                    But If you always had a static id for a node this means no id has been written to eeprom and you can still go back to AUTO to fetch a new id.

                    For a node that HAS received an id and you want to receive a new id for some reason, you have to use the clear eeprom example which writes 0xFF to the id-position of eeprom again. This allows node to fetch a new fresh id from controller in AUTO mode.

                    m26872M Offline
                    m26872M Offline
                    m26872
                    Hardware Contributor
                    wrote on last edited by
                    #9

                    @hek said:

                    It won't work if you previously had AUTO enabled and have received an id. This id will be written to eeprom.

                    But If you always had a static id for a node this means no id has been written to eeprom and you can still go back to AUTO to fetch a new id.

                    For a node that HAS received an id and you want to receive a new id for some reason, you have to use the clear eeprom example which writes 0xFF to the id-position of eeprom again. This allows node to fetch a new fresh id from controller in AUTO mode.

                    I always use nothing but static node-ids and I'm unable to re-include working nodes to my Vera without first erasing the eeprom. The sensors "new parent"-debug message isn't showed until after this either. Is this correct?

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


                    8

                    Online

                    11.7k

                    Users

                    11.2k

                    Topics

                    113.0k

                    Posts


                    Copyright 2019 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