From 1dff0aa8549fc046f739f4affcb9fb9b7b799457 Mon Sep 17 00:00:00 2001 From: Mike Langmayr Date: Tue, 20 Oct 2026 17:58:02 -0700 Subject: [PATCH] Send APPLYMOD and APPLYDIO in uppercase hex and allow 15 seconds for an Archon reply --- camerad/archon_controller.cpp | 3 +++ utils/network.h | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/camerad/archon_controller.cpp b/camerad/archon_controller.cpp index e6150af..6df2aac 100644 --- a/camerad/archon_controller.cpp +++ b/camerad/archon_controller.cpp @@ -597,10 +597,12 @@ namespace Camera { */ std::string ArchonController::make_applymod_command(int mod) const { std::ostringstream oss; + // Archon rejects lowercase hex, so MOD11 must be 0A, not 0a oss << "APPLYMOD" << std::setfill('0') << std::setw(2) << std::hex + << std::uppercase << (mod-1); return oss.str(); } @@ -3190,6 +3192,7 @@ namespace Camera { << std::setfill('0') << std::setw(2) << std::hex + << std::uppercase << (module-1); error = this->send_cmd(applystr.str()); } diff --git a/utils/network.h b/utils/network.h index 2d8f50c..68afcf3 100644 --- a/utils/network.h +++ b/utils/network.h @@ -37,9 +37,9 @@ namespace Network { - // 3000 was not enough for an Archon APPLYALL, which measures 4.5s on a - // controller whose bias boards make its power-down ramp slow - constexpr const int POLLTIMEOUT = 5000; /// default Poll timeout in msec + // An Archon APPLYALL measures 6s on a controller whose bias boards make its + // power-down ramp slow; a reply later than this desyncs every command after it + constexpr const int POLLTIMEOUT = 15000; /// default Poll timeout in msec constexpr const int LISTENQ = 64; /// listen(3n) backlog constexpr const int UDPMSGLEN = 256; /// UDP message length constexpr const int CONNECT_TIMEOUT_SEC = 3; /// Connect() timeout in seconds