Implementation / Dependecies of WiFi.setHostname() #1637
-
I'm having an issue with my Raspberry Pico W. I don't have the code with me right now, but I can upload it later if required. The issue I'm having is as such: I can't get my Pico W to show up under it's hostname in Station mode, which is of course dependent on the Pico's and my Router's DNS handling. I'm basically doing the following:
My problem is that my I can't reach the Pico under that hostname, I always have to enter it's IP in the browser or for pings. The code works without crashing, so any errors in the code above is from my faulty memory. The Data aquisition on Core0 runs perfectly, as does the Webpage serving on Core1. Am I doing something wrong with the handling of the WiFi-library, or do I have to use another mDNS library to actively request a DNS entry on the DNS-server like another user did on #1257 ? Appreciate any help with this ! My project is already crowded, so I don't realy want to use a display to constantly display the IP on the outside or connect a cable to read the IP through the Serial port. If nothing works I'll probably have to send the last IP number as binary code through the Builtin_LED ^^ |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
The Pico does not handle real DNS lookups, that's up to your router configuration or whatever your DNS server settings are set to (i.e. sometimes it's set to Google's Assuming you've set your router to be the DNS server for your network (and any DHCP replies it sends out) then you might also need to append whatever domain name you've set up as your local net in it. MDNS basically lets every machine on the network serve its own hostname to anyone that asks. So, that might be your best (only) bet if your DNS server is set to a global internet one like above, or if your router sometimes doesn't register DHCP names with DNS. It uses some (small) CPU but because it's multicast should be reachable on your net under the |
Beta Was this translation helpful? Give feedback.
Yes,
xxx.local
is MDNS and not port 53 DNS.MDNS is already included in the core, see the examples in https://github.com/earlephilhower/arduino-pico/tree/master/libraries/LEAmDNS