Great tutorial, thanks! Just a heads-up that there are a number of web serving libraries which could make the work easie...my favourite is microdot which is inspired by Flask and the decorators used to configure HTTP endpoints. Please keep the MicroPython videos coming! (I'll be mentioning this one at the Melbourne MicroPython Meetup tomorrow!)
Great starter video. I really appreciate the basic web server. Just the basics. Nice not having to learn Flask (or whatever) first. Read a pin from the board. Read input from the web. Change an output on the board. Write something out to a web page. That gets me started. Exactly what I needed. Feel I can take this and run with it. Thanks
Well well, now you just need to find a Pico W to buy. Chip Shortage sux :/ I mean, i was happy enough to get 2 Pico W's on release day, but i feel so bad for the people trying to get one atm ^^
I did a quick search on your videos and I did not see a video for a Pico W setup as a stand alone AP/WebServer. This video looks as if the Pico W will log into the home network and then the user will access the the Pico w through the home network. A stand alone Pico W could be a GREAT future video. Maybe even utilizing the Push button/LED project for that video also. Just a thought. Outstanding Video!
A good tutorial that gives a basic web interface for the Pico. Other videos I've watched cover Flask but in a full blown Python/Pi 3/4/zero context. It's good that you get to see results from code that you can follow along with. Will experiment with my Piicodev OLED, Atmospheric sensor, and Li-ion battery. Hopefully capture data to a CSV file and create a remote data logger.
I don't know where you live, but if shipping isn't too expensive, just order some from Germany. All other Raspberry boards are completely sold out, but there seems to be more than enough of the Pico and Pico W left. I bought 4 Pico and 4 Pico W myself yesterday, so I can assure you that you will get some here.
@@GermanBluntSmoker Thanks for the advice, I live in Japan, few days ago I tried from UK but i was rejected because of the address, I bought from aliexpress I hope it arrives and works well.
I'm trying to connect the raspberry pi Pico W with wifi and successful, but when i copy paste the ip address to browse it's not opening. I tried many times but failed. Can you help me to figure out the fault ? I've also a stable internet connection.
That was a really useful tutorial! Would you consider doing a tutorial on combining a Pico w web server with a BME280? I've been programming in C for years, and I am now starting to learn python, and I think a project like that would be good one to learn how to remotely read sensors.
Check out the HomeStation project by Liam on our forums! His example presents a live dashboard using a BME280. forum.core-electronics.com.au/t/homestation-a-pico-w-powered-webpage-dashboard/14900
Very informative and amazing video. I tried the same using my Rpi zero W but ran into machine ModuleNotFound error. Could you suggest any corrections for this? Thank you
This will only work for a Pico W Microcontroller, not Raspberry Pi's single board computers. We don't have a guide on it unfortunately (thats a good idea though), but you can find others along the lines of "Rpi Zero W host HTTP Server"
Thanks that is a really cool started project. Can you also make a video on micropython vs circuitPython. I'm new to this and it's all very confusing. Appreciate the efforts.❤
I'm a little confused about what you are looking for, this method should work even if your local wireless network doesn't have internet. If you don't want to use an existing wireless network, we have a tutorial on how to make the pico serve a webpage over its own network that it hosts! core-electronics.com.au/courses/raspberry-pi-pico-workshop/#5.3-hosting-a-wi-fi-access-pint-and-web-page
@@Core-Electronics Thanks for the response, I'll have a read through. I think that's what I was looking for. Something really simple, (like a wifi hard-drive) but where you can just link to the wifi coming from the Pi and it takes you to a webpage and lets you access the content (as web pages). Be great for workshops in the middle of nowhere, or camp sites or could provide info in isolated places.
Yes! The best way to get technical help for any of our content is on the forums: forum.core-electronics.com.au/ We're full-time makers and are on the forums every working day!
Thanks! This was a great tutorial for my first Pico W project. I took an additional step and set up port forwarding on my router to allow access from a public IP address using a specific port. That worked great, until I had different users try it from different locations and some had trouble connecting until I reboot the pico. Maybe it gets stuck on a connection session with the first person to connect? Could this be solved if we end the connection with the logged in user after X minutes of inactivity so that the server is waiting for a new connection without a reboot? I'm new to python - any suggestions are welcome.
Thanks for this, I find your presentation well paced and easy to follow. I am trying to re-program a garden watering system to include a wifi connection. All the examples of Pico W web servers I've found involve an infinite loop for the server. What I need is code running the watering system to run with the server in the background. The server traffic will be minimal.. just me on the LAN occasionally. I'm not sure if I should try to use uasyncio or just run through the server code every few cycles to see if there is incoming requests. Any advice?
The best way to get technical help for any of our content is on the forums: forum.core-electronics.com.au/ We're full-time makers and are on the forums every working day!
The RP2040 has two independent cores. You can run the server on an infinite loop, and have the other core handling I/O, along with the help of the 4 independent PIO cores, if required. A very powerful little chip.
Thank you. I am trying to run example code for Arduino nano rp2040 connect but I am seeing error 'OSError: [Errno 1] EPERM' for the line 'wlan.connect(ssid, password)'
This video brings another thought/question. I'm currently using a Rpi0W as a control server for my Rigol DM3058e, thanks to your video on making the Rigol stuff talk to each other. I have the PSU and the DSO on LAN but the DMM only has USB-B. The Rpi0w is really a waste of resources for running simple webserver for control/datalogging. I'm wondering if a Pico with a webserver would handle that small function. Only tricky part is the USB connection.... Can it be done?
Outstanding video, Thanks! Is It possible to read sensor within a wifi direct connection ? For example, reading over Wi-Fi Direct between a smartphone app and a Pico ?
Great video as always from Core Electronics. I am trying to implement a pico w with an LDR sensor that logs time and date to a CSV file when my central heating comes on and goes off. I have all that aspect of the project working just great but I want to be able to download the CSV file from the pico via a link on a web page. I am very close but I am unable to download the file, any file, and I cant find out why or how to do it. It seems like it should be such an easy thing to do. All the examples of webserver functionality seem to focus on LED manipulation. Who needs to turn on an LED over the internet? I would really appreciate any help or info on how I can achieve file downloads over my LAN. Thanks in advance.
👏👏 Great tutorial, Michael, thanks a lot for this! I need to open a file in OneDrive and save/read some log data (e.g. temperature) there with my Pico W. Any hints how can I do it??? Greetings from Brazil!!!
I think this is way too much to handle for the Pico, you might need a Raspberry Pi 3 or 4 (or any SBC for that matter), not a microcontroller for this, as you need to handle authentication and file upload
Even 10, but this about the pi pico. Here to you can run multiple processed as it has 2 cores, or you can use uasync library for cooperative sharing of a single core. There are also 8 state machines, but those are a bit trickier to program. It's a really powerful little device
Would I be able to use a Raspberry Pi Pico W as a Backup DNS Server to keep my Internet Online if my Raspberry Pi 4 goes Offline? My problem is my Router makes me put in two DNS Addresses so I set them both as the PiHole DNS Addresses I've tried setting the Secondary DNS as Google's DNS but if I do that and turn off my Raspberry Pi 4 it doesn't allow me to connect to the Internet unless I turn the Raspberry Pi 4 back on and with the Prices of Raspberry Pi 4 and even the Raspberry Pi 3 right now I don't really want to spend that amount of money on another one right now if I don't have to?
This is a necessary constraint of PiHole - blocked queries *need* to fail. It's worth a shot! sounds like an interesting project. The trouble will be keeping the DNS tables synchronised between devices.
I'm having trouble connecting the Raspberry pi pico W to an open wi-fi from a hotel lobby, is this because of security measures or should I just try this at home instead?
@@Core-Electronics Question on the Hardware test, how is the pin 15 and pin 16 complete the circuit if none of them have an LED light on there or has nothing of ground in it at least that is what the paper the pico W basic set brought) led = Pin(15, Pin.OUT) button = Pin(16, Pin.IN, Pin.PULL_UP) I've been trying to figure that out for 1 hour or so, but I can't seem to find the logic in it (I've followed the video and it works I just want to understand it better)
I realized that if you put these pin numbers in here: led = Pin(16, Pin.OUT) button = Pin(15, Pin.IN, Pin.PULL_UP) the light gets dimmer, as if the voltage coming from over there is too low and that makes it reach less to the LED light. don't know if that's true but I'm still figuring things out. Thanks in Advanced
>>> %Run -c $EDITOR_CONTENT MPY: soft reboot waiting for connection... Traceback (most recent call last): File "", line 42, in RuntimeError: network connection failed >>> But my rpi is pico w
Hi Mike, Pi Hole is an application that is designed for Linux based systems, so it won't run on a Pico W as it is only a Microcontroller and not a complete computer. It may be possible to create an ad blocker that runs on a Pico W but we seriously doubt its efficacy when compared to a Raspberry Pi running Pi Hole. Thanks for the question 🙂
haha you're blurring your local ip address, let me guess, the address starts with 192.168.0. no need to hide that. nobody will be able to access that unless you specifically allow someone on your local network, afterwhich it is already to late I'm afraid
I set my ROUTER to always give each PICO a STATIC IP ADDRESS, and still got the 'address in use error". So I put wlan.disconnect() # release the current IP# time.sleep(3) # time for router to react right after the line "wlan.active(True)". I almost never get that error now.
Glad that's your only complaint for this tutorial - I guess the rest was pretty clear then 😀 There's a lot more going on in an enterprise network than your average household network. We don't want to reveal any information about the network structure.
@@Core-Electronics So why did you even leave the "192" in the first place? It would have made more sense if you censored your whole IP, right? Also, I don't think revealing a single *local* IP address could do any harm or give something away about your network, except the address range (which you already pretty much revealed).
dang u censored Local address how am i supposed to hack u now. 😂😂😂
He had to be %1000000 sure
Great tutorial, thanks! Just a heads-up that there are a number of web serving libraries which could make the work easie...my favourite is microdot which is inspired by Flask and the decorators used to configure HTTP endpoints. Please keep the MicroPython videos coming! (I'll be mentioning this one at the Melbourne MicroPython Meetup tomorrow!)
Great starter video. I really appreciate the basic web server. Just the basics. Nice not having to learn Flask (or whatever) first. Read a pin from the board. Read input from the web. Change an output on the board. Write something out to a web page. That gets me started. Exactly what I needed. Feel I can take this and run with it. Thanks
Glad this helped, thanks for watching.
N'étant pas un fervent de la langue de shakespeare, je m'en suis sorti très correctement et merci pour cette vidéo très explicite. Bravo et merci.
Thank you. Keep em coming. Love the pico w. There should be more of them in a few weeks.
Well well, now you just need to find a Pico W to buy. Chip Shortage sux :/ I mean, i was happy enough to get 2 Pico W's on release day, but i feel so bad for the people trying to get one atm ^^
Thank you for the great tutorial. If it were a little closer, I would thank you personally. Greetings from Poland
This looks super useful. I will definitely mess around with this using my Pico. The clicking the buttons seems particularly useful
Just brilliant! This helps makers use MicroPython in powerful new ways. Thank you for this so much!
You're very welcome!
I did a quick search on your videos and I did not see a video for a Pico W setup as a stand alone AP/WebServer. This video looks as if the Pico W will log into the home network and then the user will access the the Pico w through the home network. A stand alone Pico W could be a GREAT future video. Maybe even utilizing the Push button/LED project for that video also. Just a thought. Outstanding Video!
What a timely comment, we may be working on that exact video right now...
@@Core-Electronics
Please, do you have a vide on this now?
Thank you, your guides are wonderfully clear and concise. I appreciate them so much.
Glad we can get people making! :)
A good tutorial that gives a basic web interface for the Pico. Other videos I've watched cover Flask but in a full blown Python/Pi 3/4/zero context. It's good that you get to see results from code that you can follow along with. Will experiment with my Piicodev OLED, Atmospheric sensor, and Li-ion battery. Hopefully capture data to a CSV file and create a remote data logger.
Good, tank's very much Master..
Amazing, really good tutorial, I want to have that board do practice and play, unlikely are sold out for now.
I don't know where you live, but if shipping isn't too expensive, just order some from Germany. All other Raspberry boards are completely sold out, but there seems to be more than enough of the Pico and Pico W left. I bought 4 Pico and 4 Pico W myself yesterday, so I can assure you that you will get some here.
@@GermanBluntSmoker Thanks for the advice, I live in Japan, few days ago I tried from UK but i was rejected because of the address, I bought from aliexpress I hope it arrives and works well.
Hi, great video. What do I have to change if I want the website to be addressable from different wifis?
I'm trying to connect the raspberry pi Pico W with wifi and successful, but when i copy paste the ip address to browse it's not opening. I tried many times but failed.
Can you help me to figure out the fault ?
I've also a stable internet connection.
This tutorial really helped me
appreciate the walkthrough. Felt like I was getting some questionable vibes at the beginning tho XD
Can't have you peeping our local IP address #haxxor 😎
That was a really useful tutorial! Would you consider doing a tutorial on combining a Pico w web server with a BME280? I've been programming in C for years, and I am now starting to learn python, and I think a project like that would be good one to learn how to remotely read sensors.
Check out the HomeStation project by Liam on our forums! His example presents a live dashboard using a BME280.
forum.core-electronics.com.au/t/homestation-a-pico-w-powered-webpage-dashboard/14900
@@Core-Electronics Thanks for the link, that project is just what I am looking for.
Fantastic video & resources. Will be a huge benefit to my students. Much much appreciated!
Great to hear!
Very informative and amazing video. I tried the same using my Rpi zero W but ran into machine ModuleNotFound error. Could you suggest any corrections for this? Thank you
This will only work for a Pico W Microcontroller, not Raspberry Pi's single board computers. We don't have a guide on it unfortunately (thats a good idea though), but you can find others along the lines of "Rpi Zero W host HTTP Server"
I really dig your channel. Thanks for all the cool projects.
Appreciate ya! 🙏
Thanks that is a really cool started project. Can you also make a video on micropython vs circuitPython. I'm new to this and it's all very confusing. Appreciate the efforts.❤
Great video! I got mine working.
Interesting stuff, are there any projects about setting up a stand-alone webserver to serve webpages (without being connected to the Internet)
I'm a little confused about what you are looking for, this method should work even if your local wireless network doesn't have internet. If you don't want to use an existing wireless network, we have a tutorial on how to make the pico serve a webpage over its own network that it hosts!
core-electronics.com.au/courses/raspberry-pi-pico-workshop/#5.3-hosting-a-wi-fi-access-pint-and-web-page
@@Core-Electronics Thanks for the response, I'll have a read through. I think that's what I was looking for. Something really simple, (like a wifi hard-drive) but where you can just link to the wifi coming from the Pi and it takes you to a webpage and lets you access the content (as web pages). Be great for workshops in the middle of nowhere, or camp sites or could provide info in isolated places.
That works. Be better as a webhost though.
Thank you for the video.
What can I do to acces the html page anywhere? Instead of localhost
Is it possible to control a servo motor through a web server as well using the raspberry pi Pico w?
Yes! The best way to get technical help for any of our content is on the forums: forum.core-electronics.com.au/
We're full-time makers and are on the forums every working day!
and add a sd-card reader for extra file storage ...
Thanks! This was a great tutorial for my first Pico W project. I took an additional step and set up port forwarding on my router to allow access from a public IP address using a specific port. That worked great, until I had different users try it from different locations and some had trouble connecting until I reboot the pico. Maybe it gets stuck on a connection session with the first person to connect? Could this be solved if we end the connection with the logged in user after X minutes of inactivity so that the server is waiting for a new connection without a reboot? I'm new to python - any suggestions are welcome.
Thanks for this, I find your presentation well paced and easy to follow. I am trying to re-program a garden watering system to include a wifi connection. All the examples of Pico W web servers I've found involve an infinite loop for the server. What I need is code running the watering system to run with the server in the background. The server traffic will be minimal.. just me on the LAN occasionally. I'm not sure if I should try to use uasyncio or just run through the server code every few cycles to see if there is incoming requests. Any advice?
The best way to get technical help for any of our content is on the forums: forum.core-electronics.com.au/
We're full-time makers and are on the forums every working day!
The RP2040 has two independent cores.
You can run the server on an infinite loop, and have the other core handling I/O, along with the help of the 4 independent PIO cores, if required.
A very powerful little chip.
Thank you. I am trying to run example code for Arduino nano rp2040 connect but I am seeing error 'OSError: [Errno 1] EPERM' for the line 'wlan.connect(ssid, password)'
This video brings another thought/question. I'm currently using a Rpi0W as a control server for my Rigol DM3058e, thanks to your video on making the Rigol stuff talk to each other. I have the PSU and the DSO on LAN but the DMM only has USB-B. The Rpi0w is really a waste of resources for running simple webserver for control/datalogging. I'm wondering if a Pico with a webserver would handle that small function. Only tricky part is the USB connection.... Can it be done?
I’m nitpicking little bit here, but query in GET should not change state. It is supposed to be idempotent.
To change state, use POST.
Nice demo anyway
Outstanding video, Thanks! Is It possible to read sensor within a wifi direct connection ? For example, reading over Wi-Fi Direct between a smartphone app and a Pico ?
could you do that? i want to do the same thing
Great video as always from Core Electronics. I am trying to implement a pico w with an LDR sensor that logs time and date to a CSV file when my central heating comes on and goes off. I have all that aspect of the project working just great but I want to be able to download the CSV file from the pico via a link on a web page. I am very close but I am unable to download the file, any file, and I cant find out why or how to do it. It seems like it should be such an easy thing to do. All the examples of webserver functionality seem to focus on LED manipulation. Who needs to turn on an LED over the internet? I would really appreciate any help or info on how I can achieve file downloads over my LAN. Thanks in advance.
Great. I have a question, How do you manage multiple pico w with the same feature on mobile phone/web-app?
You would give each its own IP address
👏👏
Great tutorial, Michael, thanks a lot for this!
I need to open a file in OneDrive and save/read some log data (e.g. temperature) there with my Pico W.
Any hints how can I do it???
Greetings from Brazil!!!
I think this is way too much to handle for the Pico, you might need a Raspberry Pi 3 or 4 (or any SBC for that matter), not a microcontroller for this, as you need to handle authentication and file upload
how do you upload a separate html file and reference it instead
sir, On the Raspberry Pi 4 model, is it possible to run two programmes at the same time?
Even 10, but this about the pi pico. Here to you can run multiple processed as it has 2 cores, or you can use uasync library for cooperative sharing of a single core. There are also 8 state machines, but those are a bit trickier to program. It's a really powerful little device
I have the problem that fail massage is always present and I can power the pico how often I like new but it never solve the Issue.
Does it work even if the pc is turned off?
Would I be able to use a Raspberry Pi Pico W as a Backup DNS Server to keep my Internet Online if my Raspberry Pi 4 goes Offline? My problem is my Router makes me put in two DNS Addresses so I set them both as the PiHole DNS Addresses I've tried setting the Secondary DNS as Google's DNS but if I do that and turn off my Raspberry Pi 4 it doesn't allow me to connect to the Internet unless I turn the Raspberry Pi 4 back on and with the Prices of Raspberry Pi 4 and even the Raspberry Pi 3 right now I don't really want to spend that amount of money on another one right now if I don't have to?
This is a necessary constraint of PiHole - blocked queries *need* to fail. It's worth a shot! sounds like an interesting project. The trouble will be keeping the DNS tables synchronised between devices.
Hi when I try to import network in thonny I get an import error in circuit python please help
How can i adjust the code, so i can simply only show a website without buttons, leds or anything else
Change the HTML?
For some reason it said trace back modulenotfounderror: no modula name ‘network’
Why is this happening
Why is from machine import ptin not working?
I'm having trouble connecting the Raspberry pi pico W to an open wi-fi from a hotel lobby, is this because of security measures or should I just try this at home instead?
I'd try again at home on your own network. Public networks don't allow connections between local users.
@@Core-Electronics Holy crap it worked! thank you for this tutorial!
@@Core-Electronics Question on the Hardware test, how is the pin 15 and pin 16 complete the circuit if none of them have an LED light on there or has nothing of ground in it at least that is what the paper the pico W basic set brought)
led = Pin(15, Pin.OUT)
button = Pin(16, Pin.IN, Pin.PULL_UP)
I've been trying to figure that out for 1 hour or so, but I can't seem to find the logic in it
(I've followed the video and it works I just want to understand it better)
I realized that if you put these pin numbers in here:
led = Pin(16, Pin.OUT)
button = Pin(15, Pin.IN, Pin.PULL_UP)
the light gets dimmer, as if the voltage coming from over there is too low and that makes it reach less to the LED light. don't know if that's true but I'm still figuring things out. Thanks in Advanced
>>> %Run -c $EDITOR_CONTENT
MPY: soft reboot
waiting for connection...
Traceback (most recent call last):
File "", line 42, in
RuntimeError: network connection failed
>>>
But my rpi is pico w
Question to the author can i run pi hole on the new raspebbry pico w
Hi Mike, Pi Hole is an application that is designed for Linux based systems, so it won't run on a Pico W as it is only a Microcontroller and not a complete computer. It may be possible to create an ad blocker that runs on a Pico W but we seriously doubt its efficacy when compared to a Raspberry Pi running Pi Hole. Thanks for the question 🙂
Man, you didn't even censor the fact that your local network uses IP! I might have assumed you were operating on AppleTalk.
Is this server safe and secure?
Nope
No one can do this with arduino ide and c++ all write to slow python where word going
you forgot to blur your local ip address at 8:23
so you dont have to edit as much, you dont have to blur out your local ip. 192.168.x.x or 10.0.x.x
Enterprise network! Can't be too revealing 😉
These
bro really censored a private ip
This man censoring his local ip
haha you're blurring your local ip address, let me guess, the address starts with 192.168.0. no need to hide that. nobody will be able to access that unless you specifically allow someone on your local network, afterwhich it is already to late I'm afraid
I set my ROUTER to always give each PICO a STATIC IP ADDRESS, and still got the 'address in use error". So I put
wlan.disconnect() # release the current IP#
time.sleep(3) # time for router to react
right after the line "wlan.active(True)". I almost never get that error now.
WHY would you hide a local address?
Can't be too careful! Even a local IP exposes *some* information about internal network structure. It seems to provoke lots of engagement too 😅
Dude, I can't take someone who censors his LOCAL IP seriously.
Glad that's your only complaint for this tutorial - I guess the rest was pretty clear then 😀
There's a lot more going on in an enterprise network than your average household network. We don't want to reveal any information about the network structure.
@@Core-Electronics So why did you even leave the "192" in the first place? It would have made more sense if you censored your whole IP, right? Also, I don't think revealing a single *local* IP address could do any harm or give something away about your network, except the address range (which you already pretty much revealed).