Quote:
Originally Posted by roguexuk
I just installed it on my Libra2, I can confirm that the Kobo Remote now works on koreader! Hooray!
I have to refresh device input to get it to work again.
|
I'm glad it's working for you. All devices are very particular so the behaviours may be different. Things like these are mainly the reason why I didn't conceal "Refresh Device Input" behind a simple connect button. Some devices disconnect and connect within milliseconds and that means the device event listener disappears in the OS.
I recommend that you bind a finger gesture to Restore Device Input and then you can get that triggered easily.
---
Clara BW (MediaTek) - Investigation Results
Thanks to WaveEquation for spending time testing and debugging the plugin on his Clara BW. Here's what we discovered.
The Problem
The Clara BW uses a MediaTek MT8110 processor. Unlike the i.MX6-based Kobos (Libra 2, Clara 2E), Kobo has replaced the standard Linux Bluetooth stack:
- No bluetoothctl involved in managing bluetooth - the standard BlueZ command-line tool is absent
- No bluetoothd daemon running even when bluetooth is working.
- Seems like kobo created their own proprietary "btservice" daemon.
- This btservice has no exposed command-line interface that we could figure out.
This means the plugin cannot turn Bluetooth on/off or manage device pairing on MediaTek devices in it's current stage.
What Works
Partial solution: if you manage Bluetooth through Kobo's native settings, the button mapping still works.
1. Turn on Bluetooth via Kobo settings (not KOReader)
2. Pair and connect your controller via Kobo settings
3. Launch KOReader
4. Use Bluetooth > Refresh Device Input
5. Use Bluetooth > Event Map Editor > Guided Simple Setup to configure buttons
All button actions work correctly once the input device is detected.
The catch is that apparently there's a known KOReader bug where exiting KOReader while Bluetooth is ON can reboot the device and sometimes remove NickelMenu. This could significantly impact the usefulness of any bluetooth integration. We may need help from the wider koreader community. See:
https://github.com/koreader/koreader/issues/12739
Because the plugin cannot control Bluetooth on MediaTek, you cannot turn it off before exiting. The workaround is to use "Reboot device" instead of "Exit" when leaving KOReader with Bluetooth active.
Simplified Branch Available
I've pushed a "clarabw" branch to the repository with the Bluetooth management code disabled. This version assumes Bluetooth is handled externally and only provides the event mapping functionality.
Repository:
https://github.com/onatbas/bluetooth.koplugin
Branch: clarabw
Future Work
In order for Bluetooth to be fully supported, we need to figure out how to program bluetooth in Clara/Libra BW/Colour without bluetoothd running. One of the benefits of this plugin is easily turning bluetooth functions on/off, and that's the piece new device users are missing here.
It may come to to reverse-engineering how Kobo's btservice works so we can fully integrate with it. If anyone has experience with MediaTek Bluetooth stacks or has one of these devices or wants to help investigate, please feel free to get involved. Remote debugging is quite challenging and I don't want to brick another persons device.
For now, Clara/Libra BW/Colour users will need to manage Bluetooth manually through Kobo's interface.