Guide by Michael; Raspberry Pi Pico W | Connecting to the Internet

Hi Dave,

The Pico W external pinout is the same so all of your existing projects should work the same!
Great idea for a Pico W card though!

I’d check out the guide on the differences between the two: Raspberry Pi Pico W vs. Pico | What's the difference? - Tutorial Australia

PS: Other than wireless there isnt too much of a difference! The main one is the onboard LED pin (From 25, to 'LED'
Liam

2 Likes

I’ve tried a few projects with pico w, and all work great when the pico wis plugged in to my laptop. Connect it to a battery or remote power source such as a wall socket or usb hub, and it fails to connect to my wifi.

Any hints?

2 Likes

Hi David,

Were you saving the file as main.py? That specific filename is required to run automatically.

1 Like

Hi Liam

yep saved as main.py. The program itself runs, its a little pomordoro setup with googly eyes that blink randomly and a timer that can be set to say 20 mins. I am running it on the pico w with a pimoroni screen. The actual pomordoro program looks for wifi, should connect and then searches for local time and then displays the eyes, a clock and then a countdown timer that you set by pressing one of the buttons on the screen. When connected through Thonny using main.py it all works. WHen connected to the battery everything comes up but it does not connect to the wifi and so the local time is not recovered from the web and the clock starts at midnight.

I will have a play around with the code to try and get the pico to keep looking to connect to the wifi until it connects, maybe add a delay to the other parts of the program until it connects to wifi. Just a noob to micorpython.

1 Like

Hi David,

Welcome to the forum!!

Sounds like an awesome project! Would it be possible to send through your code? We can take a look and offer some recommendations to get it working automatically :smiley:

Liam

Hi Michael,
Thanks for the great example on the Pico2W…

The “http://date.jsontest.com” link appears broken, but you can get another that does the same thing from Time API, just follow the instructions on the site and make sure you prefix the IANA timezone name in front of your city, e.g. Australia/Perth. The site will generate a HTML string you’ll need to replace the original with, cut and paste into the code and it should be done. If other folks here want to see the date string you explained at the end, just add the lines.

print(‘\r’)
print(r.json()[‘date’])

2 Likes

Hi Malcolm,

Thanks for the heads up with that, I’ve just tested it with what was previously known good code and it appears there’s some sort of connection issue with http://date.jsontest.com/, it may just be a temporary issue that will resolve itself in the future but for the moment your suggestion looks to be great!

1 Like