08-08-2024, 11:54 PM | #1 |
Connoisseur
Posts: 65
Karma: 81859
Join Date: Oct 2023
Location: Ontario, Canada
Device: Kobo Aura Edition 2, Kobo Clara 2E
|
Bluetooth Page Turner plugin for Kobo KOReader
Hello everyone,
I’m pleased to share an exciting update about my KOReader plugin for kobo devices, which now includes proper scripts for turning Bluetooth on and off, along with the necessary modifications and connections to run my selfie clicker as a page turning device. This should be adaptable to various devices and can serve as a useful example for other developers. While I plan to add more functionality in the future and polish it, make it more error prune etc., I wanted to share now and invite the community to collaborate. Key Features and Insights Bluetooth On and Off: This plugin allows you to turn Bluetooth on and off on the fly and connect to your device directly from KOReader. Here’s how it works: Turning Bluetooth On: Normally bluetooth processes are killed with KOReader on bootup. The plugin enables Bluetooth directly from KOReader and establishes connection to pre-paired bluetooth devices. Turning Bluetooth Off: Properly shutting down Bluetooth is crucial to prevent excessive battery drain. On a Clara 2E, I observed a battery drain of about 2.8-3% per hour during sleep if Bluetooth isn’t turned off correctly. The plugin ensures Bluetooth is turned off properly. Without a proper shutdown (like pkill only) the drain would still be around 1.5% per hour during sleep. With this plugin, I can turn Bluetooth on and off and leave the device to sleep with 0% drain. Nickel doesn’t shut down Bluetooth correctly, so relying on Nickel to turn Bluetooth off after exiting KOReader can still result in significant battery drain. It’s better to turn off Bluetooth using this. Installation and Usage Instructions How to Install: The installation isn't quite hands-free right now. You still need to pair your device once using nickel, and find which /dev/input/eventX it gets mapped to. The initial pairing can also be done using SSH/bluetoothctl. You also need to add the event code to device.lua listened devices with the action you're expecting. Readme has some examples and more detail on this. How it Works: This plugin adds a menu under Gear > Network > Bluetooth, which includes: Bluetooth On: Turns on WiFi (required for Bluetooth) and Bluetooth, then attempts to establish a connection to a previously paired input device. The plugin also includes the uhid.ko kernel patch, which is necessary for certain Bluetooth devices to be recognized. Bluetooth Off: Properly shuts down Bluetooth to prevent battery drain. EDIT:After "Bluetooth On", you need to do [Exit > Restart KOReader] for now to get the device events registered. I'm planning on fixing this in the near future, but for now the complete operation for page turners is to enable bluetooth, and restart KOreader. No need to go to nickel again, just a KOReader restart is fine. Further Information For more details or to contribute, please visit the GitHub repository: https://github.com/onatbas/bluetooth.koplugin Let me know what you think and I look forward to your feedback and contributions. Last edited by lumping-sugar66; 08-12-2024 at 11:14 AM. |
08-12-2024, 11:12 PM | #2 | |
Connoisseur
Posts: 58
Karma: 128
Join Date: Nov 2018
Device: Likebook Mars
|
Quote:
I'm a Kobo developer newbie, so please forgive me for my ignorance on the topic. For step 3 of the guide on your Github it says to be sure the device is mapped to event3, how would I go about doing that on a Kobo? I believe I understand how to go about the rest. Thank you! |
|
Yesterday, 10:52 AM | #3 | ||||
Connoisseur
Posts: 65
Karma: 81859
Join Date: Oct 2023
Location: Ontario, Canada
Device: Kobo Aura Edition 2, Kobo Clara 2E
|
Quote:
Code:
ls /dev/input/ Code:
ls /dev/input/ Quote:
If your event list doesn't change after you pair/connect your device, uhid.ko may be required and not have applied. You can cd into the bluetooth.koplugin folder and do Quote:
If your event is mapped to a different location, modify main.lua to match yours. Be sure to check device.lua.patch for what's being done. the Quote:
I also realized a slight mistake in my code. The line at https://github.com/onatbas/bluetooth...5/main.lua#L61 has a hardcoded path and assumes that KOReader is installed under "/mnt/onboard/.adds/koreader/". This may not be the right location for your installation, so change that your path as well. Last edited by lumping-sugar66; Yesterday at 10:56 AM. |
||||
Today, 09:53 AM | #4 | |
Connoisseur
Posts: 58
Karma: 128
Join Date: Nov 2018
Device: Likebook Mars
|
Quote:
I am exposing myself as a rookie even further, but I've not used telnet with the kobo before. I'm familiar with telnet and Linux, but not with Kobo. Is there a specific package from this link that I would launch from NickelMenu https://www.mobileread.com/forums/sh...d.php?t=254214 |
|
Today, 11:02 AM | #5 |
Connoisseur
Posts: 58
Karma: 128
Join Date: Nov 2018
Device: Likebook Mars
|
I believe I have found the answer. Just need to re install NickelMenu, with the telnet parts uncommented. Will update with progress. Thanks again.
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Bluetooth page turning for Kobo eReaders | tsowell | Kobo Reader | 163 | Today 01:24 PM |
A Wi-Fi remote control page turner for Kobo e-readers | sublipri | Kobo Reader | 40 | 07-18-2024 12:57 AM |
Accessories Bluetooth page turner on Oasis? | iamagloworm | Amazon Kindle | 4 | 06-03-2024 03:28 PM |
Libra 2 Is there a Bluetooth page turner for Libra2? | windirt | Kobo Reader | 22 | 12-12-2021 10:25 PM |
Bluetooth page turner for Android tablets? | DaveGa | Android Devices | 1 | 11-28-2018 04:38 PM |