The device exclusively connects over BLE GATT. Paring does not seem to be necessary.
Find it by searching for a BLE device with the UART service, and check whether the device name (service 0x1800, characteristic 0x2A00) is "Motherboard".
The main service has a UUID of {6E400001-B5A3-F393-E0A9-E50E24DCCA9E}
.
You can use the TX characteristic {6E400003-B5A3-F393-E0A9-E50E24DCCA9E}
to receive data from the device.
It's as CRLF-separated ASCII text.
Send [0x01, 0x00] to its Client Characteristic Configuration (0x2902) descriptor to start receiving data as notifications.
Note that before you do this, trying to send commands to the RX characteristic will hang.
Each notification is up to 20 bytes long. Some messages may be shorter or longer than this, so you'll have to split and combine them to get full lines.
You can use the RX characteristic {6E400002-B5A3-F393-E0A9-E50E24DCCA9E}
to send commands to the device. They start with a single letter, and take numeric parameters.
The main mode is entered by sending the command 'S' (for Stream) optionally followed by a sample rate in Hz, which is usually 30. (e.g. 'S30' (three bytes, [0x53, 0x36, 0x30])) If you do not provide a sample rate, it will default to the last-used one.
When the stream starts it will print out "Stream:" followed by the sample rate. It can also indicate errors by printing a line starting with "Error". (For example, "Error VAL" can appear if you send an invalid command)
Each report is a 32-character HEX string. Once decoded, you'll have 16 bytes:
Unsigned byte 0-1: sample number
Unsigned byte 2-3: battery charge
Signed byte 4-6, 7-9, 10-12, 13-15: ADC readings
They're all little endian numbers. The fourth ADC is be unused.
Write 'C' to obtain the current calibrations.
The device will print four calibration points for all four sensors (for a total of 16 lines).
They are in the format sensor,calibrationPoint,mass,adc
, for example: 2,3,47.3,1112352
, which means that a reading of 1112352 on the third sensor corresponds to 47.3 kg of mass.
The sensors have a linear response, so you can do linear interpolation when your readings fall between two calibrations.
Subtract tare from the mass to get absolute weight.
When you calculate the bias (hanging balance), you need to compensate for which holes the fingers are in.
You send send the command 'D' to RX to get the data in a plain text format instead. Just like the 'S' command, you can choose a sample rate. The format is as follows:
sampleNumber,batteryCharge,A,sensor0Reading,sensor2Reading
sampleNumber,batteryCharge,B,sensor1Reading,sensor3Reading
Calibration data can be obtained from https://media.griptonite.io/assets/motherboard-final-calibrations.json.
Get the serial number using characteristic {00002A25-0000-1000-8000-00805F9B34FB}
on service {0000180A-0000-1000-8000-00805F9B34FB}
and look it up in that file. (.[serialNumber][sensor][calibrationPoint])
To write a calibration, send a 'C' and then a calibration in the same format as the output of the 'C' command.
The device also has a service for controlling its LEDs. That service's UUID is {10ABABCD-15E1-28FF-DE13-725BEA03B127}
.
The characteristic for the red LED is {10AB1524-15E1-28FF-DE13-725BEA03B127}
, and the green LED is {10AB1525-15E1-28FF-DE13-725BEA03B127}
.
Send a 1
byte to turn the LED on, or a 0
byte to turn it off.