Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Oct 19, 2025

Overview

This PR adds support for Shimano DI2 and SRAM AXS cycling shifters as controllers in SwiftControl, addressing the feature request in the issue. Users with these electronic shifting systems can now use their shifter's special function buttons to control training apps like MyWhoosh, Rouvy, and others.

What's Changed

New Device Support

Shimano DI2

  • Implements BLE connectivity for Shimano DI2 electronic shifting systems
  • Supports 8 configurable button mappings for special function buttons
  • Users must configure special buttons via the E-Tube app before use

SRAM AXS

  • Implements BLE connectivity for SRAM AXS wireless shifting systems
  • Supports 8 button mappings across left/right shifters and controllers
  • Uses composite key mapping (component ID + button ID) for button identification

Implementation Details

Both device classes follow the established pattern used by existing devices (Elite Square, Wahoo Kickr Bike Shift):

  • Extend BaseDevice with protocol-specific BLE handling
  • Proper button press/release state tracking via handleButtonsClicked()
  • Error handling for missing BLE services/characteristics
  • Debug logging via actionStreamInternal for troubleshooting

Files Added

  • lib/bluetooth/devices/shimano/shimano_di2.dart - DI2 device implementation
  • lib/bluetooth/devices/sram/sram_axs.dart - AXS device implementation

Files Modified

  • lib/bluetooth/devices/base_device.dart - Added device detection and BLE service UUIDs
  • README.md - Added DI2 and AXS to supported devices list
  • TROUBLESHOOTING.md - Added configuration and troubleshooting guidance

Important Notes

⚠️ Beta Status: Both devices are marked as beta and require real hardware testing. The BLE service UUIDs and protocol specifications are based on research and common implementations, but may need refinement based on actual device behavior.

📝 User Requirements:

  • DI2: Configure special function buttons in the Shimano E-Tube app
  • AXS: Ensure firmware is up to date via the SRAM AXS app
  • Both devices must be disconnected from their configuration apps before connecting to SwiftControl
  • Only special function buttons are supported, not regular shifting operations

Testing

  • ✅ Syntax validation passed
  • ✅ Follows existing device implementation patterns
  • ✅ No security vulnerabilities detected (CodeQL)
  • ✅ Minimal, surgical changes with no breaking modifications
  • ⏳ Real hardware testing pending - feedback from users with DI2/AXS hardware is needed to validate BLE protocols

Statistics

  • Files added: 2
  • Files modified: 3
  • Lines added: 178
  • Lines removed: 0

Closes #[issue_number]

Original prompt

This section details on the original issue you should resolve

<issue_title>Support for Shimano DI2 / SRAM AXS as controllers?</issue_title>
<issue_description>Another two potential devices that could be implemented as controller in SwiftControl, to use MyWhoosh, Rouvy & co with it.

Let me know if you're interested in this

Other keywords: ANT+, Zwift, Remote control</issue_description>

Comments on the Issue (you are @copilot in this section)

@jonasbark Yes, that's pretty much the same idea. Swiftcontrol connects to di2 directly, then should be able to grab these configured "special buttons". I don't think it can receive the other buttons though and they would continue to do the actual di2 shifting.

Fixes #108


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits October 19, 2025 06:29
Co-authored-by: jonasbark <1151304+jonasbark@users.noreply.github.com>
Co-authored-by: jonasbark <1151304+jonasbark@users.noreply.github.com>
Copilot AI changed the title [WIP] Add support for Shimano DI2 and SRAM AXS controllers Add support for Shimano DI2 and SRAM AXS as controllers Oct 19, 2025
Copilot AI requested a review from jonasbark October 19, 2025 06:34
Copilot finished work on behalf of jonasbark October 19, 2025 06:34
@jonasbark jonasbark closed this Oct 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support for Shimano DI2 / SRAM AXS as controllers?

2 participants