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

Поділитися
Вставка
  • Опубліковано 4 січ 2025

КОМЕНТАРІ • 105

  • @Alpha_fitz
    @Alpha_fitz 2 роки тому +7

    Thank you. Keep em coming. Love the pico w. There should be more of them in a few weeks.

  • @davidwhite633
    @davidwhite633 Рік тому +4

    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

  • @Gribouille28210
    @Gribouille28210 Рік тому +2

    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.

  • @jeffschroeder4805
    @jeffschroeder4805 8 місяців тому

    Thank you, your guides are wonderfully clear and concise. I appreciate them so much.

  • @L2.Lagrange
    @L2.Lagrange 8 місяців тому

    This looks super useful. I will definitely mess around with this using my Pico. The clicking the buttons seems particularly useful

  • @mattytrentini
    @mattytrentini 2 роки тому +13

    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!)

  • @donaldhoudek2889
    @donaldhoudek2889 8 місяців тому +1

    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  8 місяців тому

      What a timely comment, we may be working on that exact video right now...

    • @olofintiladavid3479
      @olofintiladavid3479 6 місяців тому

      @@Core-Electronics
      Please, do you have a vide on this now?

  • @richardw2977
    @richardw2977 3 місяці тому +1

    SO many ideas. I have a rocket telemetry project that I may try this with - assuming that I can get it to connect to an iPhone hotspot and then serve a dynamic page back to the iPhone while outside cell tower range.

  • @darekkrawczyk8745
    @darekkrawczyk8745 2 роки тому +1

    Thank you for the great tutorial. If it were a little closer, I would thank you personally. Greetings from Poland

  • @JorgeSilva-em8pf
    @JorgeSilva-em8pf 21 день тому

    Amazing explanation!

  • @mytechnotalent
    @mytechnotalent 2 роки тому +2

    Just brilliant! This helps makers use MicroPython in powerful new ways. Thank you for this so much!

  • @grahamhillson1294
    @grahamhillson1294 3 місяці тому +1

    Great video thanks. I have a question, if I've already written programs that are stored on the pico, can i use the button interface to simply call them so that they will run? Many thanks

    • @Core-Electronics
      @Core-Electronics  3 місяці тому

      That is a bit of a curveball question! We have a lot of maker eyes over on our forums that would know a few ways to do that, feel free to chuck that question over there where you can get some better help!
      forum.core-electronics.com.au/

  • @dabunnisher29
    @dabunnisher29 Рік тому

    I really dig your channel. Thanks for all the cool projects.

  • @fredmunyao787
    @fredmunyao787 9 місяців тому

    This tutorial really helped me

  • @DanielMurrayMakes
    @DanielMurrayMakes 2 роки тому

    Fantastic video & resources. Will be a huge benefit to my students. Much much appreciated!

  • @FranciscoJavier32423
    @FranciscoJavier32423 2 роки тому +1

    Amazing, really good tutorial, I want to have that board do practice and play, unlikely are sold out for now.

    • @GermanBluntSmoker
      @GermanBluntSmoker 2 роки тому +1

      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 2 роки тому

      @@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.

  • @SirSurreal
    @SirSurreal Рік тому

    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.

  • @laynemccormic9102
    @laynemccormic9102 2 роки тому

    appreciate the walkthrough. Felt like I was getting some questionable vibes at the beginning tho XD

    • @Core-Electronics
      @Core-Electronics  2 роки тому +1

      Can't have you peeping our local IP address #haxxor 😎

  • @Amihuman-ey7ne
    @Amihuman-ey7ne 7 місяців тому

    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  7 місяців тому

      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"

  • @juniorngomajose9454
    @juniorngomajose9454 Рік тому

    Thank you for the video.
    What can I do to acces the html page anywhere? Instead of localhost

  • @TheCeredigion
    @TheCeredigion 6 місяців тому

    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  6 місяців тому +1

      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 6 місяців тому

      @@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.

  • @Wawan_Setiaw4n_Robotik
    @Wawan_Setiaw4n_Robotik Рік тому +1

    Good, tank's very much Master..

  • @DennisWilliams-l2i
    @DennisWilliams-l2i Рік тому

    Great video! I got mine working.

  • @gamerneversleep4200
    @gamerneversleep4200 2 роки тому +53

    dang u censored Local address how am i supposed to hack u now. 😂😂😂

  • @Taki7o7
    @Taki7o7 2 роки тому +6

    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 ^^

  • @itwaslikethatwhenigothere
    @itwaslikethatwhenigothere 2 роки тому +3

    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  2 роки тому +2

      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 2 роки тому

      @@Core-Electronics Thanks for the link, that project is just what I am looking for.

  • @rupadarshisamanta3288
    @rupadarshisamanta3288 Рік тому +1

    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.

  • @wasdaletimelapse7658
    @wasdaletimelapse7658 Рік тому

    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.

  • @tommypham916
    @tommypham916 2 роки тому +1

    Is it possible to control a servo motor through a web server as well using the raspberry pi Pico w?

    • @Core-Electronics
      @Core-Electronics  2 роки тому +1

      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 2 роки тому +1

    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  2 роки тому

      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 2 роки тому

      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.

  • @lloydsshednanigans
    @lloydsshednanigans 2 роки тому

    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?

  • @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 ?

    • @oiphebal
      @oiphebal Рік тому

      could you do that? i want to do the same thing

  • @MohitKhare
    @MohitKhare Рік тому

    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.❤

  • @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 5 місяців тому

      You would give each its own IP address

  • @BambooInc
    @BambooInc 2 роки тому

    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.

  • @sivaasapu4580
    @sivaasapu4580 2 роки тому +1

    sir, On the Raspberry Pi 4 model, is it possible to run two programmes at the same time?

    • @Jo-re2ye
      @Jo-re2ye 5 місяців тому

      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

  • @thespacecowboy420
    @thespacecowboy420 Рік тому

    how do you upload a separate html file and reference it instead

  • @엄브릿지
    @엄브릿지 11 місяців тому

    Does it work even if the pc is turned off?

  • @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)'

  • @britishtechguru
    @britishtechguru 2 роки тому

    That works. Be better as a webhost though.

  • @geraldojosegardinalli1305
    @geraldojosegardinalli1305 2 роки тому

    👏👏
    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 2 роки тому +2

      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

  • @jyvben1520
    @jyvben1520 2 роки тому +2

    and add a sd-card reader for extra file storage ...

  • @guythegeek
    @guythegeek Рік тому

    Hi when I try to import network in thonny I get an import error in circuit python please help

  • @jimw1266
    @jimw1266 23 дні тому

    Hardware test works great but when I run the wifi connection part I get the following error:
    Traceback (most recent call last):
    File "", line 42, in
    RuntimeError: network connection failed
    this is the code that causes the fail:

    # Handle connection error
    if wlan.status() != 3:
    raise RuntimeError('network connection failed')
    else:
    print('Connected')
    Any help would be greatly appreciated!!!

    • @Core-Electronics
      @Core-Electronics  23 дні тому

      We have a newer video with a bit more robust Wi-Fi code over here:
      ua-cam.com/video/hLLUxuFxLOI/v-deo.html
      If that doesn't work, we have a maker forum where you can post your issue. We have lots of makers over there that can help!
      forum.core-electronics.com.au/

  • @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.

  • @Michael-pw1gc
    @Michael-pw1gc 2 роки тому

    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.

  • @edwinrivera5128
    @edwinrivera5128 2 роки тому

    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  2 роки тому +1

      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

  • @peter7329
    @peter7329 2 місяці тому

    when copy in the new html the page wont load if i copy the old one back it works fine its confusing

    • @Core-Electronics
      @Core-Electronics  2 місяці тому

      We have a newer guide that might be help out!
      ua-cam.com/video/hLLUxuFxLOI/v-deo.html&ab_channel=CoreElectronics

    • @peter7329
      @peter7329 2 місяці тому

      @@Core-Electronics that is brilliant thanks he does explain it all very well that's the same html from the RPi example which I did first
      I found this video while trying to find how format the page better I like how the code here has bigger buttons and they're coloured and centred
      Is formatting like that not poss5

  • @cheze_bun
    @cheze_bun Рік тому

    For some reason it said trace back modulenotfounderror: no modula name ‘network’
    Why is this happening

  • @gandalfsVater
    @gandalfsVater 2 роки тому

    How can i adjust the code, so i can simply only show a website without buttons, leds or anything else

    • @Jo-re2ye
      @Jo-re2ye 5 місяців тому

      Change the HTML?

  • @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

  • @mikehadzhiev4152
    @mikehadzhiev4152 2 роки тому

    Question to the author can i run pi hole on the new raspebbry pico w

    • @Core-Electronics
      @Core-Electronics  2 роки тому +1

      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 🙂

  • @yesultimate1225
    @yesultimate1225 Рік тому

    Why is from machine import ptin not working?

  • @PreshithaMediaLive
    @PreshithaMediaLive Рік тому

    >>> %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

  • @mitcore
    @mitcore Рік тому

    you forgot to blur your local ip address at 8:23

  • @joetimbersock7639
    @joetimbersock7639 2 роки тому

    Is this server safe and secure?

  • @alex-ku9yt
    @alex-ku9yt Рік тому

    No one can do this with arduino ide and c++ all write to slow python where word going

  • @splatink
    @splatink 9 місяців тому +1

    bro really censored a private ip

  • @acermf7983
    @acermf7983 2 роки тому

    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

  • @Henrix1998
    @Henrix1998 2 роки тому +3

    This man censoring his local ip

  • @alex-ku9yt
    @alex-ku9yt Рік тому

    These

  • @sambeard4428
    @sambeard4428 Рік тому

    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

  • @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.

  • @VoeViking
    @VoeViking 2 роки тому

    WHY would you hide a local address?

    • @Core-Electronics
      @Core-Electronics  2 роки тому

      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 2 роки тому

    Dude, I can't take someone who censors his LOCAL IP seriously.

    • @Core-Electronics
      @Core-Electronics  2 роки тому +1

      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 2 роки тому

      @@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).