Compare commits

..

No commits in common. "update-things" and "main" have entirely different histories.

13 changed files with 8 additions and 22 deletions

View file

@ -1 +0,0 @@
adafruit_requests==2.0.5

View file

@ -24,12 +24,8 @@ fi
echo "Found device at $device_path" echo "Found device at $device_path"
echo 'Copying application code...' echo 'Copying application code...'
rsync --verbose --recursive --delete --checksum --times --modify-window=1 \ rsync --verbose --recursive --delete --checksum \
--include '/._*' --exclude '/.*' \ --include '/._*' --exclude '/.*' \
--exclude '/boot_out.txt' --exclude '/settings.toml' --exclude '/lib' \ --exclude '/boot_out.txt' --exclude '/settings.toml' \
"$project_directory/src/" "$device_path" "$project_directory/src/" "$device_path"
echo 'Finished copying application code' echo 'Finished copying application code'
echo 'Installing libraries with circup'
circup install --requirement circup_requirements.txt
echo 'Finished installing libraries with circup'

View file

@ -7,17 +7,7 @@ import socketpool
import supervisor import supervisor
import wifi import wifi
from adafruit_httpserver.server import Server as HTTPServer from adafruit_httpserver.server import HTTPServer
from adafruit_httpserver.response import Response
def index(request):
u = os.uname()
return Response(
request,
content_type="text/plain",
body=f"Hello from {u.machine} running CircuitPython {u.version}!\n",
)
def main() -> None: def main() -> None:
@ -34,8 +24,7 @@ def main() -> None:
host = str(wifi.radio.ipv4_address) host = str(wifi.radio.ipv4_address)
pool = socketpool.SocketPool(wifi.radio) pool = socketpool.SocketPool(wifi.radio)
http_server = HTTPServer(pool) http_server = HTTPServer(pool)
http_server.route("/")(index) http_server.start(host, port=80, root_path="public_html")
http_server.start(host, port=80)
ssl_context = ssl.create_default_context() ssl_context = ssl.create_default_context()
# The Pico is the server and does not require a certificate from the client, so disable # The Pico is the server and does not require a certificate from the client, so disable
@ -46,8 +35,7 @@ def main() -> None:
) )
tls_pool = TLSServerSocketPool(pool, ssl_context) tls_pool = TLSServerSocketPool(pool, ssl_context)
https_server = HTTPServer(tls_pool) https_server = HTTPServer(tls_pool)
https_server.route("/")(index) https_server.start(host, port=443, root_path="public_html")
https_server.start(host, port=443)
print() print()
print("The web server is listening on:") print("The web server is listening on:")

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -0,0 +1,3 @@
<!DOCTYPE html>
<title>Hello world &middot; Raspberry Pi Pico W</title>
<p>Hello world from Raspberry Pi Pico W!</p>