nerves-hub / nerves_hub_link

Connect devices to NervesHub via a Phoenix channel
https://hex.pm/packages/nerves_hub_link
Apache License 2.0
36 stars 18 forks source link

Fix problem where signed_at time was often expired #225

Closed lawik closed 2 months ago

lawik commented 2 months ago

When rebooting a device NervesTime will try to restore a reasonable time from the RTC or the FileTime simulated RTC. This then sets OS time.

The shared secret signing code was pulling System.system_time/1 which can lag behind System.os_time/1 for many minutes and can often start on a time that is wildly out of whack.

This changes to use os_time meaning devices should reboot and connect much faster by default.

lawik commented 2 months ago

Yeah, I've seen it take a decent bit. And it is aggravated by it trying a few times and then backing off. So it takes some time before it will even try again.

lawik commented 2 months ago

I don't have merge on this repo btw.