Hi. I am trying to do the wifi scan using with Arduino RP2040 Connect with MicroPython. However, I am struggling with activating the wifi. Here is the code below :-
Basically, I just copied from standard code from Arduino's MicroPython example. The different is I am using the UART port for displaying instead of using print statement for output.
I am using PyCharm IDE. But I think it is not relevant because I try with Pico-W with similar coding (wifi scan) but it works well on Pico-W.
Anyone have idea how to solve it?
Thanks,
Cimiy
------- Code --------
"""
Demo program for Arduino RP2040 Connect
"""
import machine, time, network
led = machine.Pin("LED", machine.Pin.OUT)
uart = machine.UART(0, baudrate=9600, tx=machine.Pin(0), rx=machine.Pin(1))
wlan = network.WLAN()
wlan.active(True) # <----- Hang up this line
uart.write('Scanning\r\n')
uart.write(f'Status = {wlan.status()}')
while True:
led.on()
#scan_result = wlan.scan()
uart.write('Message from Arduino RP Connect...MicroPython\r\n')
time.sleep(1)
led.off()
time.sleep(0.1)
I spent couple of hours to trial and error and I found that due to the old version of NINA WiFi firmware 1.4.8. The latest MircoPython (ARDUINO_NANO_RP2040_CONNECT-20231227-v1.22.0.uf2) cannot support it.
So right now, I downgrade the MicroPython version to V1.18 (ARDUINO_NANO_RP2040_CONNECT-20220117-v1.18.uf2) and now it's working properly. I am using simple Thonny IDE.
I don't know whether it is possible to do using MicroPython, but if you want to update the firmware on the board you can do that using Arduino IDE. Instructions are available here:
By the way, I have gone a lot of messages at this forum, seems this issue is kept on-going and no solid solution yet.
My application target to using MicroPython. Right now for the WiFi part, I proved it works using the combination of NINA@1.4.8 + MicroPython@1.18. But I sure that is it not the good combination as both of them are already outdated. MP@1.18 doesn't support to lit on the RGB LEDs
So, it is the best if I can update the NINA to 1.5.0.