microReticulumTbeam/exercises/05_SD_Card_Watcher
2026-02-14 14:17:58 -08:00
..
src Fixed Issue #1, see explanations 2026-02-14 14:17:58 -08:00
platformio.ini Modified by ChatGPT for migration to microRecticulum_Firmware, not verified by me... yet, but I am preserving to document this stage. 2026-02-14 10:10:31 -08:00
README.md RTC keeps time between POWER OFF & ON, SD Card at start still needs work -- if card is in the slot, it is not readable until it is pulled on and then inserted. 2026-02-13 18:52:17 -08:00

Exercise 05: SD Card Watcher

This exercise continuously watches SD card presence and prints state-change events.

Watcher behavior:

  1. Initializes PMU and enables SD power rail (AXP2101 BLDO1).
  2. Polls for card changes with debounced state transitions.
  3. Emits events only on change:
    • EVENT: card inserted/mounted
    • EVENT: card removed/unavailable
    • EVENT: no card detected
  4. On mount event, prints card info and runs SD write workflow.
  5. Every 15 seconds while mounted, runs a periodic write/permission check.
  6. Uses fast preferred probe (HSPI @ 400k) and occasional full fallback scan.

Files used in this exercise:

  • /Exercise_05_test.txt
  • /test/testsub1/testsubsub1/Exercise_05_test.txt

Build

source /home/jlpoole/rnsenv/bin/activate
pio run -e node_a

Upload

source /home/jlpoole/rnsenv/bin/activate
pio run -e node_a -t upload --upload-port /dev/ttyACM0

Monitor

screen /dev/ttyACM0 115200