How can I set the device hostname properly using MBED OS 6?
In the olden days (MBED OS 2) one solution was to change EthernetInterface.cpp file and header file as described here:
I´d expected new functions/methods to implement this function. I’m working with LPC1768, but apparently this feature is not supported by the OS, even with latest platforms.
Thanks for all your suggestions.
+1 I would also like to know the solution to this.
+2, I have been waiting also. I ran across a comment somewhere that it was supposed to be showing up in MBED OS 6.
I have been using the following since MBED OS 5.9. It’s not a long term solution as it could break down the road and a little bit of a brute force method.
Still waiting a solution .
Thanks for your suggestion @tim35ca, this workaround freezes at net.disconnect() using MBED OS 6.3 and LPC1768.
I might be wrong but the friendly name is usually assigned to a host by DNS (Domain Name System/Server). However, for small local networks the mDNS (Multicast DNS) can be used as a workaround . A search for mDNS on Mbed pages returns several libraries. Maybe some of them work also with Mbed OS 6. I think it’s worth to try out.
Best regards, Zoltan
Does this solution still work?
Or are you looking for a new solution because it stopped working?
I have only been able to go to 6.2.1 for a number of my solutions. There are quite a few problems with the 6.3 release (only tried the online compiler). I haven’t pulled 6.3 into mbed studio yet.
Are any “official” MBED people acting on this?
There is no official way of setting the host name in Mbed.
The proposed workaround uses Lwip which is a private dependency of Mbed’s IP network stack. It is not recommended to use internal dependencies in applications as it can change state in the back of the middleware that uses it. It is not unexpected to see different behavior version to version if an application touches these internal part.
To make such feature available to Mbed it would require adding a new method at the
NetworkInterface level and propagates the call down the stack. We are not working actively on such feature but warmly welcome pull requests from the Mbed community.