Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] In K2 Pro, if RGB is off, the bluetooth connection resets every second in wireless mode #348

Open
teddympq opened this issue Dec 26, 2024 · 4 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@teddympq
Copy link

teddympq commented Dec 26, 2024

Describe the Bug

Having RGB off causes the Bluetooth connection to disconnect every second of keyboard inactivity.

This ultimately causes DF(layer) return to default. Even if the default layer is changed to persistent, OSM mods sometimes won't work because the keyboard resets.

This issue never happens if:

  • RGB is on
  • RGB is off and the keyboard is in wireless mode but connected via cable
  • RGB is off and the keyboard is in wired mode

Additionally, it won't happen if keys are pressed nonstop or keys are held.
I am using the latest firmware from the wireless_playground branch.

@teddympq teddympq added bug Something isn't working help wanted Extra attention is needed labels Dec 26, 2024
@PeterMortensen
Copy link

Related:

@PeterMortensen
Copy link

This is supposedly fixed with the 0.2.1 Bluetooth firmware version.

@teddympq
Copy link
Author

I'm glad to see that they have found a solution. For the K Pro Series, the only workaround I can think of is creating a custom RGB layer with no LEDs activated

@teddympq
Copy link
Author

teddympq commented Jan 23, 2025

I tried to find a solution by tinkering a little bit... I noticed there was a function that activated if backlight is off

I tried making this function useless. As a result, the keyboard no longer resets, and works well with the backlight turned off. However, this function is vital for detecting whether the battery level is low and performing other necessary actions if needed. Is that correct? At least, now we know where the problem lies.

void battery_task(void) {
uint32_t t = rtc_timer_elapsed_ms(bat_monitor_timer_buffer);
if (get_transport() == TRANSPORT_BLUETOOTH && bluetooth_get_state() == BLUETOOTH_CONNECTED) {
if ((battery_power_on_sample()
#if defined(LED_MATRIX_ENABLE) || defined(RGB_MATRIX_ENABLE)
&& !indicator_is_enabled()
#endif
&& t > BACKLIGHT_OFF_VOLTAGE_MEASURE_INTERVAL) ||
t > VOLTAGE_MEASURE_INTERVAL) {
battery_check_empty();
battery_check_critical_low();
bat_monitor_timer_buffer = rtc_timer_read_ms();
if (bat_monitor_timer_buffer > RTC_MAX_TIME) {
bat_monitor_timer_buffer = 0;
rtc_timer_clear();
}
battery_measure();
power_on_sample++;
if (power_on_sample > VOLTAGE_POWER_ON_MEASURE_COUNT) power_on_sample = VOLTAGE_POWER_ON_MEASURE_COUNT;
}
}
if ((bat_empty || critical_low) && usb_power_connected()) {
bat_empty = false;
critical_low = false;
#if defined(BAT_LOW_LED_PIN) || defined(BAT_LOW_LED_PIN_STATE)
indicator_battery_low_enable(false);
#endif
#if defined(LOW_BAT_IND_INDEX)
indicator_battery_low_backlit_enable(false);
#endif
}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants