From 4a9d1612865dc66a19b89cf39c31f06da221a5b2 Mon Sep 17 00:00:00 2001 From: Raymond Bourges Date: Sun, 30 Nov 2025 19:02:20 +0100 Subject: [PATCH] FEAT : Webrepl --- main.py | 6 +++++- notes.md | 10 +++++++++- utils/webrepl_setup.py | 1 + 3 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 utils/webrepl_setup.py diff --git a/main.py b/main.py index 97c703a..0b4c394 100644 --- a/main.py +++ b/main.py @@ -3,7 +3,10 @@ import network import time import ntptime import urequests -import localtime_fr +import localtime_fr # TODO : Lire info HP.. HC.. sur HA > sensor.compteur_linky_ptec +import webrepl + +# Capter exception pour éviter les sorties intempestives (comme timeout sur ntp) led_jaune = Pin(0, Pin.OUT) led_bleue = Pin(2, Pin.OUT) @@ -72,6 +75,7 @@ def ntp(): ntptime.settime() ntp_ok = True ntp_attente = ntp_ttl + webrepl.start() if (ntp_ok): date_heure = localtime_fr.localtime() print(f"Date et heure : {date_heure[3]}:{date_heure[4]}:{date_heure[5]} ({ntp_attente}, {HC(date_heure)})") diff --git a/notes.md b/notes.md index 3c8088d..283b2f0 100644 --- a/notes.md +++ b/notes.md @@ -1,7 +1,15 @@ +# Notes + +## Mise en place micropython + esptool --port /dev/ttyACM0 erase-flash cd tmp wget https://micropython.org/resources/firmware/ESP32_GENERIC_C6-20250911-v1.26.1.bin cd - -esptool --port /dev/ttyACM0 --baud 460800 write-flash 0 ./tmp/ESP32_GENERIC_C6-20250911-v1.26.1.bin \ No newline at end of file +esptool --port /dev/ttyACM0 --baud 460800 write-flash 0 ./tmp/ESP32_GENERIC_C6-20250911-v1.26.1.bin + +## Webrepl + +init via un run sur utils/webrepl_setup.py \ No newline at end of file diff --git a/utils/webrepl_setup.py b/utils/webrepl_setup.py new file mode 100644 index 0000000..d5e6dfc --- /dev/null +++ b/utils/webrepl_setup.py @@ -0,0 +1 @@ +import webrepl_setup \ No newline at end of file