Skip to content

Commit ba05949

Browse files
committed
Add filesystem commit identification and identify api call
1 parent db1523b commit ba05949

File tree

6 files changed

+283
-136
lines changed

6 files changed

+283
-136
lines changed

scripts/extra_script.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@
33
import gzip
44
from shutil import copyfileobj, rmtree
55
from pathlib import Path
6+
import subprocess
7+
8+
revision = (
9+
subprocess.check_output(["git", "rev-parse", "HEAD"])
10+
.strip()
11+
.decode("utf-8")
12+
)
613

714
def gzip_file(input_file, output_file):
815
with open(input_file, 'rb') as f_in:
@@ -24,7 +31,9 @@ def process_directory(input_dir, output_dir):
2431
output_file_path = os.path.join(output_root, file + '.gz')
2532
gzip_file(input_file_path, output_file_path)
2633
print(f'Compressed: {input_file_path} -> {output_file_path}')
27-
34+
file_path = os.path.join(output_dir, "fs_hash.txt")
35+
with open(file_path, "w") as file:
36+
file.write(revision)
2837

2938

3039
# Build web interface before building FS

scripts/find_btclocks.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ def add_service(self, zc: Zeroconf, type_: str, name: str) -> None:
4848
#arguments = [f"-i {str()} -f -r"]
4949
namespace = argparse.Namespace(
5050
esp_ip=info.parsed_addresses()[0],
51-
image=f"{os.getcwd()}/.pio/build/lolin_s3_mini_qr/firmware.bin",
52-
littlefs=f"{os.getcwd()}/.pio/build/lolin_s3_mini_qr/littlefs.bin",
51+
image=f"{os.getcwd()}/.pio/build/lolin_s3_mini_213epd/firmware.bin",
52+
littlefs=f"{os.getcwd()}/.pio/build/lolin_s3_mini_213epd/littlefs.bin",
5353
progress=True
5454
)
5555
if (str(info.properties.get(b"version").decode())) != "3.0":
@@ -64,7 +64,7 @@ def add_service(self, zc: Zeroconf, type_: str, name: str) -> None:
6464
print("Different version, going to update")
6565
#espota.serve(namespace.esp_ip, "0.0.0.0", 3232, random.randint(10000,60000), "", namespace.littlefs, SPIFFS)
6666

67-
#espota.serve(namespace.esp_ip, "0.0.0.0", 3232, random.randint(10000,60000), "", namespace.image, FLASH)
67+
espota.serve(namespace.esp_ip, "0.0.0.0", 3232, random.randint(10000,60000), "", namespace.image, FLASH)
6868
#print(arguments)
6969

7070
#logging.basicConfig(level = logging.DEBUG, format = '%(asctime)-8s [%(levelname)s]: %(message)s', datefmt = '%H:%M:%S')

src/lib/led_handler.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,12 @@ void ledTask(void *parameter) {
4343
case LED_DATA_PRICE_ERROR:
4444
blinkDelayColor(150, 2, 177, 90, 31);
4545
break;
46+
case LED_FLASH_IDENTIFY:
47+
blinkDelayTwoColor(100, 2, pixels.Color(255, 0, 0),
48+
pixels.Color(0, 255, 255));
49+
blinkDelayTwoColor(100, 2, pixels.Color(0, 255, 0),
50+
pixels.Color(0, 0, 255));
51+
break;
4652
case LED_EFFECT_WIFI_CONNECT_SUCCESS:
4753
case LED_FLASH_SUCCESS:
4854
blinkDelayColor(150, 3, 0, 255, 0);

src/lib/led_handler.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ const int LED_PROGRESS_100 = 203;
3535

3636
const int LED_DATA_PRICE_ERROR = 300;
3737
const int LED_DATA_BLOCK_ERROR = 301;
38-
38+
const int LED_FLASH_IDENTIFY = 990;
3939
const int LED_POWER_TEST = 999;
4040
extern TaskHandle_t ledTaskHandle;
4141
extern Adafruit_NeoPixel pixels;

0 commit comments

Comments
 (0)