TINCLIBC: Wi-Fi setup for the TI-84 Plus CE. A calculator program that connects your ESP8266 board to Wi-Fi, shows its status and tests the connection, so programs built with tinclib can get online. Apps that need setup hand off to it and get the result back.
- Status screen: Wi-Fi state, board clock, slot, signal (RSSI) and IP.
- Saved networks: as many slots as the board reports (up to 254). Five show at a time, and the list scrolls with a scrollbar when there are more. Each slot can be set (SSID, masked password, hidden network) or forgotten.
- Connection test: Wi-Fi, the board clock, and one HTTPS GET of
hello.txtfrom GitHub, printed on 200 (with the TLS failure reason if the handshake or certificate check fails). - Wi-Fi lock aware: if the board locks its Wi-Fi profiles (for example the PC build of the firmware), the slot list is greyed out, and selecting a slot shows a notice instead.
- About: app, protocol, tinclib, firmware (with board name) and titrmlib versions.
- Tested: host tests with ASan and UBSan, and emulator tests in CEmu.
tinclib-config is one part of four:
| Repo | What |
|---|---|
| tinclib | The C library your calculator program links against |
| tinclib-firmware | Firmware for the ESP8266 board, which does the networking |
| tinclib-config (this one) | TINCLIBC, the calculator app for Wi-Fi setup |
| tinclib-protocol | The wire protocol between calculator and board |
See AGENTS.md for the design rules.
- Flash tinclib-firmware v0.7 onto the board. Older firmware fails the handshake, and the status screen says to update it.
- Download
TINCLIBC.8xpfrom Releases. - Send it to the calculator with TI Connect CE or TILP, along with the CE C libraries (graphx, keypadc, fileioc, usbdrvce, srldrvce).
- Plug in the board, run
prgmTINCLIBC, and add your network under saved networks.
- Not in protocol 0.7 yet: scan, connect-now, and the insecure-TLS toggle.
- Handoff is blocked: see Handoff.
- Needs a lot of free RAM to start, even when archived: the program
(36.5 KB in v0.6.1, 42.5 KB in v0.6.0) is copied into RAM, and LibLoad loads USBDRVCE,
GRAPHX, SRLDRVCE, FILEIOC and KEYPADC next to it. 63 KB free wasn't
enough on a real TI-84 Plus CE (
ERR: MEMORY); after a RAM reset it started. The exact minimum isn't measured. An app that opens TINCLIBC needs this much on top of its own RAM.
Install the CE C toolchain (v15.0) and put CEdev/bin on your PATH.
Dependencies are pinned git submodules under lib/:
| Submodule | Tag |
|---|---|
| tinclib | v0.7.0 |
| tinclib-protocol | v0.7 |
| titrmlib | v0.4.2 |
tinclib has its own nested copy of the protocol, which isn't checked out or
built here. CI fails if it pins a different commit than lib/tinclib-protocol.
git clone --recursive https://github.com/gavinhsmith/tinclib-config.git
# or, in an existing clone:
git submodule update --initmake # -> bin/TINCLIBC.8xp
make handoff # -> bin/handoff/THANDOFF.8xp, a tinclib app for the handoff test
make cleanTo run it, the calculator needs the CE C libraries (graphx, keypadc, fileioc, usbdrvce, srldrvce).
Typing on the keypad: [alpha] types one letter and [2nd][alpha] locks alpha.
[mode] switches letters between lower and upper case. Only the symbols
. : - ? + " * / , ( ) ^ and space can be typed.
tinclib owns the byte layout (lib/tinclib/src/tinc_config.c), and
src/handoff.h mirrors it. TINCLIBC only acts on a request
whose result is still NONE. It writes back the result and a nonce echo, then
exits. The app comes back through its own os_RunPrgm callback.
The result is:
OKif Wi-Fi is up (forTEST_CONN, if the test passed)FAILEDwith the error code if there's no boardCANCELLEDotherwise
Known blocker: in CEmu (OS 5.8.5), the handoff crashes the calculator
(RAM Cleared) when the called program is bigger than the caller: on
launch, or on the callback return. TINCLIBC is about 37 KB, so tests/handoff fails until this is fixed in
tinclib or CEdev.
Host tests (plain C, ASan + UBSan):
test_handoff: parsing and writing the handoff appvartest_admin: admin command payloads, with the link stubbedtest_interop: tinclib's realtinc_openConfig()andtinc_takeSetupResult()against our parser, on tinclib's host stubs
make -C tests # or: make host-test
make -C tests SANITIZE= # toolchains without sanitizers (e.g. MinGW)Emulator tests run in CEmu via cemu-autotester, which ships with the toolchain.
You need a TI-84 Plus CE ROM dump (not included; it's copyrighted) with the
CE C libraries installed,
or set AUTOTESTER_LIBS_GROUP to clibs.8xg:
make && make handoff
AUTOTESTER_ROM=/path/to/ce.rom python tests/autotest.py autotest.json tests/handoff/autotest.jsonautotest.json: the menu draws (no board in the emulator) and[clear]exits.tests/handoff/autotest.json: THANDOFF callstinc_openConfig(), TINCLIBC shows its hint,[clear]exits, and THANDOFF'stinc_init()reportsFAILED(no board).
tests/autotest.py launches through AsmHook2 on arTIfiCE-jailbroken ROMs
(OS 5.5+ has no Asm(), reusing titrmlib's runner. Failing screens are saved
as PNGs under tests/build/. To re-record a CRC after a UI change, check the
PNG, then copy the CRC the autotester reports into expected_CRCs.
.github/workflows/ci.yml checks the protocol pins match and runs the host
tests. It then builds TINCLIBC and THANDOFF and runs the emulator tests.
- Emulator tests run only when the
CE_ROM_TOKENrepo secret is set. Otherwise they're skipped with a warning. The ROM is ~4 MB, far over the 48 KB secret limit, so it lives asti-84ce.romin the private repogavinhsmith/ce-rom.CE_ROM_TOKENis a fine-grained PAT with read-only Contents access to that one repo. - Releases: push a
v*tag to publish a GitHub release withTINCLIBC.8xpattached. The release only happens if the emulator tests pass, so none is published while the handoff test is failing (v0.4.0tov0.4.2have no release for this reason;v0.6.0andv0.6.1were released by hand).