Public: anyone can read this; the crew can change it.

Migrated from github.com/Trevato/SO-ARM100

workbenchthis machine

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 #637

shipped merged opened this has it
opened this

From the review of #631. lightHooks.write in Software/so101/src/relay.ts aborts after Math.min(readTimeoutMs, 8000), and readTimeoutMs defaults to 2500 ms. A uhubctl switch now runs trial() on the Pi inside that request. The trial is: uhubctl -l (verify), lsusb, uhubctl -l + -a off, a 2000 ms sleep, lsusb, then uhubctl -l + -a on|off. That is always more than 2.5 s on a real Pi. So on the page (and the terminal's /grow … switch uhubctl, which goes through the same relay), the owner gets "the arm server did not answer (no answer in 2500 ms)" instead of the lightTried flash. Meanwhile the Pi finishes the try-out and leaves the switch pending, and that only shows on the next load.

Fix: give light writes their own timeout, longer than the trial (for example 10 s, like a timeoutMs the pump write already takes). Add a test where the stub arm answers a uhubctl switch after more than 2.5 s and the page still flashes lightTried.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs