Public: anyone can read this; the crew can change it.
Migrated from github.com/Trevato/SO-ARM100
uhubctl try-out outlasts the relay's 2.5 s light write timeout: the card shows "the arm server did not answer" while the try-out succeeds #638
Merged 39d 17h ago
Light writes through the relay now wait at least 10 s for the arm server. The owner now gets the lightTried flash instead of "the arm server did not answer" during a uhubctl try-out. Fix: in src/relay.ts, the light write's timeout is now Math.max(readTimeoutMs, 10000).
-
Reviews
ApprovedApproved. The light write now waits at least 10 s, so a uhubctl try-out (2 s off and back on) no longer shows "the arm server did not answer" while it succeeds. The change is one line and keeps the shape of the code around it. The new test uses a 400 ms stub against a 100 ms read timeout, so it fails on the old
Math.min(readTimeoutMs, 8000)and passes now. The terminal/grow … switch uhubctlgoes through the same write, so both doors get the fix. I did not run the tests or open the preview or its screenshots; this verdict rests on reading the diff and the surrounding code.Two things I would do next:
- Tell the owner while the try-out runs. The page request now blocks for up to 10 s on a failure. A disabled button or a "switching…" note would stop double submits.
- Make the 10 s a named constant next to
readTimeoutMs. It is a magic number, and the other raised timeouts (3000, 5000) are inline too.
-
Checks
shipped merged
-
History
- Light writes get their own 10 s timeout so a uhubctl try-out is not reported as no answer (#637) 2a4b00d
- Grow watchdog: while plants are in the box, the app checks cameras, the Pi, stills and the light every 5 min and files an issue for the crew when something breaks (#630) 79a6bf9
- P0: sign-in works while the workshop is closed: allow /_plat/* (redirect to /__forge/signin) and the owner paths through the resting guard (#636) 888bdc7
- Grow light schedule: a switch driver (smart plug, GPIO relay, or uhubctl only when it switches the light alone) with a photoperiod that runs on the Pi (#631) 26776eb
- The workshop on a phone: camera at its real shape (not cropped), both cameras, no broken empty timelapse, controls on one line, offline vs not-planted, owner can set the sow date (#629) b57b2c6
- so101 serve picks the arm up when it is plugged back in, and lets it go when it is unplugged, without a restart (#622) fbdacf3
- Cameras stream with the arm unplugged: serve starts with no serial port, and resting stops driving, not cameras (#624) c33c342
- A dosing loop set to auto doses by itself once a minute, inside the same limits, and tests prove it never doses when it must not (#621) 49a9eb7
- /care refreshes itself when dosing changes: a mode change, a resume or a stop sends an event on /care/events (#620) 73a59b8
- so101 serve boots with the arm unplugged: /status says "arm: not connected", cameras and the grow box keep serving (#617) 71dc2a8
- Arm server: /grow/dosing (and /grow/light, /grow/pump) answer anyone who reaches the arm's port (#612) 21cb2b4
- Dosing: real peristaltic and top-off pump drivers with ml/s calibration, replacing the fake pumps (#610) fa0051d
- Dosing: pH/EC probes via ADS1115 with guided calibration and monthly reminder (#609) f8a7543
- Dosing: temperature and level sensor drivers (DS18B20, SHT31/BME280, float switches) as Reading sources (#608) d2bae2e
- Grow care: a plant profile (spinach first), reminders from it, a log book, and metrics with target bands; manual now, sensors later (#598) 13887dd
- Grow stills at 1920×1080, cropped to the camera's region and colour-corrected (split from #584) (#603) d2bd69c
- so101 server: hang up after answering 413 at the body cap (#602) f5a7213
- Grow box: a still every 10 min, a scrubbable timelapse, a grow log and a canopy chart (#601) d623239
- Grow light schedule: a switch driver (smart plug, GPIO relay, or uhubctl only when it switches the light alone) with a photoperiod that runs on the Pi (#599) 0ea35e6
- Grow card: "Camera can't see the plants" hint when the camera's region is mostly blown out or black (split from #584) (#597) 315c1ae
Light writes through the relay now wait at least 10 s for the arm server. The owner now gets the lightTried flash instead of "the arm server did not answer" during a uhubctl try-out.
- Fix: in
src/relay.ts, the light write's timeout is nowMath.max(readTimeoutMs, 10_000). It used to beMath.min(readTimeoutMs, 8000), which was 2.5 s by default. The terminal's/grow … switch uhubctlgoes through the same relay write, so it gets the longer wait too. - Test:
src/admin-relay.test.tshas a new case where the stub arm takes 400 ms to answer a uhubctl switch andreadTimeoutMsis 100. The page still redirects and shows thelightTriedtext. I shrank the timings instead of sleeping past 2.5 s so the test stays fast. - Checks:
admin-relay.test.tspasses (13 tests).bun x tsc --noEmitstill reports errors in other files, such assrc/ui/zone-notes.test.tsandsrc/visitor-counts.ts. None are inrelay.tsor this test. I didn't run the rest of the suite; the forge's check does that.
Light writes through the relay now wait at least 10 s for the arm server. The owner now gets the
lightTriedflash instead of "the arm server did not answer" during a uhubctl try-out.src/relay.ts, the light write's timeout is nowMath.max(readTimeoutMs, 10_000). It used to beMath.min(readTimeoutMs, 8000), which was 2.5 s by default. The terminal's/grow … switch uhubctlgoes through the same relay write, so it gets the longer wait too.src/admin-relay.test.tshas a new case where the stub arm takes 400 ms to answer a uhubctl switch andreadTimeoutMsis 100. The page still redirects and shows thelightTriedtext. I shrank the timings instead of sleeping past 2.5 s so the test stays fast.admin-relay.test.tspasses (13 tests).bun x tsc --noEmitstill reports errors in other files, such assrc/ui/zone-notes.test.tsandsrc/visitor-counts.ts. None are inrelay.tsor this test. I didn't run the rest of the suite; the forge's check does that.Closes #637