"""Quick-start cheat sheet shown on launch. Targets the DEPLOYED firmware: new_system.bin, app "kota-sensorboard" 1.0, built Jun 29 2026 11:03:32, ELF SHA256 45fa9d5b9... (verified on a live board). That build has no Wi-Fi setup portal / SSID-on-SD support; those exist only in the newer, unbuilt source. The status LED is always SOLID; the separate small LED toggles every second while alive. """ # (swatch colour, LED name, meaning, first action) LED_TABLE = [ ("#2e9e44", "Green", "Everything OK.", "Nothing to do."), ("#8e44ad", "Purple", "No Internet / InfluxDB or OTA server unreachable.", "Check the box is commissioned in the Matter app (sticker QR code) and the " "site Wi-Fi has Internet. Board reboots itself after ~2.5 min of purple."), ("#d64541", "Red", "Sensor or hardware fault (BME688, SEN66, AS7341, microphone, flicker) " "or failed self-check after update.", "Connect serial - the log names the failing sensor. Check sensor cables."), ("#2f6fd6", "Blue", "Clock (RTC DS1307) failed to start. The RTC is the first I2C device, " "so a broken I2C cable also shows blue.", "Check the I2C harness first, then the RTC module / coin cell."), ("#e6c229", "Yellow", "Firmware update downloading.", "Do not switch off. Wait."), ("#f08c1a", "Orange", "Self-check after an update (~2.5 min).", "Wait; should turn green (or red on failure)."), ("#f4f4f4", "White", "SD card missing/unreadable or ENV.TXT incomplete - or a factory reset is " "in progress (Matter button held 5 s).", "If nobody pressed the Matter button: the SD card is inside the case - " "unscrew, re-seat or re-provision it."), ("#444444", "Off", "Firmware did not start (or crashed very early).", "Check power switch & USB cable. If the small LED is also dark: re-flash."), ] HINTS = [ "Colour keeps changing / LED goes dark every few seconds = reboot loop. " "Connect serial and press Reset & capture: the last lines before the " "reboot name the cause.", "Small LED next to the RGB LED blinks once per second while the " "firmware runs. Not blinking = firmware hung or not running.", "Outside the case: power switch and the Matter button. Holding the " "Matter button 5 s factory-resets the box (it forgets its Matter " "network and must be commissioned again with the sticker QR code).", "Inside the case (unscrew): RESET and BOOT buttons and the SD card. " "Normally not needed - the tool resets the board over USB.", "Gathering messages for the first ~2 minutes are normal " "(the air-quality sensor warms up for 120 s).", ] STEPS = [ "Switch the sensorbox power switch ON.", "Connect the laptop to the box's native USB port with a data-capable cable.", "Open the Serial monitor tab, choose the sensorbox port, press " "Connect.", "Press Reset & capture to record a full boot log from the first line.", "Note the RGB LED colour and compare with the table below.", ] def cheatsheet_html() -> str: rows = "".join( f"      {name}" f"{meaning}{action}" for c, name, meaning, action in LED_TABLE ) steps = "".join(f"
  • {s}
  • " for s in STEPS) hints = "".join(f"
  • {h}
  • " for h in HINTS) return f"""

    Sensorbox quick start

      {steps}

    RGB status LED (always solid colour)

    {rows}
    LED Most likely meaning First action

    Good to know

    """