← Technical specifications

ROT2PROG protocol

TCP command protocol used by the SPID MD01 rotor controller.

The MD01 controller accepts commands over a TCP connection (default port 23). All packets are 13 bytes in the command direction and 12 bytes in the response direction. The protocol is binary; all values are raw bytes, not ASCII.

Each command–response exchange completes synchronously: the client sends 13 bytes, then reads a 12-byte response before sending the next command.

Command packet (13 bytes)

Byte(s) Field Value Notes
0 S (start) 0x57 Always 'W'
1–4 H1–H4 (azimuth) encoded angle Ignored for Stop. See encoding below.
5 PH controller setting Ignored for Stop. Use 0x00.
6–9 V1–V4 (elevation) encoded angle Ignored for Stop. See encoding below.
10 PV controller setting Ignored for Stop. Use 0x00.
11 K (command) see table below Determines the command type.
12 END 0x20 Always ' ' (space)
K byte Command
0x0F Stop — stop rotation and return current position
0x6F Get position — return current position without moving
0x5F Set position — move to the azimuth/elevation in H1–H4, V1–V4

Response packet (12 bytes)

All three commands return a 12-byte position response:

Byte(s) Field Value Notes
0 S (start) 0x58 Always 'X' for a position response. Stop may also respond with 0x57 ('W') as an ACK when the rotor was actively moving.
1–4 H1–H4 (azimuth) encoded angle Current azimuth. See encoding below.
5 PH controller setting Reflects the controller's internal resolution setting.
6–9 V1–V4 (elevation) encoded angle Current elevation. See encoding below.
10 PV controller setting Reflects the controller's internal resolution setting.
11 END 0x20 Always ' ' (space)

Angle encoding

Angles are encoded as a 4-byte big-endian integer representing (angle_degrees + 360) × 100, with each byte being one decimal digit of that integer (not ASCII — raw byte values 0–9):

value = H1×1000 + H2×100 + H3×10 + H4
angle_degrees = value / 100.0 − 360.0

For example, azimuth 5.54° is encoded as (5.54 + 360) × 100 = 36554, giving bytes [3, 6, 5, 5, 4]. One could expect ASCII encoding (bytes 0x300x39), but the hardware returns raw digit bytes (0–9). The SALSA backend uses raw bytes.

TCP connection

The controller accepts a single persistent TCP connection on port 23. The SALSA backend keeps the connection alive across commands to avoid re-connection delays during active tracking. A 1-second timeout is applied to both reads and writes. On connection failure the backend reconnects automatically on the next control loop cycle (1 Hz).

A Stop command is issued once when the backend first connects, to ensure the rotor is not moving from a previous session.

References