How To Setup a HTTP Web Server With Raspberry Pi Pico W (using WiFi)
The full guide: https://core-electronics.com.au/guides/raspberry-pi-pico-w-create-a-simple-http-server/
Now that we can connect our Raspberry Pi Pico to the internet, it’s time to control something! This guide will cover setting up a server to host a simple page on your network. We’ll use this page to control some hardware attached to our Pico W – drive an LED and read the status of a button. Once we master these inputs and outputs, the sky is the limit!
For products featured in this guide:
• Raspberry Pi Pico W: https://core-electronics.com.au/raspberry-pi-pico-w-wireless-wifi.html
• Raspberry Pi Pico: https://core-electronics.com.au/raspberry-pi/pico.html
If you have any questions about this content or want to share a project you’re working on head over to our maker forum http://coreelec.io/forum
Core Electronics is located in the heart of Newcastle, Australia. We’re powered by makers, for makers. Drop by if you are looking for:
• Raspberry Pi https://core-electronics.com.au/raspberry-pi.html
• Arduino https://core-electronics.com.au/arduino.html
• Sparkfun https://core-electronics.com.au/brands/sparkfun-australia
• Adafruit https://core-electronics.com.au/brands/adafruit-australia
• Pololu https://core-electronics.com.au/brands/pololu-australia
• DFRobot https://core-electronics.com.au/brands/dfrobot-australia
The following trademarks are owned by Core Electronics Pty Ltd:
“Core Electronics” and the Core Electronics logo
“Makerverse” and the Makerverse logo
“PiicoDev” and the PiicoDev logo
“GlowBit” and the GlowBit logo
by Core Electronics
linux http server
Thank you for the video.
What can I do to acces the html page anywhere? Instead of localhost
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.
you forgot to blur your local ip address at 8:23
Hi when I try to import network in thonny I get an import error in circuit python please help
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.
>>> %Run -c $EDITOR_CONTENT
MPY: soft reboot
waiting for connection…
Traceback (most recent call last):
File "<stdin>", line 42, in <module>
RuntimeError: network connection failed
>>>
But my rpi is pico w
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 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.
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.
I really dig your channel. Thanks for all the cool projects.
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
Great. I have a question, How do you manage multiple pico w with the same feature on mobile phone/web-app?
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)'
Good, tank's very much Master..
Great video! I got mine working.
For some reason it said trace back modulenotfounderror: no modula name ‘network’
Why is this happening
Man, you didn't even censor the fact that your local network uses IP! I might have assumed you were operating on AppleTalk.
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 ?
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?
Amazing, really good tutorial, I want to have that board do practice and play, unlikely are sold out for now.
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?
Is this server safe and secure?
Dude, I can't take someone who censors his LOCAL IP seriously.
Thank you for the great tutorial. If it were a little closer, I would thank you personally. Greetings from Poland
How can i adjust the code, so i can simply only show a website without buttons, leds or anything else
sir, On the Raspberry Pi 4 model, is it possible to run two programmes at the same time?
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
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?