Reverse-engineer DWARF II telescope API and build open-source Go client
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
This commit is contained in:
25
dwarfctl/Makefile
Normal file
25
dwarfctl/Makefile
Normal file
@ -0,0 +1,25 @@
|
||||
.PHONY: proto build clean test install
|
||||
|
||||
PROTOC ?= protoc
|
||||
GO ?= go
|
||||
BINARY = dwarfctl
|
||||
|
||||
build: ## Build the dwarfctl binary
|
||||
$(GO) build -o $(BINARY) ./cmd/dwarfctl/
|
||||
|
||||
proto: ## Regenerate Go protobuf bindings from .proto files
|
||||
$(PROTOC) --go_out=. --go_opt=paths=source_relative --proto_path=. dwarf.proto
|
||||
|
||||
install: build ## Install dwarfctl to $$GOBIN
|
||||
$(GO) install ./cmd/dwarfctl/
|
||||
|
||||
test: ## Run tests
|
||||
$(GO) test ./...
|
||||
|
||||
clean: ## Remove build artifacts
|
||||
rm -f $(BINARY)
|
||||
|
||||
help: ## Show this help
|
||||
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN{FS=":.*?## "}{printf " \033[36m%-12s\033[0m %s\n",$$1,$$2}'
|
||||
|
||||
.DEFAULT_GOAL := build
|
||||
Reference in New Issue
Block a user