MiP-Protocol.md

March 25, 2016 · View on GitHub

Please note that all received commands (MiP->Device) are prefixed with the command you sent. So if you send 0x14, then the response will contain 0x14 for the first byte, then it will follow the table below. We just ignore the returned response.

NameCodeDirectionLengthDataNotes
Play Sound0x06->MIP1BYTE 1 : Sound file index (1~106) or send 0xF7-0xFE for volumeSend 105 to stop playing
2BYTE 2 : Delay in intervals of 30ms (0~255)
… (repeat sound file index then delay for as many files as you want to play)
17BYTE 17 : Number of times to repeat (0-255)Only need to send if you want the sequence to repeat
Set Mip Position0x08-> MIP1BYTE 1 : On back: 0x00, Face down: 0x01
Distance Drive0x70->MIP5BYTE 1 : Forward: 0x00 or Backward: 0x0120 commands are queued
BYTE 2 : Distance (cm): 0x00-0xFFNo speed control
BYTE 3 : Turn Clockwise: 0x01 or Anti-clockwise: 0x00
BYTE 4 : Turn Angle(High byte): 0x00~0x01
BYTE 5 : Turn Angle(Low byte): 0x00~0xFFNote:0x0000(0)~0x0168(360)
Drive forward with Time0x71->MIP2BYTE 1 : Speed (0~30)
BYTE 2 : Time in 7ms intervals (0~255)35ms
Drive backward with Time0x72->MIP2BYTE 1 : Speed (0~30)
BYTE 2 : Time in 7ms intervals (0~255)Time = Byte2 Value * 7ms
Turn left by Angle0x73->MIP2BYTE 1 : Angle in intervals of 5 degrees (0~255)Angle = Byte1 Value * 5
BYTE 2 : Speed (0~24)
Turn right by Angle0x74->MIP2BYTE 1 : Angle in intervals of 5 degrees (0~255)Angle = Byte1 Value * 5
BYTE 2 : Speed (0~24)
Continuous Drive0x78->MIP2BYTE 1 : Fw:0x01(slow)~0x20(fast)Buffer = 0
OR Bw:0x21(slow)~0x40(fast)This command is for single drive or turn
BYTE 2 : Right spin:0x41(slow)~0x60(fast)Note:Sending per 50ms if held
OR Left spin:0x61(slow)~0x80(fast)
BYTE 1 : Crazy Fw:0x81(slow)~0xA0(fast)
OR Crazy Bw:0xA1(slow)~0xC0(fast)
BYTE 2: Crazy Right spin:0xC1(slow)~0xE0(fast)
OR Crazy Left spin:0xE1(slow)~0xFF(fast)
Set Game Mode0x76->MIP1BYTE 1 : 0x01 – AppThe same as cancel Gesture and Radar
0x02 – Cage Play back
0x03 – TrackingThe same as enable Radar
0x04 – Dance Play back
0x05 – Default Mip ModeThe same as enable Gesture(0x0A)
0x06 – Stack Play back
0x07 – Trick programming and playback
0x08 – Roam Mode Play back
Get current MIP Game Mode0x82-> MIP-
Current MIP Game Mode0x82iOS <-1BYTE 1 : 0x01 – App
0x02 – Cage
0x03 – Tracking
0x04 – Dance
0x05 – Default Mip Mode
0x06 – Stack
0x07 – Trick programming and playback
0x08 – Roam Mode
Stop0x77->MIP--
Request MIP status0x79-> MIP-
MIP status0x79iOS <-2BTYE 1 : Battery Level :0x4D(4.0V)-0x7C(6.4V)
BYTE 2 : On back: 0x00
Face down 0x01
Upright: 0x02Note:Send one time per 30 seconds
Picked up: 0x03Note:it will be sent after(connecting,falldown,pickup….)
Hand stand: 0x04
Face down on tray: 0x05
On back with kickstand: 0x06
Mip Get Up0x23-> MIP1BTYE 1 : 0x00 – Get up when mip has fallen frontMip will attempt to get up from front if angle is correct
0x01 – Get up when mip has fallen backMip will attempt to get up from back if angle is correct
0x02 – Get up when mip has fallen back or front
Request weight update0x81-> MIP
Weight update0x81iOS <-1BYTE 1 : 0xD3(-45 degree) - 0x2D(+45 degree)
0xD3 (211) (max)~0xFF(min) (255) is holding the weight on the front
0x00(min)~0x2D(max) is holding the weight on the back
Request Chest LED0x83->MIP--
Chest LED0x83iOS <-5BYTE 1 : Red (0~255)
BYTE 2 : Green (0~255)
BYTE 3 : Blue (0~255)
BYTE 4 : if flashing then, TIME ON in 20ms intervals (0255) else Fade in time in 10ms intervals (0255)
BYTE 5 : if flashing then, TIME OFF in 20ms intervals (0~255) else will only be 4 bytes
Set Chest LED0x84->MIP3BYTE 1 : Red (0~255)
BYTE 2 : Green (0~255)
BYTE 3 : Blue (0~255)
Flash Chest LED0x89->MIP5BYTE 1 : Red (0~255)Value of 0 means LED color will be changed immediately
BYTE 2 : Green (0~255)
BYTE 3 : Blue (0~255)
BYTE 4 : TIME ON in 20ms intervals (0~255)Time on = Byte4 Value * 20ms
BYTE 5 : TIME OFF in 20ms intervals (0~255)Time off = Byte5 Value * 20ms
Set Head LED0x8A->MIP4BYTE 1 : LIGHT1 (0=off, 1=on, 2=blink slow, 3=blink fast)
BYTE 2 : LIGHT2 (0=off, 1=on, 2=blink slow, 3=blink fast)
BYTE 3 : LIGHT3 (0=off, 1=on, 2=blink slow, 3=blink fast)
BYTE 4 : LIGHT4 (0=off, 1=on, 2=blink slow, 3=blink fast)
Request Head LED0x8B->MIP-
Head LED0x8BiOS <-4BYTE 1 : LIGHT1 (0=off, 1=on, 2=blink slow, 3=blink fast)
BYTE 2 : LIGHT2 (0=off, 1=on, 2=blink slow, 3=blink fast)
BYTE 3 : LIGHT3 (0=off, 1=on, 2=blink slow, 3=blink fast)
BYTE 4 : LIGHT4 (0=off, 1=on, 2=blink slow, 3=blink fast)
Read Odometer0x85->MIP-
Odometer reading0x85iOS <-4BYTE 1 & 2 & 3 & 4 : Distance ((0~4294967296)/48.5) cmTotal distance travelled. Not reset by power cycle.
1cm=48.5, 0xFFFFFFFF=4294967295=88556026.7cm
BYTE 1 & 2 & 3 & 4 :Byte1 is highest byte
Reset Odometer0x86->MIP-
Sent only when requested unless it is over 4294967296 then it sends to app and resets
Gesture Detect0x0AIOS<-1BYTE 1 : Left: 0x0A
Right: 0x0B
Center Sweep Left: 0x0C
Center Sweep Right: 0x0D
Center Hold: 0x0E
Forward: 0x0F
Back: 0x10(700ms hold)
Set Gesture Or Radar Mode0x0C-> MIP1BYTE 1 :
0x00: Disable Gesture and Radar
0x02: Gesture Mode on (Disable Radar)Gesture mode is tracking hand gestures
0x04: Radar Mode on (Disable Gesture)
Get Radar Mode0x0D-> MIP--
Radar Mode Status0x0DiOS <-1BYTE 1: 0x00: Disable Gesture and Radar
0x02: Gesture Mode on (Disable Radar)
0x04: Radar Mode on (Disable Gesture)
Radar Response0x0CiOS <-1BYTE 1 : 0x01: No object Or object disappear
0x02: See object in 10cm~30cm
0x03: See object less than 10cmUsed for radar
MIP Detection Mode0x0E-> MIP2BYTE 1 : Off: 0x00, On: 0x1-255 for ID number
BYTE 2 : Set IR Tx power(1120)(About 1cm300cm)
Request MIP Detection Mode0x0F-> MIP--
Mip Detection Status0x0FiOS <-2BYTE 1 : Off: 0x00, On: 0x1-255 for ID numberThis constantly 'pings' other MiPs to check if any are in range. When this is enabled it will automatically disable Radar mode & gesture mode
BYTE 2 : Set IR Tx power(1120)(About 1cm300cm)
Mip Detected0x04iOS <-1BYTE 1 : ID number, if got the 0x00 means find one MIP without setting number
Shake Detected0x1AiOS <---
IR Remote Control Enabled0x10-> MIP1BTYE 1 : Off: 0x00, On: 0x01
Request IR Control Enabled0x11-> MIP--
IR Control Status0x11iOS <-1BTYE 1 : Off: 0x00, On: 0x01
Sleep0xFAMIP<->iOS-Power down bluetooth.
Disconnect App0xFE->MIP--Mip should switch off app mode and return to previous mode
Force BLE disconnect0xFC->MIP--
Set User Data0x12-> MIP2BYTE 1 : Data address(0x20~0x2F)
BYTE 2 : Data
Get User Or Other Eeprom Data0x13-> MIP1BYTE 1 : User Data address(0x20~0x2F) and other data is in Eeprom
MIP User Or Other Eeprom Data0x13iOS <-2BYTE 1 : User Data address(0x20~0x2F) and other data is in Eeprom
BYTE 2 : Data
Get Mip Software Version0x14-> MIP--
Mip Software Version0x14iOS <-4BYTE 1: Year (software ver)
BYTE 2: Month (software ver)Gets some software version info
BYTE 3: Day (software ver)Date of the software release
BYTE 4: Unique Version #this is used if more than one release on one day, normally it is 0x00
Get Mip Hardware Info0x19-> MIP--
Mip Hardware Info0x19iOS <-2BYTE 1: Voice chip version
BYTE 2: Hardware Version
Set Mip Volume0x15-> MIP1BYTE 1: Volume level between 0-7Sets the MIP volume level, 0=off, 7=loudest, Power off save
Get Mip Volume0x16-> MIP--
Mip Volume0x16iOS <-1BYTE 1: Volume level between 0-7Reads the current MIP volume level
Send IR Dongle code0x8C-> MIP6BYTE1:IR data bit31~bit24
BYTE2:IR data bit23~bit16
BYTE3:IR data bit15~bit8
BYTE4:IR data bit7~bit0
BYTE5:IR data numbers(1~32):e.g. BYTE5=0x08 means BYTE4 is useful.
BYTE6:IR Tx power(1120)(About 1cm300cm)
Note:It can be useful in shooting game.
Receive IR Dongle code0x03iOS <-3~5BYTE 1 : 0x02,0x03,0x04Receive an IR command
BYTE2~BYTE5 are the datas of Transmiting.
Byte2 is high byte,Byte5 is low byte
(0x03,0x02,0xNN,0xNN)
(0x03,0x03,0xNN,0xNN,0xNN)
(0x03,0x04,0xNN,0xNN,0xNN,0xNN)
Clap times0x1DiOS <-1BYTE 1: 0x01 – 0xFF times
Clap Enabled0x1E-> MIP1BTYE 1 : Off: 0x00, On: 0x01(Default is disable after App connecting)
Request Clap Enabled0x1F-> MIP--
Clap Status0x1FiOS <-3BTYE 1 : Off: 0x00, On: 0x01
BYTE2(high)~BYTE3(low)(Delay time between two claps)
Delay time between two claps0x20-> MIP2BYTE1(high)~BYTE2(low)(Delay time between two claps)