Author Topic: Live-stream from Garmin watches via ANT+ stick & virtual box (evtl. coud, IOT)  (Read 2808 times)

0 Members and 1 Guest are viewing this topic.

Offline Peter Gamma

  • Regular Contributor
  • *
  • Posts: 201
  • Country: ch
For all meditators who suffer and also fail to meditate with Garmin Fenix 5 and Microsoft Power BI, try it with Moxymonitor ANT to Serial Converter:

https://www.moxymonitor.com/product/ant-to-serial-converter/

https://www.thisisant.com/forum/viewthread/7074/P30
 

Offline Peter Gamma

  • Regular Contributor
  • *
  • Posts: 201
  • Country: ch
May all beings be free from suffering and the causes of suffering. May all beings rejoice in the well-being of others. May all beings live in peace, free from greed and hatred. Each of the four verses corresponds to a mental state: loving kindess, compassion, sympathetic joy, and peace (or equanimity).

https://www.ling.upenn.edu/~beatrice/buddhist-practice/four-immeasurables.html

For all those who don t wan t to suffer, I recommend this solution:

https://forums.garmin.com/developer/connect-iq/f/discussion/8077/sending-sensors-data-to-pc
 

Offline Peter Gamma

  • Regular Contributor
  • *
  • Posts: 201
  • Country: ch
 

Offline Peter Gamma

  • Regular Contributor
  • *
  • Posts: 201
  • Country: ch
Or find a C# programmer with a heart for Meditators.
 

Offline Peter Gamma

  • Regular Contributor
  • *
  • Posts: 201
  • Country: ch
ScottPlott had 9.360 total downloads, 29 downloads per day (avg) this is also Champions League :-+.
 

Offline Peter Gamma

  • Regular Contributor
  • *
  • Posts: 201
  • Country: ch
 

Offline janoc

  • Super Contributor
  • ***
  • Posts: 3088
  • Country: fr
I am not sure what you expect people to do with this "brain dump" and saying that for you "it takes time" (It doesn't for others? Or do you expect people to do this for free for you?). However, I can give you my experience with implementing a custom solution for ANT+.

It wasn't for the Garmin watch but we needed to integrate the Tacx cycling trainer (possibly the Vortex Smart but not 100% sure about the model) in one of our projects. I had to completely reverse engineer the communication because only the protocol for the brake was standard, the rest (the control "puck" and the Blacktrack steering sensor) uses an undocumented, proprietary profile over ANT+. And Tacx doesn't provide any meaningful SDK or access to the data, of course.

The easiest way to get anything working is to download the ANTWARE II for testing, then download their SDK:

https://www.thisisant.com/developer/resources/downloads/ (you will need to register).

There is an C/C++ SDK version for all major OSes, including Linux, for Windows there is also C#. That will save you a ton of time because most of the low level ANT+ complexity is handled there for you. That doesn't mean it is easy - the SDK is a mess, unfortunately. Of course, in order to be able to talk ANT+ to anything, your computer will need a supported dongle - some recommended ones are listed on that page, alternatively your watch may have come with one already.

I also strongly recommend to read the available documentation for the protocol, it is all explained there, including all the standard profiles. ANT+ is a bit oddball protocol in some aspects and the documentation will explain what is going on.

With this you should have no issues getting the data from the Garmin watch, assuming it uses standard ANT+ profiles (not every device does!), even though it will certainly require some elbow grease.

Alternatively, you can do it also in hardware - e.g. the Nordic nRF52 SoC series expressly supports ANT+ (and, in fact, the nRF52840 is the chip most commonly found in those ANT+ USB dongles). However, that is significantly more complex and you may need to sign some paperwork with Nordic/ANT to get an implementor's license before you could get your hands on the necessary Nordic protocol stack.

Re your idea of running this on some "compute stick" and such - as long as you can get the application to compile and run and the platform supports an USB dongle (I believe the ANT+ dongles are standard USB to serial devices not requiring any particular drivers), it will likely run OK. The determining factor will be what you want to do with your application (data processing, how many devices you are talking to simultaneously, networking, etc.) and not ANT+. ANT+ is designed to be a very low power and simplistic protocol not requiring much computing power to implement.
« Last Edit: April 05, 2020, 07:36:03 pm by janoc »
 

Offline Peter Gamma

  • Regular Contributor
  • *
  • Posts: 201
  • Country: ch
Thank you for sharing your experience,  janoc . I know THIS IS ANT, and I ve seen the documents you mentioned before. For me personally, there are two options interesting:


1. Moxymonitor ANT to Serial Converter which is commercially available (for MATLAB):

https://www.thisisant.com/forum/viewthread/7074/


2. Garmin IoT Series is a Microsoft Azure Cloud solution from Dave Does Demos :

https://forums.garmin.com/developer/connect-iq/f/discussion/209439/eventhubapp


Version 2, I ve tested with a Fenix 5 and Microsoft Power BI. Unfortunately, I did not get it to work.


Version1  for the Moxymonitor ANT to Serial Converter there is a Matlab example available. This is fine for research institutes. But I think as a community project,  Moxymonitor ANT to Serial Converter with the ScottPlott could be a success. This would be a low cost high quality solution. The Matlab example can be »reversed ingeneered» to a C# script which then can be connected to the ScottPlott.

https://www.thisisant.com/forum/viewthread/7074/P30

In my view, this would make sense as a community project to try it out.  I don t know whether it is possible to develop commerial products in this field. How many are interested in those? But to focus those people on one or two projects which will finally work could be a success.
 

Offline janoc

  • Super Contributor
  • ***
  • Posts: 3088
  • Country: fr
In my view, this would make sense as a community project to try it out.  I don t know whether it is possible to develop commerial products in this field. How many are interested in those? But to focus those people on one or two projects which will finally work could be a success.

In other words, you are hoping someone will solve your very specific problem for free under the guise of a "community project". Also I don't get the logic that if something isn't (supposedly) commercially viable because there isn't enough interest, so you hope someone will rather do it for free as a "community project"?

I am afraid that's not how this works.

Open source/community projects are about scratching one's own itch first and foremost - you have the problem, you have the hardware so you start coding and share your code, then someone who finds it useful or interesting will contribute. It won't happen otherwise. Alternatively, you provide both the hardware to test it on and pay someone else to develop the code for you (which you may open source later).

 

Offline Peter Gamma

  • Regular Contributor
  • *
  • Posts: 201
  • Country: ch
I contributed to this project the best I can. You can see my contributions on my GITHUB page:

https://github.com/PeterGamma

When you try to convince someone to code who is not a C# programmer, this will take very, very, very very long.

To pay someone to code it could be very expensive.

A Dr. heart is needed.

And when AlphaMonkeyC from Garmin, Dave Lusty who works for Microsoft UK, Walter Roberson from Matlab, Roger Schmitz from Moximonitor, Dr Scott Harden from Sound Card ECG, James Clutterbeck from Mind Monitor, Dr. Milind Y. Desai from Cleveland Clinic, Arnauld Delorme from the Swartz Center for Computational Neuroscience, Richard Davidson from the Center of Healthy Minds, or the Dalai Lama, Spritual Leader of the Tibetans, or a Superconductor from EEV Blog is not interested in developing this live-stream from a Garmin watch to a PC application, then I don t know whether this project will survive.
« Last Edit: April 08, 2020, 09:34:32 am by Peter Gamma »
 

Offline Peter Gamma

  • Regular Contributor
  • *
  • Posts: 201
  • Country: ch
Or other simple contributors, bloggers, and c# programmers from EEVBLOG, as I am  :).
 

Offline Peter Gamma

  • Regular Contributor
  • *
  • Posts: 201
  • Country: ch
I ve got the following information from a friend who send a e-mail to Roger Schmitz - CEO - Moxy Monitor:

«The Mox Ant to Serial converter works independently of a Moxy.  It can be used with any one or any combination of the sensor types up to 15 sensors.

The Converter will work with the following ANT+ profiles. 
    • Muscle Oxygen
    • Heart Rate
    • Speed
    • Cadence
    • Combined Speed and Cadence
    • Cycling Power
    • Stride Based Speed and Cadence
    • FEC

It just encodes the ANT+ data into a serial format and then sends that over the USB com port.  You need to write something on the computer side to decode the data.  Matlab was the intended target but any application that can read and decode a serial string would work.  I had it streaming directly into Excel yesterday.

Let me know if you'd like to setup an online call to discuss.

Roger

 

Offline Peter Gamma

  • Regular Contributor
  • *
  • Posts: 201
  • Country: ch
I suppose, the easiest and most comfortable way for a ant+ live-stream to MATLAB is:

- Install Linux on a notebook like Jumper EZBOOK 3 PRO
- Install a Linux Version of MATLAB
- try to run  Darren Hagues (SAP UK) Virtual Power in MATLAB and modify it to your needs

https://www.mathworks.com/matlabcentral/answers/142677-capturing-heart-rate-from-usb-ant-dongle-and-chest-strap

« Last Edit: April 09, 2020, 11:48:15 am by Peter Gamma »
 

Offline Peter Gamma

  • Regular Contributor
  • *
  • Posts: 201
  • Country: ch
Darren Hague is Dr. heart  :).
 

Offline Peter Gamma

  • Regular Contributor
  • *
  • Posts: 201
  • Country: ch
Darren Hague solution is  the easiest and most comfortable, exept for Dave Lustys Azure Cloud Power Bi solution, which is expensive, complicated and provided someone manages and confirms that it is working and manages to connect it to Matlab and to other applications.

 

Offline Peter Gamma

  • Regular Contributor
  • *
  • Posts: 201
  • Country: ch
On the other hand, as of Matlab R2019b, Matlab supports Bluetooth smart. It should be possible to connect your Polar H7 directly to Matlab :):

https://ch.mathworks.com/matlabcentral/answers/308210-communicate-with-bluetooth-low-energy-ble-with-matlab
 

Offline Peter Gamma

  • Regular Contributor
  • *
  • Posts: 201
  • Country: ch
There already models there of BLE Devices with Heart Rate Profile:

https://ch.mathworks.com/help/comm/examples/modeling-of-ble-devices-with-heart-rate-profile.html

This is the future.
 

Offline Peter Gamma

  • Regular Contributor
  • *
  • Posts: 201
  • Country: ch
Will there be a revolution with bluetooth smart sensors, the GATT client-server scenario as specified in the Bluetooth core specification, and Wireshark?

https://www.mathworks.com/matlabcentral/answers/142677-capturing-heart-rate-from-usb-ant-dongle-and-chest-strap
« Last Edit: April 13, 2020, 05:40:28 am by Peter Gamma »
 

Offline Peter Gamma

  • Regular Contributor
  • *
  • Posts: 201
  • Country: ch
My personal Conclusion:

Only nerds try to stream ANT+ sensors to Matlab. Smart people choose blueooth smart sensors, which can be connected directly to Matlab since Matlab release R2019b:

https://www.mathworks.com/matlabcentral/answers/308210-communicate-with-bluetooth-low-energy-ble-with-matlab

and try to connect them with the bluetooth smart example in Matlab, which exists since Matlab release R2020a:

https://www.mathworks.com/help/comm/examples/modeling-of-ble-devices-with-heart-rate-profile.html
 

Offline Peter Gamma

  • Regular Contributor
  • *
  • Posts: 201
  • Country: ch
Unfortunately, there is currently no bluetooth smart-live stream example available:

https://www.mathworks.com/matlabcentral/answers/518074-is-there-an-example-how-to-connect-the-polar-oh1-bluetooth-low-energy-heart-rate-sensor-with-matlab?s_tid=prof_contriblnk

https://www.mathworks.com/matlabcentral/answers/518075-is-there-an-example-how-to-connect-the-stryd-low-energy-foot-pod-sensor-with-matlab?s_tid=prof_contriblnk

Garmin fit files when converted to csv are a data soup. It takes a lot of time to get meaningful data out of it:

www.mathworks.com/.../394287-is-there-a-matlab-function-to-read-in-a-fit-file-from-a-garmin-device

there is also currently no live-steam example available from a GARMIN watch which would allow building up a data base with a simple and clear data structure:

www.mathworks.com/.../518101-is-there-an-example-how-to-stream-ant-sensor-data-live-to-matlab

An EventHubApp, Microsoft Azure Cloud, Power BI, Matlab, Python example could solve this problem immediately.


 

Offline Peter Gamma

  • Regular Contributor
  • *
  • Posts: 201
  • Country: ch
Post-processing alternative:

Max Candocia, the developer of the tool «Converting Garmin FIT Files to CSV»

https://maxcandocia.com/article/2017/Sep/22/converting-garmin-fit-to-csv/

is a Data Scientist who lives in Chicago and works at Mark Bio Inc, a biotec start up as a data scientist. He has a MS in Physics and a BS in Statistics:



According to the documentation, csv files generated by his tool have a simple an clear data structure. For me personally, the data structure of  the files converted by the official THIS IS ANT .fit to .csv converter was not clear.

I continued a thread about this subject in the GARMIN forum. Unfortunately, my posts where removed and the threat was locked:

https://forums.garmin.com/apps-software/mobile-apps-web/f/garmin-connect-web/122799/see-all-date-exported-in-fit-file---maybe-excel-oder-some-other-program/683009#683009

I don t know what was the reason for shut down.

I tried to use the Candocia FIT Files to CSV converter. Unfortunatley, I failed the first time I tried tu use it. It uses Python as a base, and I m not familiar with it. 
I think for everyone who is interested in a simple and clear data structure of converted GARMIN fit files, it s worth having a closer look at Max Candocias tool. 

Here is the most recent tutorial I could find for Converting Garmin files FIT to CSV format:



It uses code from Max Candocia. The resulting plot is very clear.
 

Offline Peter Gamma

  • Regular Contributor
  • *
  • Posts: 201
  • Country: ch
What does a data scientist like Max Candocia who want s to pulll out the data from a GARMIN watch?

The answer is decribed above.

A wonder if there a better solution than the path a data scientist like  Max Candocia is gone to solve this problem.

Unfortunately, I m not a Python programmer. For the time being, I stay with copy and paste data from converted csv files to other application.
 

Offline Peter Gamma

  • Regular Contributor
  • *
  • Posts: 201
  • Country: ch
 The tool uses code from Max Candocia

The tutorial is from RD Gameplays & Tech from BRASIL

https://www.youtube.com/user/rdlady11/about
 

Offline Peter Gamma

  • Regular Contributor
  • *
  • Posts: 201
  • Country: ch
The second time I wrote posts in the GARMIN Forum about the "Max Candocia" FIT to CSV Tool, I receveived a message  from GARMIN they were flagged as inappropriate. They where not published in the forum.  I don t know the reason for that. There was no answer from GARMIN when I asked for the reason.

I published my posts I wanted to post in the GARMIN forum in DC RAINMAKERS BLOG instead:

https://www.dcrainmaker.com/2014/10/heads-resource-rainmaker.html/comment-page-1#comment-3545862
 

Offline Peter Gamma

  • Regular Contributor
  • *
  • Posts: 201
  • Country: ch
Currently, me personally, I would choose the follwoing options to pull data from a GARMIN watch:

Post-processing option:

1. If you don t know how to download an run Python code, use the official THIS IS ANT .fit to csv converter:

https://www.thisisant.com/forum/viewthread/6654/

2.  If you know how to download an run Python code try to use following guide for Matlab or other applications.

https://www.mathworks.com/matlabcentral/answers/394287-is-there-a-matlab-function-to-read-in-a-fit-file-from-a-garmin-device#answer_426999?s_tid=prof_contriblnk

Real-time stream option:

3. For a real-time stream to Matlab or other applications, I would try the solution from Darren Hague:

https://www.mathworks.com/matlabcentral/answers/518101-is-there-an-example-how-to-stream-ant-sensor-data-live-to-matlab?s_tid=prof_contriblnk
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf