Это видео недоступно.
Сожалеем об этом.
Step-by-Step Pi Pico W: WIFI, gpio Control and Webserver
HTML-код
- Опубликовано: 17 авг 2024
- 00:00 Introduction
01:00 initail setup (wlan scan and mac)
02:40 blinking on board LED
03:58 Initial Wlan / Wifi (wlan scan and mac)
06:57 Static Website
14:15 Website with GPIO control and state display
In this tutorial i show how to setup a raspberry Pi Pico w (or other board with a RP2040 and WiFI) and i show how to setup the WLAN and read out the Mac address. I explain how to update the UF2 file I´m showing how to setup a Website and control GPIO´s with it. For the programming code i´m using Micro Python.
-----------------------------------------------------------------
Links :
UF2 file :
www.raspberryp...
Gibthub rep for files:
github.com/Lut...
Thonny:
thonny.org/
----------------------------------------------
Buy Raspberry Pi W and support my channel without extra costs :
US
Pi Pico W:
amzn.to/3WJIrES*
Pi Pico with full starter KIT:
amzn.to/3XWZkga*
Germany:
Pi Pico W:
amzn.to/3JowFfY*
Pi Pico with full starter KIT:
amzn.to/3Dfpnr9*
*affiliate link
My understanding is growing, thanks for your tutorial! Gregory
Thanks, I'm new to this python, and to Pico. Your help is appreciated.
Wow, this is a great tutorial. I like your teaching style!
Hello Lutz. Thanks for the tutorial been running your code so see if it will work in my situation. Only thing i changed was the Netwroking Mywifi and added my own.
The only problem i have is the the code runs fine, the website is accessible, but if you close the browser, (phone or desktop) and go back to it later, the website is inaccessible. Running a network ip scanner, the pico w can't be pinged. Yet looking on thonny (still connected to the pico w), there are no disconnect errors. The only change I made was to the SSID Password details. Did you have this problem or do you know how to make it more stable when the website is not accessed for a while (3 minutes or longer)
Excellent information .. Thank You for sharing .. Cheers :)
Hi Lutz, do you have the webserver example with textbox but with arduino language.
I want to use both core and microPhyton dont work well.
Very helpful!
Great tutorial! thanks a lot
I'm glad you like it. Thanks a lot for your Feedback!
New to pi. I need 5 analog sensors to be physically seperate from the pi but sending values to the main pi. Can I do this with pico w? For 5 analog signals, It would require two of them wouldn't it?
Yes your right. A pi Pico has 3 adc's. So you need two of them. Propably still cheaper than using a adc expansion and a Pico.
But you need two think about how to send the Signals to the "Main Pi". You need some Kind of a Server / Client architecture for it.
Hello, great video!
Is there a way to retrieve information from a slider in the html?
Like if I set the slider on the webpage to half for example, a variable in the program would be 0.5
I only saw boolean outputs on webpages in micropython so i don't know if there is a way to do this with analog outputs
Hi lemure,
Thank you for your Feedback.
ruclips.net/video/wCac3uIW5nU/видео.html
Here i explain how to transmit adjustable values.
If you use the Slider as an Input instead of the field i use, you have it.
@@lutz4tech thank's a lot for responding that fast!
How would you add an adjustable timer function to the led toggle button on the webpage?
I figured out how to refresh the page automatically! Just add this to your html:
I put mine just below the head of the page.
Hi, yeah with the Word "adjustable" you make it directly complicate :D my lazy Idea would be to use different Buttons with different Timings. That whot you mean to send Parameters is more complex i can put it in my todo list for an Others Video.
Thanks for that hint with the automatic refresh of the Page!
@@lutz4tech just like a text slot where it looks for a time in minutes to set the toggle on for and if not entered its toggled on until toggled off. I would appreciate any help you can offer!
I needed to finish an other Video at first, but today i finished your wish. I hope its still usefull for you (and a million others ;) )
ruclips.net/video/wCac3uIW5nU/видео.html
Thank YOu
Hi, Is it possible to access the Raspberry pi pico W outside the wifi network? I've tried to forward ports on the router, but I can't access it.
Overall this should work.Did you sucessfullly tried the Port forward with an other Server?
What comes in my mind why it May Not work are two Things.
1) You need to have your Public IP to do this. So not your local IP of the Pico. At best this one is static and dies mit change so you can reach your pi erverytime with the Same IP.
2) The Code i used an adapted is only able to serve one Client at a time. So If you are Connected from your WiFi and try at the Same time an external Connection the pi will Not respond to the second request.
I hope this helps you let me know if not.
where is the mywifi module, it doesn't exist on github? there is an error, because the mywifi module doesn't exist
If the wifi signal is temporally lost, the pico hangs and will not reconnect when the signal returns. Is there a way to utilize the WDT to cause a reboot in the case of a lost signal?
Hi, nice question thanks for this !
Well the watchdog is to be used with:
from machine import WDT
wdt = WDT(timeout=2000) # enable it with a timeout of 2s
wdt.feed()
If you place the feeding somewhere where it can't bei reached in Case you Looser the Connection it should Work.
If i have time i'll try it out, and give you a more detailed Feedback. May i make a Video about this. Could be a really interesting question.
@@lutz4tech I just started working on it too and will let you know what happens. Thanks.
I got it working. Placed if wlan.status()>2 wdt.feed() in the loop with await asyncio.sleep(check_interval_sec)
Checked it by turning phone mobile hot spot on and off.
@@jazzjohn2 nice !
Just an other Idea and i didn't tried it but May this works without the wdt If you use:
If WLAN.isconnected()
WLAN.connect
?
May miss Something but this could be easier and you don't loose the state of the Pins.
My led does not blink when i enter the exact same code
If you use a pi pico W you need to Update the uf2 File. I explain this in the beginning of the Video.
Can the pico w connect to MSSQL database?
Well, i think it can, but i didn't found a lib for this. So you would need to make your own libary and that would Take a while.
I think it would be easier to list the Data you eant to Store in the Database on a Website, and let the Database Server Poll the Website for Updates.
@@lutz4tech Thanks,your video is very helpful I will try it.
@@qweqweqweqw1187 thank you, let me know if you need something Else. Maybe i can do a Video about it.
LED is not pin 25, 'LED' works instead. But WTF is 'LED'? it must map to a pin number, where do I find what pin it is? pin 0 ?
Yeah normaly you are right with your Idea, but this time not 😉
When you Look into the schematic (
www.google.com/url?q=datasheets.raspberrypi.com/picow/pico-w-datasheet.pdf&sa=U&ved=2ahUKEwjjxanRhMr7AhWG7KQKHVv2B5oQFnoECAoQAg&usg=AOvVaw1WGyuOD6vwKLFp-Tke_e1P ) you See that it's coming from the Wireless Modul and Not from the rp2040.
So the word "Led" ist masking the complexity a bit for the user 😉
I Hope this helps you.
Python dislike