diff --git a/ESP32/boot.py b/ESP32/boot.py index 993205a..0016c3d 100644 --- a/ESP32/boot.py +++ b/ESP32/boot.py @@ -1,21 +1,20 @@ # This file is executed on every boot (including wake-boot from deepsleep) -# It is executed after boot.py, before main.py +# It is executed before main.py import os, machine import network import gc gc.collect() -# Disable Access Point -ap_if = network.WLAN(network.AP_IF) -ap_if.active(False) -# Connect to the WIFI when booting +# --- WIFI Configuration --- SSID = '' # Set the WIFI network SSID PASSWORD = '' # Set the WIFI network password network.country('') # Set the country code for the WIFI (ISO 3166-1 Alpha-2 country code) network.hostname('busylight-esp32') # Hostname that will identify this device on the network +# -------------------------- +# Function to connect to the WIFI def boot_wifi_connect(): wlan = network.WLAN(network.STA_IF) if not wlan.isconnected(): @@ -25,10 +24,13 @@ def boot_wifi_connect(): while not wlan.isconnected(): pass ip, mask, gateway, dns = wlan.ifconfig() + + # Print the network configuration print('\nNetwork config:') print('- IP address: ' + ip) print('- Network mask: ' + mask) print('- Network gateway: ' + gateway) print('- DNS server: ' + dns + '\n') +# Connect to the WIFI when booting boot_wifi_connect() \ No newline at end of file diff --git a/README.md b/README.md index 10f67d4..3bb3d4d 100644 --- a/README.md +++ b/README.md @@ -103,7 +103,9 @@ It will automatically switch to the BusyLight in: |-------------------------------|-------------------------------------| | ![lib-menu](img/lib-menu.png) | ![lib-install](img/lib-install.png) | -**(3)** Drop the content of [ESP32](ESP32/) folder to the root directory of your ESP32 file system. Again, can easily be done using [Thonny](https://thonny.org): +**(3)** Edit the `WIFI Configuration` section in the [boot.py](/ESP32/boot.py) file. + +**(4)** Copy the content of [ESP32](ESP32/) folder with the modified `boot.py` file to the root of your ESP32 file system. Again, can easily be done using [Thonny](https://thonny.org): ![file-copy](img/file-copy.png)