Complete reverse-engineering of the DWARFLAB Android app (v3.4.0) protocol
and implementation of a working CLI tool to control DWARF II telescopes.
Analysis (from APK decompilation with jadx):
- Extracted 17 protobuf definitions (382 messages) from embedded descriptors
- Mapped all 323 WebSocket command IDs across 16 modules
- Documented the full protocol: BLE discovery, WebSocket control (port 9900),
RTSP preview, WsPacket envelope (proto v2.3)
- Documented the Android UI structure (screens, navigation, shooting modes)
- Key discovery: telescope responds with type=3 (reply), not type=1 (response),
and several commands are fire-and-forget (RGB, camera open/close)
dwarfctl Go client:
- Protobuf bindings generated from extracted .proto files (397 messages)
- WebSocket transport layer with request-response matching and notification fan-out
- Typed API covering cameras, motors, astrophotography, focus, tracking, system, power
- Cobra CLI with 30+ subcommands and --debug traffic logging
- 57 unit tests (transport round-trip, command routing, proto encoding)
- Validated on real hardware: state, photo, motor slew (all directions/speeds),
focus, RGB, time/location sync all confirmed working
💘 Generated with Crush
Assisted-by: Crush:glm-5.2
53 lines
816 B
Protocol Buffer
53 lines
816 B
Protocol Buffer
// source: param.proto
|
|
package param;
|
|
syntax = "proto3";
|
|
|
|
message ReqSetExposure {
|
|
uint64 param_id = 1;
|
|
int32 mode = 2;
|
|
int32 value = 3;
|
|
}
|
|
|
|
message ReqSetGain {
|
|
uint64 param_id = 1;
|
|
int32 mode = 2;
|
|
int32 value = 3;
|
|
}
|
|
|
|
message ReqSetWb {
|
|
uint64 param_id = 1;
|
|
int32 mode = 2;
|
|
int32 value = 3;
|
|
}
|
|
|
|
message ReqSetGeneralIntParam {
|
|
uint64 param_id = 1;
|
|
int32 value = 2;
|
|
}
|
|
|
|
message ReqSetGeneralFloatParam {
|
|
uint64 param_id = 1;
|
|
float value = 2;
|
|
}
|
|
|
|
message ReqSetGeneralBoolParams {
|
|
uint64 param_id = 1;
|
|
bool value = 2;
|
|
}
|
|
|
|
message ReqSetAutoParam {
|
|
int32 camera_type = 1;
|
|
int32 shooting_tech = 2;
|
|
bool is_auto = 3;
|
|
}
|
|
|
|
message ResSetAutoParam {
|
|
int32 shooting_mode = 1;
|
|
int32 camera_type = 2;
|
|
int32 shooting_tech = 3;
|
|
bool is_auto = 4;
|
|
bool update_all = 5;
|
|
int32 code = 6;
|
|
}
|
|
|