<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Scale on SROEMER</title>
    <link>/tags/scale/</link>
    <description>Recent content in Scale on SROEMER</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en</language>
    <copyright>Stefan Römer</copyright>
    <lastBuildDate>Sat, 14 Sep 2024 22:19:00 +0700</lastBuildDate><atom:link href="/tags/scale/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Reverse engineering a BLE body fat scale protocol</title>
      <link>/posts/2024/09/scale_interface/</link>
      <pubDate>Sat, 14 Sep 2024 22:19:00 +0700</pubDate>
      
      <guid>/posts/2024/09/scale_interface/</guid>
      <description>&lt;p&gt;I recently bought the &amp;lsquo;&lt;em&gt;smart&lt;/em&gt;&amp;rsquo; body fat scale &lt;em&gt;Crénot Gofit S2&lt;/em&gt;. As many of those modern &amp;lsquo;&lt;em&gt;smart&lt;/em&gt;&amp;rsquo; devices it uses
&lt;code&gt;Bluetooth Low Energy&lt;/code&gt; (&lt;code&gt;BLE&lt;/code&gt;) and an App on the phone to connect to it. Due to privacy concerns I do not want to use this
cloud based App and share my fitness / health data.&lt;/p&gt;
&lt;p&gt;Instead I found &lt;a href=&#34;https://github.com/oliexdev/openScale&#34;&gt;openScale&lt;/a&gt;. An open source App which would give me the same
functionality while storing all data locally on my phone. Sadly it did not support my scale so I started investigating
if I can add support for it.&lt;/p&gt;</description>
      <content>&lt;p&gt;I recently bought the &amp;lsquo;&lt;em&gt;smart&lt;/em&gt;&amp;rsquo; body fat scale &lt;em&gt;Crénot Gofit S2&lt;/em&gt;. As many of those modern &amp;lsquo;&lt;em&gt;smart&lt;/em&gt;&amp;rsquo; devices it uses
&lt;code&gt;Bluetooth Low Energy&lt;/code&gt; (&lt;code&gt;BLE&lt;/code&gt;) and an App on the phone to connect to it. Due to privacy concerns I do not want to use this
cloud based App and share my fitness / health data.&lt;/p&gt;
&lt;p&gt;Instead I found &lt;a href=&#34;https://github.com/oliexdev/openScale&#34;&gt;openScale&lt;/a&gt;. An open source App which would give me the same
functionality while storing all data locally on my phone. Sadly it did not support my scale so I started investigating
if I can add support for it.&lt;/p&gt;
&lt;p&gt;Initially I read the &lt;a href=&#34;https://github.com/oliexdev/openScale/wiki/How-to-reverse-engineer-a-Bluetooth-4.x-scale&#34;&gt;How to reverse engineer a Bluetooth 4.x scale&lt;/a&gt;
notes on the openScale Github page and also created a Bluetooth HCI snoop log as described there, but then ended up
following a different approach and wrote a small client in Python by using &lt;a href=&#34;https://pypi.org/project/bleak/&#34;&gt;Bleak&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;BLE devices use the &lt;code&gt;Generic Attribute Profile&lt;/code&gt; (&lt;code&gt;GATT&lt;/code&gt;) and provide services with different characteristics.
The &lt;a href=&#34;https://play.google.com/store/apps/details?id=com.macdom.ble.blescanner&#34;&gt;BLE scanner&lt;/a&gt; App mentioned in the notes
became handy to gather information about the scales provided services and characteristics.&lt;/p&gt;
&lt;p&gt;With this information I quickly was able to reliably get the weight value from the scale but did not figure out yet how other
values - like body fat percentage for example -  are transferred.&lt;/p&gt;
&lt;p&gt;My client can be found in my &lt;a href=&#34;https://github.com/sroemer/scale-communication&#34;&gt;scale-communication&lt;/a&gt; repo on Github and
with knowing the basic communication protocol it also will be possible to implement this in openScale. I also did not
give up yet on getting the missing values from my scale - but that&amp;rsquo;s for another time.&lt;/p&gt;
</content>
    </item>
    
  </channel>
</rss>
