A dhcp_hostname query fails on MicroPython v1.19.1?

General discussions and questions abound development of code with MicroPython that is not hardware specific.
Target audience: MicroPython Users.
Post Reply
Jibun no kage
Posts: 144
Joined: Mon Jul 25, 2022 9:45 pm

A dhcp_hostname query fails on MicroPython v1.19.1?

Post by Jibun no kage » Wed Jul 27, 2022 6:24 am

A dhcp_hostname query fails on MicroPython v1.19.1? I am using DHCP, it is working correctly for all clients, but if I try to query from for the hostname of my Pico W board, I get the following error? as 'unknown config param' code example below:

theHost=theInterface.config('dhcp_hostname'). Where theInterface is my network.WLAN object, that is both active and connected to my WiFi. I can get other config values, like MAC, channel, txpower, essid, etc. Documentation states that I can query as well as set the dhcp_hostname, welll I guess the query is bugged?

How does one get the hostname of an ESP device or Pico W device that receives and IP address from a DHCP server via MicroPython?

Jibun no kage
Posts: 144
Joined: Mon Jul 25, 2022 9:45 pm

Re: A dhcp_hostname query fails on MicroPython v1.19.1?

Post by Jibun no kage » Wed Jul 27, 2022 8:52 pm

Got the answer from a different question/answer... there is a pending issue documented, but has yet to be picked up and fixed.

User avatar
scruss
Posts: 360
Joined: Sat Aug 12, 2017 2:27 pm
Location: Toronto, Canada
Contact:

Re: A dhcp_hostname query fails on MicroPython v1.19.1?

Post by scruss » Wed Jul 27, 2022 9:01 pm

Jibun no kage wrote:
Wed Jul 27, 2022 6:24 am
Documentation states that I can query as well as set the dhcp_hostname, welll I guess the query is bugged?
No, documentation states (under WLAN.config):
Following are commonly supported parameters (availability of a specific parameter depends on network technology type, driver, and MicroPython port).
So there's no guarantee that they're supported everywhere

Jibun no kage
Posts: 144
Joined: Mon Jul 25, 2022 9:45 pm

Re: A dhcp_hostname query fails on MicroPython v1.19.1?

Post by Jibun no kage » Thu Jul 28, 2022 3:47 am

Yeah, I found a reference that the WLAN driver used on Pico W right now, lacks much of what the others ESP32, etc., support, a maturity thing a times. CWA or was it the CWA3? Don't recall the exact name at the moment. I remember some time ago the ESP32 implementation lacked similar, but I and a few others chimed in and the feature set was enhanced.

User avatar
scruss
Posts: 360
Joined: Sat Aug 12, 2017 2:27 pm
Location: Toronto, Canada
Contact:

Re: A dhcp_hostname query fails on MicroPython v1.19.1?

Post by scruss » Thu Jul 28, 2022 4:53 pm

if you want things changed in MicroPython, you need to raise an issue. Mentioning in on this forum doesn't get it worked on.

Thankfully, there is an open issue for this, and it'll likely make it into the next release in a few months.

Jibun no kage
Posts: 144
Joined: Mon Jul 25, 2022 9:45 pm

Re: A dhcp_hostname query fails on MicroPython v1.19.1?

Post by Jibun no kage » Sat Jul 30, 2022 3:56 pm

Good point, I knew that in fact, but it is worth repeating. When I hit this issue on ESP32 ESP8266 (this was a long time ago) it was posted as an issue on github. Now the same basic issue with Pico W, no surprise, and as you noted, it has already been identified, so with a bit of luck, addressed in a timely manner (I hope).

Post Reply