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

Pi Pico W WLAN set hostname in STA #10397

Open
alexphobby opened this issue Jan 2, 2023 · 4 comments
Open

Pi Pico W WLAN set hostname in STA #10397

alexphobby opened this issue Jan 2, 2023 · 4 comments

Comments

@alexphobby
Copy link

Please help, cannot set hostrname in Pi Pico W
firmware:
MicroPython v1.19.1-782-g699477d12 on 2022-12-20; Raspberry Pi Pico W with RP2040

code:
wlan = network.WLAN(network.STA_IF)
wlan.config(hostname="mypicow")
Traceback (most recent call last):
File "", line 1, in
ValueError: unknown config param

@fivdi
Copy link
Contributor

fivdi commented Jan 2, 2023

See #8906

@th3w
Copy link
Sponsor

th3w commented Jan 2, 2023

I am also interested in this option for the Pico_W. Reading #8906 I found out the following:
In issue #8906 the required changes were discussed to set a hostname in the cyw43 driver code under /driver/cyw43. and in /extmod/network_cyw43.
Also the resulting PR's #8918 and #9058/#9086 changes the cyw43 code in /driver/cyw43/

Currently, however, the rp2 build for Pico_W seems to use the version in submodul https://github.com/georgerobotics/cyw43-driver/tree/2cf328d9e41603405a037a29e081a7d30dd519e6 at /lib/cyw43-driver

(See CMakelist.txt https://github.com/micropython/micropython/blob/master/ports/rp2/CMakeLists.txt#L243-L247 )

if (MICROPY_PY_NETWORK_CYW43)
    string(CONCAT GIT_SUBMODULES "${GIT_SUBMODULES} " lib/cyw43-driver)
    if((NOT (${ECHO_SUBMODULES})) AND NOT EXISTS ${MICROPY_DIR}/lib/cyw43-driver/src/cyw43.h)
        message(FATAL_ERROR " cyw43-driver not initialized.\n Run 'make BOARD=${MICROPY_BOARD} submodules'")
    endif()

@th3w
Copy link
Sponsor

th3w commented Jan 5, 2023

I found out that, at least when building your own Pico_W firmware from the actual Micropython Master branch, you can set a default hostname with the flag CYW43_HOST_NAME.

I have simply added in ports/rp2/boards/PICO_W/mpconfigboard.h the line
#define CYW43_HOST_NAME "uPY_PICOW"

@jimmo
Copy link
Member

jimmo commented Feb 1, 2023

See #10635

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants