Disable dangerous motor reset command after causing telescope reboot

The motor reset command (cmd 14003, inferred from a gap in the WsCmd enum)
caused the telescope to immediately reboot during live testing. The Android
app never uses ReqMotorReset — it only uses joystick (14006-14009), run
(14000) and stop (14002). Motor homing is handled internally by the firmware
during astro calibration or panorama operations.

Changes:
- MotorReset() now returns an error instead of sending the command
- CLI "motor reset" shows the disabled message
- Documented the incident and lessons in TEST_RESULTS.md
- Confirmed motor position query (cmd 14001) works but returns NEED_RESET
- Confirmed slew movements (all directions/speeds) work safely after reboot

💘 Generated with Crush

Assisted-by: Crush:glm-5.2
This commit is contained in:
Jacquin Antoine
2026-07-12 15:24:11 +02:00
parent 814a836c5a
commit c01a99093f
3 changed files with 31 additions and 10 deletions

View File

@ -98,6 +98,25 @@ Le `motor stop` interrompt un slew en cours instantanément.
`ReqMotorRunTo` : moteur ID, position cible, vitesse. Fire-and-forget (pas de ack type=3).
#### 4.6 Motor get-position (cmd 14001 — inféré, confirmé fonctionnel)
| Test | Commande | Résultat |
|------|----------|----------|
| Position moteur 0 | `motor position 0` | ✅ reply type=3, `code=-14520` (NEED_RESET) |
| Position moteur 1 | `motor position 1` | ✅ reply type=3, `code=-14520` (NEED_RESET) |
L'ID 14001 n'est pas dans le WsCmd enum de l'APK mais fonctionne — le firmware répond avec `ResMotorPosition{id, code, position}`. Le `code=-14520` correspond à `CODE_STEP_MOTOR_NEED_RESET` : les moteurs n'ont pas été homed.
#### 4.7 Motor reset (cmd 14003 — ⚠️ DANGEREUX, DÉSACTIVÉ)
| Test | Commande | Résultat |
|------|----------|----------|
| Reset moteur 0 | `motor reset 0 0` | ⚠️ **A causé le reboot du télescope** |
L'ID 14003 est inféré (gap entre STOP=14002 et JOYSTICK=14006). L'envoi de `ReqMotorReset{id, direction}` a provoqué un **reboot immédiat du télescope**. La commande est désormais **désactivée** dans le code et retourne une erreur explicite.
**Leçon** : ne jamais envoyer de commandes inférées (IDs non confirmés dans le WsCmd enum de l'APK) sans validation préalable. L'app Android n'utilise que les commandes joystick (14006-14009), run (14000) et stop (14002). Le reset/home des moteurs est probablement géré côté firmware uniquement, déclenché par la calibration astro ou le panorama.
#### 4.6 Observations sur la lecture de position
- **`focus_position`** (moteur de mise au point) : visible dans `state``focus_position:{pos:593}`, reste stable pendant les mouvements de pointage.