Kitra COM - rushup/Kitra520 GitHub Wiki

Table of Contents generated with DocToc

1 KITRA520 COMPUTING BLOCK DIAGRAM

Schema 1

2 KITRA520 SYSTEM BLOCK DIAGRAM

Schema 2

3 INTRODUCTION

The KITRA520 platform is made of two computational level: the first one is real time and the second one is high level processing. The real time section is on an STM32F411 microcontroller and its role is to handle low level drivers and communicate with embedded modules like Artik 5. The high level computing, based on ARTIK 5 IoT core module is capable to manage audio, video and high-speed communication interfaces. These two embedded worlds communicate using only one communication peripheral and the programmer of one side do not need to study the other side but only send commands and read answers.

3.1 Parameters

  • 115200 bps

  • 1 stop bit

  • No parity

  • No flow control

4 PROTOCOL DESCRIPTION

KITRA520 protocol enables you to control low level peripherals connected to a real time system through high level messages, providing direct and managed modes. Both modes are high level: direct expect you to manually manage data, managed mode manages data for you using built-in patterns and provide the final result. For example, polling touch coordinates fo a display and check if the user performed a swipe by software is considered direct mode. Instead, waiting for a notification like “SWIPE LEFT” or “SWIPE RIGHT” is considered managed. Both modes can be used simultaneously, there is no command to explicitly enable direct or managed mode. If you configure a peripheral to send you a swipe event that doesn’t disable the possibility to poll.

4.1 Command structure

Commands are composed by comma separated ASCII strings, all start with $KITRA string. Commands are followed by a 8bit checksum and ended with < CR >< LF >. Command structure is the same of the NMEA protocol used in many GPS receivers. Every field of the packet must be ordered as shown in the command table, it is possible to leave fields empty if they are optional.

Ex.$KITRA,523,2,1,1,,,*1F< CR >< LF > valid

Ex.$KITRA,523,2,1,1*33< CR ><LF > valid

Communication is mostly master-slave, except for start command, errors and notifications.

4.2 Checksum calculation

The checksum is appended at the end of the command and is composed by a "*" character and a checksum 8 bit value calculated over the whole packet string ("$" and "*" not included), represented as two hex characters. It is calculated xoring every character.

C:

void getChecksum(char* packet, char* chks) {
    char n_chks = 0;
    int len = strlen(packet);
    for (int c = 0; c < len; c++) {
        n_chks = (char)(n_chks ^ packet[c]);
    }
    sprintf(chks, "%02X", n_chks);
}

Javascript:

function getChecksum(packet)
{
   // Compute the checksum by XORing all the character values in the string.
   var checksum = 0;
   for(var i = 0; i < packet.length; i++) {
      checksum = checksum ^ packet.charCodeAt(i);
   }
}

Online calculator

5 STM32 PROTOCOL INPUT

Serial command sent from the high level stack to the real time system. For every non-polling input command the stm32 will answer with an acknowledgment packet.

We describe every command with a table, if the CMD field is bold that means that the field is mandatory, if it isn't then it's an optional field.

Check the Kitra-COM introduction to see how to handle optional field.

5.1 SYSTEM COMMAND

5.1.1 Change Baud Rate

Change baud rate. Mcu will change it after it sent the acknoledgement. Default baud rate at startup is 115200, changes are not retained.

CMD TYPE CODE
id INTEGER 511
baud_rate INTEGER 115200

Max allowed baud rate is 1Mbps.

5.1.2 Get firmware version

CMD TYPE CODE
id INTEGER 512

5.1.3 Start fw upgrade

Sends mcu in fw upgrade phase (115200 bps).

CMD TYPE CODE
id INTEGER 513

5.1.4 Reserved

5.1.5 Get kitra520 status

Get kitra520 statuses, for example battery status.

CMD TYPE CODE
id INTEGER 515

5.1.6 Kitra520 reset

Resets the Kitra520 board. This command also reboots Artik without any power off sequence, it can be dangerous for the file system. Before sending this command you must put Artik in a secure state.

CMD TYPE CODE
id INTEGER 516
option INTEGER 0
option description
1 Soft reset. All configurations are cleared.
2 Wait 20s and then remove power to Artik.
3 Unsafe reset. Power is immediately removed to Artik.

Only from firmware V1

5.1.7 Kitra520 sleep

Sends Kitra520 to deep sleep mode. Kitra520 will go to an unreachable state, allowing very low power consuption. Useful if you need Kitra520 only to power Artik.

CMD TYPE CODE
id INTEGER 517
option INTEGER 0

option not yet used.

5.2 DIGITAL INPUT COMMAND

5.2.1 Enable/Disable

Enable or disable input pin by hardware. The kitra520 board has 5 input pins, the first 4 are the DI on the external connector (see schematics), the 5th is the power-button. If pressed for less then 4 seconds it can be used as user button. Disabling a pin cause loss of its configurations.

CMD TYPE CODE
id INTEGER 521
pin INTEGER 2
enabled BOOLEAN 0
pull INTEGER 0
pull description
0 No pull
1 Pull-up
2 Pull-down

5.2.2 Read state

Read state input pin.

CMD TYPE CODE
id INTEGER 522
pin INTEGER 2

5.2.3 Configure activation

If configuration_target is notification and enabled is true, mcu will send a packet as soon as the pin change its state. A sampling time of 0 means that state will change as soon as it is detected. Active_state field is applied to both targets. Not bold fields are optional.

CMD TYPE CODE
id INTEGER 523
pin INTEGER 2
notification_enabled BOOLEAN 0
active_state BOOLEAN 0
sampling_time INTEGER (ms) 0
filter_activation INTEGER 0

filter_activation can be between 0 and 4095.

5.3 ANALOG INPUT COMMAND

5.3.1 Enable/Disable

Enable or disable analog pin by hardware. Disabling a pin cause loss of his configurations.

CMD TYPE CODE
id INTEGER 531
pin INTEGER 2
enabled BOOLEAN 0

5.3.2 Change operating mode

Change operating mode of the analog input pin. Resetting the value will clear current value.

CMD TYPE CODE
id INTEGER 532
pin INTEGER 2
mode INTEGER 0
mode values
0 STOP
1 PAUSE
2 START

5.3.3 Change configuration

CMD TYPE CODE
id INTEGER 533
pin INTEGER 2
sampling_time INTEGER (ms) 100
average INTEGER (ms) 1

average can be any any power of two till 1024.

Note: If you enable notifications with a high sampling_time, you need a high baud rate.

5.3.4 Read last sample

Read last analog input sample, data is with average. Mcu will send a response with a value between 0 and 65536 proportional to the voltage level.

CMD TYPE CODE
id INTEGER 534
pin INTEGER 2

5.3.5 Set notification

Configure notification for new packet and threshold interrupt of the analog pin (they are two different notifications).

CMD TYPE CODE
id INTEGER 535
pin INTEGER 2
notification_enabled BOOLEAN 0
threshold_level INTEGER 0
threshold_notification_enabled BOOLEAN 0

5.4 DIGITAL OUPUT & PWM COMMAND

5.4.1 Enable/Disable

Enable or disable output pin by hardware. Disabling a pin cause loss of its configurations.

CMD TYPE CODE
id INTEGER 541
pin INTEGER 2
enabled BOOLEAN 0
mode INTEGER 0
mode description
0 push-pull
1 open-dran

5.4.2 Change state

Read state input pin.

CMD TYPE CODE
id INTEGER 542
pin INTEGER 2
state BOOLEAN 0
state description
0 LOW
1 HIGH

5.4.3 Init/Configure PWM

Configure pwm duty cycle. Configuring a pin while pwm is on cause a stop.

CMD TYPE CODE
id INTEGER 543
pin INTEGER 2
frequency INTEGER (Hz) 100
percentage INTEGER (%) 50
autostart BOOLEAN 0

frequency can be between 1Hz and 1Mhz.

Set autostart to 1 if you want the pwm to start after the command.

5.4.4 Change mode PWM

After configuring the PWM you must start it with the change mode command. Stop and pause command bring the output LOW, stop cause loss of configurations.

CMD TYPE CODE
id INTEGER 544
pin INTEGER 2
mode INTEGER 0
mode description
0 STOP
1 PAUSE
2 START

5.5 CAPACITIVE TOUCH COMMAND

5.5.1 Enable Disable

Enable or disable touch button. Disabling a pin cause loss of its configurations.

CMD TYPE CODE
id INTEGER 551
pin INTEGER 2
enabled BOOLEAN 0
sensivity INTEGER 20

sensivity can be between 0 (most sensitive) and 255 (less sensitive).

5.5.2 Read state

Read touch state,no threshold or filter is applied.

CMD TYPE CODE
id INTEGER 552
pin INTEGER 2

5.5.3 Configure notifications

By default all notifications are disabled.

CMD TYPE CODE
id INTEGER 553
pin INTEGER 2
notification_touch_enabled BOOLEAN 0
notification_press_enabled BOOLEAN 0
notification_release_enabled BOOLEAN 0
threshold_level_press INTEGER (ms) 50

threshold_level_press can be between 0 and 4095.

5.5.4 Configure

CMD TYPE CODE
id INTEGER 554
frequency INTEGER (ms) 16

frequency must be multiple of 8. Internal frequency used by the sensor to read keys.

High ms reduce power consuption. 0 means off.

5.6 LRA HAPTIC DRIVER COMMAND

5.6.1 Enable/Disable

Enable or disable haptic. Disabling cause loss of its configurations.

CMD TYPE CODE
id INTEGER 561
pin INTEGER 1
enabled BOOLEAN 0

5.6.2 Configuration

Using managed mode a buil-in effect will be performed. Percetange isn’t used if managed mode is true.

Effect_number isn’t used if managed mode is false.

CMD TYPE CODE
id INTEGER 562
pin INTEGER 1
managed BOOLEAN 0
*percetange * INTEGER (%) 70
effect_number INTEGER 3
autostart INTEGER (ms) 0

percetange is mandatory if managed is disbled. effect_number is mandatory if managed is enabled. Can be between 1 and 127. Check drv2605 datasheet for informations about each effect.

5.6.3 Change mode

After configuring haptic you must start it with the change mode command.

CMD TYPE CODE
id INTEGER 563
pin INTEGER 1
mode INTEGER 0
mode description
0 STOP
1 PAUSE
2 START

5.7 PROXIMITY & LUX

Kitra520 board embeds two proximity sensors:

  • VL53L0X (pin 1): Proximity sensor for long dinstance measurement. Up to 2 meters on appropriate enviroment condition.
  • VL6180X (pin 2): Proximity sensor for short distance measurement and light. This sensor is also used with enviroment commands when reading light.

5.7.1 Enable/Disable

Disabling cause loss of its configurations.

CMD TYPE CODE
id INTEGER 571
pin INTEGER 2
enabled INTEGER 0

V0 Note: they are automatically disabled if microphone is active.

5.7.2 Read lux

Read lux intensity request, measured in lx.

CMD TYPE CODE
id INTEGER 572
pin INTEGER 2

Working only for pin 1.

5.7.3 Read proximity

Read proximity, measured in mm.

CMD TYPE CODE
id INTEGER 573
pin INTEGER 1

5.7.4 Sensor configuration

Disabling lux or prox will grant better performance on the proximity measurement.

CMD TYPE CODE
id INTEGER 574
pin INTEGER 1
disable_lux INTEGER 0
disable_prox INTEGER 0
extended_range INTEGER 1

On pin 1:

extended_range description
1 LONG_RANGE
2 HIGH_SPEED
3 HIGH_ACCURACY

On pin 2:

extended_range description
1 max 200mm
2 max 400mm
3 max 600mm

V0 Note: Remember that if you disable lux here you won’t be able to read its value with the enviroment command.

5.7.5 Sensor notifications

Notification regarding samples, not managed. Notification provide values for both lux and proximity. Not bold fields are optional.

CMD TYPE CODE
id INTEGER 575
pin INTEGER 2
sample_notification_enabled BOOLEAN 0
notification_rate INTEGER (ms) 1000
threshold_level_proximity INTEGER (mm) 0
threshold_level_lux FLOAT (lx) 0
threshold_notification_proximity_ enabled BOOLEAN 0
threshold_notification_lux_enabled BOOLEAN 0

5.7.6 Sensor managed notifications

Enabling managed notification the mcu will send a notification when a common gesture is recognized. To have a good performance we recommend to disable the lux sensor (through the configure command). Note that this command will change internal average of the sensor. VL53L0X will be put in HIGH_SPEED mode and VL6180X in 200mm mode. Disabling will restore the previous modes.

CMD TYPE CODE
id INTEGER 576
enabled BOOLEAN 0

V0 Note: not avaiable for this firmware version

5.8 LED RGB COMMAND

Each command has a pin field pointing to which led the command must be applied.

pin description
0 All leds
1 Led 1
2 Led 2
3 Led 3
4 Led 4

It is also possible to indicate a combination on led using a bit mask, each bit of the pin field is a led. To prevent conflict with the previous pin values you must set the 7th bit of the field to 1.

pin description
0x8F All leds
0x81 Led 1
0x83 Led 1 + Led 2
... ...

Only from firmware V1

5.8.1 Enable/Disable

Enable or disable rgb pin by hardware.

A pin value 0 means all leds.

CMD TYPE CODE
id INTEGER 581
pin INTEGER 2
enabled BOOLEAN 0

5.8.2 Set

Set color and intensity of a RGB LEG.

A pin value 0 means all leds.

CMD TYPE CODE
id INTEGER 582
pin INTEGER 0
color HEX INTEGER (32bit) 0xFF0000
intensity INTEGER (%) 100
autostart INTEGER 1

5.8.3 Set managed

Only from firmware V1

CMD TYPE CODE
id INTEGER 583
pin INTEGER 0
effect INTEGER 1
color_target HEX INTEGER (32bit) 0xFF0000
intensity_target INTEGER (%) 1000
duration INTEGER (ms) 1000
loop INTEGER 1
loop_delay INTEGER (ms) 0
autostart BOOLEAN 1
effect description
0 NONE
1 TRANSITION
loop description
0 Repeat until stop
1 Repeat once
2 Repeat 2 times
... ...

After each loop, a timeout of loop_delay is applied.

5.8.4 Change mode

CMD TYPE CODE
id INTEGER 584
pin INTEGER 1
mode INTEGER 0
mode description
0 STOP
1 PAUSE
2 START
3 REDIRECT

REDIRECT is like START but keeps current leds state if they are handling another transition.

5.9 ACCELEROMETER/GYROSCOPE/MAGNETOMETER COMMAND

5.9.1 Enable/Disable

Enable or disable IMU sensors.

CMD TYPE CODE
id INTEGER 591
enabled INTEGER 0

Toggling the enable will cause the magnetometer calibration to be reset.

5.9.2 Read raw

Request read of X,Y,Z of accellerometer and magnetometer, and dps (degree per second) of gyroscope.

Filter mask let you dedice what value receive, other fields of the response will be left empty. Every bit correspond to a field of the response, ordered as shown in the read raw response.

CMD TYPE CODE
id INTEGER 592
filter_mask HEX INTEGER (16bit) 0xFFFF

5.9.3 Read euler angles

Request read of roll, pinch, yaw parameters. Values and not raw but filtered and calculated over all sensors.

CMD TYPE CODE
id INTEGER 593

5.9.4 Configuration

Filter mask let you dedice to what raw value the enable field is applied, disabled fields on the response will be left empty. Filter mask is applied only during enable, during disable all notifications are removed. Every bit correspond to a field of the response, ordered as shown in the read raw response.

CMD TYPE CODE FW
id INTEGER 594 V0
enable_raw_notification BOOLEAN 0 V0
filter_mask_raw HEX INTEGER (16bit) 3F V0
enable_euler_notification INTEGER 0 V0
sampling_frequency INTEGER (Hz) 10 V0
notification_mask HEX INTEGER (16bit) 0 V0
full_scale INTEGER 0 V1E1

sampling_frequency can be between 1 and 100.

Every bit of the notification mask corresponds to a managed notification. Every notification is enabled or disabled according to the bits.

notification_mask bit
freefall 0
tap 1
double tap 2
tilt 3
wake_up 4
pedometer 5
enable_euler_notification description
0 Euler disabled
1 Euler enabled 9X
2 Euler enabled 6X

The first 2 bits of the full scale fields indicate the full scale of the accellerometer, the bits 2-3 indicate the full scale of the gyroscope.

full_scale description
0 acc 2g
1 acc 4g
2 acc 8g
3 acc 16g
0 245dps
1 500dps
2 2000dps

Example: 0x05 (acc 4g and gyro 500dps)

V0 Note: gyro full scale is fixed for this firmware version.

You shouldn't use euler notifications with a custom full scale combination.

5.9.5 Read calibration state

Yaw needs to be calibrated rotating the device in a 8 figure.

CMD TYPE CODE
id INTEGER 595

5.9.6 Read step counter

Reads pedometer step counter.

CMD TYPE CODE
id INTEGER 596

5.10 ENVIRONMENT SENSORS COMMAND

5.10.1 Enable/Disable

Enable or disable sensors.

Filter_mask tells what sensors to apply enable or disable. Each bit correspond to a sensors, ordered as: PRESSURE/TEMPERATURE/HUMIDITY/LUX Not bold fields are optional.

CMD TYPE CODE
id INTEGER 5101
enabled BOOLEAN 0
filter_mask HEX INTEGER (8bit) 0x0F
filter_mask bit
PRESSURE 0
TEMPERATURE 1
HUMIDITY 2
LUX 3

5.10.2 Read value

Read sensor value or values. Values aren't raw.

CMD TYPE CODE
id INTEGER 5102
filter_mask HEX INTEGER (8bit) 0x0F
filter_mask bit
PRESSURE 0
TEMPERATURE 1
HUMIDITY 2
LUX 3

5.10.3 Enable notification

Enable notification or threshold notification for a certain sensor.

CMD TYPE CODE FW
id INTEGER 5103 V0
enabled INTEGER 0 V0
sensor INTEGER 2 V1E1
notification_threshold_up_enabled BOOLEAN 0 V1E1
notification_threshold_down_enabled BOOLEAN 0 V1E1
threshold_value FLOAT 45 V1E1
notification_freq INTEGER (ms) 100 V1E1

notification_freq is global.

5.11 MICROPHONE COMMAND

Sampling and Beamforming supported only from version V1E2.

5.11.1 Enable/Disable

Enable disable microphones.

CMD TYPE CODE
id INTEGER 5111
mode INTEGER 0
mic_out_sel_1_2 HEX INTEGER (8bit) 0x04
notification_enabled BOOLEAN 1
noti_freq INTEGER (ms) 2000
bf_alg_type INTEGER 2000
bf_gain INTEGER 2000
mode description
0 Off
1 Localization
2 Sampling
3 Beamforming

mic_out_sel_1_2 is mandatory for sampling or beamforming. Defines stereo or mono streaming by checking the first 4 bits and the last 4 bits to identifiy the two microphone we want to record. A zero value means no microphone (can be used for mono streaming).

Ex. 0x14 for first and third microphones.

bf_alg_type description
0 Cardioid basic
1 Cardioid denoise

bf_alg_type and bf_gain are mandatory for beamforming.

Note: Beamforming and Sampling require very high baud rate, suggested speed is 1Mbit.

5.11.2 Get localization angle

Localization mode must be enabled.

CMD TYPE CODE
id INTEGER 5112

5.12 NEOPIXEL COMMAND

Supported from firmware V1E2.

5.12.1 Enable/Disable

CMD TYPE CODE
id INTEGER 5121
enabled BOOLEAN 0
nleds BOOLEAN 1

Note: To drive more then one led use an external supply.

5.12.2 Set

CMD TYPE CODE
id INTEGER 5122
pin INTEGER 0
color HEX INTEGER (32bit) 0xFF0000
intensity INTEGER (%) 100
autostart INTEGER 1

A pin value of 0 means all leds.

5.12.3 Change mode

Use this command to apply multiple set commands in a single shot.

CMD TYPE CODE
id INTEGER 5123
mode INTEGER 1

5.13 RESERVED

5.14 BUZZER COMMAND

5.14.1 Enable/Disable

CMD TYPE CODE
id INTEGER 5141
enabled BOOLEAN 0

5.14.2 Change state

CMD TYPE CODE
id INTEGER 5142
frequency INTEGER 1500
duty_cycle INTEGER 50
toggle_ms INTEGER (ms) 0

toggle_ms toggles the buzzer each time the duration exprires, if you do not need this feature do not send the parameter or buzzer won't start.

5.15 I2C COMMAND

Read/Write to the I2C bus via Kitra-COM. You can read/write up to 4 bytes.

Not bold fields for 16bit address must be left as optional or the command won't work.

5.15.1 Read I2C

Not bold fields are optional.

CMD TYPE CODE
id INTEGER 5151
device_address HEX BYTE (8bit) 1D
data_address_low HEX BYTE (8bit) BB
data_address_high HEX BYTE (8bit) BB
size INTEGER (8bit) 1

size can be between 1 to 4.

5.15.2 Write I2C

Not bold fields for 16bit address must be left as optional or the command won't work.

CMD TYPE CODE
id INTEGER 5152
device_address HEX BYTE (8bit) 1D
data_address_low HEX BYTE (8bit) BB
data_address_high HEX BYTE (8bit) BB
data0 HEX BYTE (8bit) AA
data1 HEX BYTE (8bit) AA
data2 HEX BYTE (8bit) AA
data3 HEX BYTE (8bit) AA

6 STM32 PROTOCOL OUTPUT

Command sent from the real time system to the high level stack. All the response command follow a master-slave relation (mcu is the slave) but power up, error and notification are async.

We describe every command with a table, if the CMD field is bold that means that the field is mandatory, if it isn't then it's an optional field.

Check the Kitra-COM introduction to see how to handle optional field.

6.1 SYSTEM COMMAND

6.1.1 Power up

Message sent by the mcu at powerup.

CMD TYPE CODE
id INTEGER 611

6.1.2 Acknowledgment

Message sent as response to a non-polling command.

CMD TYPE CODE
id INTEGER 612
ref_id INTEGER Ex. 533

ref_id is the id corresponding to the command the ack is referring to.

6.1.3 Error/Nack

Message sent when something wrong happends, it can be relative to a certain request or not.

CMD TYPE CODE
id INTEGER 613
error_code INTEGER Es. 1
ref_id INTEGER 533
error_code description
1 Bad format
2 Command not supported
3 Param not supported
4 Pin not enabled
5 Peripheral error

6.1.4 Get firmware version response

CMD TYPE CODE
id INTEGER 614
hw_version INTEGER 1
fw_version INTEGER 1
extra INTEGER 0

Firmware version start from 0.

The extra field is a 16bit value used to hold subversion information and manufacturer data for custom firmwares.

bit description
1 - 7 Subversion
7 - 8 Beta
8 - 16 Custom firmware identification

The official Kitra-COM firmware has 0 as firmware identification.

Note Bootloader from V1 (bootloader firmware, KitraIAP_VX.bin) answer to this command too with a fixed extra value of 0xFFFF.

6.1.5 Get kitra520 status response

CMD TYPE CODE
id INTEGER 615
battery_mv INTEGER (mV) 3600
battery_usb_plugged BOOLEAN 0

battery_mv is the battery voltage, with the provided battery you should read between 3400mV and 4300mV.

Under 3400mV the kitra520 board should be turned off.

6.2 DIGITAL INPUT COMMAND

6.2.1 Read state response

Read state input pin.

CMD TYPE CODE
id INTEGER 621
pin INTEGER 2
state BOOLEAN 0
state description
0 LOW
1 HIGH

6.2.2 State notification

Report state change if notification is enable.

CMD TYPE CODE
id INTEGER 622
pin INTEGER 2
state INTEGER 0
state description
0 LOW
1 HIGH

6.3 ANALOG INPUT COMMAND

6.3.1 Read last sample response

Mcu will send a response with a value between 0 and 4095 proportional to the voltage level.

CMD TYPE CODE
id INTEGER 631
pin INTEGER 2
state INTEGER 2300

6.3.2 Sample notification

CMD TYPE CODE
id INTEGER 632
pin INTEGER 2
sample INTEGER 2300

6.3.3 Threshold notification

This message is sent if the threshold is reached and the threshold notification is enabled.

CMD TYPE CODE
id INTEGER 633
pin INTEGER 2

6.4 CAPACITIVE TOUCH COMMAND

6.4.1 Read state response

CMD TYPE CODE
id INTEGER 641
pin INTEGER 2
state INTEGER 0
state description
0 OFF
1 ON

6.4.2 Notification

By default all notifications are disabled.

CMD TYPE CODE
id INTEGER 642
pin INTEGER 2
type INTEGER 0
type description
0 Touch
1 Release
2 Press

6.5 PROXIMITY & LUX

6.5.1 Read lux response

Read lux intensity requst, misured in lx.

CMD TYPE CODE
id INTEGER 651
pin INTEGER 1
type FLOAT (lx) 10.8

6.5.2 Read proximity response

Read proximity, measured in mm.

CMD TYPE CODE
id INTEGER 652
pin INTEGER 1
proximity INTEGER (mm) 20

6.5.3 Notification

CMD TYPE CODE
id INTEGER 653
pin INTEGER 1
threshold_prox BOOLEAN 0
threshold_lux BOOLEAN 0
proximity INTEGER (mm) 20
lux FLOAT (lx) 10.8

6.5.4 Managed notification

Left and right swipe notification.

CMD TYPE CODE
id INTEGER 654
type INTEGER 0
pin_mask HEX INTEGER (8bit) 0x02
type description
0 Left
1 Right

6.6 ACCELEROMETER/GYROSCOPE/ MAGNETOMETER COMMAND

6.6.1 Read raw response

Send X,Y,Z and angle parameters.

CMD TYPE CODE
id INTEGER 661
acc_x SIGNED INTEGER (mg) 0
acc_y SIGNED INTEGER (mg) 0
acc_z SIGNED INTEGER (mg) 0
gyro_x SIGNED INTEGER (° dps) 3600dps
gyro_y SIGNED INTEGER (° dps) 3600dps
gyro_z SIGNED INTEGER (° dps) 3600dps
magnet_x SIGNED INTEGER (mgauss) 0
magnet_y SIGNED INTEGER (mgauss) 0
magnet_z SIGNED INTEGER (mgauss) 0

6.6.2 Read euler angles response

Send roll, pinch, yaw parameters. Filtered and calculated over all sensors.

CMD TYPE CODE
id INTEGER 662
roll INTEGER (°) 90
pitch INTEGER (°) 90
yaw INTEGER (°) 90

6.6.3 Notification raw

Values sent depend of the filter mask configuration in the request. By default all are sent.

CMD TYPE CODE
id INTEGER 663
acc_x SIGNED INTEGER (mg) 0
acc_y SIGNED INTEGER (mg) 0
acc_z SIGNED INTEGER (mg) 0
gyro_x SIGNED INTEGER (° dps) 90
gyro_y SIGNED INTEGER (° dps) 90
gyro_z SIGNED INTEGER (° dps) 90
magnet_x SIGNED INTEGER (mgauss) 0
magnet_y SIGNED INTEGER (mgauss) 0
magnet_z SIGNED INTEGER (mgauss) 0

6.6.4 Notification euler

Values not raw but filtered and calculated over both sensors.

CMD TYPE CODE
id INTEGER 664
roll INTEGER (°) 90
pitch INTEGER (°) 90
yaw INTEGER (°) 90

6.6.5 Managed notification

At least one of the three field required. Not bold are optional.

CMD TYPE CODE
id INTEGER 665
notification_mask HEX INTEGER (16bit) Ex: 0x01
extra INTEGER Ex: 40 (Step counter)

extra field contains the step counter value if a step notification is being received.

notification_mask bit
freefall 0
tap 1
double tap 2
tilt 3
wake_up 4
pedometer 5

6.6.6 Read calibration state

Yaw (heading) needs to be calibrated rotating the device in a 8 figure.

CMD TYPE CODE
id INTEGER 666
calibrated BOOLEAN 0

6.6.7 Read step counter

Send pedometer cumulative step counter.

CMD TYPE CODE
id INTEGER 667
step_counter INTEGER 40

6.7 SENSORS COMMAND

6.7.1 Read value response

Read sensors values (not raw).

CMD TYPE CODE
id INTEGER 671
pressure FLOAT (hPa) 9700
temperature FLOAT (c°) 32
humidity FLOAT (%) 30
lux FLOAT (lux) 20

6.7.2 Notification

Only values of sensors with notification enabled are sent.

CMD TYPE CODE
id INTEGER 672
pressure FLOAT (hPa) 9700
temperature FLOAT (c°) 32
humidity FLOAT (%) 30
lux FLOAT (lux) 20

6.7.3 Threshold notification

CMD TYPE CODE
id INTEGER 673
sensor INTEGER 2
up_down INTEGER 0 -> Up
1 -> Down
sensor bit
PRESSURE 0
TEMPERATURE 1
HUMIDITY 2
LUX 3
up_down bit
UP 0
DOWN 1

6.8 MICROPHONE COMMAND

6.8.1 Get localization response

Tells the angle that received louder sounds.

CMD TYPE CODE
id INTEGER 681
angle INTEGER (°) 23

6.8.2 Localization notification

Tells the angle that received louder sounds.

CMD TYPE CODE
id INTEGER 682
angle INTEGER (°) 23

6.9 I2C COMMAND

Read/Write to the I2C bus via Kitra-COM. You can read/write up to 4 bytes.

6.9.1 I2C Read response

CMD TYPE CODE
id INTEGER 691
device_address HEX BYTE (8bit) 0x1D
data_address_low HEX BYTE (8bit) 0xBB
data_address_high HEX BYTE (8bit) 0xBB
data0 HEX BYTE (8bit) 0xAA
data1 HEX BYTE (8bit) 0xAA
data2 HEX BYTE (8bit) 0xAA
data3 HEX BYTE (8bit) 0xAA
⚠️ **GitHub.com Fallback** ⚠️