Husarnet 3.0 - How to check if a robot is online in a deterministic way? How to set the `master` device?

Hi, Husarnet Team.

With Husarnet 3.0 we no longer have the /api/status/$DeviceID to determine if the robot is online or not.

I know we can check the lastContact field when retrieving the device details, but it looks like that field is not updated so often. Then the question is:

  1. How often is the lastContact field updated?
  2. Most devices still use husarnet binary clients for Husarnet 2.0. Does that impact how often lastContact is updated?

I’m going to take the chance to also ask the following:

  1. When retrieving network details (to then get device details/status), I see a huge list of devices come in the attachableDevices field. Would it be possible to maybe have a parameter to say fetchAttachableDevices: false when we do not need that huge list of devices?

Also, in Husarnet 2.0 we had a way of setting the master device, used initially as the ROS Master in ROS 1, but also used for connectivity tests using ping6 master.

  1. Is there a way to set the master device, or give a second name (an alias) to a device in a group/network, so that in each network we could have a device named master?

I also see that the /etc/hosts file sometimes does not list all devices in the network that the device is attached to.

  1. Did Husarnet 3.0 really change how /etc/hosts file is updated?

Please forgive my ignorance if these questions were already answered elsewhere.

Hello @ralves

First of all, thanks for taking the time to provide feedback! I’ll try to provide answers in points below:

Yes, this is significant change between daemon versions. We have removed the option to ping the device from the Dashboard, as in the new version devices send heartbeats to control plane about every minute - so the API will know precisely if the device is online or not. In Husarnet 2.0, daemons (once joined) only send the update every 15 minutes (but instead you could try to ping it from websetup to obtain status).

For partial compatibility with older version, we have created a heuristic that provides status field on a device object in the API, which is on, off or unknown. It is on when lastContact was no longer than 1,5 minute ago, and off if it was more than 16 minutes ago. You can use this field instead of lastContact directly.

We need a couple more days to polish the new client, I think after the update your problem will be resolved, unless you need more granular information than “in the last minute”

Good point, that would probably help a lot with large accounts. This is something we will definitely implement.

Yes, this functionality is preserved, it will be now known as “hostname aliases”. The web frontend and CLI displays are not yet implemented, but should work via API, try:

husarnet -–json -i device update <DEVICE NAME or IP> --add-alias master

No, there shouldn’t be changes in this part, please feel welcome to provide more details/reproduction and we will take a look.

Thank you once again,
ympek

Thank you very much for the answers, @ympek.

Those answers already help me a lot.

I may come back later when/if I have more info related to /etc/hosts or anything else.

Have a wonderful day.

1 Like