Acknowledged
CIQQA-3271

LightNetworkListener.onBikeLightUpdate not called when certain data fields are installed

When certain data fields are installed alongside a CIQ application that uses LightNetworkListener, the onBikeLightUpdate method stops being called.
For example, the Smart Bike Lights data field (which uses onBikeLightUpdate) does not receive light updates when used alongside either:
- Tempe Visualizer
- TyreWiz Data Field

Both of these fields use a background service to communicate with an ANT+ sensor. Based on testing, it appears that onBikeLightUpdate stops being called when the background service of either field starts.
If the device is restarted after onBikeLightUpdate stops functioning, it resumes working even when both data fields are on the same data screen until the background service starts again (5 minutes after first use).

I tried to reproduce the issue by creating a simple data field that uses a background service to open an ANT channel and retrieve data from a Tempe sensor. Unfortunately, I was not able to reproduce the problem, as the onBikeLightUpdate method continued to be called normally.
It seems that something more is required to trigger the issue. There may be something unique in how the Tempe Visualizer or TyreWiz Data Field manage their background services or ANT channels that causes the conflict. You can find my test implementation here: https://github.com/maca88/SmartBikeLights/tree/test/ant-background-service/Source/TempeField 

Since Smart Bike Lights is a complex data field, I created a simpler one called Light Tester. It uses LightNetworkListener to display the total number of times the onBikeLightUpdate method is called. This makes it easier to observe and analyze the core issue.

How to reproduce (one ANT+ light is required):
1. Pair one or more ANT+ lights
2. Build and sideload the LightTester data field 
3. Install Tempe Visualizer data field (a Tempe sensor is not required)
4. Go to an activity and add "Light Tester" data field to a data screen
5. Turn on and off the paired light to see the "Updates=<NUMBER>" value in Light Tester increase
6. Add Tempe Visualizer to the same data screen
7. Turn the light on and off again. This time, the "Updates=<NUMBER>" value will no longer increase, indicating that onBikeLightUpdate is not being called.

The issue seems to affect all Garmin devices. I was able to reproduce the issue on all my devices:
Edge 1000
Edge 1040
Forerunner 245
Fenix 7

Parents
  • I tried to change parameters for the ANT channel, but so far no luck in reproducing it. I tried the following things individually and in combination:
    - set searchTimeoutHighPriority
    - change deviceType to zero
    - set searchThreshold
    - change ChannelType to CHANNEL_TYPE_RX_ONLY
    - use setBackgroundScan(true)


    For clarification, my data field does not open an ANT channel directly. Instead, it uses the AntPlus.LightNetwork class, which relies on the connection established by the native Sensor menu.

    When the problematic data field is added alongside mine, the light remains connected. I can confirm this because I can still use the LightNetwork.getBikeLights API to retrieve the current light mode. If the light mode changes, I can retrieve the updated mode using getBikeLights again. However, the LightNetworkListener.onBikeLightUpdate callback stops being called on a light mode change.

    I have contacted the developer of the Tempe Visualizer but have not received a response so far.

    > Or if it's on an Edge device, then editing the layout and first only adding yours, and only after it connects successfully, adding the other DataField. Do both then work?

    Yes, those are exactly the steps I followed to reproduce the issue on Edge. Even after the lights are connected, adding the other data field causes the onBikeLightUpdate callback to stop working.

    > I guess it only works for the first 5 minutes?

    The onBikeLightUpdate stops working as soon as the other data field is added for the first time, when its background service starts. The only way to temporarily restore functionality is to restart the device. After that, the callback works again, but only until 5 minutes have passed since the original start time (until the next background service run). At that point, it stops working again.

Comment
  • I tried to change parameters for the ANT channel, but so far no luck in reproducing it. I tried the following things individually and in combination:
    - set searchTimeoutHighPriority
    - change deviceType to zero
    - set searchThreshold
    - change ChannelType to CHANNEL_TYPE_RX_ONLY
    - use setBackgroundScan(true)


    For clarification, my data field does not open an ANT channel directly. Instead, it uses the AntPlus.LightNetwork class, which relies on the connection established by the native Sensor menu.

    When the problematic data field is added alongside mine, the light remains connected. I can confirm this because I can still use the LightNetwork.getBikeLights API to retrieve the current light mode. If the light mode changes, I can retrieve the updated mode using getBikeLights again. However, the LightNetworkListener.onBikeLightUpdate callback stops being called on a light mode change.

    I have contacted the developer of the Tempe Visualizer but have not received a response so far.

    > Or if it's on an Edge device, then editing the layout and first only adding yours, and only after it connects successfully, adding the other DataField. Do both then work?

    Yes, those are exactly the steps I followed to reproduce the issue on Edge. Even after the lights are connected, adding the other data field causes the onBikeLightUpdate callback to stop working.

    > I guess it only works for the first 5 minutes?

    The onBikeLightUpdate stops working as soon as the other data field is added for the first time, when its background service starts. The only way to temporarily restore functionality is to restart the device. After that, the callback works again, but only until 5 minutes have passed since the original start time (until the next background service run). At that point, it stops working again.

Children
No Data