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

[BUG] RaspberryPi-Pico-W is not getting WiFi with Pi Pico SDK 2.0 #13828

Open
1 task done
UAV-Pilot opened this issue Oct 5, 2024 · 6 comments
Open
1 task done

[BUG] RaspberryPi-Pico-W is not getting WiFi with Pi Pico SDK 2.0 #13828

UAV-Pilot opened this issue Oct 5, 2024 · 6 comments
Labels
Arch: arm Issues related to ARM (32-bit) architecture Area: Networking Effects networking subsystem

Comments

@UAV-Pilot
Copy link

UAV-Pilot commented Oct 5, 2024

Description / Steps to reproduce the issue

Except getting the latest Pi Pico SDK 2.0, the rest is the same as #7475, which is closed now.

Similar to the errors in #7475, the following errors occurred:

I set SSID and passphrase in menuconfig, and also tried to set them in nsh.

nsh> renew wlan0
ERROR: netlib_obtain_ipv4addr() failed
nsh> ifconfig wlan0
wlan0 Link encap:Ethernet HWaddr 00:00:00:00:00:00 at DOWN mtu 5nsh>
nsh>
nsh> ifup wlan0
ifup wlan0...Failed

ChatGPT suggested to set mac address:
ifconfig wlan0 hw ether XX:XX:XX:XX:XX:XX (e.g., 28:CD:C1:0A:38:9A)
but got error:
nsh: ifconfig: argument invalid

nsh> wapi show wlan0
wlan0 Configuration:
IP: 0.0.0.0
NetMask: 255.255.255.0
nsh> wapi scan wlan0
nsh> wapi scan_results wlan0
nsh> ifup wlan0
ifup wlan0...Failed

Besides this firmware issue during setup, along the way I encounter other issues as shown in comments below:

  1. When not set during menuconfig, SSID and passphrase entered manually in wapi commands disappeared after reboot
  2. ifconfig did not output ip address, etc.
  3. ifup wlan0 returned message OK which was misleading when wlan0 was not connected and not up running correctly

On which OS does this issue occur?

[OS: Linux]

What is the version of your OS?

Windows 11 WSL2 Ubuntu 22.04.2

NuttX Version

NuttX 12.7.0-RC0 0976258-dirty Oct 4 2024 22:58:36 arm rasp

Issue Architecture

[Arch: arm]

Issue Area

[Area: Networking]

Verification

  • I have verified before submitting the report.
@github-actions github-actions bot added Arch: arm Issues related to ARM (32-bit) architecture Area: Networking Effects networking subsystem labels Oct 5, 2024
@darwinbeing
Copy link

darwinbeing commented Oct 6, 2024

Download the BINARY firmware file from this link: 43439A0-7.95.49.00.combined ~220K

Make sure the configuration file variable points to the correct firmware file:
CONFIG_CYW43439_FIRMWARE_BIN_PATH="${PICO_SDK_PATH}/lib/cyw43-driver/firmware/43439A0-7.95.49.00.combined"
When compiling, the cyw43439.firmware.image file is created, and it’s the same as firmware/43439A0-7.95.49.00.combined. Ensure the paths and files match during the build, especially in:
boards/arm/rp2040/common/src/cyw43439.firmware.image
prebuilt firmware nuttx.uf2.zip

Screenshot 2024-10-06 at 3 32 59 AM

@UAV-Pilot
Copy link
Author

UAV-Pilot commented Oct 6, 2024

@darwinbeing Thanks a lot for your quick help! With that firmware, I got wifi working on pi pico W with SDK 2.0.

Besides this firmware issue during setup, along the way I encounter other issues as shown by the following commands:

  1. When not set during menuconfig, SSID and passphrase entered manually in wapi commands disappeared after reboot
  2. ifconfig did not output ip address, etc.
  3. ifup wlan0 returned message OK which was misleading when wlan0 was not connected and not up running correctly

Note: for the following session, SSID and passphrase were not set from menuconfig.

NuttShell (NSH) NuttX-12.7.0-RC0
nsh> ifconfig wlan0
wlan0 Link encap:Ethernet HWaddr 28:cd:c1:0a:38:9a at UP mtu 576nsh>
nsh> ifup wlan0
ifup wlan0...OK
nsh>
nsh> wapi show wlan0
wlan0 Configuration:
IP: 0.0.0.0
NetMask: 255.255.255.0
Frequency: 2412
Flag: WAPI_FREQ_AUTO
Channel: 1
Frequency: 2412
ESSID:
Flag: WAPI_ESSID_ON
Mode: WAPI_MODE_MANAGED
BitRate: 72000
Flag: WAPI_BITRATE_FIXED
Sense: 0
Country: XX
nsh>
nsh> wapi psk wlan0 XXXXXXX WPA_ALG_CCMP
nsh> wapi essid wlan0 MySSID WAPI_ESSID_ON
nsh> renew wlan0
nsh> wapi show wlan0
wlan0 Configuration:
IP: 192.168.1.160
NetMask: 255.255.255.0
Frequency: 2462
Flag: WAPI_FREQ_AUTO
Channel: 11
Frequency: 2462
ESSID: MySSID
Flag: WAPI_ESSID_ON
Mode: WAPI_MODE_MANAGED
AP: f8:9b:6e:e7:9e:44
BitRate: 65000
Flag: WAPI_BITRATE_FIXED
TxPower: 31
Flag: WAPI_TXPOWER_DBM
Sense: -76
Country: XX

nsh> ifconfig wlan0
wlan0 Link encap:Ethernet HWaddr 28:cd:c1:0a:38:9a at RUNNING mt5.255.0

nsh> ping 192.168.1.254
PING 192.168.1.254 56 bytes of data
56 bytes from 192.168.1.254: icmp_seq=0 time=0.0 ms
56 bytes from 192.168.1.254: icmp_seq=1 time=0.0 ms
56 bytes from 192.168.1.254: icmp_seq=2 time=0.0 ms
56 bytes from 192.168.1.254: icmp_seq=3 time=0.0 ms
rtt min/avg/max/mdev = 0.000/0.000/0.000/0.000 ms, time 3730 ms
nsh>

@linguini1
Copy link
Contributor

linguini1 commented Oct 7, 2024

I see if there is no firmware file present, then the firmware file is initialized with the text "dummy" at boards/arm/rp2040/raspberrypi-pico-w/src/Make.defs line 53.

Did the firmware file used to be generated? Maybe we can incorporate that generation back into the build system, or instruct users on how to build the firmware? This should at least be documented somewhere versus the current documentation which just instructs the firmware repo to be cloned.

@linguini1
Copy link
Contributor

It appears the new firmware file actually allows the blob binary to be included as a C variable instead of requiring the assembly instruction to include the binary.

Maybe we could update the boards/arm/rp2040/common/src/rp2040_firmware.c file to do that? I'll look into it. It would also be good to add a warning for the missing firmware file instead of silently making a dummy file.

@darwinbeing
Copy link

darwinbeing commented Oct 26, 2024

Convert WiFi binary firmware for W43439 module to C array format
w43439.patch
OR
w43439.patch

@linguini1
Copy link
Contributor

This patch works in the sens that ifup wlan0 is now returning okay, but it does not work when I try to renew wlan0.

nsh> renew wlan0
ERROR: netlib_obtain_ipv4addr() failed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Arch: arm Issues related to ARM (32-bit) architecture Area: Networking Effects networking subsystem
Projects
None yet
Development

No branches or pull requests

3 participants