BLOGサブスレッドの日常

2019.02.04

オムロンさんの血圧計 HEM-7600T がスゴい

tama

あけましておめでとうございます。tamaです。
2019年になってもう1ヶ月以上たつのに誰もブログを更新していないという現実…

最近弊社のお父さんの血圧が心配という話題がありまして。
測り忘れ対策とみんなで健康に気付かうという観点で #Withings みたいに測定した血圧値を自動的にツイートする仕組みとかないのかなと思って探してみたんですが意外とそういうの見つからない。

ないものは作ろう

というわけで考えてみました。

血圧計の値を読み取りたい

オムロンヘルスケア HEM-6300F

手元にあった手首式血圧計。これNFC対応していてAndroid端末で測定値を読み出すことができます。
でもいちいちアプリ起動して端末かざすのがめんどくさいんスよね。。
と思ってたら最近のはBLE(Bluetooth Low Energy)対応になっていてiPhoneでも測定値を読み出せるとのこと。ふむふむ。
それならパソコンやRaspberry PiのBluetoothでデータを読み出せる可能性が?

オムロンヘルスケア HEM-7600T

ヨドバシカメラに行ったら売っていたチューブレスでスタイリッシュな上腕式血圧計。液晶表示も精細!
これを買ってみてさっそくBluetoothのスキャンをしてみました。
(BlueZ 5.50をビルドしてインストールしたRaspberry Piから)

$ gatttool -b EC:21:E5:XX:XX:XX --primary
attr handle: 0x0001, end grp handle: 0x0051 uuid: 00001800-0000-1000-8000-00805f9b34fb
attr handle: 0x0100, end grp handle: 0x0112 uuid: 00001801-0000-1000-8000-00805f9b34fb
attr handle: 0x0200, end grp handle: 0x0281 uuid: 0000180a-0000-1000-8000-00805f9b34fb
attr handle: 0x0300, end grp handle: 0x03a2 uuid: ecbe3980-c9a2-11e1-b1bd-0002a5d5c51b
attr handle: 0x0400, end grp handle: 0x0421 uuid: 00001810-0000-1000-8000-00805f9b34fb
attr handle: 0x0500, end grp handle: 0x0512 uuid: 0000180f-0000-1000-8000-00805f9b34fb
attr handle: 0x0600, end grp handle: 0x0612 uuid: 00001805-0000-1000-8000-00805f9b34fb

サービスは上から順に

Generic Access
Generic Attribute
どんなBLEデバイスにもあるような
Device Name
Appearance
Service Changed
などが入っているサービス、
Device Information には
Model Number String
Firmware Revision String
などが入っています。
gatttool -b EC:21:E5:XX:XX:XX --characteristics で確認できます)

ベンダー依存サービスは詳細がわかりませんが、その下に Blood Pressure が!
これは Blood Pressure Service に詳細が書かれていて、
その中身は Blood Pressure Profile に従っています。
すごくざっくり言うと、CollectorになるRaspberry Piは bond してセンサーを white list に入れたあと、
CCC(Client Characteristic Configuration)
indication を有効にすれば
Blood Pressure Measurement
の通知を受け取ることができます。

ちなみに
gatttool -b EC:21:E5:XX:XX:XX --char-desc --start=0x0400 --end=0x0421
gatttool -b EC:21:E5:XX:XX:XX --char-read --handle=0x04XX の結果は次の通りです。

  • handle = 0x0400, uuid = 00002800-0000-1000-8000-00805f9b34fb Primary Service
    • 10 18 ⇒ このサービスのUUID:1810(=00001801-0000-1000-8000-00805f9b34fb)
  • handle = 0x0410, uuid = 00002803-0000-1000-8000-00805f9b34fb Characteristic Declaration
    • 20 11 04 35 2a ⇒ Characteristicの定義 プロパティ:indicate handle:0x0411 UUID:2a35(=00002a35-0000-1000-8000-00805f9b34fb)
  • handle = 0x0411, uuid = 00002a35-0000-1000-8000-00805f9b34fb Blood Pressure Measurement
    • Attribute can't be read(プロパティに read が付いてないので)
  • handle = 0x0412, uuid = 00002902-0000-1000-8000-00805f9b34fb Client Characteristic Configuration
    • 00 00 ⇒ 通知設定 notifications:disabled indications:disabled
  • handle = 0x0420, uuid = 00002803-0000-1000-8000-00805f9b34fb Characteristic Declaration
    • 02 21 04 49 2a ⇒ Characteristicの定義 プロパティ:read handle:0x0421 UUID:2a49(=00002a49-0000-1000-8000-00805f9b34fb)
  • handle = 0x0421, uuid = 00002a49-0000-1000-8000-00805f9b34fb Blood Pressure Feature
    • 27 00 ⇒ サポートしている機能 body movement detection、cuff fit detection、irregular pulse detection、multiple bonds

Pythonで dbus モジュールの処理周りをラップするライブラリを作って(後日公開します)ごにょっとデータを取ってみたらそれっぽい値になってましたよー?

  • 16 72 00 4C 00 58 00 E3 07 01 1C 16 2E 07 43 00 01 00
    • 16 ⇒ 単位はmmHg、タイムスタンプあり、脈拍あり、測定ステータスあり
    • 72 00 ⇒ 収縮期血圧114mmHg
      • IEEE-11073 16-bit SFLOAT なので上位4ビット(0b0000)が2の補数表現された指数部、下位12ビット(0x072=114)が2の補数表現された仮数部
    • 4C 00 ⇒ 拡張期血圧76mmHg
    • 58 00 ⇒ 平均動脈圧88mmHg
    • E3 07 01 1C 16 2E 07 ⇒ 2019-01-28 22:46:07
    • 43 00 ⇒ 脈拍67bpm
    • 01 00 ⇒ 測定ステータス:体動あり
  • 16 79 00 50 00 5D 00 E3 07 01 1D 00 0C 1A 42 00 00 00
    • 16 ⇒ 単位はmmHg、タイムスタンプあり、脈拍あり、測定ステータスあり
    • 79 00 ⇒ 収縮期血圧121mmHg
    • 50 00 ⇒ 拡張期血圧80mmHg
    • 5D 00 ⇒ 平均動脈圧93mmHg
    • E3 07 01 1C 16 2E 07 ⇒ 2019-01-29 00:12:26
    • 42 00 ⇒ 脈拍66bpm
    • 00 00 ⇒ 測定ステータス:異常なし

あとはこのスクリプトを cron で定期的に走らせて、取得した値を Twitter なり ChatWork なりに投げるようにすればお父さんの死活監視ができます。

オムロンヘルスケア HEM-6324T

オムロンヘルスケア HEM-7511T

気をよくしてさらに2機種、手首式血圧計と上腕式血圧計(どちらも2人分記録対応)を手配して作ったモジュールの検証をしてみようと思ったんですが、、

$ gatttool -b EC:21:E5:XX:XX:XX --primary
attr handle = 0x0001, end grp handle = 0x0051 uuid: 00001800-0000-1000-8000-00805f9b34fb
attr handle = 0x0100, end grp handle = 0x0112 uuid: 00001801-0000-1000-8000-00805f9b34fb
attr handle = 0x0200, end grp handle = 0x0281 uuid: 0000180a-0000-1000-8000-00805f9b34fb
attr handle = 0x0300, end grp handle = 0x03a2 uuid: ecbe3980-c9a2-11e1-b1bd-0002a5d5c51b

$ gatttool -b EC:21:E5:XX:XX:XX --characteristics
handle = 0x0010, char properties = 0x02, char value handle = 0x0011, uuid = 00002a00-0000-1000-8000-00805f9b34fb
handle = 0x0020, char properties = 0x02, char value handle = 0x0021, uuid = 00002a01-0000-1000-8000-00805f9b34fb
handle = 0x0030, char properties = 0x0e, char value handle = 0x0031, uuid = 00002a02-0000-1000-8000-00805f9b34fb
handle = 0x0040, char properties = 0x02, char value handle = 0x0041, uuid = 00002a03-0000-1000-8000-00805f9b34fb
handle = 0x0050, char properties = 0x02, char value handle = 0x0051, uuid = 00002a04-0000-1000-8000-00805f9b34fb
handle = 0x0110, char properties = 0x20, char value handle = 0x0111, uuid = 00002a05-0000-1000-8000-00805f9b34fb
handle = 0x0210, char properties = 0x02, char value handle = 0x0211, uuid = 00002a23-0000-1000-8000-00805f9b34fb
handle = 0x0220, char properties = 0x02, char value handle = 0x0221, uuid = 00002a24-0000-1000-8000-00805f9b34fb
handle = 0x0230, char properties = 0x02, char value handle = 0x0231, uuid = 00002a25-0000-1000-8000-00805f9b34fb
handle = 0x0240, char properties = 0x02, char value handle = 0x0241, uuid = 00002a26-0000-1000-8000-00805f9b34fb
handle = 0x0250, char properties = 0x02, char value handle = 0x0251, uuid = 00002a27-0000-1000-8000-00805f9b34fb
handle = 0x0260, char properties = 0x02, char value handle = 0x0261, uuid = 00002a28-0000-1000-8000-00805f9b34fb
handle = 0x0270, char properties = 0x02, char value handle = 0x0271, uuid = 00002a29-0000-1000-8000-00805f9b34fb
handle = 0x0280, char properties = 0x02, char value handle = 0x0281, uuid = 00002a2a-0000-1000-8000-00805f9b34fb
handle = 0x0310, char properties = 0x1e, char value handle = 0x0311, uuid = b305b680-aee7-11e1-a730-0002a5d5c51b
handle = 0x0320, char properties = 0x0c, char value handle = 0x0321, uuid = db5b55e0-aee7-11e1-965e-0002a5d5c51b
handle = 0x0330, char properties = 0x0c, char value handle = 0x0331, uuid = e0b8a060-aee7-11e1-92f4-0002a5d5c51b
handle = 0x0340, char properties = 0x0c, char value handle = 0x0341, uuid = 0ae12b00-aee8-11e1-a192-0002a5d5c51b
handle = 0x0350, char properties = 0x0c, char value handle = 0x0351, uuid = 10e1ba60-aee8-11e1-89e5-0002a5d5c51b
handle = 0x0360, char properties = 0x12, char value handle = 0x0361, uuid = 49123040-aee8-11e1-a74d-0002a5d5c51b
handle = 0x0370, char properties = 0x12, char value handle = 0x0371, uuid = 4d0bf320-aee8-11e1-a0d9-0002a5d5c51b
handle = 0x0380, char properties = 0x12, char value handle = 0x0381, uuid = 5128ce60-aee8-11e1-b84b-0002a5d5c51b
handle = 0x0390, char properties = 0x12, char value handle = 0x0391, uuid = 560f1420-aee8-11e1-8184-0002a5d5c51b
handle = 0x03a0, char properties = 0x10, char value handle = 0x03a1, uuid = 8858eb40-aee8-11e1-bb67-0002a5d5c51b

え、00001810-0000-1000-8000-00805f9b34fb
Blood Pressure
ないやん/(^o^)\
(ちなみに HEM-6324T は address type が random なので -t random というフラグが必要)

ecbe3980-c9a2-11e1-b1bd-0002a5d5c51b という Vendor Specific なサービスをどうにかすれば目的のデータにたどり着けるとは思うんですが
オムロンさんに怒られそうなのでそれはまた別のお話…

結論

というわけで今のところ HEM-7600T しか
Blood Pressure Profile に対応してないぽいです。
チューブレスでスタイリッシュなだけでなく標準仕様のBLP(Blood Pressure Profile)に対応してる HEM-7600T スゲー!ってお話。

ただし高い

他社デバイスはまだ調べてないのですが各社様、ぜひとも標準仕様に対応していただけるとありがたいです🙂

この記事を書いた人

tama