Author Topic: 121GW bluetooth protocol  (Read 12313 times)

0 Members and 2 Guests are viewing this topic.

Offline savageautomate

  • Supporter
  • ****
  • Posts: 42
  • Country: us
  • Technology Entrepreneur, Consultant, Enthusiast
    • Savage Home Automation (Blog)
Re: 121GW bluetooth protocol
« Reply #25 on: January 18, 2018, 10:47:24 pm »
Hi,

I have written a sample NodeJS (Javascript) program that can parse and decode the 121GW data protocol if anyone is interested.
I gathered most of the info needed from David's C# sources.

that's were I also gathered my information for the script.

But did you find a way to get correct readings in VA mode?
 
In VA mode I get every now an then a correct reading but most of the readings are way off, but not invalid in the packet data..

No .. I'm seeing the same thing you are .. wildly erratic values for VA readings.   
I'll have to look again, but I think also some incorrect values for secondary measurements too while on a VA mode.

 
The following users thanked this post: Iagash

Offline nuclearcatTopic starter

  • Supporter
  • ****
  • Posts: 382
  • Country: lb
Re: 121GW bluetooth protocol
« Reply #26 on: January 28, 2018, 10:07:30 pm »
Here is the further developed version of my simple perl-script. It now parses the output of gatttool and displays it in readable form.

You should rename the file from 121gw.txt to 121gw.pl.

Then you can run it via:
gatttool -b 88:6B:0F:73:XX:XX --char-write-req -a 0x0009 -n 0300 --listen | ./121gw.pl

It reads the output of gatttool and parses the packet the multimeter sends.
It detects a lot of error but not all of them, so it's something to play with but until the bluetooth transmission is fixed in the firmware I would not rely on the data.

If the meter is in VA mode most of the data is wrong. This can't be fixed in the script and is also the case in the Android app.

The output looks like this:
Quote
1516048737.255 2017-08 00042   Voltage DC (V)  4.4652 V      _TempC    24.0
1516048737.795 2017-08 00042   Voltage DC (V)  4.4648 V      _TempC    24.0
1516048738.065 2017-08 00042   Voltage DC (V)  4.4648 V      _TempC    24.0
1516048739.010 2017-08 00042   Voltage DC (V)  4.4643 V      _TempC    24.0
1516048739.280 2017-08 00042   Voltage DC (V)  4.4643 V      _TempC    24.0
1516048739.550 2017-08 00042   Voltage DC (V)  4.4640 V      _TempC    24.0
1516048739.820 2017-08 00042   Voltage DC (V)  4.4640 V      _TempC    24.0
1516048740.157 2017-08 00042   Voltage DC (V)  4.4639 V      _TempC    24.0

At the beginning is a unix timestamp when the record was received.
The year and month is always the same since the meter doesn't seem to send the current one.
The third column is the "serial number" of the meter. You can set this value on the meter by cycling through the setup until you reach the display with 00000. If you long press SETUP you can change the digits to some other number. This number is send by the meter in every bluetooth frame.

Here is some PoC i created (unfortunately no sources yet, as its too ugly and mostly just PoC, it is linux specific, C++), idea that might be handy for EE:
Measuring resistance in auto range mode, it is a bit slow to get to correct range.
https://www.youtube.com/watch?v=7mnrvE271fA&feature=youtu.be
I used cheapo chinese microscope ($70) and, sure, 121GW
Not sure if worth to continue this app.
 

Offline benst

  • Regular Contributor
  • *
  • Posts: 87
  • Country: nl
Re: 121GW bluetooth protocol
« Reply #27 on: January 29, 2018, 11:32:01 pm »
Here is some PoC i created (unfortunately no sources yet, as its too ugly and mostly just PoC, it is linux specific, C++), idea that might be handy for EE:
Measuring resistance in auto range mode, it is a bit slow to get to correct range.
https://www.youtube.com/watch?v=7mnrvE271fA&feature=youtu.be
I used cheapo chinese microscope ($70) and, sure, 121GW

That's a great idea!

Ben
I hack for work and pleasure.
 

Offline prof

  • Contributor
  • Posts: 34
  • Country: de
Re: 121GW bluetooth protocol
« Reply #28 on: February 01, 2018, 11:41:48 pm »
I tried analysing the protocol with the "Bluetooth Explorer.app" on the Mac a while back but didn't have a lot of success because the format is rather weird (as you've figured out) and the values are extremely erratic. Glad you figure out at least that much!
 

Offline nuclearcatTopic starter

  • Supporter
  • ****
  • Posts: 382
  • Country: lb
Re: 121GW bluetooth protocol
« Reply #29 on: February 01, 2018, 11:45:13 pm »
I'm waiting firmware with a bit more reliable data(or statement that it is going to stay like this and best way to validate data), or if there is some successful efforts to make custom stm32 firmware.
Unfortunately i dont have much time to spend on reverse engineering or making workarounds that wont be needed in future.
Then i might continue on video app with OSD.
 

Offline kgmuzungu

  • Newbie
  • Posts: 7
  • Country: at
Re: 121GW bluetooth protocol
« Reply #30 on: December 08, 2019, 06:53:45 pm »
Hi,

did someone get it running? I mean to directly read from the bluetooth (COM) port and log to a file? If you have some code, also if buggy, can you post or link it?

thanks
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf