-
Notifications
You must be signed in to change notification settings - Fork 106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
adding getHostname #57
Comments
Hi @aster94, Is there a particular use case you had in mind for this? Do you want to query the hostname you set or get the default one? |
hi @sandeepmistry, In my opinion it would be useful especially to get the default one. I don't know if the arduino boards comes out from the factory with all the same hostname but anyway at some point the user could change easily it, thanks to the Also, if someone would like to be 100% sure that the set function worked a similar approach could be made: bool change_hostname (String name)
{
WiFi.setHostname(name);
if (name != WiFi.getHostname())
{
return false;
}
else
{
return true;
}
} at the end if it is not too much code/trouble i would suggest arduino staff to implement it. Since arduino boards rely on esp32 and they already implemented it it would be possible to take a look at what they did maybe |
The only concern with this is the default hostname depends on the firmware version loaded on the board. We have two options:
I'm leaning towards options two, since it would be compatible with all versions of the firmware. Option 1 is more robust however. |
@facchinm any thoughts on this? |
Option 2 looks fine for me, at least in the meantime. We can decide to switch to option 1 after some months / when the boards being produced will be flashed with the new FW |
Hello, Some news about adding getHostname? |
It would be useful to have the possibility to get the hostname, rigth now it is possible only to set it: https://www.arduino.cc/en/Reference/WiFiNINAsetHostname
other platform have already added it, like esp32:
https://github.com/espressif/arduino-esp32/blob/6dab3f6777b47e077fecd5b27f5f316664dd6096/libraries/WiFi/src/WiFiSTA.cpp#L570-L580
The text was updated successfully, but these errors were encountered: