Bluetooth
π BLUETOOTH COMMANDS AND PARAMETERSβ
π§ DEVICE CONFIGURATIONβ
| Command | Parameter | Description | Example |
|---|---|---|---|
set address | 1-255 | Sets the device Modbus address | set address 5 |
set baudrate | 2400,4800,9600,19200,38400,57600,115200 | Sets the RS485 communication speed | set baudrate 19200 |
π‘ WIFI MANAGEMENTβ
| Command | Description | Result |
|---|---|---|
wifi enable | Activates the WiFi hotspot | SSID: STATOTEST_LASERX, password: statotest2024 |
wifi disable | Deactivates WiFi | Turns off the WiFi module |
π MEASUREMENTβ
| Command | Description | Response |
|---|---|---|
stt measure | One-off measurement | MEASURE STARTED + JSON data |
stt continuous measure start | Starts continuous measurement (1s interval) | CONTINUOUS MEASURE STARTED |
stt continuous measure stop | Stops continuous measurement | CONTINUOUS MEASURE STOPPED |
π΄ LASER CONTROLβ
| Command | Description | Response |
|---|---|---|
laser on | Turns on the laser light | LASER ON |
laser off | Turns off the laser light | LASER OFF |
βΉοΈ DEVICE INFORMATIONβ
| Command | Description | Example response |
|---|---|---|
fw version | Firmware version | FW version: 1 |
hw version | Hardware version | HW version: 2 |
help | Shows the help | Complete list of commands |
π SYSTEM COMMANDSβ
| Command | Description | Result |
|---|---|---|
restart | Restarts the device | Immediate ESP32 restart |
π MEASUREMENT DATA FORMATβ
During a measurement, data is sent in JSON format:
[
{
"SensorId": 90,
"Channel": 0,
"value": 1.2345,
"unit": "m",
"sensor": "laser",
"type": "displacement"
},
{
"SensorId": 90,
"Channel": 0,
"value": 23.5,
"unit": "C",
"sensor": "laser",
"type": "temperature"
},
{
"SensorId": 90,
"Channel": 0,
"value": 3.3,
"unit": "V",
"sensor": "laser",
"type": "voltage"
}
]
π CONNECTIONβ
- Device name:
STATOTEST-LASER-X(where X = the device address) - Service UUID:
6E400001-B5A3-F393-E0A9-E50E24DCCA9E - RX Characteristic:
6E400002-B5A3-F393-E0A9-E50E24DCCA9E(for sending commands) - TX Characteristic:
6E400003-B5A3-F393-E0A9-E50E24DCCA9E(for receiving responses)
β οΈ NOTESβ
- All commands are case-sensitive
- Unknown commands return:
UNKNOWN COMMAND: [your command] - Changes to the address and baudrate are saved to the flash memory
- The WiFi hotspot has a timeout of 600 seconds (10 minutes)
- Continuous measurement runs until it is explicitly stopped