screentinker/brightsign/server
ScreenTinker 350cd31414 brightsign: read the server flag as an integer, not a Boolean
`if serverEnabled then` demands a genuine Boolean in BrightScript. ServerEnabled()
was declared As Boolean but branched on type() over ParseJSON output - "Boolean",
"Integer", "roInt", "String" - and none of those reliably produced one for a JSON 1.
The device took the whole file down with it:

    Script runtime error: Type Mismatch. (runtime error &h18) in SSD:/autorun.brs(63)
    Load or runtime error in autorun. Forcing recovery.

...and then looped through recovery, re-fetching autorun.zip - which contained the
same broken file, so recovery could not recover.

ServerEnabledFlag() returns 0 or 1 and the call sites compare explicitly. It finds
the setting by substring rather than by parsing, which is cruder and can be fooled
by a "server" key inside another string, but cannot mismatch a type. There is no
BrightScript interpreter on the machine this is written on, so every type guess
costs a boot cycle plus a recovery loop; a config file we write ourselves does not
justify that risk. Anything short of a clear yes stays a player.

Verified on XT245 URD3C6000823: clean boot, no runtime error, server up on :8181
45s after reboot, diagnostics screen showing the setup address.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014kfhrUPit5MCqxeTQyqr56
2026-08-18 17:37:38 -05:00
..
autorun.brs brightsign: read the server flag as an integer, not a Boolean 2026-08-18 17:37:38 -05:00
bs-payload-install.js Run the ScreenTinker server on the player it serves (#288) 2026-08-18 15:16:09 -05:00
bs-server-boot.js Make the on-device server opt-in, and stop the status port answering the LAN (#291) 2026-08-18 16:32:37 -05:00
node-server.html Make the on-device server opt-in, and stop the status port answering the LAN (#291) 2026-08-18 16:32:37 -05:00
server.env.example Run the ScreenTinker server on the player it serves (#288) 2026-08-18 15:16:09 -05:00
st-config.example.json Make the on-device server opt-in, and stop the status port answering the LAN (#291) 2026-08-18 16:32:37 -05:00