Files
wadamesh/scripts/inject_wifi_env.py
Kaj SchittecatandClaude Opus 4.8 1f6409702c feat: Heltec V4 TFT touch firmware — app + ui-touch + board + platformio
First board lands. wadamesh builds the LVGL touch firmware as its own project,
consuming the MeshCore core via lib_deps @ git tag (ALLFATHER-BV/MeshCore
#v1.16.0-wada.0) — no vendored core in this repo. Output is byte-identical to the
in-tree meshcomod build (delta = embedded build-path strings only).

Contents: companion_radio app (MyMesh/main/DataStore), ui-touch LVGL UI,
variants/heltec_v4 board glue, boards/heltec_v4.json, lv_conf, the bundled
ed25519 lib, AsyncElegantOTA, partition table, and a flattened platformio.ini
for env heltec_v4_tft_companion_radio_usb_tcp_touch.

MeshCore-derived files (app glue) remain MIT; ui-touch is GPL — see NOTICE.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: Kaj Schittecat <kaj@schittecat.com>
2026-06-13 00:01:32 +02:00

24 lines
956 B
Python

#!/usr/bin/env python3
"""Inject WIFI_SSID and WIFI_PWD from environment into build. Never put real credentials in the repo."""
import os
Import("env")
ssid = os.environ.get("WIFI_SSID", "YourSSID").replace("\\", "\\\\").replace('"', '\\"')
pwd = os.environ.get("WIFI_PWD", "YourPassword").replace("\\", "\\\\").replace('"', '\\"')
# Write a generated header so we avoid -D quote escaping; force-include it.
out_dir = os.path.join(env.get("PROJECT_DIR", "."), "scripts", "build")
os.makedirs(out_dir, exist_ok=True)
header_path = os.path.join(out_dir, "wifi_secrets.h")
with open(header_path, "w") as f:
f.write("/* Generated at build from WIFI_SSID/WIFI_PWD env - do not commit */\n")
f.write("#ifndef WIFI_SECRETS_H\n#define WIFI_SECRETS_H\n")
f.write('#define WIFI_SSID "%s"\n' % ssid)
f.write('#define WIFI_PWD "%s"\n' % pwd)
f.write("#endif\n")
env.Append(CPPPATH=[out_dir])
env.Append(CCFLAGS=["-include", "wifi_secrets.h"])