simonprickett / phewap

Raspberry Pi Pico W Wifi Configuration Example with Pimoroni Phew and MicroPython
MIT License
79 stars 17 forks source link

mDNS #8

Open veebch opened 8 months ago

veebch commented 8 months ago

First of all, thank you for this. It's incredibly helpful!

Now, something that I'm sure you've looked at already: Is it possible to use mDNS on this? Googling seems to throw up a host of possible avenues to explore, but I imagine that this is something you already have firmly on your radar.

simonprickett commented 8 months ago

Hi there - thanks for posting... I always love to get feedback on projects and it seems like this one has resonated with quite a few people. Adding mDNS is something I want to look at some more and have been reading up about, as it would be really nice to give the device a fixed name so the end user doesn't have to guess the IP address especially for devices that don't have an attached screen that could show this.

One improvement I am going to pull into this project as soon as I get a moment is to replace the manual entry of the SSID with a drop down list of detected SSIDs in order of signal strength (while maintaining the ability for the user to type in the name of another SSID that can't be seen - for example where the name isn't broadcast. I've already implemented this in the setup process for my ISS tracker project (https://github.com/simonprickett/iss-tracker) so it should be an easy thing to lift and shift over here. Tracking that work as #9

I'd suggest starring this project to get updates as I add more stuff to it. I'll also leave this issue open as a reminder / place to note progress with mDNS.

Thanks!

Simon.

veebch commented 8 months ago

Already starred! The dropdown would definitely be good too. It always amazes me how many people don't know the SSID of their WiFi.

I'll let you know when we publish the code for the thing we're making. There's some CSS that people might find useful in there.

simonprickett commented 8 months ago

Sounds good - you can also email me directly if you don't want to share publically -- see https://simonprickett.dev/contact/

tristanwilson111 commented 3 months ago

FYI, I went down a rabbit hole hoping to implement mDNS on the Phew repo.

Pico W currently has a limitation for mDNS, see here: https://github.com/cbrand/micropython-mdns/issues/9

Wanted to share here in case anyone else goes down the same rabbit hole. Modifying the "connect_to_wifi" function with an additional network.hostname('example-hostname') will not broadcast a reachable address for Pico W devices.

While the Micropython documentation mentions both DHCP and mDNS support, it mentions "if enabled" for ESP32 devices. It seems like it may enable DHCP, but I wasn't able to get mDNS working with my local changes.

If anyone's looking to verify this, a user in the linked thread above mentioned a modified .uf2 file to enable mDNS on Pico W here: https://github.com/cbrand/micropython-mdns/issues/9#issuecomment-1925869228

Edit: Direct link to a modified UF2 file with disabled mDNS, going to try testing this out. https://github.com/arag0re/micropython/releases/tag/mDNS-fixed