How to easily detect from the robot-side that it was removed from Husarnet network, and join again?

Hello, everyone.

For context, I was following the Using Husarnet Docker Image tutorial.

  • I was able to have different devices DeviceA, DeviceB, DeviceC in the same network.

  • Then I removed DeviceB from https://app.husarnet.com

  • I checked /etc/hosts in DeviceB and it still contained the values that were added when joined the network.

At this point, how can DeviceB know that it has been removed from the network so that it can run husarnet join again?

Or, do you have any suggestion on how to automatically connect a device in case it was accidentally removed from https://app.husarnet.com?

I was thinking of running husarnet join every ~30 seconds, but, is there a better approach for the problem described here?

Hi ralvers,

the simplest approach to solving this problem that comes to mind is to simply run join when Husarnet addresses become unreachable. You may want to specify a task in corn that checks for connectivity and runs joins if need be.

Best regards,
Konrad

1 Like

Hi @konrad,

Thank you very much for your suggestion. I’ll follow your advice.

Cheers.

1 Like