bitspire/apps/machine
Padreug ea4c1f406b fix(machine): make the dispenser optional, as the validator already was
initializeHal created and initialised the dispenser unconditionally, so a
missing dispenser device threw and aborted the WHOLE of HAL init — taking
the validator down with it, even when the validator was present and
working.

The Pi bring-up hit exactly that. With a Pyramid Apex correctly wired and
enumerated on /dev/ttyValidator0:

  [ATM] Validator device: /dev/ttyValidator0
  [ATM] Dispenser device: /dev/ttyDispenser-not-fitted
  [Electron] HAL init failed: cannot open /dev/ttyDispenser-not-fitted
  [Recovery] Reloading renderer to re-attempt initialization

and round again, forever, with a perfectly good acceptor attached.

The validator has been optional since it was written — it checks the
device exists, catches init failures, and logs "running dispenser-only".
The dispenser had no equivalent. That asymmetry was the bug, not the
placeholder device path that exposed it: a cash-in-only machine is a
legitimate configuration, and the Raspberry Pi reference build is one.

Mirrors the validator's handling exactly: existence check, try/catch,
null on failure, and a log line saying what the machine will do instead
("running cash-in only"). Three call sites then need guarding —
dispenseCash returns a clear "No dispenser fitted on this machine —
cash-out unavailable" rather than dereferencing null, setCassettes still
records the layout but skips the re-init, and cleanup uses an optional
call.

This also removes the sharp edge from the rpi4/rpi5 presets added in the
previous commit. Their dispenser block points at a path that does not
exist because DispenseType has no 'none' variant and DeviceConfig
requires the field. That is still worth fixing properly with a real
'none' variant, but the machine no longer has to care.
2026-09-29 18:16:41 +02:00
..
electron fix(machine): make the dispenser optional, as the validator already was 2026-09-29 18:16:41 +02:00
public feat(machine): add Ubuntu font and kiosk animations 2026-03-01 12:09:42 -05:00
src feat(machine): add rpi4/rpi5 device presets, wire 'apex' into the app types 2026-09-25 22:56:57 +02:00
.env.example docs: relay + LNbits pubkey are seed-provided, not required (#70) 2026-07-02 21:53:51 +00:00
components.json feat(docker): add dev.sh with auto-funding and ATM app setup 2026-02-15 14:19:16 -05:00
index.html security(H1): add Content Security Policy 2026-03-07 09:36:59 -05:00
package.json feat(machine): NFC Bolt Card reader driver + IPC (main process) 2026-08-05 04:42:07 +02:00
tsconfig.json feat(docker): add dev.sh with auto-funding and ATM app setup 2026-02-15 14:19:16 -05:00
tsconfig.node.json feat(docker): add dev.sh with auto-funding and ATM app setup 2026-02-15 14:19:16 -05:00
vite.config.ts refactor(rename): @lamassu/* → @bitSpire/* package scopes 2026-06-01 19:08:03 +02:00
vitest.config.ts chore(machine): set up vitest for apps/machine 2026-06-01 19:12:11 +02:00