Skip to content

FortiusAnt with BLE/Bless breaks down after 5...20 minutes; time delay appears to solve the issue #480

@AfromD

Description

@AfromD

Problem: When using BLE bless between FortiusANT and Apple TV on a pi4 with debian 12, the data stream will break down after 5 to 20 minutes in seemingly random situations, and the bluetooth FortiusANT device is no longer responsive. I was able to isolate this to FortiusANT. The X interface and trainer communication stay active, just BLE breaks. Command line options used were noteably -bb -D-1. So use BLE Bless, no ANT.

When trying to record such a breakdown in the log, I used the command line options -bb -D -d bD. So use bless, use an ANT dongle and log all BLE communication to file. This was because I was using a Viiiiva for backup should the BLE break down, so that I could quickly switch to ANT+ communication. I guess this slows down execution, since we have two parallel communications and constant writing to an SD card on every BLE message.

The result was that I was able to complete a 35km cobble stone ride in the north of France (no stadium finish, bummer!) in somewhat over an hour. There was no data interruption, BLE worked as it should.

This leads me to believe that we are dealing with some sort of race condtion or thread safety issue, where BLEbless methods are called in a too quick order, where memory contents might change half way through the call or something similar. On the Bless repository there is a similar issue with overloading: kevincar/bless#140

So I propose a rate limiting whenever calling BLEbless. Pseudocode before invoking a bless method:

if last_bless_call + 50 > time():
    return
else:
    last_bless_call = time()

Or maybe even something upstream in the Bless library, but I am no expert on python coding.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions