Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
en:dev:tailcontrol-command-protocol [2024/11/01 17:22] – [Device Advertisement] darkgrueen:dev:tailcontrol-command-protocol [2025/06/21 14:27] (current) – [Conference Mode] darkgrue
Line 1: Line 1:
-====== TailCoNTROL Command Protocol ======+====== TailControl Command Protocol ======
  
  
-Command list for the Tail Company TailCoNTROL firmware. TailCoNTROL is the unified firmware platform (version 5.//x//.//x// and higher) for the MiTail, MiTail Mini, FlutterWings, and EarGear 2, and covers the shared features that exist across all those devices.+Command list for the Tail Company TailControl firmware. TailControl is the unified firmware platform (version 5.//x//.//x// and higher) for the MiTail, MiTail Mini, FlutterWings, and EarGear 2, and covers the shared features that exist across all those devices.
  
 All commands are case-sensitive. Trailing whitespace (e.g., `NULL`, `CR`, etc.) are ignored. The space between a command keyword and the parameters is mandatory. All commands are case-sensitive. Trailing whitespace (e.g., `NULL`, `CR`, etc.) are ignored. The space between a command keyword and the parameters is mandatory.
  
 <WRAP round todo 90%> <WRAP round todo 90%>
-**IMPORTANT NOTICE:** TailCoNTROL and the TailCoNTROL Protocol is still under development. Some commands and features described here relate to a future release and are subject to change at this time, especially EarGear 2 features.+**IMPORTANT NOTICE:** TailControl and the TailControl Protocol is still under development. Some commands and features described here relate to a future release and are subject to change.
 </WRAP> </WRAP>
  
Line 35: Line 35:
  
 <WRAP round todo 90%> <WRAP round todo 90%>
-TailCoNTROL will use a new Service and Characteristics UUIDs going forward, to distinguish it from previous firmwares (and to further enforce the “forklift upgrade” required).+TailControl will use a new Service and Characteristics UUIDs going forward, to distinguish it from previous firmwares (and to further enforce the “forklift upgrade” required).
  
-The BLE Device Service for TailCoNTROL is ''19F8ADE2-D0C6-4C0A-912A-30601D9B3060'': +The BLE Device Service for TailControl is ''19F8ADE2-D0C6-4C0A-912A-30601D9B3060'': 
-  * RX Characteristic is ''5E4D86AC-EF2F-466F-A857-8776D45FFBC2'' and +  * RX Characteristic is ''5E4D86AC-EF2F-466F-A857-8776D45FFBC2''. 
-  * TX Characteristic is ''567A99D6-A442-4AC0-B676-4993BF95F805''+  * TX Characteristic is ''567A99D6-A442-4AC0-B676-4993BF95F805'', and the 
-  * Under the standard Device Information Service (DIS, ''0x180A'') is +  * Battery Voltage is ''E818BDA3-88A7-43C0-8509-6E0BBB6F55D9''.
-    * Manufacturer Name ''0x2A29'' (''The Mechanical Tail Company Limited''), +
-    * Model Number ''0x2A24'', +
-    * Firmware Revision ''0x2A26'', and +
-    * Hardware Revision ''0x2A27''. +
-  * Under the standard Battery Service UUID (''0x180F'') is +
-    * Battery Percentage ''0x2A19'', +
-    * Battery Voltage is ''E818BDA3-88A7-43C0-8509-6E0BBB6F55D9'', and the +
-    * Charging State (if hardware supported) is ''5073792e-4fc0-45a0-b0a5-78b6c1756c91''.+
 </WRAP> </WRAP>
  
Line 55: Line 47:
 </WRAP> </WRAP>
  
-===== TailCoNTROL Device Indicators =====+===== TailControl Device Indicators =====
  
 ==== Blue LED ==== ==== Blue LED ====
Line 103: Line 95:
 ==== Automatic Actions ==== ==== Automatic Actions ====
  
-TailCoNTROL will automatically shut down the device if there is no BLE connection for 5 minutes. This behavior is suspended if a PD-capable adapter is attached (to allow for charging and/or operating from a external battery) **OR** if the firmware is compiled with a compile-time option to disable the timer (to facilitate wired serial console control where BLE connectivity is not used) [Note: to be moved to a configuration option in NVS in a future release].+TailControl will automatically shut down the device if there is no BLE connection for 5 minutes. This behavior is suspended if a PD-capable adapter is attached (to allow for charging and/or operating from a external battery) **OR** if the firmware is compiled with a compile-time option to disable the timer (to facilitate wired serial console control where BLE connectivity is not used) [Note: to be moved to a configuration option in NVS in a future release].
  
 Additional automatic actions are described in [[en:dev:tailcontrol-command-protocol#No-phone Mode|No-phone Mode]], below. Additional automatic actions are described in [[en:dev:tailcontrol-command-protocol#No-phone Mode|No-phone Mode]], below.
  
  
-===== Tail Moves =====+===== Move Commands =====
  
 Move commands return ''<movename> BEGIN'' upon start, and '' <movename> END'' upon completion. If the move is set to return home after completion (all firmware moves are), then it will be immediately followed by a ''TAILHM BEGIN'' and a ''TAILHM END'' as well. Move commands return ''<movename> BEGIN'' upon start, and '' <movename> END'' upon completion. If the move is set to return home after completion (all firmware moves are), then it will be immediately followed by a ''TAILHM BEGIN'' and a ''TAILHM END'' as well.
Line 160: Line 152:
 ===== EarGear 2-only Commands ===== ===== EarGear 2-only Commands =====
  
-| **LISTENMODE** | Starts Listen Mode[[#Listen Mode|see below]], returns ''OK''+| **LISTENMODE** (or **LISTEN FULL**) | Starts Listen Mode ([[#Listen Mode|see below]]), returns ''OK''
-| **STOPLISTEN** | Stops Listen Mode[[#Listen Mode|see below]], returns ''OK''+| **STOPLISTEN** (or **ENDLISTEN**) | Stops Listen Mode ([[#Listen Mode|see below]]), returns ''OK''
-| **STOPTILT** | Stops Tilt Mode[[#Tilt Mode|see below]], returns ''OK''+| **STOPTILT** (or **ENDTILTMODE**) | Stops Tilt Mode ([[#Tilt Mode|see below]]), returns ''OK''
-| **TILTMODE** | Starts Tilt Mode[[#Tilt Mode|see below]], returns ''OK'' |+| **TILTMODE** (or **TILTMODE START**) | Starts Tilt Mode ([[#Tilt Mode|see below]]), returns ''OK'' |
  
 +===== RGB LED Commands =====
 +
 +| **RGBOFF** | **RGB** LEDs **OFF**, returns ''OK'' |
 +| **RGBRBO** | **RGB** **R**ain**B**ow pattern, returns ''OK'' |
 +| **RGBRB2** | **RGB** **R**ain**B**ow pattern with random sparkly glitter, returns ''OK'' |
 +| **RGBCON** | **RGB** **CON**fetti; random-colored speckles that blink in and fade smoothly, returns ''OK'' |
 +| **RGBSIN** | **RGB** **SIN**e; a colored dot sweeping back and forth, with fading trails, returns ''OK'' |
 +| **RGBJUG** | **RGB** **JUG**gle; eight colored dots, weaving in and out of sync with each other, returns ''OK'' |
 +| **RGBBPM** | **RGB** **BPM**; colored stripes pulsing at a defined Beats-Per-Minute, returns ''OK'' |
 +| **RGBDMO** | **RGB** **DE**m**O**; cycle through all the preceding patterns, changing every 10 seconds, returns ''OK'' |
 +| **RGBTST** | **RGB** **TE**s**T**; color cycle the first and last pixel of the RGB string (endpoints test), returns ''OK'' |
 +| **SETRGB** | **SET** **RGB** configuration and restart after 3 seconds; (e.g., ''SETRGB 325 12 2900''), returns ''OK'' [''numRGBLEDs'' ''maxRGBVolt'' ''maxRGBmAmp''] |
  
 ===== Other Commands ===== ===== Other Commands =====
  
-| **AUTOMODE** | **AUTO**nomous **MO**de[[#Autonomous Mode|see below]], returns ''OK''+| **AUTOMODE** | **AUTO**nomous **MO**de ([[#Autonomous Mode|see below]]), returns ''OK''
-| **DSSP** | **D**irectly **S**et **S**ervo **P**osition[[#Directly Set Servo Position|see below]], returns ''OK'' |+| **DSSP** | **D**irectly **S**et **S**ervo **P**osition ([[#Directly Set Servo Position|see below]]), returns ''OK'' |
 | **HWVER** | Returns **H**ard**W**are **VER**sion; returns ''HWVER LEGACY MITAIL'' or ''HWVER MITAIL x.x'' for tail-series controller hardware, ''HWVER EG2 x.x'' for EarGear 2 controller hardware | | **HWVER** | Returns **H**ard**W**are **VER**sion; returns ''HWVER LEGACY MITAIL'' or ''HWVER MITAIL x.x'' for tail-series controller hardware, ''HWVER EG2 x.x'' for EarGear 2 controller hardware |
 | **PING** | Keepalive heartbeat (from application), returns ''PONG'' | | **PING** | Keepalive heartbeat (from application), returns ''PONG'' |
-| **SETPUSSKEY** | **SET** **P**a**SSKEY**, enable Conference Mode, and restart after 3 seconds[[#Conference Mode|see below]], returns ''OK'' |+| **SETPUSSKEY** | **SET** **P**a**SSKEY**, enable Conference Mode, and restart after 3 seconds ([[#Conference Mode|see below]]), returns ''OK'' |
 | **SHUTDOWN** | **SHUT DOWN** the unit (will lose the BLE connection), returns ''SHUTDOWN BEGIN'' or ''ERR'' if charger is attached | | **SHUTDOWN** | **SHUT DOWN** the unit (will lose the BLE connection), returns ''SHUTDOWN BEGIN'' or ''ERR'' if charger is attached |
 | **STOPAUTO** | **STOP AUTO**nomous Mode, returns ''OK'', followed by ''AUTO END'' | | **STOPAUTO** | **STOP AUTO**nomous Mode, returns ''OK'', followed by ''AUTO END'' |
 | **STOPNPM** | **STOP** **N**o-**P**hone **M**ode and disables it in NVS configuration; returns ''OK'', followed by ''AUTO END'' | | **STOPNPM** | **STOP** **N**o-**P**hone **M**ode and disables it in NVS configuration; returns ''OK'', followed by ''AUTO END'' |
-| **USERMOVE** | [[#User-defined Tail Moves and LEDs Patterns|See below]], returns ''OK''+| **USERMOVE** | Set user-defined move ([[#User-defined Moves and Glow Tip Patterns|see below]]), returns ''OK''
-| **STOPPUSSKEY** | **STOP** **P**a**SSKEY**, disable Conference Mode and restart after 3 seconds[[#Conference Mode|see below]], returns ''OK''+| **STOPPUSSKEY** | **STOP** **P**a**SSKEY**, disable Conference Mode and restart after 3 seconds ([[#Conference Mode|see below]]), returns ''OK''
-| **USERLEDS** | [[#User-defined Tail Moves and LEDs Patterns|See below]], returns ''OK''+| **USERLEDS** | Set user-defined Glow Tip pattern ([[#User-defined Moves and Glow Tip Patterns|see below]]), returns ''OK''
-| **VER** | Returns the firmware **VER**sion number; ''VER x.x.x''followed by a second message: either ''GLOWTIP FALSE'' if a Glow Tip is not connected, or ''GLOWTIP TRUE'' if one is |+| **VER** | Returns the firmware **VER**sion number; ''VER x.x.x''followed by a line that is either ''GLOWTIP TRUE'' if a Glow Tip is connected, or ''GLOWTIP FALSE'' if one is not; and a final line that is either ''RGB TRUE'' if a RGB LED strip is connected, or ''RGB FALSE'' if it is not |
  
  
Line 185: Line 189:
  
 | **BATT** | **BATT**ery percentage, returns the integer value of estimated battery capacity remaining  (e.g., ''61'') | | **BATT** | **BATT**ery percentage, returns the integer value of estimated battery capacity remaining  (e.g., ''61'') |
-| **FORMATNVS** | **FORMAT** **NVS** (erase all contents of the default NVS partitionincluding BLE bonds) and reboot |+| **READCONF** | **READ** running **CONF**iguration; returns space-delimited running configuration parameters (e.g., ''READCONF 1 5 0 15 40 3 8 0 0 1 3 0 1 0 1 1 495974 325 12 2900'') [''ver'' ''minsToSleep'' ''minsToNPM'' ''minNPMPauseSec'' ''maxNPMPauseSec'' ''groupsNPM'' ''servo1home'' ''servo2home'' ''listenModeNPMEnabled'' ''listenModeResponseOnly'' ''groupsLM'' ''tiltModeNPMEnabled'' ''tiltModeResponseOnly'' ''disconnectedCountdownEnabled'' ''homeOnAppPoweroff'' ''conferenceModeEnabled'' ''securityPasskey'' ''numRGBLEDs'' ''maxRGBVolt'' ''maxRGBmAmp''] | 
 +| **WRITECONF** | **WRITE** **CONF**iguration to NVS and set running configuration to match (e.g., ''WRITECONF 1 5 0 15 40 3 8 0 0 1 3 0 1 0 1 1 495974 325 12 2900''), returns ''OK'' [''ver'' ''minsToSleep'' ''minsToNPM'' ''minNPMPauseSec'' ''maxNPMPauseSec'' ''groupsNPM'' ''servo1home'' ''servo2home'' ''listenModeNPMEnabled'' ''listenModeResponseOnly'' ''groupsLM'' ''tiltModeNPMEnabled'' ''tiltModeResponseOnly'' ''disconnectedCountdownEnabled'' ''homeOnAppPoweroff'' ''conferenceModeEnabled'' ''securityPasskey'' ''numRGBLEDs'' ''maxRGBVolt'' ''maxRGBmAmp''] | 
 +**SETDISCONNECTEDCOUNT** | **SET** BLE **DISCONNECTED** power off **COUNT**down parameter in NVS and running configuration (in minutes, ''SETDISCONNECTEDCOUNT 0'' disables automatic poweroff), returns ''OK''
 +| **SETHOLDONSTOP** | **SET** servo **HOLD** is maintained when the servos **STOP** (maintains servo PWM when not moving, default for EarGear 2); returns ''OK''
 +| **UNSETHOLDONSTOP** | **UNSET** servo **HOLD** when the servos **STOP** (servo PWM is dropped when not movingdefault for tail-based devices); returns ''OK''
 +| **SETHOME** | **SET** **HOME** position (0 through 8) for each servo (e.g., ''SETHOME 4 4''), NOTE: only available on FlutterWings, and EarGear 2; returns ''OK'' |
 | **OTA** | Starts firmware **O**ver **T**he **A**ir update process (e.g., ''OTA <expected size in bytes> <expected MD5>''); returns ''BEGIN OTA'' or ''ERR'' on failure to start, ''OTA SUCCESS'' on success, or ''OTA ERR'' on error during OTA process | | **OTA** | Starts firmware **O**ver **T**he **A**ir update process (e.g., ''OTA <expected size in bytes> <expected MD5>''); returns ''BEGIN OTA'' or ''ERR'' on failure to start, ''OTA SUCCESS'' on success, or ''OTA ERR'' on error during OTA process |
-| **READCONF** | **READ** running **CONF**iguration; returns space-delimited running configuration parameters (e.g.''READCONF 1 5 0 15 40 3 8 0 0 0 3 0 0 0 1 0 123456''[''ver'' ''minsToSleep'' ''minsToNPM'' ''minNPMPauseSec'' ''maxNPMPauseSec'' ''groupsNPM'' ''servo1home'' ''servo2home'' ''listenModeNPMEnabled'' ''listenModeResponseOnly'' ''groupsLM'' ''tiltModeNPMEnabled'' ''tiltModeResponseOnly'' ''disconnectedCountdownEnabled'' ''homeOnAppPoweroff'' ''conferenceModeEnabled'' ''securityPasskey''+| **FORMATNVS** | **FORMAT** **NVS** (erase all contents of the default NVS partitionincluding BLE bondsand reboot 
-| **READNVS** | **READ** **CONF**iguration from NVS; returns space-delimited configuration parameters stored in NVS (e.g., ''READNVS 1 5 0 15 40 3 8 0 0 0 0 0 1 0 123456'') [''ver'' ''minsToSleep'' ''minsToNPM'' ''minNPMPauseSec'' ''maxNPMPauseSec'' ''groupsNPM'' ''servo1home'' ''servo2home'' ''listenModeNPMEnabled'' ''listenModeResponseOnly'' ''groupsLM'' ''tiltModeNPMEnabled'' ''tiltModeResponseOnly'' ''disconnectedCountdownEnabled'' ''homeOnAppPoweroff'' ''conferenceModeEnabled'' ''securityPasskey''] |+| **READNVS** | **READ** **CONF**iguration from NVS; returns space-delimited configuration parameters stored in NVS (e.g., ''READNVS 1 5 0 15 40 3 8 0 0 3 0 1 0 1 1 495974 325 12 2900'') [''ver'' ''minsToSleep'' ''minsToNPM'' ''minNPMPauseSec'' ''maxNPMPauseSec'' ''groupsNPM'' ''servo1home'' ''servo2home'' ''listenModeNPMEnabled'' ''listenModeResponseOnly'' ''groupsLM'' ''tiltModeNPMEnabled'' ''tiltModeResponseOnly'' ''disconnectedCountdownEnabled'' ''homeOnAppPoweroff'' ''conferenceModeEnabled'' ''securityPasskey'' ''numRGBLEDs'' ''maxRGBVolt'' ''maxRGBmAmp''] |
 | **REBOOT** | **REBOOT** after 3 seconds, returns ''OK'' | | **REBOOT** | **REBOOT** after 3 seconds, returns ''OK'' |
-| **SETHOME** | **SET** **HOME** position (0 through 8) for each servo (e.g., ''SETHOME 4 4''), NOTE: only available on FlutterWings, and EarGear 2; returns ''OK''+| **TASKU** | Prints to the hardware serial console the minimum amount of remaining stack space that was available to the task since the task started executing (high water mark), returns ''OK'' |
-| **TASKU** | Prints to the hardware serial console the minimum amount in words of remaining stack space that was available to the task since the task started executing, returns ''OK''+
-| **WRITECONF** | **WRITE** **CONF**iguration to NVS and set running configuration to match (e.g., ''WRITECONF 1 5 0 15 40 3 8 0 0 0 3 0 0 0 1 0 123456''), returns ''OK'' [''ver'' ''minsToSleep'' ''minsToNPM'' ''minNPMPauseSec'' ''maxNPMPauseSec'' ''groupsNPM'' ''servo1home'' ''servo2home'' ''listenModeNPMEnabled'' ''listenModeResponseOnly'' ''groupsLM'' ''tiltModeNPMEnabled'' ''tiltModeResponseOnly'' ''disconnectedCountdownEnabled'' ''homeOnAppPoweroff'' ''conferenceModeEnabled'' ''securityPasskey''| +
 ===== Directly Set Servo Position ===== ===== Directly Set Servo Position =====
  
Line 222: Line 228:
  
  
-===== User-defined Tail Moves and LEDs Patterns =====+===== User-defined Moves and Glow Tip Patterns =====
  
-Up to 4 user-defined move definitions and 4 LED patterns can be sent over the BT/BLE connection and assigned to user+Up to 4 user-defined move definitions and 4 Glow Tip LED patterns can be sent over the BT/BLE connection and assigned to user
 presets (callable with the ''TAILU1'' ... ''TAILU4'' commands). These presets will be lost once the unit is powered off. presets (callable with the ''TAILU1'' ... ''TAILU4'' commands). These presets will be lost once the unit is powered off.
  
-The two instructions used to send a tail move or a Glow Tip LED pattern definition follow the same syntax and consist of a+The two instructions used to send a move or a Glow Tip LED pattern definition follow the same syntax and consist of a
 keyword (''USERMOVE'' or ''USERLEDS'') followed by a number of parameters. These are letter-number pairs, where the letter keyword (''USERMOVE'' or ''USERLEDS'') followed by a number of parameters. These are letter-number pairs, where the letter
 defines the type of parameter (see table, below). defines the type of parameter (see table, below).
Line 360: Line 366:
 ===== Conference Mode ===== ===== Conference Mode =====
  
-Conference mode pairs the user's phone with the TailCoNTROL device and establishes a bond that performs long-term storage of encryption info (particularly keys) so that the devices “know” each other and can easily reconnect in an encrypted way. This protects your device in a number of different ways:+Conference mode pairs the user's phone with the TailControl device and establishes a bond that performs long-term storage of encryption info (particularly keys) so that the devices “know” each other and can easily reconnect in an encrypted way. This protects your device in a number of different ways:
  
   * **Authentication:** verifying the identity of the device connecting.   * **Authentication:** verifying the identity of the device connecting.
Line 366: Line 372:
   * **Replay Attack:** a type of network attack in which an attacker captures a valid network transmission and then retransmits it later. The main objective is to trick the system into accepting the retransmission of the data as legitimate.   * **Replay Attack:** a type of network attack in which an attacker captures a valid network transmission and then retransmits it later. The main objective is to trick the system into accepting the retransmission of the data as legitimate.
  
 +<WRAP round important 90%>
 +Do NOT attempt to use Conference Mode on TailControl firmware prior to 5.3.0, or a condition requiring repair of the control board can occur.</WRAP>
 ==== Enabling Conference Mode (Pairing and Binding) ==== ==== Enabling Conference Mode (Pairing and Binding) ====
  
-Pairing is performed with a 6-digit number entered on each of the devices. In the case of TailCoNTROL, the passkey is set on the device in a "safe" location and saved to the firmware configuration.+Pairing is performed with a 6-digit number entered on each of the devices. In the case of TailControl, the passkey is set on the device in a "safe" location and saved to the firmware configuration.
  
 **SETPUSSKEY <nnnnnn>** **SETPUSSKEY <nnnnnn>**
Line 384: Line 392:
 ==== Unbinding ==== ==== Unbinding ====
  
-Resetting/removing bonds requires two separate actions: resetting the TailCoNTROL device, and removing the bond on the phone or other device.+Resetting/removing bonds requires two separate actions: resetting the TailControl device, and removing the bond on the phone or other device.
  
-There are two different methods of factory-resetting a TailCoNTROL device (which resets all persistent options to defaults and removes all bonding information):+There are two different methods of factory-resetting a TailControl device (which resets all persistent options to defaults and removes all bonding information):
  
-  * Sending a ''FORMATNVS'' command to the TailCoNTROL console. This will factory-reset and reboot.+  * Sending a ''FORMATNVS'' command to the TailControl console. This will factory-reset and reboot.
   * Performing a factory reset using the single button:   * Performing a factory reset using the single button:
       - Press and hold the power button.       - Press and hold the power button.
Line 395: Line 403:
  
 <WRAP round info 90%> <WRAP round info 90%>
-The bond will also need to be removed on the phone or other device as well, or it will attempt to continue to use the bond (which will fail, because those stored credentials will no longer be valid).+Note that the bond will also need to be removed on the phone or other device as well, or it will attempt to continue to use the bond (which will fail, because those stored credentials are no longer valid).
  
   * On Android, enter Settings, Connections, Bluetooth and find the device to remove (e.g., "mitail"). Select the gear icon, and then select "Unpair". Confirm the dialog to unpair and forget the device.   * On Android, enter Settings, Connections, Bluetooth and find the device to remove (e.g., "mitail"). Select the gear icon, and then select "Unpair". Confirm the dialog to unpair and forget the device.
Line 441: Line 449:
 ===== No-phone Mode ===== ===== No-phone Mode =====
  
-No-phone mode is a feature exclusive of MiTail firmware 4.0.0 or greater or TailCoNTROL.+No-phone mode is a feature exclusive of MiTail firmware 4.0.0 or greater or TailControl.
  
 **AUTOMODE G<n>[G<n>[G<n>]] T<nnn>T<nnn>T<251 ... 254>** **AUTOMODE G<n>[G<n>[G<n>]] T<nnn>T<nnn>T<251 ... 254>**
Line 461: Line 469:
  
  
-== Copyright 2024 © The Mechanical Tail Company Limited contact@thetailcompany.com. All Rights Reserved. ==+== Copyright 2024-2025 © The Mechanical Tail Company Limited contact@thetailcompany.com. All Rights Reserved. The Mechanical Tail Company Limited also claims trademark rights in the following: TailControl, MiTail, MiTail Mini, FlutterWings, and EarGear.  Any unauthorized use is expressly prohibited. ==
  
Back to top