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. parentNode and distance

parentNode and distance

Scheduled Pinned Locked Moved Troubleshooting
4 Posts 3 Posters 984 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.
  • X Offline
    X Offline
    xefil
    wrote on last edited by xefil
    #1

    Hello,

    Until API2.0 I was getting two informations from the nodes:

    • parentNode
    • distance

    I was taking those informations to have an overview how far is a node and who is his parent. All that with this code:

    parentNode = _nc.parentNodeId;
    distance = _nc.distance;
    (...)
    send(msgNodeVar1.set(parentNode, 1));
    send(msgNodeVar2.set(distance, 1));
    

    Now this is not working anymore...

    error: '_nc' was not declared in this scope
       parentNode = _nc.parentNodeId;
                    ^
    exit status 1
    '_nc' was not declared in this scope
    

    Any idea?

    Thanks,

    Simon

    T 1 Reply Last reply
    0
    • gohanG Offline
      gohanG Offline
      gohan
      Mod
      wrote on last edited by
      #2
      This post is deleted!
      1 Reply Last reply
      0
      • X xefil

        Hello,

        Until API2.0 I was getting two informations from the nodes:

        • parentNode
        • distance

        I was taking those informations to have an overview how far is a node and who is his parent. All that with this code:

        parentNode = _nc.parentNodeId;
        distance = _nc.distance;
        (...)
        send(msgNodeVar1.set(parentNode, 1));
        send(msgNodeVar2.set(distance, 1));
        

        Now this is not working anymore...

        error: '_nc' was not declared in this scope
           parentNode = _nc.parentNodeId;
                        ^
        exit status 1
        '_nc' was not declared in this scope
        

        Any idea?

        Thanks,

        Simon

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

        @xefil You will find the information here: https://www.mysensors.org/apidocs/group__MyTransportgrp.html - i.e.

        transportGetParentNodeId()
        

        and

        transportGetDistanceGW()
        
        1 Reply Last reply
        1
        • X Offline
          X Offline
          xefil
          wrote on last edited by
          #4

          Thanks both @gohan and @tekka
          I'll give there a look and try by myself.

          :-)

          Simon

          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


          19

          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