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 674 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

    tekkaT 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

        tekkaT Offline
        tekkaT 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
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          111

          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