-
Open the Thonny IDE
-
Clone your files to your Raspberry Pi Pico W.
-
To ensure that everything works flawlessly, please ensure, that you have the wireless Pico version.
-
Set your Wifi details in
env.py
: You can add as many access points as you want. -
Run the
env.py
script in order to generate theenv_encrypted.py
file with your encrypted wifi data. -
In order to check for full functionality, execute the
pico_server.py
script manually inside your Thonny IDE. -
In order to detect the IP address of your future webserver, you can either look into your wifi settings or start the
pico_server.py
script manually. -
If your Pico W successfully connects to one of your access points and returns an IP address with its port, everything has worked. If so, feel free to rename
pico_server.py
tomain.py
. -
This ensures that if you unplug your Raspberry Pi Pico W and plug it in again, the
main.py
script is executed automatically. -
Because the automatically executed file takes a lot longer, I have added a couple of
time.sleep(x)
commands in theconnect.py
file. If you execute the script manually, feel free to remove these lines. -
If everything runs correctly, the onboard LED should flash for one second and blink faster another nine times.
-
Give your Pico at least ten seconds (because of a couple
time.sleep(x)
statements) and the LED will flash once more if it connects to one of your specified access points. -
If the LED blinks another three times, you are ready to go. Everything has worked flawlessly and you can now connect to your webserver.
-
If it instead turns on and never goes out, an error has occured.
-
If problems occur, check the automatically generated
log.txt
file, which will help you start debugging. -
You can connect multiple devices to this webserver. Depending on the time, you wil either receive a html file which says that the server is currently offline or a file which lets you control the onboard LED.
-
As already mentioned, you are allowed to use multiple devices. Because of SSE (Server Sent Events), the UI will update on all devices depending on the current LED state.
-
I hope that this (more or less) simple project gives you an idea of how you can utilize your Raspberry Pi Pico W for your use case.
-
Notifications
You must be signed in to change notification settings - Fork 0
Raspberry Pi Pico W flexible Webserver
License
StackOverflowIsBetterThanAnyAI/pico-w-flexible-webserver
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
Raspberry Pi Pico W flexible Webserver
Topics
Resources
License
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published