Jump to content

Welcome to Smart Home Forum by FIBARO

Dear Guest,

 

as you can notice parts of Smart Home Forum by FIBARO is not available for you. You have to register in order to view all content and post in our community. Don't worry! Registration is a simple free process that requires minimal information for you to sign up. Become a part of of Smart Home Forum by FIBARO by creating an account.

 

As a member you can:

  •     Start new topics and reply to others
  •     Follow topics and users to get email updates
  •     Get your own profile page and make new friends
  •     Send personal messages
  •     ... and learn a lot about our system!

 

Regards,

Smart Home Forum by FIBARO Team


  • 0

How to use /networkDiscovery/arp in API


Lambik

Question

When accessing

Please login or register to see this link.

I can see that there could be arp functionality.

 

Anyone know how to use this?

 

Maybe it is possible to arping a device? That would be nice to monitor mobile devices when connecting the network...

Link to comment
Share on other sites

Recommended Posts

  • 0
  • Inquirer
  • put in parameter dialog {"body": 0}

    Thank You!!

     

    This opens a possibility to check if my phone is online, where I waited a long for!

    Nice!

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • I'm a rookie in API-string-commands but I trying to find out the URL to get the json data. When found I will post it. Maybe you know a place to find the right answer? 

    Please login or register to see this image.

    /emoticons/default_icon_mrgreen.gif" alt=":mrgreen:" /> 

    Link to comment
    Share on other sites

    • 0

    I tried the same thing

    Please login or register to see this image.

    /emoticons/default_smile.png" alt=":)" srcset="https://forum.fibaro.com/uploads/emoticons/[email protected] 2x" width="20" height="20" /> looks like it needs post prior to just obtaining the data?

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • Maybe something like this?

     

    Please login or register to see this link.

     

    I try some stuff this week. I let you know.

    Link to comment
    Share on other sites

    • 0

    Maybe something like this?

    Please login or register to see this link.

    I try some stuff this week. I let you know.

    No I don't think so they are simple get results... I think this requires post to obtain data then save it somehow then get data from json result?

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  •  

    try it and see response

    Please login or register to see this code.

    Okay!! Thanx, I will try this later. Keep your posted.

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • Here you have working example

    It's working! You're the best!!!

     

    Thanks!

    Link to comment
    Share on other sites

    • 0

    I know it is working, I've just made it and checked

    Please login or register to see this image.

    /emoticons/default_smile.png" alt=":)" srcset="https://forum.fibaro.com/uploads/emoticons/[email protected] 2x" width="20" height="20" /> The rest it get json from response and do with data everytthing you want. Make scene to "click" button every X minutes and you have arp checking

    Link to comment
    Share on other sites

    • 0

    I know it is working, I've just made it and checked

    Please login or register to see this image.

    /emoticons/default_smile.png" alt=":)" srcset="https://forum.fibaro.com/uploads/emoticons/[email protected] 2x" width="20" height="20" /> The rest it get json from response and do with data everytthing you want. Make scene to "click" button every X minutes and you have arp checking

    Thank you works great i have managed to get it to fire a global variable based on mac address connectivity and it works very well!

     

    Much appreciated...

    Link to comment
    Share on other sites

    • 0

    Actually the value seems to be a little erratic! Changes constantly even if you are connected or not... assuming network issue from my phone i will investigate further

    Link to comment
    Share on other sites

    • 0

    Actually the value seems to be a little erratic! Changes constantly even if you are connected or not... assuming network issue from my phone i will investigate further

    If I check this table at 10 min intervals, the entries change indeed... But I expected that behavior. If this is a standard "arp" implementation, as used on linux or windows, then the entries will time out and disappear from the table, if no data exchange took place between the HC2 and the device, or the device has not done an "arp broadcast" in a certain interval. I'm guessing this timeout would be 5 or 10 minutes, but that's a long shot... Could this explain what you call "erratic behavior"? To have something similar on windows: "arp -a" or on a mac "arp -ax".

    This is scene version of the VD code:

    Please login or register to see this code.

    Link to comment
    Share on other sites

    • 0

    timeouts as would suggest happen a LOT quicker!

     

    i can be sat with a main loop checking if mac address response.match("foo") equals the mac address i want based on standard 3 seconds or even increased to 15 or so it will show connected then switch to not connected on my VD very quickly!

     

    I think you are indeed correct it may show Not Connected on timeout? then once the value changes it updates mobile client which then wakes it again and show connected?

     

    thank you for your help... this is not going to help regards locating the phone easily on the network using mac address rather than ip

     

    you potentially saved me a day of messing about

    Please login or register to see this image.

    /emoticons/default_smile.png" alt=":)" srcset="https://forum.fibaro.com/uploads/emoticons/[email protected] 2x" width="20" height="20" />

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • Just some code I want to share to monitor arp and online devices behaviour. Copy and paste the code in a Virtual Device 'Main loop' and change it to your needs. Watch the debug-window.

     

    I gratefully used the knowledge you shared to write this code. Thank you all!!

    Please login or register to see this image.

    /emoticons/default_icon_mrgreen.gif" alt=":mrgreen:" />

    Please login or register to see this code.

    Link to comment
    Share on other sites

    • 0

    on Debian i suppose you can check and change ARP default time in file /proc/sys/net/ipv4/neigh/eth0/gc_stale_time

    You will need root to your HC2.

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • on Debian i suppose you can check and change ARP default time in file /proc/sys/net/ipv4/neigh/eth0/gc_stale_time

    You will need root to your HC2.

    I don't have root access to my HC2. I guess you do. Can you check what the default value is?

    Link to comment
    Share on other sites

    • 0

    How to display if device 1, device 2, etc.. is online or offline in an VD?

    Link to comment
    Share on other sites

    Join the conversation

    You can post now and register later. If you have an account, sign in now to post with your account.

    Guest
    Answer this question...

    ×   Pasted as rich text.   Paste as plain text instead

      Only 75 emoji are allowed.

    ×   Your link has been automatically embedded.   Display as a link instead

    ×   Your previous content has been restored.   Clear editor

    ×   You cannot paste images directly. Upload or insert images from URL.

    ×
    ×
    • Create New...