Nanoleaf Aurora panel autodiscovery
Nanoleaf panels can get different IP addresses, at times that are difficult (potentially even impossible) for humans or code to predict. For example, when the Nanoleaf controller's DHCP lease gets renewed, it is possible for the new lease to assign a different IP address to the old lease. This could result in unpredictable and sudden inability to control the Nanoleaf device via OLA, until the user performs a manual rediscovery of the Nanoleaf device(s) and manual reconfiguration of OLA.
As a result, I don't think it's a good idea to require the user to specify the panel's IP address in a configuration file (I understand OLA currently requires this). In my opinion, it would be better to automatically discover all Nanoleaf panel(s) on the same broadcast domain as the machine running OLA, and automagically make them available via OLA.
Here is my implementation of auto-discovery of Nanoleaf "Aurora" panels using the Avahi library - please feel free to copy'n'paste parts of it, integrate it wholesale into OLA, use it as inspiration, or whatever else you deem appropriate:
https://github.com/developer79433/nanoleaf-controller/blob/master/src/discovery.cpp
Hope this helps!
You can bind a static IP to a MAC address through a DHCP server or use hostname. That should work even for the Nanoleaf Aurora panel or am I missing something?
Auto-discovery is a nice function though :)
You can bind a static IP to a MAC address through a DHCP server or use hostname. That should work even for the Nanoleaf Aurora panel or am I missing something?
Auto-discovery is a nice function though :)
Yep, you can do that, but it requires:
- The user's DHCP server to have that functionality - some low-quality consumer router+gateway products don't let you bind static IPs. For example, my router has this feature, but my elderly mother's poor-quality router supplied by her ISP doesn't have this feature.
- A user knowledgeable enough about DHCP to add the static IP (as you can imagine, this is completely beyond my elderly mother).
- The user to remember, or find, the static IP then add it to the config file.
All of which is a hassle and an inferior user experience to the software just "figuring it out" by itself.