Garmin shows 0.0 speed sent by esp32 over BLE

  1. Hi..

I've been working on esp32 project to get treadmill speed sent to my Gamin Fenix5. 

The idea is simple. Esp32 reads the speed from flywheel via reed relay and transmits the speed data over BLE to my watch.  The Garmin connects to esp32 but doesn't show the speed. The reading is 0.0.

nRF connect shows this:

nRF Connect, 2022-03-20
Footpod(3C:61:05:30:B2:06)
V 08:45:07.813 Connecting to 3C:61:05:30:B2:06...
D 08:45:07.813 gatt = device.connectGatt(autoConnect = false, TRANSPORT_LE, preferred PHY = LE 1M)
D 08:45:08.039 [Callback] Connection state changed with status: 0 and new state: CONNECTED (2)
I 08:45:08.039 Connected to 3C:61:05:30:B2:06
D 08:45:08.065 [Broadcast] Action received: android.bluetooth.device.action.ACL_CONNECTED
I 08:45:08.412 Connection parameters updated (interval: 7.5ms, latency: 0, timeout: 5000ms)
V 08:45:08.751 Discovering services...
D 08:45:08.751 gatt.discoverServices()
D 08:45:08.771 [Callback] Services discovered with status: 0
I 08:45:08.771 Services discovered
V 08:45:08.776 Generic Attribute (0x1801)
- Service Changed [I] (0x2A05)
   Client Characteristic Configuration (0x2902)
Generic Access (0x1800)
- Device Name [R] (0x2A00)
- Appearance [R] (0x2A01)
- Central Address Resolution [R] (0x2AA6)
Running Speed and Cadence (0x1814)
- Sensor Location [R] (0x2A5D)
- RSC Measurement [N] (0x2A53)
   Characteristic User Description (0x2901)
   Client Characteristic Configuration (0x2902)
D 08:45:08.777 gatt.setCharacteristicNotification(00002a05-0000-1000-8000-00805f9b34fb, true)
D 08:45:08.780 gatt.setCharacteristicNotification(00002a53-0000-1000-8000-00805f9b34fb, true)
I 08:45:08.907 Connection parameters updated (interval: 35.0ms, latency: 0, timeout: 5000ms)
V 08:45:12.723 Enabling notifications for 00002a53-0000-1000-8000-00805f9b34fb
D 08:45:12.723 gatt.setCharacteristicNotification(00002a53-0000-1000-8000-00805f9b34fb, true)
D 08:45:12.725 gatt.writeDescriptor(00002902-0000-1000-8000-00805f9b34fb, value=0x0100)
I 08:45:12.860 Data written to descr. 00002902-0000-1000-8000-00805f9b34fb, value: (0x) 01-00
A 08:45:12.860 "Notifications enabled" sent
V 08:45:12.868 Notifications enabled for 00002a53-0000-1000-8000-00805f9b34fb
I 08:45:13.916 Notification received from 00002a53-0000-1000-8000-00805f9b34fb, value: (0x) 03-BB-06-01-01-00-0A-00-00-00
A 08:45:13.916 "Speed: 6.73 m/s, Candence: 1 RPM,
Instantaneous Stride Length: 0.01 m,
Total Distance: 1.0 m,


Speed is sent but Garmin won't show it. 

I believe something is missing from BLE characteristics.

Any idea?

Thanks.


  • Best would be to have nRF log prints from Garmin food pod to compare what it actually sends.

    What about doing a read vs notify?
    With nRFConnect, you can do both reads and notifies. 

    I needs to study this. I'm not that familiar with the tool.

    add println calls, build a sideload, and create the needed log file.

    To the ESP32 code? Sorry...I'm a bit lost here

  • You add the println calls to your CIQ app on the garmin device to see what's going on.

    In https://forums.garmin.com/developer/connect-iq/w/wiki/4/new-developer-faq#testing-purposes

    See "How can I test or debug Connect IQ apps I am developing?"

  • Thanks for the link...

  • Could i please get a link to your code or even the bare bones structure of the services and characteristics?

    I'm just trying the same thing with an esp32 and although my FR245 can add the accessory, it then refuses to connect to it.

    nRF Toolbox shows that my RSC implementation is valid

  • Here..

    https://github.com/imwitti/FootpodMimic/blob/master/ManualFootpodMimic

    There is also possibility that Garmin rejects the data (hence 0.0) if it's out of range??

    I have a Speed sensor for bicycle. I hooked that one to my treadmill...with some lego gearing Slight smile

    This setup works pretty well. However, before I managed to calibrate it, the speed was also 0.0, if the speed data was either too low or too high.

    If I choose  "Running" the watch won't recognisze speed sensor for Bikes. I guess it accepts ony FP-FootPod. So I have to choose "Bicycle" workout., then the  sensor is seen as SPD (Speed sensor)

    But.."bicycle" workout won't support  running dynamics-data. So I guess I need to settle for speed and distance data only.

    Unless I get the esp32 working as FootPod.


  • Here is SPD--Speed Sensor data from nRF connect.

    31874-101 (D8:73:2E:D9:9D:AB)

    V 09:28:07.876 Connecting to D8:73:2E:D9:9D:AB...
    D 09:28:07.876 gatt = device.connectGatt(autoConnect = false, TRANSPORT_LE, preferred PHY = LE 1M)
    D 09:28:08.882 [Callback] Connection state changed with status: 0 and new state: CONNECTED (2)
    I 09:28:08.883 Connected to D8:73:2E:D9:9D:AB
    V 09:28:08.884 Discovering services...
    D 09:28:08.884 gatt.discoverServices()
    D 09:28:08.931 [Broadcast] Action received: android.bluetooth.device.action.ACL_CONNECTED
    I 09:28:09.113 Connection parameters updated (interval: 7.5ms, latency: 0, timeout: 5000ms)
    D 09:28:09.536 [Callback] Services discovered with status: 0
    I 09:28:09.536 Services discovered
    V 09:28:09.560 Generic Access (0x1800)
    - Device Name [R W] (0x2A00)
    - Appearance [R] (0x2A01)
    - Peripheral Preferred Connection Parameters [R] (0x2A04)
    - Central Address Resolution [R] (0x2AA6)
    Generic Attribute (0x1801)
    Unknown Service (8ce5cc01-0a4d-11e9-ab14-d663bd873d93)
    - Unknown Characteristic [N W WNR] (8ce5cc02-0a4d-11e9-ab14-d663bd873d93)
       Client Characteristic Configuration (0x2902)
    - Unknown Characteristic [N W WNR] (8ce5cc03-0a4d-11e9-ab14-d663bd873d93)
       Client Characteristic Configuration (0x2902)
    Battery Service (0x180F)
    - Battery Level [N R] (0x2A19)
       Client Characteristic Configuration (0x2902)
    Device Information (0x180A)
    - Manufacturer Name String [R] (0x2A29)
    - Model Number String [R] (0x2A24)
    - Serial Number String [R] (0x2A25)
    - Hardware Revision String [R] (0x2A27)
    - Firmware Revision String [R] (0x2A26)
    - Software Revision String [R] (0x2A28)
    Cycling Speed and Cadence (0x1816)
    - CSC Measurement [N] (0x2A5B)
       Client Characteristic Configuration (0x2902)
    - CSC Feature [R] (0x2A5C)
    - Sensor Location [R] (0x2A5D)
    - SC Control Point [I W] (0x2A55)
       Client Characteristic Configuration (0x2902)
    D 09:28:09.560 gatt.setCharacteristicNotification(8ce5cc02-0a4d-11e9-ab14-d663bd873d93, true)
    D 09:28:09.565 gatt.setCharacteristicNotification(8ce5cc03-0a4d-11e9-ab14-d663bd873d93, true)
    D 09:28:09.567 gatt.setCharacteristicNotification(00002a19-0000-1000-8000-00805f9b34fb, true)
    D 09:28:09.571 gatt.setCharacteristicNotification(00002a5b-0000-1000-8000-00805f9b34fb, true)
    D 09:28:09.573 gatt.setCharacteristicNotification(00002a55-0000-1000-8000-00805f9b34fb, true)
    I 09:28:09.617 Connection parameters updated (interval: 35.0ms, latency: 0, timeout: 5000ms)
    I 09:28:14.502 Connection parameters updated (interval: 490.0ms, latency: 0, timeout: 4000ms)
    V 09:28:19.668 Enabling indications for 00002a55-0000-1000-8000-00805f9b34fb
    D 09:28:19.669 gatt.setCharacteristicNotification(00002a55-0000-1000-8000-00805f9b34fb, true)
    D 09:28:19.671 gatt.writeDescriptor(00002902-0000-1000-8000-00805f9b34fb, value=0x0200)
    I 09:28:20.379 Data written to descr. 00002902-0000-1000-8000-00805f9b34fb, value: (0x) 02-00
    A 09:28:20.379 "Indications enabled" sent
    V 09:28:20.389 Indications enabled for 00002a55-0000-1000-8000-00805f9b34fb
    V 09:28:25.827 Enabling notifications for 00002a5b-0000-1000-8000-00805f9b34fb
    D 09:28:25.827 gatt.setCharacteristicNotification(00002a5b-0000-1000-8000-00805f9b34fb, true)
    D 09:28:25.829 gatt.writeDescriptor(00002902-0000-1000-8000-00805f9b34fb, value=0x0100)
    I 09:28:26.749 Data written to descr. 00002902-0000-1000-8000-00805f9b34fb, value: (0x) 01-00
    A 09:28:26.749 "Notifications enabled" sent
    V 09:28:26.778 Notifications enabled for 00002a5b-0000-1000-8000-00805f9b34fb
    I 09:28:27.242 Notification received from 00002a5b-0000-1000-8000-00805f9b34fb, value: (0x) 01-A8-00-00-00-DC-8E
    A 09:28:27.242 "Wheel rev: 168,
    Last wheel event time: 36572 ms" received
    I 09:28:28.223 Notification received from 00002a5b-0000-1000-8000-00805f9b34fb, value: (0x) 01-A9-00-00-00-C0-90
    A 09:28:28.223 "Wheel rev: 169,
    Last wheel event time: 37056 ms" received
    I 09:28:28.224 Notification received from 00002a5b-0000-1000-8000-00805f9b34fb, value: (0x) 01-AA-00-00-00-C0-92
    A 09:28:28.224 "Wheel rev: 170,
    Last wheel event time: 37568 ms" received
    I 09:28:28.714 Notification received from 00002a5b-0000-1000-8000-00805f9b34fb, value: (0x) 01-AB-00-00-00-BB-94
    A 09:28:28.714 "Wheel rev: 171,

  • The "Wheel Size" parameter needs to be entere to Garmin watch. Then it can calculate the speed based on Wheel rev and Wheel size.

  • MZYPT I have a Polar foot pod wich I used both with zwift and my garmin FR935. If you didn't solve the problem and think that it will be a bit of help I can get the nrFconnect output for you. Let me know  if you need it or if there's something special to look for.

    I also have an ESP32 sending speed from my treadmill to zwift, but unfortunately it's disassembled by now and I don't remember if I tried it with the forerunner. I am planning to reasemble it but not immediately.

  • I got tired and bored to investigate this.I bought RUNN smart sensor insted..It was something 80€ so not bad.

    However..it also used ANT+ technology. Maybe  I still would like to investigate this further..

    I have a Polar foot pod wich I used both with zwift and my garmin FR935. If you didn't solve the problem and think that it will be a bit of help I can get the nrFconnect output for you. Let me know  if you need it or if there's something special to look for

    Is Polar footpod using BT or ANT+? 

    I can get the nrFconnect output for you

    That would help

  • Polar footpod its only BLE, no ANT+ functionality, I used to have it matched with my previous Polar M430, then Garmin FR935 and later to zwift on my iPad. It was not really accurate, especially on treadmill so I switched to and ESP32 picking signal from a hall sensor on the front roll of it. The real problem with the polar sensor apart from accuracy is that is a pain in the ass to switch it between shoes, so its in a box resting right now. I will be going on holidays soon so no time no to test it right now, I will see if during february I can get you more info with nrFconnect or something like that.