# Pico 2 W problem with Pimoroni .uf2

**URL:** https://forums.pimoroni.com/t/pico-2-w-problem-with-pimoroni-uf2/26638
**Category:** Support
**Created:** [November 26, 2024, 7:06pm UTC](https://forums.pimoroni.com/t/pico-2-w-problem-with-pimoroni-uf2/26638 "2024-11-26T19:06:24Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![Tonygo2](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/tonygo2/32/7814_2.png) [@Tonygo2](https://forums.pimoroni.com/u/Tonygo2)
#### Post date: [November 26, 2024, 7:06pm UTC](https://forums.pimoroni.com/t/pico-2-w-problem-with-pimoroni-uf2/26638/1 "2024-11-26T19:06:24Z")

</div>

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.

```auto
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:

```auto
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:

```auto
>>> %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.

---

<div class="post-metadata">

### Author: ![ZodiusInfuser](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/zodiusinfuser/32/10546_2.png) [@ZodiusInfuser](https://forums.pimoroni.com/u/ZodiusInfuser)
#### Post date: [November 26, 2024, 7:22pm UTC](https://forums.pimoroni.com/t/pico-2-w-problem-with-pimoroni-uf2/26638/2 "2024-11-26T19:22:47Z")

</div>

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?

---

<div class="post-metadata">

### Author: ![gadgetoid](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/gadgetoid/32/13_2.png) [@gadgetoid](https://forums.pimoroni.com/u/gadgetoid)
#### Post date: [November 26, 2024, 7:43pm UTC](https://forums.pimoroni.com/t/pico-2-w-problem-with-pimoroni-uf2/26638/3 "2024-11-26T19:43:09Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![gadgetoid](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/gadgetoid/32/13_2.png) [@gadgetoid](https://forums.pimoroni.com/u/gadgetoid)
#### Post date: [November 26, 2024, 11:42pm UTC](https://forums.pimoroni.com/t/pico-2-w-problem-with-pimoroni-uf2/26638/5 "2024-11-26T23:42:17Z")

</div>

Okay I’m not totally sure there was anything wrong with our builds, but I’ve cut new ones anyway since they could use a tidyup. The firmware(s) are currently building now and should be available at [Release v0.0.11 - Pico 2 W Is Officially A Thing Now · pimoroni/pimoroni-pico-rp2350 · GitHub](https://github.com/pimoroni/pimoroni-pico-rp2350/releases/tag/v0.0.11) (which I’ll fix up and officially release in the morning)

For LED\_server you need to copy the connect.py to your board, from here: [gsw-micropython-on-raspberry-pi-pico-2e/eg/ch11/connect.py at main · raspberrypipress/gsw-micropython-on-raspberry-pi-pico-2e · GitHub](https://github.com/raspberrypipress/gsw-micropython-on-raspberry-pi-pico-2e/blob/main/eg/ch11/connect.py)

Worth trying the official unofficial Pico 2 W firmware to see if you fare any better, you can find that here: [https://downloads.raspberrypi.com/micropython/mp\_firmware\_unofficial\_latest.uf2](https://downloads.raspberrypi.com/micropython/mp_firmware_unofficial_latest.uf2)

… that filename tho, misery loves company!

---

<div class="post-metadata">

### Author: ![Tonygo2](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/tonygo2/32/7814_2.png) [@Tonygo2](https://forums.pimoroni.com/u/Tonygo2)
#### Post date: [November 27, 2024, 9:01am UTC](https://forums.pimoroni.com/t/pico-2-w-problem-with-pimoroni-uf2/26638/6 "2024-11-27T09:01:05Z")

</div>

[gadgetoid](https://forums.pimoroni.com/u/gadgetoid)Pimoroni Crew,  
Thank you the Requests program is now working. I will work through the other sample programs in the Guide.

---

<div class="post-metadata">

### Author: ![Tonygo2](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/tonygo2/32/7814_2.png) [@Tonygo2](https://forums.pimoroni.com/u/Tonygo2)
#### Post date: [November 27, 2024, 9:07am UTC](https://forums.pimoroni.com/t/pico-2-w-problem-with-pimoroni-uf2/26638/7 "2024-11-27T09:07:23Z")

</div>

Unfortunately, I still get the missing module error when I try LED.server.py

```auto
from connect import wlan
import socket
import machine

led_onboard = machine.Pin("LED", machine.Pin.OUT)
led_onboard.value(0)
led_state = "LED is off"

html = """
<!DOCTYPE html>
<html>
    <head> <title>Raspberry Pi Pico W</title> </head>
    <body> <h1>Raspberry Pi Pico W</h1>
        <p>%s</p>
    </body>
</html>
"""

address = socket.getaddrinfo("0.0.0.0", 80)[0][-1]
s = socket.socket()
s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
s.bind(address)
s.listen(1)
print("Listening for connections on", wlan.ifconfig()[0])

while True:
    try:
        client, address = s.accept()
        print("Connection accepted from", address)
        request = client.recv(1024).decode("UTF-8")
        print(request)

        led_on = request.startswith("GET /led/on")
        led_off = request.startswith("GET /led/off")
        print("led_on = " + str(led_on))
        print("led_off = " + str(led_off))

        if led_on:
            print("Client requested to turn the LED on.")
            led_onboard.value(1)
            led_state = "LED is on"

        if led_off:
            print("Client requested to turn the LED off.")
            led_onboard.value(0)
            led_state = "LED is off"

        response = html % led_state

        client.send("HTTP/1.0 200 OK\r\n")
        client.send("Content-type: text/html\r\n\r\n")
        client.send(response)
        client.close()

    except OSError as e:
        client.close()
        print("Error, connection closed.")

```

```auto
`>>> %Run -c $EDITOR_CONTENT

MPY: soft reboot
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: no module named 'connect'
>>> `

```

I get the same results using the ‘official’ UF2

---

<div class="post-metadata">

### Author: ![hel](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/hel/32/6075_2.png) [@hel](https://forums.pimoroni.com/u/hel)
#### Post date: [November 27, 2024, 11:21am UTC](https://forums.pimoroni.com/t/pico-2-w-problem-with-pimoroni-uf2/26638/8 "2024-11-27T11:21:30Z")

</div>

> [@gadgetoid](#):
>
> For LED\_server you need to copy the connect.py to your board, from here: [gsw-micropython-on-raspberry-pi-pico-2e/eg/ch11/connect.py at main · raspberrypipress/gsw-micropython-on-raspberry-pi-pico-2e · GitHub](https://github.com/raspberrypipress/gsw-micropython-on-raspberry-pi-pico-2e/blob/main/eg/ch11/connect.py)

@Tonygo2 Did you copy `connect.py` to your board?

---

<div class="post-metadata">

### Author: ![Tonygo2](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/tonygo2/32/7814_2.png) [@Tonygo2](https://forums.pimoroni.com/u/Tonygo2)
#### Post date: [November 27, 2024, 12:17pm UTC](https://forums.pimoroni.com/t/pico-2-w-problem-with-pimoroni-uf2/26638/9 "2024-11-27T12:17:47Z")

</div>

Thanks, that gets it to work. Did not notice the need to copy that to Pico 2W in the book instructions.

I’ve now had all the examples in the Official Guide 2nd Ed chapters 11 and 12 working as expected.

Thank you **gadgetoid**
