From 636e9e6564dbfa3c29e50b44c7b06893c24e6a52 Mon Sep 17 00:00:00 2001 From: Jonathan Neuhauser Date: Mon, 13 Feb 2023 11:38:10 +0100 Subject: [PATCH 1/2] Avoid EISDIR error when installing from Windows --- install-on-device-fs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/install-on-device-fs b/install-on-device-fs index 79c0abd..9f3b302 100755 --- a/install-on-device-fs +++ b/install-on-device-fs @@ -34,8 +34,8 @@ function create_directory { function copy { for file in $1 do - echo -n "> copying file $file" - mpremote connect ${DEVICE} cp $file $2 > /dev/null + echo "> copying file $file" + mpremote connect ${DEVICE} cp $file $2$(basename $file) if [ $? -eq 0 ] ; then echo " .. done!" else From 2d67fb6dda99b782b443c7c23970e210ceb5c0f7 Mon Sep 17 00:00:00 2001 From: Jonathan Neuhauser Date: Mon, 13 Feb 2023 13:38:43 +0100 Subject: [PATCH 2/2] Manual IP configuration --- enviro/__init__.py | 3 +++ enviro/config_template.py | 1 + enviro/html/header.html | 6 ++++++ enviro/html/provision-step-2-wifi.html | 26 ++++++++++++++++++++++++++ enviro/provisioning.py | 15 ++++++++++++++- 5 files changed, 50 insertions(+), 1 deletion(-) diff --git a/enviro/__init__.py b/enviro/__init__.py index 236f280..b279b69 100644 --- a/enviro/__init__.py +++ b/enviro/__init__.py @@ -180,6 +180,9 @@ def connect_to_wifi(): wlan = network.WLAN(network.STA_IF) wlan.active(True) wlan.connect(wifi_ssid, wifi_password) + if config.wifi_ifconfig is not None: + logging.info(f"> using manual ip config {config.wifi_ifconfig}") + wlan.ifconfig(config.wifi_ifconfig) start = time.ticks_ms() while time.ticks_diff(time.ticks_ms(), start) < 30000: diff --git a/enviro/config_template.py b/enviro/config_template.py index a345cc0..91b68a7 100644 --- a/enviro/config_template.py +++ b/enviro/config_template.py @@ -11,6 +11,7 @@ # network access details wifi_ssid = None wifi_password = None +wifi_ifconfig = None # how often to wake up and take a reading (in minutes) reading_frequency = 15 diff --git a/enviro/html/header.html b/enviro/html/header.html index 070ca6b..1021624 100644 --- a/enviro/html/header.html +++ b/enviro/html/header.html @@ -100,6 +100,12 @@ #done pre {max-height: 20rem; overflow: scroll; background-color: var(--black); border-radius: var(--input-radius); color: white; padding: 1rem;} + details {user-select: none;} + details>summary span.icon {transition: all 0.5s; margin-left: auto;} + details[open] summary span.icon { transform: rotate(90deg); } + summary {display: flex; cursor: pointer; } + summary::-webkit-details-marker {display: none;} + /* adjustments for viewing on phone rather than tablet or computer */ @media (max-width: 680px) { #intro {grid-template-columns: 1fr;} diff --git a/enviro/html/provision-step-2-wifi.html b/enviro/html/provision-step-2-wifi.html index ac1b458..da50d96 100644 --- a/enviro/html/provision-step-2-wifi.html +++ b/enviro/html/provision-step-2-wifi.html @@ -28,6 +28,32 @@

Enter your WiFi password so that we can download pictures of cats upl
+ +
+

Advanced configuration

+ +
+

+

+ +

IPv4 address:

+
+ +
+

Netmask:

+
+ +
+

Gateway:

+
+ +
+

DNS server:

+
+ +
+

+