Flutter read from polar heart rate monitor - flutter

I would like to build an app with Flutter that can read data from a Polar H9 or H10 heart rate monitor (Bluetooth).
I must say that I am a bit lost and don't see how to do.
I would appreciate some clues and a little guidance for it.
Thank you very much !
Best Regards

The best way to start with any new BLE would be to look for any kind of documentation describing the process of connecting and accessing the data. I found the official polar SDK on GitHub. It's written for either iOS (Swift) or Android (Java) but might help you anyway.
In case it is not possible to use native libraries with flutter you should start by using a generic BLE scanner such as nRF Connect to find out more about the device and the available BLE services. It could be that nRF Connect already recognizes the Heart Rate Service in case Polar uses the official Service structure. If that's the case you need to read the specification of the Heart Rate Service (Found here).
If they decided to use a custom service or protocol you could use nRF Connect to try to find out something about the device by sending some messages. This is a tedious process of try and error. A BLE sniffer might also help to collect data about existing communications between the sensor and a device.

Related

How do I send data using low bluetooth energy in flutter

I have a Project to send data from flutter to Arduino to do some tasks, I was working with HC -05 and 'serial Bluetooth communication library' but I found that isn't support Low energy Bluetooth, so I have to work with 'flutter_blue' and I can't find exactly how just send data like "1"
if someone has already work with something like that, help me and thanks
method to how can I send data with this library "Flutter blue"
'how can I send data with this library "Flutter blue"?'
There is an example there in flutter blue page (https://pub.dev/packages/flutter_blue) on how to get and send data to a BLE device.
await c.write([0x12, 0x34])
There are initial steps before the app can read and write data to the BLE device. Basically, the steps consists of scanning, connecting, and discovering services. After that, the app can start reading and writing data. Data are written(or read) to (or from) a 'characteristics'. The app can also subscribe to a characteristics so it can receive data from the notification. These are just a general guide for communicating with BLE devices. You must know the details from the documentation of the specific device.

Movesense low level API

I am planning to connect Movesense to Arduino with BLE Shield.
Where I can get deep protocol description to get position data from the Movesense? Do this information public?
On Android I have library mdslib-1.39.0(1)-release.aar that allows connection to Movesense, but have not able to get code from it, to create Arduino connection to Movesense, based on Android sample.
The "Whiteboard protocol" that MDS implements on top of BLE is quite complicated as well as proprietary, so it is not possible to have that on Arduino (or outside the common environments). However that is not the only way to communicate with the Movesense sensor.
For low level BLE access, you can either define your own GATT service using CustomGATTService, or use one of the existing "out of the box" profiles (HRS or Nordic UART Service. These will be nicer in 2.0).
The new 2.0 comes with a sample that provides any sensor data over GATT (as a binary stream) and we've back ported it to 1.9.4 as well (find it in https://bitbucket.org/suunto/movesense-device-lib/downloads/).
In my opinion if you just want IMU-data, the "gatt_sensordata_app"-sample is by far the easiest way to go.
Full disclosure: I work for the Movesense team

How can I get real-time heart rate data in a progressive web app for phones?

I'm building a progressive web application (target is smart phones for now). The app needs to be able to access heart rate and heart rate variability, ideally in real-time. While it seems totally asinine, I'm open to using REST calls to some remote server if that is the only way. I'm also fine with restricting the app to only work with certain hardware if necessary. In this case, the ideal hardware would be some sort of earbud that uses optics to scan for heart rate, but at this point, I'm open...
The best that I have thought up is to find a heart rate monitor that converts the direct signal into audio and use the microphone web API. That seems like a lot more work than ideal, so I'm hoping someone has a better idea. Any ideas are welcome. Please, no one downvote anyone if it doesn't solve all my constraints. I've been working on this for a bit and I'm not sure that there is a clean and perfect solution yet. Thanks in advance!
If the sensor can speak Bluetooth, the Web Bluetooth API can perhaps help: https://developer.mozilla.org/en-US/docs/Web/API/Web_Bluetooth_API
https://developers.google.com/web/updates/2015/07/interact-with-ble-devices-on-the-web
How about use a Web Bluetooth that lets you control any Bluetooth Low Energy device like heart rate monitors. It will read the Service Location Characteristics (which tells your where the sensor is placed - which body part) and subscribe to notifications from the Heart Rate Characteristics, meaning you will get an event whenever the device performs a new measurement. Then use a service worker that will define the behavior of the app to mimic native app capabilities like offline support and notifications.
It's like a Physical Web that you can send a link to your website from a Bluetooth beacon to a user's device and with PWA, that link can be to your web app that looks, feels and functions like a native app. Then with Web Bluetooth, you can then speack to the device. Visit this blog post for more details.

Can we read heart beat data from wear os using raspberry pi

I have purchased a Ticwatch which is running Android wear OS. I want to read the heart beart data from the device over bluetooth using raspberry pi. I found no resources to do so. But I found a tutorial to do so using Polar H7. Link below:
https://github.com/danielfppps/hbpimon
But the same thing is not doing anything with Ticwatch wear OS.
Can anyone even tell me if this is even possible ?
I haven't done this myself - it's quite likely that nobody has, it's a real corner case - but I have no doubt that it's doable.
Getting the heart rate data on Wear is pretty easy; there's an API to do just that. Here's a SO Q&A with some basic code to do so: How to read Heart rate from Android Wear
Transferring that data to your RasPi is going to be more work, but it's still eminently possible. Both devices support a full Bluetooth stack, but there's no simple API for this, so you'll have to build this piece more-or-less from scratch. On the Android side, a good starting point is Google's Bluetooth Chat sample: https://github.com/googlesamples/android-BluetoothChat
In summary: Anything's possible. Many things are difficult.
I ended up creating my own app on Wear OS. Thanks for all help.

Movesense with Unity BLE plugin

I am trying to get the Movesense to work with a Unity BLE asset as originally I thought MS would be simple enough. I have managed to connect to it and subscribed to the "61353090-" starting service and the "34802252-" starting charasteristic. I think I even got some notifications. Now the problem is, that I am not receiving or able to decode any data from there.
I also ended up reading the example codes and found out the complex system the Movesense uses and the "whiteboard", which I am unfamiliar with. I cannot find anything sensible by googling, as whiteboard is a whiteboard :)
Now my questions are:
What should I do to progress? Do I need to write something to the "17816557"?
What is the "whiteboard" actually?
Would it actually be smarter to just make a Unity plugin for the Movesense?
Thank you
Your are quite right that the answer is in the "Whiteboard" component. Whiteboard is the embedded REST framework (Note: it is not over HTTP!) that Movesense uses to implement REST services within as well as inter device (e.g. over UART or BLE). As you can imagine it is not a simple component, so decoding the traffic without Amersports'/Suunto's help is quite a big challenge. The actual BLE layer is simple: one characteristic to each direction (write & notify), the complexity lies in what goes inside that data pipe.
However, if you are trying to use Unity to make a mobile app the situation is not so bad. There has been a prototype of Movesense mobile library integration for Unity (Android) that uses the existing Movesense mobile library. If you ask Movesense team (info (at) movesense.com) they might be able to help you further. For Windows (Unity or plain) there is nothing done (at least not yet) mainly because until Windows 10 there was no official BLE API for Windows.
Full disclosure: I work for the Movesense team