Files
tactility_apps/Apps/BibleVerse
Adolfo 4a153099f9 fix(bibleverse): fix gui stack overflow after firmware update
Gui task stack is 4096 with 2800 free min. After recent driver migrations,
app overflowed:

- verse_buf[2048] on stack in show_current_verse
- bin_path[320]+idx_path[320] in load_book
- temp[512] in parse_books_json

Caused 'stack overflow in task gui' + LoadProhibited in sdmmc/stat path.

Fix:
- MAX_PATH 320 -> 128 (paths <80 chars)
- temp 512 -> 256
- verse_buf stack -> heap malloc/free
- ref buffers reduced

Also bump manifest to V2 (0.2) required by SDK 0.8.0-dev and versionCode 2.

Tested on 192.168.68.132 (ES3C28P): loads 66 books, displays verse, no reboot.
2026-07-21 14:16:20 -04:00
..

BibleVerse for Tactility

Single-verse bible reader. Shows one verse fullscreen, auto-advances every minute. Tap to toggle controls.

UX

  • Default view (no chrome): immersive context — just the verse text + reference, centered, large font. Like BookPlayer image-only view.
  • Tap: shows header (current ref + position) and footer controls:
    • Close X, Prev, Pause/Play (auto-advance), Next, Highlight (star), Audio memo placeholder.
  • Highlighted verses saved to favorites.txt in app user data. Long-term: record voice memo, read aloud TTS.

Bible data format (split per book)

We fetch public domain bibles from https://github.com/sajeevavahini/bibles (Zefania XML).

Offline conversion:

python3 tools/convert_bible.py  --src "World English Bible.xml" --dst assets/bible

Result structure:

assets/bible/
  books.json          # {"books":[{"bnumber":1,"bname":"Genesis","verses":1533,...}], total_verses, translation, version}
  01.bin / 01.idx     # Genesis
  02.bin / 02.idx     # Exodus
  ...
  66.bin / 66.idx
  • .bin: concatenated NUL-terminated UTF8 verse texts. No parsing needed, low RAM.
  • .idx: header 10 bytes: magic 'BIBK', uint16 version, uint32 count. Then per entry 8 bytes: uint32 offset, uint16 cnum, uint16 vnum.

This split makes memory footprint tiny for ESP32:

  • Only one book loaded at a time (max ~215KB for Psalms, typical 12-100KB).
  • Index ~19KB max for Psalms, typically <5KB.

SD card fallback

App also scans:

  • /sdcard/bibles/ and /sdcard/bible/

If books.json not found in assets, it will try to use SD folder. This lets users drop extra translations offline.

Settings persistence

Same pattern as EpubReader / BookPlayer (but those two didn't persist in BookPlayer, EpubReader does):

Using Tactility app user data paths:

  • tt_app_get_user_data_path() -> e.g. /sdcard/user/app/one.tactility.bibleverse
  • progress.txt: stores global verse index + b/c/v for debug
    1234
    1 1 1
    0 0
    
  • favorites.txt: list of global indices, one per line.

This lives on SD card (or internal data partition), survives app reinstalls.

Build (color screen device, esp32s3)

Same as BookPlayer — external app, compiled for esp32s3 target (covers CYD-2432s028r, m5stack-cores3, etc).

# source IDF (example)
source ~/esp/esp-idf/export.sh
export TACTILITY_SDK_PATH=/path/to/TactilitySDK  # or use --local-sdk

python3 tactility.py Apps/BibleVerse build esp32s3 --local-sdk

Output: build/BibleVerse.app installable via Tactility file manager or tactility.py ... install <ip>

Future extensions

  • Voice memo: record to /sdcard/bible_memos/<global>.wav using same I2S code as BookPlayer
  • TTS read aloud: use esp tts or pre-generated mp3 like BookPlayer pages
  • Book picker UI (like BookPlayer picker but for bible books)
  • Highlight color, search, jump to reference dialog