Skip to content
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

Can't set hostname in AP mode #8906

Closed
LucaDevelop opened this issue Jul 13, 2022 · 6 comments · Fixed by #10635
Closed

Can't set hostname in AP mode #8906

LucaDevelop opened this issue Jul 13, 2022 · 6 comments · Fixed by #10635
Labels

Comments

@LucaDevelop
Copy link

Board: Raspberry Pico W
Firmware file name: rp2-pico-w-20220713-unstable-v1.19.1-129-g5bf376563.uf2

I can't set the "hostname" param with config() function.

This works (without hostname param):

import network
wlan = network.WLAN(network.AP_IF)
wlan.config(essid='somessid', key="1234567890")
wlan.active(True)

This doesn't work:

import network
wlan = network.WLAN(network.AP_IF)
wlan.config(essid='somessid', key="1234567890", hostname="somehostname")
wlan.active(True)

and prints this error:

Traceback (most recent call last):
  File "<stdin>", line 3, in <module>
ValueError: unknown config param

I've tried with "dhcp_hostname" also, same result.

@jimmo
Copy link
Member

jimmo commented Jul 14, 2022

This is not currently supported on pyboard-d and pico-w (they use the same wifi driver).

It's not terribly complicated to add as the underlying driver already supports it. extmod/network_cyw43 needs to have the hostname parameter added to config, then it needs to not use the hard coded value in
https://github.com/micropython/micropython/blob/master/drivers/cyw43/cyw43_lwip.c#L120
and
https://github.com/micropython/micropython/blob/master/drivers/cyw43/cyw43_lwip.c#L135

@iabdalkader
Copy link
Contributor

I'd like to send this in, if no one is currently working on it, along with some proposed changes to connect.

@scruss
Copy link
Sponsor Contributor

scruss commented Aug 8, 2022

Although this was merged in CYW43: Allow setting hostname. by iabdalkader · Pull Request #8918 · micropython/micropython, it doesn't seem to have made it into the rp2-pico-w-20220808-unstable-v1.19.1-241-g6baeded32.uf2 nightly

@robert-hh
Copy link
Contributor

@iabdalkader:
Trying to build the binaries with MICROPY_PY_NETWORK_CYW43_USE_LIB_DRIVER=0 fails.
How did you succeed and test setting hostname?

@jimmo
Copy link
Member

jimmo commented Feb 1, 2023

See #10635

@maik123100
Copy link

It seems the last time i found it was mentioned is that you should "dhcp_hostname" instead of "hostname" to set the hostname. I found it here and the concret link would be this.
I might be completly mistaken but from what i saw this should resolve the issue. I am eager to hear how it turned out for you. But from my point of view it seems the doc is not 100% correct on this.

tannewt added a commit to tannewt/circuitpython that referenced this issue Feb 13, 2024
Pimoroni DV Base: Fix i2s audio pin assignments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
6 participants