Raspberry Pi Pico W WIFI Tutorial not working

I tried to follow the Raspberry pi Pico W WIFI tutorial (https://www.youtube.com/watch?v=GiT3MzRzG48)
and on the first programme I ran I got this error

Traceback (most recent call last):
File “”, line 22, in
File “requests/init.py”, line 205, in get
File “requests/init.py”, line 81, in request
OSError: -2

How can I fix it?

William, you’ll need to post your code.

1 Like

It is the first script that the video says to run(Raspberry Pi Pico W | Connecting to the Internet - Tutorial Australia)

Are you sure that the username and password that you added in lines 14 and 15 in that script are correct, and that your LAN has a working connection to the Internet?

1 Like

I’m sure because I’ve used it to to connect to my WiFi before.

Hi @William296703

If the credentials for your WiFi are correct the next thing to look at is whether it is a 5GHz or 2.4GHz network.

The Pico is only capable of connecting to a 2.4GHz network, and will not be able to “see” a 5GHz network.

1 Like

What about the connection to the internet - have you confirmed that is also working? (The line that errors is trying to connect to “http://www.google.com”) .

1 Like

I can confirm that the WiFi is 2.4 GHz because I have two Wi-Fi networks and each has the GHz frequency in the name

Hey @William296703

From the original guide, there appears to be someone else who was getting a similar issue to you, in their case they had quotation marks around the SSID and password, if you also have that it would be the reason its causing issues.

1 Like

Hey @William296703,

We also have a newer guide if you want to check that out. It is a bit more up to date and in the following videos we do some extra wireless stuff like hosting a webpage on the Pico itself!

Let us know how it goes.

2 Likes

Thanks it works better than expected :+1:

1 Like