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/10/19 16:21] – [Directly Set Servo Position] darkgrueen:dev:tailcontrol-command-protocol [2025/11/04 16:46] (current) 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> +<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>
 +
  
 ===== Bluetooth Low Energy (BLE) ===== ===== Bluetooth Low Energy (BLE) =====
Line 28: Line 29:
   * TX Characteristic is ''c6612b64-0087-4974-939e-68968ef294b0'', and the   * TX Characteristic is ''c6612b64-0087-4974-939e-68968ef294b0'', and the
   * Battery Voltage is ''b08fed02-0584-40ef-b006-aff7e0d24e13''.   * Battery Voltage is ''b08fed02-0584-40ef-b006-aff7e0d24e13''.
- 
-<WRAP round important> 
-For tail-series v3.6 controller hardware, the battery charging characteristic is unset (charging state is not available). 
-</WRAP> 
- 
  
 The BLE Device Service for the EarGear 2 is ''927dee04-ddd4-4582-8e42-69dc9fbfae66'': The BLE Device Service for the EarGear 2 is ''927dee04-ddd4-4582-8e42-69dc9fbfae66'':
Line 39: Line 35:
   * Battery Voltage is ''54fa919d-e8a8-4841-b280-c5461161304f''.   * Battery Voltage is ''54fa919d-e8a8-4841-b280-c5461161304f''.
  
 +<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).
 +
 +The BLE Device Service for TailControl is ''19F8ADE2-D0C6-4C0A-912A-30601D9B3060'':
 +  * RX Characteristic is ''5E4D86AC-EF2F-466F-A857-8776D45FFBC2''.
 +  * TX Characteristic is ''567A99D6-A442-4AC0-B676-4993BF95F805'', and the
 +  * Battery Voltage is ''E818BDA3-88A7-43C0-8509-6E0BBB6F55D9''.
 +</WRAP>
 +
 +<WRAP round important 90%>
 +For tail-series (MiTail, MiTail Mini, and FlutterWings) v3.6 controller hardware, the battery charging characteristic is unset (charging state is not available).
 +</WRAP>
 +
 +
 +===== TailControl Device Indicators =====
  
-===== TailCoNTROL Device Indicators ===== 
  
 ==== Blue LED ==== ==== Blue LED ====
Line 53: Line 63:
   - **Blink fast three times** when the button is held for more than 3 seconds (but less than 13), indicates the device is ready to power off when the button is released.   - **Blink fast three times** when the button is held for more than 3 seconds (but less than 13), indicates the device is ready to power off when the button is released.
   - **Blink fast continuously** when the button is held for more than 13 seconds, indicates the device is ready to factory reset when the button is released.   - **Blink fast continuously** when the button is held for more than 13 seconds, indicates the device is ready to factory reset when the button is released.
 +
  
 ==== Red LED ==== ==== Red LED ====
Line 74: Line 85:
  
 **Note:** Unlike the DIGITAiL, MiTail, MiTail Mini, and FlutterWings devices **can** be used while charging. **Note:** Unlike the DIGITAiL, MiTail, MiTail Mini, and FlutterWings devices **can** be used while charging.
 +
  
 ==== Green LED ==== ==== Green LED ====
Line 88: Line 100:
 ==== Automatic Actions ==== ==== Automatic Actions ====
  
-TailCoNTROL will automatically shut down the device if there is no BLE connection for 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 ''currConfig.minsToSleep'' (default 0, [[#Developer Commands (use at own risk)|see below]]) 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).
  
 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 145: Line 157:
 ===== 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; returns ''OK'' and restarts after 3 seconds; (e.g., ''SETRGB 325 12 2900'') [''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, returns ''OK'', and restarts after 3 seconds ([[#Conference Mode|see below]]
-| **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 ''OK'' followed by ''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, returns ''OK'', and restarts after 3 seconds ([[#Conference Mode|see below]]
-| **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; (e.g., ''VER 5.0.0''); 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 170: Line 196:
  
 | **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 partition, including 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 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''] | 
-| **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 | +| **WRITECONF** | **WRITE** **CONF**iguration to NVS and set running configuration to match (e.g., ''WRITECONF 1 5 0 15 40 3 8 0 0 3 0 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''], returns ''OK'' 
-| **READCONF** | **READ** running **CONF**iguration; returns space-delimited running configuration parameters (e.g., ''READCONF 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''] | +| **SETDISCONNECTEDCOUNT** | **SET** BLE **DISCONNECTED** power off **COUNT**down parameter in NVS and running configuration (in minutes''SETDISCONNECTEDCOUNT 0'' disables automatic poweroff), returns ''OK''
-| **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 0 1 0 123456'') [''ver'' ''minsToSleep'' ''minsToNPM'' ''minNPMPauseSec'' ''maxNPMPauseSec'' ''groupsNPM'' ''servo1home'' ''servo2home'' ''listenModeNPMEnabled'' ''listenModeResponseOnly'' ''groupsLM'' ''tiltModeNPMEnabled'' ''tiltModeResponseOnly'' ''disconnectedCountdownEnabled'' ''homeOnAppPoweroff'' ''conferenceModeEnabled'' ''securityPasskey''] | +| **SETHOLDONSTOP** | **SET** servo **HOLD** is maintained when the servos **STOP** (maintains servo PWM when not moving, default for EarGear 2); returns ''OK''
-| **REBOOT** | **REBOOT** after 3 seconds, returns ''OK'' |+| **UNSETHOLDONSTOP** | **UNSET** servo **HOLD** when the servos **STOP** (servo PWM is dropped when not moving, default 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'' | | **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 in words of remaining stack space that was available to the task since the task started executing, returns ''OK''+| **SETLISTENMOVES** | **SET** internal **LISTEN** Mode **MOVES** to play on a listen event in addition to sending event notifications; 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 3 0 0 0 123456''), returns ''OK'' [''ver'' ''minsToSleep'' ''minsToNPM'' ''minNPMPauseSec'' ''maxNPMPauseSec'' ''groupsNPM'' ''servo1home'' ''servo2home'' ''listenModeNPMEnabled'' ''listenModeResponseOnly'' ''groupsLM'' ''tiltModeNPMEnabled'' ''tiltModeResponseOnly'' ''disconnectedCountdownEnabled'' ''homeOnAppPoweroff'' ''conferenceModeEnabled'' ''securityPasskey''] |+| **UNSETLISTENMOVES** | **UNSET** internal **LISTEN** Mode **MOVES** to play on a listen event, only an event notification will be sent and it is the responsibility of the connected application to send commands to react to events; returns ''OK''
 +| **SETTILTMOVES** | **SET** internal **LISTEN** Mode **MOVES** to play on a tilt event in addition to sending event notifications; returns ''OK''
 +| **UNSETTILTMOVES** | **UNSET** internal **LISTEN** Mode **MOVES** to play on a listen event, only an event notification will be sent and it is the responsibility of the connected application to send commands to react to events; 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 | 
 +| **FORMATNVS** | **FORMAT** **NVS** (erase all contents of the default NVS partition, including BLE bonds), returns ''OK'' and reboots after 3 seconds 
 +| **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 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**; returns ''OK'' and reboots after 3 seconds | 
 +| **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''
  
 ===== Directly Set Servo Position ===== ===== Directly Set Servo Position =====
Line 200: Line 234:
   * Parameters can be separated by any character that is not a number or a letter (e.g., space, comma, semicolon). However, the letters themselves act as separators, and it is recommended that no additional characters are used, as the serial buffer has a limited capacity and may not be able to store the whole instruction.   * Parameters can be separated by any character that is not a number or a letter (e.g., space, comma, semicolon). However, the letters themselves act as separators, and it is recommended that no additional characters are used, as the serial buffer has a limited capacity and may not be able to store the whole instruction.
   * Depending on the tail and position, it can sag out of the commanded position when servo power is released at the end of the DSSP move. This may cause a visual defect of jerking back into the previous position when the next move starts.   * Depending on the tail and position, it can sag out of the commanded position when servo power is released at the end of the DSSP move. This may cause a visual defect of jerking back into the previous position when the next move starts.
 +
  
 ==== DSSP Example ==== ==== DSSP Example ====
Line 207: Line 242:
  
  
-===== 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 220: Line 255:
 ^ Prefix ^ Parameter Type  ^ Range of Values for Moves  ^ ^ Prefix ^ Parameter Type  ^ Range of Values for Moves  ^
 | **U** | User preset number | <1 ... 4> | | **U** | User preset number | <1 ... 4> |
-| **E** | Easing function to apply to Servo 1 | Default is Linear, if not specified.\\ As per [[https://github.com/ArminJo/ServoEasing/blob/bb19cd4cfd9e92fed3b0f91b90a7b2f7dd83094a/src/ServoEasing.h#L296|EaseTypes]];\\ e.g., 0 = Linear (no easing), 129 = Quadratic, 130 = Cubic,  131 = Quartic |+| **E** | Easing function to apply to Servo 1 | Default is Linear (no easing), if not specified.\\ This is the decimal representation of the (hexadecimal) easing type enumeration, as per [[https://github.com/ArminJo/ServoEasing/blob/bb19cd4cfd9e92fed3b0f91b90a7b2f7dd83094a/src/ServoEasing.h#L296|EaseTypes]] (e.g., 0 = Linear, 129 = Quadratic in/out, 130 = Cubic in/out,  131 = Quartic in/out). |
 | **F** | Easing function to apply to Servo 2 | (Same as **E**) | | **F** | Easing function to apply to Servo 2 | (Same as **E**) |
 | **A** | Point for Servo 1 | <0 ... 8>\\ 0 -> 25 degrees\\ 1 -> 41 degrees\\ 2 -> 58 degrees\\ ...\\ 8 -> 160 degrees | | **A** | Point for Servo 1 | <0 ... 8>\\ 0 -> 25 degrees\\ 1 -> 41 degrees\\ 2 -> 58 degrees\\ ...\\ 8 -> 160 degrees |
Line 246: Line 281:
  
 {{:en:dev:position_limits_visualization.png?400|}} {{:en:dev:position_limits_visualization.png?400|}}
 +
  
 ==== USERMOVE Examples ==== ==== USERMOVE Examples ====
 +
  
 === Example 1 – Slow Wag 1 (same as the ''TAILS1'' command) === === Example 1 – Slow Wag 1 (same as the ''TAILS1'' command) ===
Line 265: Line 302:
   * **L75L75** Position 2 is reached in 75 * 20 ms = 1.5 s; return to Position 1 in the same time     * **L75L75** Position 2 is reached in 75 * 20 ms = 1.5 s; return to Position 1 in the same time  
   * **H1** Home at end of move   * **H1** Home at end of move
 +
  
 === Example 2 – Test Servos === === Example 2 – Test Servos ===
Line 282: Line 320:
   * **H1** Home at end of move   * **H1** Home at end of move
  
-<WRAP round info>+<WRAP round info 90%>
 Because no easing parameters (''E'' or ''F'') are specified, no easing is used by default. Because no easing parameters (''E'' or ''F'') are specified, no easing is used by default.
 </WRAP> </WRAP>
 +
  
 ==== USERLEDS Examples ==== ==== USERLEDS Examples ====
 +
  
 === Example 1 – Beacon (same as the ''LEDBEA'' command) === === Example 1 – Beacon (same as the ''LEDBEA'' command) ===
Line 312: Line 352:
   * **A0A8** Start off, finish at full brightness     * **A0A8** Start off, finish at full brightness  
   * **L100L100** Each brightness point is reached in 100 * 20 ms = 2 s   * **L100L100** Each brightness point is reached in 100 * 20 ms = 2 s
- 
- 
-===== Autonomous Mode ===== 
- 
-Defines a sequence of random moves, selected from any of three groups as below; interval between moves varies randomly 
-from T1 to T2. 
- 
-**AUTOMODE G<n>[G<n> ... [G<n>]] T<nnn>T<nnn>T<nnn>** 
- 
-The tail will select a random move from the specified group(s), pausing for a random number of seconds between each move (min and max specified by the first and second ''T'' parameter, respectively). The tail will stop completely after the time passed by the 3rd ''T'' parameter. 
- 
-Autonomous Mode is ended (after completing any ongoing move) if a BLE connection is made. 
- 
-^ Group  ^ Move Group Name  ^ Move List  ^ 
-| 1 | Calm and Relaxed | Slow Wag 1, Slow Wag 2, Slow Wag 3 | 
-| 2 | Fast and Excited | Fast Wag, Short Wag, Happy Wag, Erect | 
-| 3 | Frustrated and Tense | Tremble 1, Tremble 2, Tremble Erect, High Wag | 
- 
-The parameter order is not important, except that the three ''T'' parameters are interpreted in the order specified below. 
- 
-^ Prefix  ^ Parameter Type  ^ Range of Values  ^ 
-| **G** | Move Group (see table above) | <1 ... 3> | 
-| **T1** | Minimum random pause between moves in 1-second increments | <1 ... 240> (1 s ... 4 min) | 
-| **T2** | Maximum random pause between moves in 1-second increments | <1 ... 240> (1 s ... 4 min) | 
-| **T3** | Total duration in 15-second increments | <1 ... 240> (15 s ... 60 min); <251 ... 254> are reserved, see [[en:dev:tailcontrol-command-protocol#no-phone_mode|No-phone Mode]], below) | 
- 
-**STOPAUTO** 
- 
-''STOPAUTO'' will abort the current Autonomous Mode after completing any ongoing move. 
  
  
 ===== 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.
   * **MITM (Man In The Middle):** process by which a third device impersonates the other two legitimate devices, in order to fool them into connecting to it. Both BLE central and peripheral will connect to the malicious device, which in turn routes the communication between the other two devices. The malicious device intercepts all data being sent and can inject false data or remove data before it reaches its recipient.   * **MITM (Man In The Middle):** process by which a third device impersonates the other two legitimate devices, in order to fool them into connecting to it. Both BLE central and peripheral will connect to the malicious device, which in turn routes the communication between the other two devices. The malicious device intercepts all data being sent and can inject false data or remove data before it reaches its recipient.
   * **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>**
  
-The device will then reboot in 3 seconds. Conference Mode is then enabled, and pairing proceeds. The user's phone (or other device) will prompt for the passkey (which was set earlier), and the bond will be established on both devices. After that, the passkey or a previous bond (up to 3 can be stored) will be required to connect to the device.+The device will then reboot after 3 seconds. Conference Mode is then enabled, and pairing proceeds. The user's phone (or other device) will prompt for the passkey (which was set earlier), and the bond will be established on both devices. After that, the passkey or a previous bond (up to 3 can be stored) will be required to connect to the device. 
  
 ==== Disabling Conference Mode ==== ==== Disabling Conference Mode ====
Line 365: Line 381:
 **STOPPUSSKEY** **STOPPUSSKEY**
  
-The device will then reboot in 3 seconds. If the bond needs to be removed or reset, see [[en:dev:tailcontrol-command-protocol#unbinding|Unbinding]], below.+The device will then reboot after 3 seconds. If the bond needs to be removed or reset, see [[en:dev:tailcontrol-command-protocol#unbinding|Unbinding]], below. 
  
 ==== 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.
-      - At approximately 3 seconds, the blue LED will flash three times and turn off. Continue to hold without releasing the button. If you Wish to cancel the factory reset, release at any time before the next step and the device will power off.+      - At approximately 3 seconds, the blue LED will flash three times and turn off. Continue to hold without releasing the button. If you wish to cancel the factory reset, release at any time before the next step and the device will power off.
       - Ten seconds after the triple-flash (13 seconds total of continuous holding), the blue LED will blink quickly continuously, release to perform the factory reset. The blue LED will go solid, then the ESP will restart, with the blue LED flashing slowly (ready to connect).       - Ten seconds after the triple-flash (13 seconds total of continuous holding), the blue LED will blink quickly continuously, release to perform the factory reset. The blue LED will go solid, then the ESP will restart, with the blue LED flashing slowly (ready to connect).
  
-<WRAP round info> +<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 386: Line 403:
  
 </WRAP> </WRAP>
- 
- 
-===== iOS Casual Mode ===== 
- 
-<WRAP round todo> 
-This feature is pending removal in a future release. 
-</WRAP> 
- 
-Because the CRUMPET application is not currently permitted to manage the tail while the iOS application is in the background, the application uses the ''AUTOMODE'' command to have the tail emulate the Casual Mode behavior on-board the tail (Note there is a typo in the string the iOS app sends: there is no space between the command and the first parameter): 
- 
-**AUTOMODEG1  T15 T100 T240** 
- 
-Note that the ''G'' and the first two ''T'' parameters will depend on the selections made in the app. 
- 
-Important! The minimum random pause cannot be less that 15 seconds. 
- 
-==== iOS Casual Mode Example ==== 
- 
-**AUTOMODE T15T60T240 G1G2** 
- 
-  * **T15** 15-second minimum random pause between moves 
-  * **T60** 60-second (1 minute) maximum random pause between moves 
-  * **T240** 3600-second (240 * 15 = 3600 s = 1 hour) total duration of Autonomous Mode 
-  * **G1G2** Randomly select a move from groups 1 and 2 
  
  
Line 426: Line 419:
 ===== No-phone Mode ===== ===== No-phone Mode =====
  
-No-phone mode is feature exclusive of MiTail firmware 4.0.0 or greater or TailCoNTROL.+Perform random moves while disconnected from BLE client, selected from any of three groups as below; interval between moves varies randomly from T1 to T2This feature is comparable to Casual Mode in the app.
  
-**AUTOMODE G<n>[G<n>[G<n>]] T<nnn>T<nnn>T<251 ... 254>**+**AUTOMODE G<n>[G<n>[G<n>]] T<1 ... 240>T<1 ... 240>T<251 ... 254>** 
 + 
 +The tail will select a random move from the specified group(s), pausing for a random number of seconds between each move (min and max specified by the first and second ''T'' parameter, respectively). The tail will stop completely after the time passed by the 3rd ''T'' parameter. 
 + 
 +No-phone Mode is suspended (after completing any ongoing move) if a BLE connection is made. It will resume after BLE is disconnected. 
 + 
 +^ Group  ^ Move Group Name  ^ Move List  ^ 
 +| 1 | Calm and Relaxed | Slow Wag 1, Slow Wag 2, Slow Wag 3 | 
 +| 2 | Fast and Excited | Fast Wag, Short Wag, Happy Wag, Erect | 
 +| 3 | Frustrated and Tense | Tremble 1, Tremble 2, Tremble Erect, High Wag | 
 + 
 +The parameter order is not important, except that the three ''T'' parameters are interpreted in the order specified below. 
 + 
 +^ Prefix  ^ Parameter Type  ^ Range of Values 
 +| **G** | Move Group (see table above) | <1 ... 3> | 
 +| **T1** | Minimum random pause between moves in 1-second increments | <1 ... 240> (1 s ... 4 min) | 
 +| **T2** | Maximum random pause between moves in 1-second increments | <1 ... 240> (1 s ... 4 min) | 
 +| **T3** | Delay to wait for BLE connection before starting NPM | <25**1** ... 25**4**> (1 ... 4 min) |
  
 No-phone Mode (NPM) will cause the tail to delay one to four minutes (based on the setting of the third ''T'' parameter of 25**1** through 25**4**) to wait for a BLE connection. If no BLE connection is made during that time, the tail will select a random move from the specified group(s), pausing for a random number of seconds between each move (min and max specified by the first and second ''T'' parameter, respectively). No-phone Mode (NPM) will cause the tail to delay one to four minutes (based on the setting of the third ''T'' parameter of 25**1** through 25**4**) to wait for a BLE connection. If no BLE connection is made during that time, the tail will select a random move from the specified group(s), pausing for a random number of seconds between each move (min and max specified by the first and second ''T'' parameter, respectively).
Line 437: Line 447:
  
 Stops No-phone mode and disables it in NVS configuration. Stops No-phone mode and disables it in NVS configuration.
 +
 +
 +==== No-phone Mode Example ====
 +
 +**AUTOMODE T15T60T243 G1G2**
 +
 +  * **T15** 15-second minimum random pause between moves
 +  * **T60** 60-second (1 minute) maximum random pause between moves
 +  * **T240** 3600-second (240 * 15 = 3600 s = 1 hour) total duration of Autonomous Mode
 +  * **G1G2** Randomly select a move from groups 1 and 2
  
  
Line 446: Line 466:
  
  
-== 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