Ninebot ES Communicaton Protocol: Release Date: 27/09/2019
Ninebot ES Communicaton Protocol: Release Date: 27/09/2019
Table of Contents
Ninebot ES Communicaton Protocol.............................................................................................. 1
    1. Summary of communicaton protocol.............................................................................2
    2. Protocol format............................................................................................................... 2
         2.1 Serial bus packet format............................................................................................ 2
         2.2 ID defniton.............................................................................................................. 2
         2.3 Packet length............................................................................................................. 3
         2.4 Command word defniton........................................................................................ 3
         2.5 Data index descripton.............................................................................................. 4
         2.6 Data segment descripton......................................................................................... 4
         2.7 Serial port check and descripton..............................................................................5
    3. Use case of Communicaton Protocol..............................................................................5
         3.1 Serial port reads memory control table.....................................................................5
         3.2 Serial port writes memory control table....................................................................6
    4. Descripton of scooter memory control table..................................................................6
    5. Descripton of batery memory control.........................................................................13
    6. Appendix1 - Serial port check code...............................................................................16
    7. Appendix 2 - Error code meaning and soluton.............................................................17
This protocol defnes the general protocol format, with which Ninebot electronic control system
realizes mult-node communicaton through physical serial ports and Bluetooth serial ports.
Confguraton of the serial port is 115200, 8 bytes, without verifcaton and with 1 stop bit.
Informaton query, control and parameter modifcaton instructon can be realized through the
read-write operaton of the “memory control table” stored in the controller. Basic storage unit of
the memory control table is 2 bytes of signed integer data (short).
All data longer than 1 byte is subject to the low-priority transmission and storage form.
Macro defniton related to the scooter communicaton protocol is stored in the NinebotCmd.h
fle based on C programming language.
Note: Compared with the previous communicaton protocol Bluetooth Serial Port Protocol, ID and
command word defniton are changed greatly and CAN bus protocol is added in this version.
2. Protocol format
 Byte    Frame header     Packet     Source    Target      Command   Data      Data      Checksum
         (2Byte)          length     ID        ID          word      index     segme     (2Byte)
                          (1Byte)    (1Byte)   (1Byte)     (1Byte)   (1Byte)   nt [N
                                                                               Byte]
 Value   0x5A     0xA5    N          0~63      0~63        0~255     0~255     Data      CSumL      CSumH
2.2 ID definiton
Point-to-point communicaton
 Name                                                 ID
 Master control of electric scooter (ES)              0x20
 Bluetooth instrument of ES                           0x21
 Built-in batery of ES                                0x22
 External batery of ES                                0x23
 PC upper computer connected through serial           0x3D
 port / CAN debugger/IoT equipment
 Mobile phone linked through Bluetooth serial         0x3E
 port (BLE)
Broadcast ID
 Name                                            ID
 Entre network broadcast                         0x00
[5] Locking or unlocking is available only in non-riding mode. Corresponding mark will be reset
afer locking or unlocking ends.
[6] Restart and shutdown are available only in non-riding mode. Corresponding mark will be reset
afer completon of the operaton.
[7] Functon setng bool variables:
Defne                               Bit Positon     Instructon       Default
NB_FUN_BOOLMARK_HEADLED_ALWAYS_O    ((unsigned      Headlight        0
N                                   short)0x0001)   always on/of
NB_FUN_BOOLMARK_HEADLED_FLASH       ((unsigned      Headlight        0
                                    short)0x0002)   fash
NB_FUN_BOOLMARK_BACKLED_ALWAYS_ON   ((unsigned      Taillight        0
                                    short)0x0004)   always on/of
NB_FUN_BOOLMARK_BACKLED_FLASH       ((unsigned      Taillight fash   0
                                    short)0x0008)
NB_FUN_BOOLMARK_BAT2LED_ALWAYS_ON   ((unsigned      Ex. Batery       1
                                    short)0x0010)   light on/of
NB_FUN_BOOLMARK_NO_ALARM_AT_LOCK    ((unsigned      No     alarm     0
                                    short)0x0020)   when locked
NB_FUN_BOOLMARK_SPEED_IN_MPH        ((unsigned      Use      mph     0
                                    short)0x0040)   units
NB_FUN_BOOLMARK_UNIT_SW             ((unsigned      Display unit     1
                                    short)0x0080)   or not
                                                    1:yes 0:no
NB_FUN_BOOLMARK_SPEED_ICON_SW       ((unsigned      Display          1
                                    short)0x0100)   speed or not
NB_FUN_BOOLMARK_PANNEL_SW           ((unsigned      Panel display    1
                                    short)0x0200)   or not
                                                    1:on 0:of
NB_FUN_BOOLMARK_BLUETOOTH_SW        ((unsigned      Bluetooth        0
                                    short)0x0400)   broadcast or
                                                    not
                                                    When on,bt
                                                    icon cannot
                                                    control;
                                                    When of,bt
                                                    icon      can
                                                    defne
                                                    status:fash
                                                    or always
 0x81:
 NB_FUN_BOOLMARK_BUTTON_SPDMODE_S                   ((unsigned              Buton can       1
 W                                                  short)0x0001)           change mode
                                                                            or not
 NB_FUN_BOOLMARK_MODE_ICON_SW                       ((unsigned              Display         1
                                                    short)0x0002)           speed mode
                                                                            or not
                                                                              Permis    Inital
Address   Name                 Command item                            Type
                                                                              sion[1]   value
0x00~
          Reserved             Reserved                                --     --        --
0x0F
0x10~                                                                  7*2
          BAT_SN               Batery serial number, 14Byte                   R         --
0x16                                                                   U8
                               Batery hardware and frmware
0x17      BAT_SW_VER                                                   U16    R         0
                               version
0x18      BAT_CAPACITY         Design capacity of the batery, mAh      U16    R         0
                               Full charge capacity of the batery,
0x19      BAT_TOTAL_CAPACITY                                           U16    R         0
                               mAh
          BAT_DESIGN_VOLTAG
0x1A                           Design voltage of the batery, 10mV      U16    R         0
          E
0x1B      BAT_CYCLE_TIMES      Cycle tmes of the batery                U16    R         0
0x1C      BAT_CHARGE_TIMES     Batery charging tmes                    U16    R         0
                               Lower 16 bits of the accumulatve
0x1D      BAT_CHARGE_CAP_L     charge capacity of the batery,          U16    R         0
                               10mAh
                               Higher 16 bits of the accumulatve
0x1E      BAT_CHARGE_CAP_H     charge capacity of the batery,          U16    R         0
                               10mAh
                               Batery overfowing and over-
                               discharging tmes, with the lower 8
          BAT_OVER_DISCHARG
0x1F                           bits indicatng the overfowing tmes      U16    R         0
          E_TIMES
                               and higher 8 bits indicatng over-
                               discharging tmes
0x20~
          Reserved             Reserved                                U16    R         --
0x2f
0x30      BAT_FUN_BOOLEAN      Boolean variable [1]                    S16
0x31      BAT_REMAINING_CAP    Current residual capacity, mAh          U16    R         --
          BAT_REMAINING_CAP    Current residual capacity percentage,
0x32                                                                   S16    R         --
          _PERCENT             0-100
0x33      BAT_CURRENT_CUR      Current current, 10mA                   S16    R         --
0x34      BAT_VOLTAGE_CUR      Current voltage, 10mV                   S16    R         --
                               Temperature, with the higher 8 bits
                               and lower 8 bits indicatng
0x35      BAT_TEMP_CUR         temperatures of two temperature         S16    R         --
                               sensors respectvely, 0-119
                               corresponding to -20 - 99℃
                                 Balanced open status of the
 0x36       BAT_BALANCE_STATU                                            S16      R           --
                                 protectve plate
                                 Undervoltage conditon of batery
 0x37       BAT_ODIS_STATE                                               S16      R           --
                                 cell
 0x38       BAT_OCHG_STATE       Overvoltage conditon of batery cell     S16      R           --
 0x39       BAT_CAP_COULO        Coulombmeter capacity                   S16      R           --
 0x3A       BAT_CAP_VOL          Voltmeter capacity                      S16      R           --
 0x3B       BAT_HEALTHY          Health degree                           S16      R           --
 0x3C~
            Reserved             Reserved                                S16      R           --
 3f
 0x40~      BAT_CORE_VOLT_1~
                                 Single cell voltage                     S16      R
 0x4f       BAT_CORE_VOLT_16