Got my Pico 2 Ws today - thanks for quick reaction to order.
Hit a problem trying the run the example programs in chapter 11 of the 2nd Edition of MicroPython on Raspberry Pi Pico.
I’ve installed the Pimoroni version of the .uf2 but the Requests.py program falls over.
MPY: soft reboot
MicroPython feature/psram-and-wifi, pico2_rp2350_wireless v0.0.10 on 2024-11-18; Raspberry Pi Pico 2 (LTE + WiFi) with RP2350
Type "help()" for more information.
>>> %Run -c $EDITOR_CONTENT
MPY: soft reboot
Connected to Wi-Fi network.
('192.168.0.73', '255.255.255.0', '192.168.0.1', '194.168.4.100')
Traceback (most recent call last):
File "<stdin>", line 28, in <module>
File "requests/__init__.py", line 201, in get
File "requests/__init__.py", line 79, in request
OSError: -2
>>>
Here is the code from the book:
import time
import network
import rp2
import requests
rp2.country("GB")
ssid = "ssid"
psk = "P word"
wlan = network.WLAN(network.STA_IF)
wlan.active(True)
wlan.connect(ssid, psk)
max_wait = 30
while max_wait > 0:
if wlan.status() < 0 or wlan.status() >= 3:
break
max_wait -= 1
print("Waiting for Wi-Fi connection...")
time.sleep(1)
if wlan.status() != 3:
raise RuntimeError("Network connection failed")
else:
print("Connected to Wi-Fi network.")
print(wlan.ifconfig())
response = requests.get("https://text.npr.org/")
[print(x) for x in response.content.splitlines()]
response.close()
LED_server also falls over like this:
>>> %Run -c $EDITOR_CONTENT
MPY: soft reboot
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: no module named 'connect'
>>>
Is anyone else hitting the same problem?
Am I using the correct uf2?
I want to output to my new Pico Display 2.8" so need the Pimoroni PicoGraphics version.
I’ve pinged @gadgetoid about this. Initially I was going to say you may be using the wrong .UF2, but from the text output it looks to be the correct one, aka pico2_rp2350_wireless.
Is there even an official Micropython build for the Pico 2 W yet?
Depends what you mean by official, but the Pico 2 W changes PR hasn’t been merged so I’d guess not. RP2350 support in general is still rocky… I mean I wrote a bunch of it, and that can’t be good!
Edit: Should note that I had a release Pico 2 W delivered today so I’ll prod this firmware and see how it goes. In any case I’ve just done a bunch of rebasing and cherry picking and other such sundry - ARGH it’s all still experimental branches on top of other experimental branches - busywork, so I should be cutting a new build anyway.