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 tested your ANT+ HRM Heart Rate Monitor data field, and it works fine alongside the Light Tester. It does not interfere with the onBikeLightUpdate method.

    For users of Tempe Visualizer, I have created a new data field called Tempe Field, which does not use a background service to open the ANT channel. This setup works well with Smart Bike Lights and avoids the interference issue.

    The issue is that both the TyreWiz Data Field and Tempe Visualizer behave as intended from the perspective of their developers. In fact, Tempe Visualizer mentions in its description that it uses a background service to save battery, so this behavior is considered a feature.

    Ideally, I would like to see a fix from Garmin, since it should not be possible for one CIQ application to interfere with another. This seems like a platform-level issue that should be addressed.

Comment
  • I tested your ANT+ HRM Heart Rate Monitor data field, and it works fine alongside the Light Tester. It does not interfere with the onBikeLightUpdate method.

    For users of Tempe Visualizer, I have created a new data field called Tempe Field, which does not use a background service to open the ANT channel. This setup works well with Smart Bike Lights and avoids the interference issue.

    The issue is that both the TyreWiz Data Field and Tempe Visualizer behave as intended from the perspective of their developers. In fact, Tempe Visualizer mentions in its description that it uses a background service to save battery, so this behavior is considered a feature.

    Ideally, I would like to see a fix from Garmin, since it should not be possible for one CIQ application to interfere with another. This seems like a platform-level issue that should be addressed.

Children
  • The test code does open the ANT channel in the background, and it still works. So far, I haven't been able to reproduce the issue using the test code.
    Could you clarify what you mean by "how they open the and channel"? If you have a specific method/parameter in mind that might cause this behavior, please let us know.

  • I don't agree with your analysis. I think it's not because they use background. I think it's how they open the ant channel. If you moved your test code to background, I think it would still work