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. Bug Reports
  3. Static IDs

Static IDs

Scheduled Pinned Locked Moved Bug Reports
6 Posts 2 Posters 2.8k 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.
  • T Offline
    T Offline
    tekka
    Admin
    wrote on last edited by tekka
    #1

    A static ID is not saved in eeprom. As a consequence, OTA bootloader will request new ID for bootloading, until the sketch takes over with the static ID.

    Resolution in MySensors.cpp / MySensor::begin procedure

    if ( (_nodeId != AUTO) && (nc.nodeId != _nodeId) ) {
    	// Set static id
    	nc.nodeId = _nodeId;
    	// Save static id in eeprom
    	eeprom_write_byte((uint8_t*)EEPROM_NODE_ID_ADDRESS, _nodeId);
    }
    
    1 Reply Last reply
    0
    • H Offline
      H Offline
      hek
      Admin
      wrote on last edited by
      #2

      @tekka

      Thanks, will be added.

      T 1 Reply Last reply
      0
      • H hek

        @tekka

        Thanks, will be added.

        T Offline
        T Offline
        tekka
        Admin
        wrote on last edited by tekka
        #3

        @hek

        Same for static parent node id in MySensors.cpp / MySensor::begin procedure:

        Resolution:

        if ( (_parentNodeId != AUTO) && (nc.parentNodeId != _parentNodeId) ) {
        	// Set static parent id
        	nc.parentNodeId = _parentNodeId;
        	// Save static parent id in eeprom
        	eeprom_write_byte((uint8_t*)EEPROM_PARENT_NODE_ID_ADDRESS, _parentNodeId);
        	autoFindParent = false;
        } else {
        	autoFindParent = true;
        }
        

        A general thought: If the parent node is not static (there are a few cases where static parent nodes make sense), it would be better to re-discover the closest node/repeater during each startup. This concept makes also more sense for OTA bootloading - you do not want to have an assigned parent node that is eventually down...

        1 Reply Last reply
        0
        • H Offline
          H Offline
          hek
          Admin
          wrote on last edited by
          #4

          Agree, but I think the bootloader code size must be kept to a bare minimum (I didn't write that part).

          T 1 Reply Last reply
          0
          • H hek

            Agree, but I think the bootloader code size must be kept to a bare minimum (I didn't write that part).

            T Offline
            T Offline
            tekka
            Admin
            wrote on last edited by
            #5

            @hek the findParentNode() part is already part of the initial OTA bootloader and only takes a few lines.

            H 1 Reply Last reply
            0
            • T tekka

              @hek the findParentNode() part is already part of the initial OTA bootloader and only takes a few lines.

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

              @tekka

              Haha.. ok. I see. someone should probably take care of the bootloader code while @ToSa is busy..

              1 Reply Last reply
              0

              Hello! It looks like you're interested in this conversation, but you don't have an account yet.

              Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

              With your input, this post could be even better 💗

              Register Login
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              7

              Online

              12.0k

              Users

              11.2k

              Topics

              113.4k

              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