|
|
#1 |
|
Zealot
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 137
Karma: 87635
Join Date: Oct 2023
Location: Ontario, Canada
Device: Kobo Aura Edition 2, Kobo Clara 2E, Kobo Libra 2
|
Bluetooth Page Turner for Kobo - v1.0.0
Use a Bluetooth controller (like 8BitDo Micro) to turn pages and control KOReader on your Kobo. What's New in v1.0.0 Complete overhaul focused on eliminating manual configuration:
Supported Devices Fully Tested:
May Work (auto-detection):
Not Yet Supported:
Installation Step 1: Copy the Plugin
Step 2: Run Diagnostics & Auto-Fix Go to Menu > Network > Bluetooth > Diagnostics Click any item marked with X and choose "Correct Automatically":
Step 3: Turn On Bluetooth & Pair Your Controller
Step 4: Connect Whenever you want to use your controller:
That's it. Features Auto-Configuration Everything is automatic:
Device Management Scan, select, and save Bluetooth devices directly from the UI. No more editing scripts. Event Map Editor Bluetooth > Event Map Editor
Diagnostics Bluetooth > Diagnostics
Bank System Map the same physical buttons to different actions by switching banks. Perfect for controllers with limited buttons. Edit Code:
bank_config.txt Code:
Bank1 BTAction1:BTLeft, A button BTAction2:BTRight, B button BTAction3:BTToggleBookmark, Y button Bank2 BTAction1:BTIncreaseBrightness, A button BTAction2:BTDecreaseBrightness, B button BTAction3:BTToggleNightMode, Y button Customizing Button Mappings The plugin comes pre-configured for 8BitDo Micro in keyboard mode. For other controllers: Option A: Event Map Editor (recommended)
Option B: Edit bank_config.txt For power users who want bank switching and full control. Available Events Page Navigation
Bookmarks
Display
Font
System
Bank Actions
Troubleshooting Buttons not working?
Controller not connecting?
Battery Note Properly shutting down Bluetooth is crucial. On a Clara 2E, improper shutdown causes ~3% battery drain per hour during sleep. This plugin ensures Bluetooth is turned off correctly - 0% drain when sleeping. Credits
Download https://github.com/onatbas/bluetooth.koplugin Feedback and contributions welcome. Last edited by lumping-sugar66; Today at 02:27 PM. |
|
|
|
|
|
#2 | |
|
Connoisseur
![]() ![]() ![]() ![]() ![]() ![]() Posts: 72
Karma: 548
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! |
|
|
|
|
|
|
#3 | ||||
|
Zealot
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 137
Karma: 87635
Join Date: Oct 2023
Location: Ontario, Canada
Device: Kobo Aura Edition 2, Kobo Clara 2E, Kobo Libra 2
|
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; 08-13-2024 at 11:56 AM. |
||||
|
|
|
|
|
#4 | |
|
Connoisseur
![]() ![]() ![]() ![]() ![]() ![]() Posts: 72
Karma: 548
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 |
|
|
|
|
|
|
#5 |
|
Connoisseur
![]() ![]() ![]() ![]() ![]() ![]() Posts: 72
Karma: 548
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.
|
|
|
|
|
|
#6 |
|
Connoisseur
![]() ![]() ![]() ![]() ![]() ![]() Posts: 72
Karma: 548
Join Date: Nov 2018
Device: Likebook Mars
|
Hi There,
So I have done all the steps needed, and double checked them all as well. I needed to change my file to event4 based on the test. I paired multiple times to ensure it was event4 each time. evtest was giving a code of 4 "Event: time 1723677209.973075, type 4 (Misc), code 4 (ScanCode), value 90002 Event: time 1723677209.973075 ------- Report Sync ------ x: 400 y: 80 p: 0 ------------ Event: time 1723677210.096978, type 4 (Misc), code 4 (ScanCode), value 90002 Event: time 1723677210.096978 ------- Report Sync ------ x: 400 y: 80 p: 0 ------------ Event: time 1723677254.911169 ------- Report Sync ------ x: 400 y: 80 p: 0 ------------ yyy " So I changed the event_map lua to reflect [4] = "RPgFwd". The device in question, a Libra 2, already had the field of HasKeys as set for yes in the lua. I installed the plugin, rebooted my device, and tried it out. It would search after turning Bluetooth on, but eventually fail connecting. What's odd is that the device connects with no issue on Nickel, and turns pages. I do have the BTPT plugin installed (https://github.com/tsowell/kobo-btpt), do you believe that could be causing issues? Edit: Forgot to include the picture of the message that would pop up shortly after turning on Bluetooth. Sorry for the snapshot, Koreader wouldn't let me take a proper screenshot. It would successfully connect to my wifi in Koreader. 2nd Edit: I uninstalled BTPT and re-did the process and all the same results/values from event and evtest. Still did not connect in Koreader https://imgur.com/a/vz60SJX Last edited by trence; 08-14-2024 at 09:41 PM. |
|
|
|
|
|
#7 |
|
Zealot
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 137
Karma: 87635
Join Date: Oct 2023
Location: Ontario, Canada
Device: Kobo Aura Edition 2, Kobo Clara 2E, Kobo Libra 2
|
Hi, it looks like you're making good progress.
That screenshot confirms that the bluetooth is turned on properly, unfortunately it doesn't say anything about connection (it never does). If your device is getting added to event4, then you need to modify device.lua patch to have it connect to /dev/input/event4. You need to add Code:
local success, err = pcall(function()
self.input.open("/dev/input/event4")
end)
Code:
self.input.open("fake_events")
I too have the plugin installed on nickel, it won't break your installation, as nickel isn't working when koreader is working. Since you say that event code 4 works on Nickel page turner I won't press too much on this but event code 4 seems suspicious. You can cross-check with your .btpt/ config file. What's your bluetooth device by the way? If the above don't work, please share your device.lua and main.lua files, and let's have a look. When you do that, kindly let me know where is your koreader installation in the device. A good way of letting me know is to cd into bluetooth.koplugin folder and do Code:
pwd |
|
|
|
|
|
#8 |
|
Connoisseur
![]() ![]() ![]() ![]() ![]() ![]() Posts: 72
Karma: 548
Join Date: Nov 2018
Device: Likebook Mars
|
Still no luck after doing the things mentioned. I have attached my files from the Plugin in a zip file. I likely am missing a key step.
I also found the 4 code strange, but that is what the telnet on NickelMenu gave when running evtest. When pressing the button a couple times: Event: time 1723756563.085844, type 4 (Misc), code 4 (ScanCode), value 90004 Event: time 1723756563.085844 ------- Report Sync ------ x: 400 y: 80 p: 0 ------------ Event: time 1723756563.175818, type 4 (Misc), code 4 (ScanCode), value 90004 Event: time 1723756563.175818 ------- Report Sync ------ x: 400 y: 80 p: 0 ------------ Event: time 1723756578.323597 ------- Report Sync ------ x: 400 y: 80 p: 0 ------------ yyy When I did the test a couple years back with evtest on a linux machine, I ended up making this for my btpt config for the page turner. I made all the buttons move a page forward. nextPage EV_KEY BTN_EAST 0 nextPage EV_KEY BTN_WEST 0 nextPage EV_KEY BTN_GAMEPAD 0 nextPage EV_KEY BTN_NORTH 0 What would the code number be in this case for Kobo, 0? That is one thing I was confused about is where the numeric values for things like RPgFwd are derived from. Appreciate all the help. Edit: My koreader is in .adds/koreader. Could the btpt be altering the output of the Kobo Telnet evtest? Or does that run at a level that would be unaffected by something in Nickel like btpt? Last edited by trence; 08-15-2024 at 07:27 PM. |
|
|
|
|
|
#9 |
|
Zealot
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 137
Karma: 87635
Join Date: Oct 2023
Location: Ontario, Canada
Device: Kobo Aura Edition 2, Kobo Clara 2E, Kobo Libra 2
|
My pleasure. Thank you for giving it a try.
The code looks good. By the way, the decimal values of those event codes are as follows. I'm not sure why evtest is skipping through the values. I haven't inspected the code of tsowell/btpt enough to make a call. but it looks like your and my installations are very similar, and I haven't had any issues. Code:
BTN_EAST: 307 BTN_WEST: 308 BTN_GAMEPAD: 304 BTN_NORTH: 305 Let me know how it goes. |
|
|
|
|
|
#10 |
|
Connoisseur
![]() ![]() ![]() ![]() ![]() ![]() Posts: 72
Karma: 548
Join Date: Nov 2018
Device: Likebook Mars
|
Sorry, I am a bit confused. Do you mean alter the patch file with:
[307] = "BTN_EAST" etc for the other buttons? |
|
|
|
|
|
#11 |
|
Zealot
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 137
Karma: 87635
Join Date: Oct 2023
Location: Ontario, Canada
Device: Kobo Aura Edition 2, Kobo Clara 2E, Kobo Libra 2
|
No, I suggested a correction for this:
Those BTN enums correspond to integers in linux input event lists. You mentioned that page turner works with tsowell's plugin and the shared the configuration file. That tells me that your device is issuing BTN_GAMEPAD, BTN_NORTH, BTN_EAST, BTN_WEST events. Their integer equivalents are 304, 305, 307, 308. (You can literally change the words in the config file to these values and it will work.) For me the event is KEY_VOLUMEUP, so an example for me is as follows. The following instructions are identical: Code:
nextPage EV_KEY KEY_VOLUMEUP 0 nextPage EV_KEY 115 0 Code:
[4] = "RPgFwd Code:
[304] = "RPgFwd", [305] = "RPgFwd", [307] = "RPgFwd", [308] = "RPgFwd", |
|
|
|
|
|
#12 |
|
Connoisseur
![]() ![]() ![]() ![]() ![]() ![]() Posts: 72
Karma: 548
Join Date: Nov 2018
Device: Likebook Mars
|
Thanks for the explanation. I have added those lines in place of the previous ones, but the clicker still doesn't connect. Instead of the slow blink it does when paired on Nickel/other devices, it continues the fast blink. And I made sure to restart Koreader after enabling bluetooth.
|
|
|
|
|
|
#13 |
|
Zealot
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 137
Karma: 87635
Join Date: Oct 2023
Location: Ontario, Canada
Device: Kobo Aura Edition 2, Kobo Clara 2E, Kobo Libra 2
|
OK, sounds like there's something wrong with bluetooth connection, rather than the events being registered.
Try this: 1. SSH into the device. 2. Turn on bluetooth via KOReader. 3. Type in bluetoothctl. (Check 1 - you should see bleuetoothctl prompt. If not, your bluetooth is not running correctly.) 4. See the device name on the bluetooth prompt (if it just says bluetooth, you're not connected). 5. If not connected to the device, check devices using "devices". If your device is in the list, use "trust <MAC_ADDRESS>" and "connect <MAC_ADDRESS>". Once a trust is established, usually devices connect after that automatically. 6. If the device is not on the list at all, then a new pairing must be made. type "scan on" to turn on scan, find your device from that spew of messages coming in, type "pair <MAC_ADDRESS>" and repeat #5. "scan off" after you're done. 7. Try reboot to the device and the workflow again. Last edited by lumping-sugar66; 08-19-2024 at 09:52 AM. |
|
|
|
|
|
#14 |
|
Connoisseur
![]() ![]() ![]() ![]() ![]() ![]() Posts: 72
Karma: 548
Join Date: Nov 2018
Device: Likebook Mars
|
This was my output, I do not see any devices:
[root@kobo ~]# bluetoothctl Waiting to connect to bluetoothd...[bluetooth]# Agent registered [bluetooth]# I typed in devices: bluetooth]# devices No default controller available I also attempted "scan on" and it said the same about a lack of default controller Last edited by trence; 08-19-2024 at 05:35 PM. |
|
|
|
|
|
#15 |
|
Zealot
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 137
Karma: 87635
Join Date: Oct 2023
Location: Ontario, Canada
Device: Kobo Aura Edition 2, Kobo Clara 2E, Kobo Libra 2
|
OK, it sounds like the way I was starting Bluetooth doesn't work properly for Libra 2. I'll modify the descriptions to clearly state it's not tested with anything but Clara 2E. I don't have a Libra 2 device to develop this further for the other devices unfortunately. Thank you for testing this and I'm sorry there isn't a satisfactory resolution.
--- As a side note, this means the missing piece is "turning on bluetooth via KOReader", this means turning it on from Nickel and then running KOReader would have your clicker working. You can comment out the portion where KOReader kills bluetooth on startup, documented here: https://github.com/koreader/koreader...ent-1791789778 But this means bluetooth will never be turned off and will drain your battery quickly. You can even delete the folder bluetooth.koplugin as all necessary changes are already in device.lua file already. |
|
|
|
![]() |
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Bluetooth page turning for Kobo eReaders | tsowell | Kobo Reader | 254 | 07-09-2025 03:31 PM |
| A Wi-Fi remote control page turner for Kobo e-readers | sublipri | Kobo Reader | 48 | 01-13-2025 04:25 AM |
| Accessories Bluetooth page turner on Oasis? | iamagloworm | Amazon Kindle | 4 | 06-03-2024 04:28 PM |
| Libra 2 Is there a Bluetooth page turner for Libra2? | windirt | Kobo Reader | 22 | 12-12-2021 11:25 PM |
| Bluetooth page turner for Android tablets? | DaveGa | Android Devices | 1 | 11-28-2018 05:38 PM |