This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
web-u2 [2019/09/11 20:35] – [Board] add HM-10 kingkevin | web-u2 [2024/01/07 17:49] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 26: | Line 26: | ||
The [[http:// | The [[http:// | ||
- | It only point to the user guide and software (with broken link).\\ | + | It only points |
Instead they recommend to follow the QQ group 313755927. | Instead they recommend to follow the QQ group 313755927. | ||
Line 84: | Line 84: | ||
==== WITRN U2 V2.0 ==== | ==== WITRN U2 V2.0 ==== | ||
- | Because the clone was bricked, I got a genuine replacement. | + | Because the clone got bricked, I got a genuine replacement. |
{{: | {{: | ||
Line 205: | Line 205: | ||
There are other messages to get the device' | There are other messages to get the device' | ||
+ | |||
+ | I've implemented a software (C program for Linux) to read to measurements over USB and output it as CSV. | ||
+ | You can find it in the [[https:// | ||
==== Bluetooth Serial ==== | ==== Bluetooth Serial ==== | ||
+ | |||
+ | The Qway has an optional Bluetooth module. | ||
+ | This allows getting the measurement without physical connection (e.g. the USB HID port). | ||
+ | You can use the [[# | ||
+ | |||
+ | I reversed the protocol so I can get the raw data myself. | ||
+ | Scan for Bluetooth (Low Energy) devices and look for one named '' | ||
+ | There is no need to pair with the device. | ||
+ | You can directly connect to it. | ||
+ | Data is then exchanged using the GATT characteristic '' | ||
+ | |||
+ | On the [[# | ||
+ | The main board is connected to the Bluetooth board using spring contacts and uses UART to communicate with the module (at 115200 bps). | ||
+ | |||
+ | First send the message '' | ||
+ | The device will reply with a message using the following format (the bytes use little endian order): | ||
+ | |||
+ | < | ||
+ | 0xf1 0x01 0x30 0x31 0x31 0x33 0x33 0x37 0x67 0x14 0x00 0x00 0x00 0x32 0x00 0x00 0x00 0x00 0x03 0x00 | ||
+ | </ | ||
+ | |||
+ | ^ index ^ byte(s) ^ format ^ meaning ^ | ||
+ | | 0-1 | '' | ||
+ | | 2-7 | '' | ||
+ | | 8 | '' | ||
+ | | 9-12 | '' | ||
+ | | 13-14 | '' | ||
+ | | 14-17 | '' | ||
+ | | 18 | '' | ||
+ | | 19 | '' | ||
+ | |||
+ | The device then sends measurements for a bit of time. | ||
+ | To keep the device sending measurements, | ||
+ | |||
+ | < | ||
+ | 0xf1 0x02 0x00 0x00 0x00 0xfe | ||
+ | </ | ||
+ | |||
+ | A complete measruement set is comprised of 5 messages. | ||
+ | But each message includes the voltage and current measurements, | ||
+ | |||
+ | ^ index ^ byte(s) ^ format ^ meaning ^ | ||
+ | | 0-1 | '' | ||
+ | | 2-5 | | float | VBUS voltage, in V | | ||
+ | | 6-9 | | float | VBUS current, in A | | ||
+ | | 10-13 | | float | D+ voltage, in V | | ||
+ | | 14-17 | | float | D- voltage, in V | | ||
+ | | 18 | | uint8 | current recording group number, add 1 | | ||
+ | | 19 | '' | ||
+ | |||
+ | ^ index ^ byte(s) ^ format ^ meaning ^ | ||
+ | | 0-1 | '' | ||
+ | | 2-5 | | float | VBUS voltage, in V | | ||
+ | | 6-9 | | float | VBUS current, in A | | ||
+ | | 10-13 | | float | internal temperature, | ||
+ | | 14-17 | | float | external temperature (from USB probe), in °C | | ||
+ | | 18 | | uint8 | current recording group number, add 1 | | ||
+ | | 19 | '' | ||
+ | |||
+ | ^ index ^ byte(s) ^ format ^ meaning ^ | ||
+ | | 0-1 | '' | ||
+ | | 2-5 | | float | VBUS voltage, in V | | ||
+ | | 6-9 | | float | VBUS current, in A | | ||
+ | | 10-13 | | uint32 | on time, in s | | ||
+ | | 14-17 | | uint32 | recording time, in s | | ||
+ | | 18 | | uint8 | current recording group number, add 1 | | ||
+ | | 19 | '' | ||
+ | |||
+ | ^ index ^ byte(s) ^ format ^ meaning ^ | ||
+ | | 0-1 | '' | ||
+ | | 2-5 | | float | VBUS voltage, in V | | ||
+ | | 6-9 | | float | VBUS current, in A | | ||
+ | | 10 | | int8 | acceleration value, X-axis | | ||
+ | | 11 | | int8 | acceleration value, Y-axis | | ||
+ | | 12 | | int8 | acceleration value, Z-axis | | ||
+ | | 14-17 | | uint32 | recording time, in s | | ||
+ | | 18 | | uint8 | current recording group number, add 1 | | ||
+ | | 19 | '' | ||
+ | |||
+ | ^ index ^ byte(s) ^ format ^ meaning ^ | ||
+ | | 0-1 | '' | ||
+ | | 2-5 | | float | VBUS voltage, in V | | ||
+ | | 6-9 | | float | VBUS current, in A | | ||
+ | | 10-13 | | float | recorded charge, in Ah | | ||
+ | | 14-17 | | float | recorded energy, in Wh | | ||
+ | | 18 | | uint8 | current recording group number, add 1 | | ||
+ | | 19 | '' | ||
+ | |||
+ | when the device is unresponsive, | ||
+ | |||
+ | < | ||
+ | 0xf1 0x03 0x00 0x00 0x00 0xfe | ||
+ | </ | ||
+ | |||
+ | I did not take time to reverse this since I got the measurements I was looking for. | ||
+ | |||
+ | I've implemented a software (C program for Linux) to read to measurements over Bluetooth and output it as CSV. | ||
+ | You can find it in the [[https:// |