Тёмный
No video :(

How To Setup a HTTP Web Server With Raspberry Pi Pico W (using WiFi) 

Core Electronics
Подписаться 122 тыс.
Просмотров 70 тыс.
50% 1

The full guide: core-electroni...
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: core-electroni...
• Raspberry Pi Pico: core-electroni...
If you have any questions about this content or want to share a project you're working on head over to our maker forum 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 core-electroni...
• Arduino core-electroni...
• Sparkfun core-electroni...
• Adafruit core-electroni...
• Pololu core-electroni...
• DFRobot core-electroni...
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

Опубликовано:

 

14 авг 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 98   
@gamerneversleep4200
@gamerneversleep4200 2 года назад
dang u censored Local address how am i supposed to hack u now. 😂😂😂
@wifinesesi
@wifinesesi Год назад
He had to be %1000000 sure
@Gribouille28210
@Gribouille28210 Год назад
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.
@davidwhite633
@davidwhite633 Год назад
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
@Core-Electronics
@Core-Electronics Год назад
Glad this helped, thanks for watching.
@Alpha_fitz
@Alpha_fitz 2 года назад
Thank you. Keep em coming. Love the pico w. There should be more of them in a few weeks.
@mattytrentini
@mattytrentini 2 года назад
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!)
@darekkrawczyk8745
@darekkrawczyk8745 Год назад
Thank you for the great tutorial. If it were a little closer, I would thank you personally. Greetings from Poland
@L2.Lagrange
@L2.Lagrange 3 месяца назад
This looks super useful. I will definitely mess around with this using my Pico. The clicking the buttons seems particularly useful
@jeffschroeder4805
@jeffschroeder4805 4 месяца назад
Thank you, your guides are wonderfully clear and concise. I appreciate them so much.
@Core-Electronics
@Core-Electronics 4 месяца назад
Glad we can get people making! :)
@mytechnotalent
@mytechnotalent 2 года назад
Just brilliant! This helps makers use MicroPython in powerful new ways. Thank you for this so much!
@Core-Electronics
@Core-Electronics 2 года назад
You're very welcome!
@donaldhoudek2889
@donaldhoudek2889 3 месяца назад
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!
@Core-Electronics
@Core-Electronics 3 месяца назад
What a timely comment, we may be working on that exact video right now...
@olofintiladavid3479
@olofintiladavid3479 Месяц назад
@@Core-Electronics Please, do you have a vide on this now?
@SirSurreal
@SirSurreal 10 месяцев назад
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.
@Taki7o7
@Taki7o7 2 года назад
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 ^^
@DanielMurrayMakes
@DanielMurrayMakes Год назад
Fantastic video & resources. Will be a huge benefit to my students. Much much appreciated!
@Core-Electronics
@Core-Electronics Год назад
Great to hear!
@FranciscoJavier32423
@FranciscoJavier32423 Год назад
Amazing, really good tutorial, I want to have that board do practice and play, unlikely are sold out for now.
@GermanBluntSmoker
@GermanBluntSmoker Год назад
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.
@FranciscoJavier32423
@FranciscoJavier32423 Год назад
@@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.
@fredmunyao787
@fredmunyao787 5 месяцев назад
This tutorial really helped me
@dabunnisher29
@dabunnisher29 Год назад
I really dig your channel. Thanks for all the cool projects.
@Core-Electronics
@Core-Electronics Год назад
Appreciate ya! 🙏
@Wawan_Setiaw4n_Robotik
@Wawan_Setiaw4n_Robotik Год назад
Good, tank's very much Master..
@rupadarshisamanta3288
@rupadarshisamanta3288 7 месяцев назад
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.
@laynemccormic9102
@laynemccormic9102 Год назад
appreciate the walkthrough. Felt like I was getting some questionable vibes at the beginning tho XD
@Core-Electronics
@Core-Electronics Год назад
Can't have you peeping our local IP address #haxxor 😎
@ferdifefe3160
@ferdifefe3160 4 месяца назад
Hi, great video. What do I have to change if I want the website to be addressable from different wifis?
@itwaslikethatwhenigothere
@itwaslikethatwhenigothere Год назад
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.
@Core-Electronics
@Core-Electronics Год назад
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
@itwaslikethatwhenigothere
@itwaslikethatwhenigothere Год назад
@@Core-Electronics Thanks for the link, that project is just what I am looking for.
@MohitKhare
@MohitKhare 11 месяцев назад
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.❤
@fatehmd8321
@fatehmd8321 Год назад
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)'
@Amihuman-ey7ne
@Amihuman-ey7ne 2 месяца назад
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
@Core-Electronics
@Core-Electronics 2 месяца назад
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"
@user-cj4jm1fx6b
@user-cj4jm1fx6b Год назад
Great video! I got mine working.
@lloydsshednanigans
@lloydsshednanigans Год назад
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?
@juniorngomajose9454
@juniorngomajose9454 8 месяцев назад
Thank you for the video. What can I do to acces the html page anywhere? Instead of localhost
@wasdaletimelapse7658
@wasdaletimelapse7658 8 месяцев назад
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.
@britishtechguru
@britishtechguru Год назад
That works. Be better as a webhost though.
@tommypham916
@tommypham916 Год назад
Is it possible to control a servo motor through a web server as well using the raspberry pi Pico w?
@Core-Electronics
@Core-Electronics Год назад
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!
@eezees9306
@eezees9306 Год назад
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?
@Core-Electronics
@Core-Electronics Год назад
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!
@MichaelKingsfordGray
@MichaelKingsfordGray Год назад
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.
@BambooInc
@BambooInc Год назад
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.
@Michael-pw1gc
@Michael-pw1gc Год назад
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.
@jyvben1520
@jyvben1520 2 года назад
and add a sd-card reader for extra file storage ...
@luke752010
@luke752010 Год назад
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 ?
@pedrobalduci7754
@pedrobalduci7754 Год назад
could you do that? i want to do the same thing
@TheCeredigion
@TheCeredigion Месяц назад
Interesting stuff, are there any projects about setting up a stand-alone webserver to serve webpages (without being connected to the Internet)
@Core-Electronics
@Core-Electronics Месяц назад
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
@TheCeredigion
@TheCeredigion Месяц назад
@@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.
@thespacecowboy420
@thespacecowboy420 8 месяцев назад
how do you upload a separate html file and reference it instead
@geraldojosegardinalli1305
@geraldojosegardinalli1305 Год назад
👏👏 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!!!
@codyrap95
@codyrap95 Год назад
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
@PreshithaMediaLive
@PreshithaMediaLive 10 месяцев назад
>>> %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
@loganphan2043
@loganphan2043 Год назад
Great. I have a question, How do you manage multiple pico w with the same feature on mobile phone/web-app?
@Jo-re2ye
@Jo-re2ye 16 дней назад
You would give each its own IP address
@JoshF151Tech
@JoshF151Tech Год назад
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?
@Core-Electronics
@Core-Electronics Год назад
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.
@sivaasapu4580
@sivaasapu4580 Год назад
sir, On the Raspberry Pi 4 model, is it possible to run two programmes at the same time?
@Jo-re2ye
@Jo-re2ye 16 дней назад
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
@viliamholub509
@viliamholub509 2 года назад
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
@guythegeek
@guythegeek 10 месяцев назад
Hi when I try to import network in thonny I get an import error in circuit python please help
@cheze_bun
@cheze_bun Год назад
For some reason it said trace back modulenotfounderror: no modula name ‘network’ Why is this happening
@엄브릿지
@엄브릿지 6 месяцев назад
Does it work even if the pc is turned off?
@user-lj3ky8xk1d
@user-lj3ky8xk1d 6 месяцев назад
how to change ssid and password of pico w after enable wifi
@truthhurts1459
@truthhurts1459 Год назад
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.
@edwinrivera5128
@edwinrivera5128 Год назад
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
@Core-Electronics Год назад
I'd try again at home on your own network. Public networks don't allow connections between local users.
@edwinrivera5128
@edwinrivera5128 Год назад
@@Core-Electronics Holy crap it worked! thank you for this tutorial!
@edwinrivera5128
@edwinrivera5128 Год назад
@@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)
@edwinrivera5128
@edwinrivera5128 Год назад
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
@gandalfsVater
@gandalfsVater Год назад
How can i adjust the code, so i can simply only show a website without buttons, leds or anything else
@Jo-re2ye
@Jo-re2ye 16 дней назад
Change the HTML?
@yesultimate1225
@yesultimate1225 8 месяцев назад
Why is from machine import ptin not working?
@mikehadzhiev4152
@mikehadzhiev4152 Год назад
Question to the author can i run pi hole on the new raspebbry pico w
@Core-Electronics
@Core-Electronics Год назад
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 🙂
@Bobo-ox7fj
@Bobo-ox7fj Год назад
Man, you didn't even censor the fact that your local network uses IP! I might have assumed you were operating on AppleTalk.
@alex-ku9yt
@alex-ku9yt 7 месяцев назад
No one can do this with arduino ide and c++ all write to slow python where word going
@mitcore
@mitcore 9 месяцев назад
you forgot to blur your local ip address at 8:23
@acermf7983
@acermf7983 Год назад
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
@Core-Electronics
@Core-Electronics Год назад
Enterprise network! Can't be too revealing 😉
@joetimbersock7639
@joetimbersock7639 Год назад
Is this server safe and secure?
@Jo-re2ye
@Jo-re2ye 16 дней назад
Nope
@splatink
@splatink 5 месяцев назад
bro really censored a private ip
@alex-ku9yt
@alex-ku9yt 7 месяцев назад
These
@Henrix1998
@Henrix1998 Год назад
This man censoring his local ip
@sambeard4428
@sambeard4428 7 месяцев назад
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
@VoeViking
@VoeViking Год назад
WHY would you hide a local address?
@Core-Electronics
@Core-Electronics Год назад
Can't be too careful! Even a local IP exposes *some* information about internal network structure. It seems to provoke lots of engagement too 😅
@edkhil
@edkhil Год назад
Dude, I can't take someone who censors his LOCAL IP seriously.
@Core-Electronics
@Core-Electronics Год назад
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.
@edkhil
@edkhil Год назад
@@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).
Далее
Raspberry Pi Pico W: Wireless Weather Station
17:13
Просмотров 285 тыс.
Every Developer Needs a Raspberry Pi
27:27
Просмотров 285 тыс.
ВОДЯНОЙ ПИСТОЛЕТ ЗА 1$ VS 10$ VS 100$!
19:09
I Built a Trampoline Park in My House!
29:50
Просмотров 12 млн
Does this sound illusion fool you?
24:55
Просмотров 761 тыс.
Can You Forge Tungsten?
16:14
Просмотров 819 тыс.
Hacking my garage door with the Raspberry Pi Pico W
11:50