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 [2025/11/04 16:24] – [iOS Casual Mode Example] darkgrueen:dev:tailcontrol-command-protocol [2026/05/16 04:42] (current) darkgrue
Line 2: Line 2:
  
  
-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 EarGear 2, FlutterWings, MiTail, MiTail Mini, and Paws with Claws (ClawGear); 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.
Line 9: Line 9:
 **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. **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 19: Line 20:
 Device name is one of the following: Device name is one of the following:
  
-  * ''mitail'' for MiTail+  * ''clawgear'' for ClawGear/Paws with Claws
-  * ''minitail'' for MiTail Mini+  * ''EG2'' for EarGear 2
-  * ''flutter'' for FlutterWings, and +  * ''flutter'' for FlutterWings
-  * ''EG2'' for EarGear 2.+  * ''mitail'' for MiTail, and 
 +  * ''minitail'' for MiTail Mini.
  
-The BLE Device Service for the MiTail, MiTail Mini, and FlutterWings is ''3af2108b-d066-42da-a7d4-55648fa0a9b6'': +TailControl will uses the same Service and Characteristics UUIDs across all supported products: ''19F8ADE2-D0C6-4C0A-912A-30601D9B3060''.
-  * RX Characteristic is ''5bfd6484-ddee-4723-bfe6-b653372bbfd6'', +
-  * TX Characteristic is ''c6612b64-0087-4974-939e-68968ef294b0'', and the +
-  * Battery Voltage is ''b08fed02-0584-40ef-b006-aff7e0d24e13''.+
  
-The BLE Device Service for the EarGear 2 is ''927dee04-ddd4-4582-8e42-69dc9fbfae66'': +  * RX Characteristic is ''5E4D86AC-EF2F-466F-A857-8776D45FFBC2'', 
-  * RX Characteristic is ''05e026d8-b395-4416-9f8a-c00d6c3781b9'', +  * TX Characteristic is ''567A99D6-A442-4AC0-B676-4993BF95F805'' and the
-  * TX Characteristic is ''0b646a19-371e-4327-b169-9632d56c0e84'', and the +
-  * 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''.   * Battery Voltage is ''E818BDA3-88A7-43C0-8509-6E0BBB6F55D9''.
-</WRAP> 
  
 <WRAP round important 90%> <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). For tail-series (MiTail, MiTail Mini, and FlutterWings) v3.6 controller hardware, the battery charging characteristic is unset (charging state is not available).
 </WRAP> </WRAP>
 +
  
 ===== TailControl Device Indicators ===== ===== TailControl Device Indicators =====
 +
  
 ==== Blue LED ==== ==== Blue LED ====
Line 60: Line 51:
   - **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 81: Line 73:
  
 **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 100: Line 93:
  
  
-===== Move Commands =====+===== Servo-Based Moves (ClawGear, EarGear 2, MiTail, MiTail Mini, FlutterWings) =====
  
-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.
  
 A command will return ''LOWBATT'' and reject the command if the battery is less than 10%. ''ERR'' will be returned if the command can't be parsed or otherwise executed. A command will return ''LOWBATT'' and reject the command if the battery is less than 10%. ''ERR'' will be returned if the command can't be parsed or otherwise executed.
Line 126: Line 119:
 | **TAILU3** | **U**ser defined **3** | | **TAILU3** | **U**ser defined **3** |
 | **TAILU4** | **U**ser defined **4** | | **TAILU4** | **U**ser defined **4** |
 +
 +
 +===== Stepper-Based Moves (Not Currently Used) =====
 +
 +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.
 +
 +A command will return ''LOWBATT'' and reject the command if the battery is less than 10%. ''ERR'' will be returned if the command can't be parsed or otherwise executed.
 +
 +A new command that is received before the currently executing command is finished will immediately end the current command and start the new one.
 +
 +| **TAILHM** | **H**o**M**e position |
 +| **MOVE1** | **MOVE** **1** |
 +| **MOVE2** | **MOVE** **2** |
 +| **MOVE3** | **MOVE** **3** |
 +| **MOVE4** | **MOVE** **4** |
 +| **MOVE5** | **MOVE** **5** |
 +| **MOVE6** | **MOVE** **6** |
 +| **MOVE7** | **MOVE** **7** |
 +| **MOVEU1** | **MOVE** **U**ser defined **1** |
 +| **MOVEU2** | **MOVE** **U**ser defined **2** |
 +| **MOVEU3** | **MOVE** **U**ser defined **3** |
 +| **MOVEU4** | **MOVE** **U**ser defined **4** |
 +
 +
 +===== ClawGear-only Commands =====
 +
 +| **CLAPMODE** | Starts Clap Mode (and disables Tilt Mode, if enabled), returns ''OK'' |
 +| **STOPCLAP** | Stops Clap Mode, returns ''OK'' |
 +| **STOPTILT** | Stops Tilt Mode, returns ''OK'' |
 +| **TILTMODE** | Starts Tilt Mode (and disables Clap Mode, if enabled), returns ''OK'' |
 +
 +===== EarGear 2-only Commands =====
 +
 +| **LISTENMODE** | Starts Listen Mode ([[#Listen Mode|see below]]), returns ''OK'' |
 +| **STOPLISTEN** | Stops Listen Mode ([[#Listen Mode|see below]]), returns ''OK'' |
 +| **STOPTILT** | Stops Tilt Mode ([[#Tilt Mode|see below]]), returns ''OK'' |
 +| **TILTMODE** | Starts Tilt Mode ([[#Tilt Mode|see below]]), returns ''OK'' |
  
  
Line 149: Line 179:
 | **LEDUS4** | **US**er defined **4** | | **LEDUS4** | **US**er defined **4** |
  
- 
-===== EarGear 2-only Commands ===== 
- 
-| **LISTENMODE** (or **LISTEN FULL**) | Starts Listen Mode ([[#Listen Mode|see below]]), returns ''OK'' | 
-| **STOPLISTEN** (or **ENDLISTEN**) | Stops Listen Mode ([[#Listen Mode|see below]]), returns ''OK'' | 
-| **STOPTILT** (or **ENDTILTMODE**) | Stops Tilt Mode ([[#Tilt Mode|see below]]), returns ''OK'' | 
-| **TILTMODE** (or **TILTMODE START**) | Starts Tilt Mode ([[#Tilt Mode|see below]]), returns ''OK'' | 
  
 ===== RGB LED Commands ===== ===== RGB LED Commands =====
 +
 +RGB support is experimental, and not included in production firmware.
  
 | **RGBOFF** | **RGB** LEDs **OFF**, returns ''OK'' | | **RGBOFF** | **RGB** LEDs **OFF**, returns ''OK'' |
Line 169: Line 194:
 | **RGBTST** | **RGB** **TE**s**T**; color cycle the first and last pixel of the RGB string (endpoints test), 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''] | | **SETRGB** | **SET** **RGB** configuration; returns ''OK'' and restarts after 3 seconds; (e.g., ''SETRGB 325 12 2900'') [''numRGBLEDs'' ''maxRGBVolt'' ''maxRGBmAmp''] |
 +
  
 ===== Other Commands ===== ===== Other Commands =====
Line 194: Line 220:
 | **SETHOLDONSTOP** | **SET** servo **HOLD** is maintained when the servos **STOP** (maintains servo PWM when not moving, default for EarGear 2); 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 moving, default for tail-based devices); 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 eac2h servo (e.g., ''SETHOME 4 4''), **NOTE:** only available on FlutterWings, and EarGear 2; returns ''OK'' |
 | **SETLISTENMOVES** | **SET** internal **LISTEN** Mode **MOVES** to play on a listen event in addition to sending event notifications; returns ''OK'' | | **SETLISTENMOVES** | **SET** internal **LISTEN** Mode **MOVES** to play on a listen event in addition to sending event notifications; returns ''OK'' |
 | **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'' | | **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'' |
Line 204: Line 230:
 | **REBOOT** | **REBOOT**; returns ''OK'' and reboots after 3 seconds | | **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'' | | **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 225: Line 253:
   * 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 271: Line 300:
  
 {{: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 290: Line 321:
   * **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 310: Line 342:
 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 337: Line 371:
   * **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
- 
  
  
Line 350: Line 383:
 <WRAP round important 90%> <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> 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) ====
  
Line 357: Line 392:
  
 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. 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 364: Line 400:
 **STOPPUSSKEY** **STOPPUSSKEY**
  
-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.+The device will then reboot after 3 seconds. If the bond needs to be removed or reset, see [[en:dev:tailcontrol-command-protocol#Unbinding / Factory Reset|Unbinding / Factory Reset]], below. 
  
-==== Unbinding ====+==== Unbinding / Factory Reset ====
  
 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.
Line 373: Line 410:
  
   * 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 (TailControl v5.1.0, forward):
       - 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.
Line 385: Line 422:
  
 </WRAP> </WRAP>
- 
- 
-===== iOS Casual Mode ===== 
- 
-<WRAP round todo 90%> 
-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. 
- 
- 
  
  
Line 418: Line 438:
 ===== 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 429: Line 466:
  
 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 438: Line 485:
  
  
-== 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. ==+== Copyright 2024-2026 © 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. ==