This page describes Bluetooth API that you can use to work with Atmotube directly via BLE connection (without Atmotube Application). e.g. you can write custom program for Windows, Raspberry Pi, etc.
There are 2 ways to get data from Atmotube device:
History data sending is implemented via UART service. You have to send commands via RX and handle device answers via TX UART characteristics.
1. After UART connection mobile device sends HST (history) request with current timestamp. UART service responds with HOK (history OK) acknowledge.
Command, ASCII, 3 bytes
Unix time, 4 bytes - current system time
HST
XXXX
Command, ASCII, 3 bytes
HOK
2. If device has not synced history available it starts data sending with HT packed following one or several HD packets. HT packet contains timestamp of the starting HD packet and number of HD packets and size.Mobile device acknowledge HD packets receiving by sending HOK command with current timestamp.
Command, ASCII, 2 bytes
1 byte
Unix time, 4 bytes - first HD packet time
Number of HD packets, 1 byte
Size of the one measurement in bytes, 1 byte
HT
0
XXXX
X
X
Command, ASCII, 2 bytes
1 byte
Packet number, 1 byte
Measurement 1
-
Measurement N
HD
0
X
XXXX
-
XXXX
Command, ASCII, 2 bytes
1 byte
Packet number, 1 byte
Measurement N+1
-
Measurement N+1+x
HD
0
X
XXXX
-
XXXX
Measurement
N
Size in bytes, 1 byte
Description
0
1
Temperature, ℃
1
1
Humidity, %
2
2 - little-endian
VOC (ppb)
3
4 - little-endian
Pressure (mbar * 100)
4
2 - little-endian
PM1, ug/m³
5
2 - little-endian
PM2.5, ug/m³
6
2 - little-endian
PM10, ug/m³
If mobile device received HT + all HD packets - it acknowledges data by sending HOK command.
Command, ASCII, 3 bytes
Unix time, 4 bytes - current system time
HOK
XXXX
Got more questions? We're here to help!
Please contact us at info@atmotube.com or by submitting a support ticket using the form on the following support page:
You may also use the ATMO Bot (usually on the right-hand side of the webpage on desktop, bottom-left for mobile) for a quick answer or leave your email address so that we may get in touch.