08-20-2024, 08:31 PM | #16 |
Junior Member
Posts: 4
Karma: 430
Join Date: Oct 2018
Device: NUNYA
|
I got bluetooth working on a Libra 2 by using `rtk_hciattach` instead of `hciattach`.
Along with the rest of the instructions on github, the plugin works great after just tweaking the on/off scripts:
No need to remove the bluetoothd kill command from the KOReader startup script or reconnect to the clicker in Nickel. Thank you for creating this! I've been using it for a few days, and it works perfectly with bluetooth on/off and Restart KOReader commands mapped to gestures. |
08-21-2024, 12:17 AM | #17 |
Connoisseur
Posts: 72
Karma: 548
Join Date: Nov 2018
Device: Likebook Mars
|
Thank you for that info, that did allow me to turn on the bluetooth. My device was listed in bluetoothctl. While doing the trust, and connect via SSH, I did receive this error message:
bluetooth]# trust E0:F8:48:04:36:23 [bluetooth]# [bluetooth]# Changing E0:F8:48:04:36:23 trust succeeded [bluetooth]# connect E0:F8:48:04:36:23 Attempting to connect to E0:F8:48:04:36:23 [bluetooth]# [bluetooth]# Failed to connect: org.bluez.Error.NotReady br-connection-adapter-not-powered [bluetooth]# Would either of you know what I am doing wrong by chance? Edit: After a reboot, connect worked and the device paired! But it does not turn pages, yet. I did restart Koreader, as well. This is my device.patch.lua, does this look correct? --- koreader/frontend/device/kobo/device.lua 2024-07-15 12:02:02.000000000 -0400 +++ koreader/frontend/device/kobo/device.lua 2024-08-11 17:54:44.000000000 -0400 @@ -489,6 +489,7 @@ hasEclipseWfm = yes, canToggleChargingLED = yes, led_uses_channel_3 = true, + hasKeys = yes, hasFrontlight = yes, display_dpi = 300, hasNaturalLight = yes, @@ -828,6 +829,7 @@ [4] = "RPgFwd", [102] = "Home", [116] = "Power", [193] = "RPgBack", [115] = "RPgFwd", [194] = "RPgFwd", [331] = "Eraser", [332] = "Highlighter", [304] = "RPgFwd", [305] = "RPgFwd", [307] = "RPgFwd", [308] = "RPgFwd", @@ -901,6 +903,13 @@ -- NOTE: usb hotplug event is also available in /tmp/nickel-hardware-status (... but only when Nickel is running ;p) self.input.open("fake_events") + local success, err = pcall(function() + self.input.open("/dev/input/event4") + end) Last edited by trence; 08-21-2024 at 02:01 AM. |
08-21-2024, 10:46 AM | #18 | |
Connoisseur
Posts: 95
Karma: 81981
Join Date: Oct 2023
Location: Ontario, Canada
Device: Kobo Aura Edition 2, Kobo Clara 2E
|
Quote:
Wow thank you for the contribution and testing this. I'll be sure to add this to the repository as a workaround for Libra! Oh, I think that's my unclear instructions that got you again. The *.patch file was just me documenting the changes that need to be applied to the actual internal KOReader files. The file you want to modify is at : koreader/frontend/device/kobo/device.lua This is outside of the plugin's folder structure. Last edited by lumping-sugar66; 08-21-2024 at 11:13 AM. |
|
08-21-2024, 03:46 PM | #19 |
Connoisseur
Posts: 72
Karma: 548
Join Date: Nov 2018
Device: Likebook Mars
|
Success! I was able to connect and turn pages. One last question, and I swear I will never bug you again
I am finding that I have to manually connect to the bluetooth device via SSH with bluetoothctl each time I want to connect. Is this expected? I added this section of the patch lua as well to my main config: local success, err = pcall(function() + self.input.open("/dev/input/event4") + end) I wasn't sure if that had something to do with the auto connection, but still no luck. Edit: Not sure what I did wrong initially, but all is well. It is connecting now automatically. Fantastic, thank you! Thank you again to both of you, really really cool of you to do this. If either of you have a "Buy Me a Coffee" type thing, please let me know. Last edited by trence; 08-21-2024 at 08:01 PM. |
08-21-2024, 11:33 PM | #20 | ||
Connoisseur
Posts: 95
Karma: 81981
Join Date: Oct 2023
Location: Ontario, Canada
Device: Kobo Aura Edition 2, Kobo Clara 2E
|
Quote:
Quote:
Until I make another patch, you can circumvent this by adding your custom bluetoothctl commands to the end of the on.sh script. Keep in mind that although $ bluetoothctl gives you a prompt to enter your bluetooth commands, it also works as a command line utility where you can pass your commands as arguments. In other words: Code:
$ bluetoothctl pair <DEVICE_MAC_ADDRESS> You would still need to restart KOReader after this, but your connection will have been established at that point. P.S.I'm also looking into automating the connections without requiring restarts, my favorite clicker is a 2$ photo shutter from china and it frequently loses bluetooth, disturbing my flow. I will make the plugin not only connect automatically but renew as connections gets lost. More to come on this. |
||
08-28-2024, 05:23 PM | #21 |
Junior Member
Posts: 2
Karma: 10
Join Date: Aug 2024
Device: Kobo Libra 2
|
In over my head!
I want to use the Logi R500s to turn pages on my Kobo Libra 2.
So far I've installed OCP-KOreader-v2024.07 and kfm_mac_install. After doing this I realized I needed nickel menu, so I installed KoboRoot.tgz copying it to the .Kobo folder. I then configured nickel menu pasting the downloaded config file to the nm folder. I got all of this from YouTube videos with titles that sounded like what I wanted to do. Next, I followed the 'How to Install' instructions found on bluetooth.koplugin/readme.md. Instruction number one was easy enough, I copied the folder into koreader/plugins. Number two was less straight forward; I tried pairing the Logi R500s by going into KOReader on my Libra 2. It found my network, but said nothing about pairing to the R500s. I also tried to pair the R500s and Libra 2 toggling it on Kobo's own reader software. That way I managed to pair the R500s, but it was toggled off the next time I checked. Instruction number three was a complete. I don't know what to make of the instruction to 'make sure that your device is mapped to /dev/input/event3'. Instruction number four is also over my head. And it's the same for number five. I did manage to make Enji's Libra 2 adaptions. I don't even know enough to know what I need help with. It feels like I'm asking a lot, but I won't know if I don't ask. Thank you in advance for whatever time and effort you can offer me. |
08-29-2024, 11:21 AM | #22 |
Connoisseur
Posts: 95
Karma: 81981
Join Date: Oct 2023
Location: Ontario, Canada
Device: Kobo Aura Edition 2, Kobo Clara 2E
|
@hilotime, Yeah this plugin is not the most non-programmer-friendliest to adopt and use in its current state. It works, but you need to do a lot of handholding and changing code to make it get to where you want it.
One thing that this plugin leaves completely out of scope is making sure your bluetooth device can be paired and ensuring the requisites for a page turner is met. Because of that, I'd recommend trying out tsowell's bluetooth page turner first, before moving on to KOReader-based page turner. Before you see the bluetooth working with kobo's nickel and nickelmenu, I'm afraid you're not at a point where you can ensure the bluetooth device is paired properly. So first step for you would be to make your device work with that page turner. Using the standard kobo software will require minimal programming/ssh access to get the bluetooth device paired, actions figured out, and give you ability to test the page turning action. Once that's ensured, we can help you better with the rest of the installation process. I hope this helps |
08-29-2024, 08:58 PM | #23 |
Junior Member
Posts: 2
Karma: 10
Join Date: Aug 2024
Device: Kobo Libra 2
|
@lumping-sugar66,
Thanks for the prompt reply. I had a feeling I was in over my head. I'll do as you said and start with tsowell's bluetooth page turner. If all goes well, you'll be hearing from me again. Thank you, again! |
09-01-2024, 07:49 PM | #24 |
Connoisseur
Posts: 95
Karma: 81981
Join Date: Oct 2023
Location: Ontario, Canada
Device: Kobo Aura Edition 2, Kobo Clara 2E
|
Attention Bluetooth enthusiasts.
I'm excited to share some improvements to this KOReader plugin for Kobo. Key updates: * the elimination of the need to restart KOReader after enabling Bluetooth. * Introduced new commands like "Refresh Device Input" and "Connect to Device". * Added custom Bluetooth actions that can be used in your device.lua for more customized functionality. Font size controls, rotation, chapter, page and a few others. * All commands can now be triggers using Taps & Gestures. See the description for more info. |
09-07-2024, 04:34 PM | #25 |
Connoisseur
Posts: 95
Karma: 81981
Join Date: Oct 2023
Location: Ontario, Canada
Device: Kobo Aura Edition 2, Kobo Clara 2E
|
Just pushed a new tag v0.3.0
This version includes:
Events as of v0.2.0 BTGotoNextChapter: Navigate to the next chapter. BTGotoPrevChapter: Navigate to the previous chapter. BTDecreaseFontSize: Reduce the font size by 1. BTIncreaseFontSize: Increase the font size by 1. BTToggleBookmark: Toggle bookmarks on and off. BTIterateRotation: Rotate the screen orientation 90 degrees. BTBluetoothOff: Turn off Bluetooth. BTRight: Go to the next page. BTLeft: Go to the previous page. New events in v0.3.0: BTPrevBookmark: Navigate to the previous bookmark in the document. BTNextBookmark: Navigate to the next bookmark in the document. BTLastBookmark: Jump to the last bookmark by creation date. BTToggleStatusBar: Toggle the display of the status bar. BTIncreaseBrightness: Increase the frontlight brightness by 10 units. BTDecreaseBrightness: Decrease the frontlight brightness by 10 units. BTToggleNightMode: Toggle between dark mode (night mode) and light mode. BTIncreaseWarmth: Increase the warmth of the frontlight by 2 units. BTDecreaseWarmth: Decrease the warmth of the frontlight by 2 units. |
09-08-2024, 09:14 PM | #26 |
Connoisseur
Posts: 72
Karma: 548
Join Date: Nov 2018
Device: Likebook Mars
|
Hey There, looking forward to trying 3.0. Still rocking the original. Quick question, does it need to be connected to a SSID to enable bluetooth? I get that the Wifi Chip and Bluetooh are the same, so if one is on the other is. But when I have no SSIDs learned in Nickel, the Connection always fails. Just curious, as I typically don't have any SSIDs learned.
|
09-09-2024, 01:09 PM | #27 | |
Connoisseur
Posts: 95
Karma: 81981
Join Date: Oct 2023
Location: Ontario, Canada
Device: Kobo Aura Edition 2, Kobo Clara 2E
|
Quote:
It's now fixed on v0.3.0, where the system will not try to manage your Wifi anymore. It will ask you to turn on Wi-Fi by yourself (if it's not on already), and doesn't care if there's no SSID to connect to. You can enable WiFi by KOReader, have it not connect to anything, and still enable bluetooth. As you pointed out, we just need the chip powered on, and there's no need for any network. |
|
09-10-2024, 02:03 AM | #28 |
Connoisseur
Posts: 72
Karma: 548
Join Date: Nov 2018
Device: Likebook Mars
|
Decided to give it a try, I started from a fresh install. Made my change to the lua that referenced event3, made the changes for Libra 2 on the on.sh. When I go to enable the Bluetooth I get a popup that says "Error: No result from the Bluetooth script"
Any idea what I did wrong? |
09-10-2024, 09:10 AM | #29 |
Connoisseur
Posts: 95
Karma: 81981
Join Date: Oct 2023
Location: Ontario, Canada
Device: Kobo Aura Edition 2, Kobo Clara 2E
|
Not exactly sure. Is the path correct for your koreader installation? Is there any mistake on on.sh by any chance? Can you run on.sh manually when you’re SSH’ed in?
|
09-10-2024, 05:29 PM | #30 |
Connoisseur
Posts: 72
Karma: 548
Join Date: Nov 2018
Device: Likebook Mars
|
When I attempt to run bluetoothctl from SSH, I get this:
[root@kobo ~]# bluetoothctl Waiting to connect to bluetoothd... And it does not change. My on.sh looks like so: #!/bin/bash cd "$(dirname "$0")" insmod /drivers/mx6sll-ntx/wifi/sdio_bt_pwr.ko insmod ./uhid/uhid.ko /sbin/rtk_hciattach -s 115200 ttymxc1 rtk_h5 dbus-send --system --dest=org.bluez --print-reply / org.freedesktop.DBus.ObjectManager.GetManagedObjec ts hciconfig hci0 up My kobo install is in the typical .adds location Edit: Unsure of why I show a space between the c and the t in Objects, as I don't have one in the file, or when I paste it When I run each command in on.sh via SSH: [root@kobo ~]# insmod /drivers/mx6sll-ntx/wifi/sdio_bt_pwr.ko [root@kobo ~]# insmod ./uhid/uhid.ko insmod: can't insert './uhid/uhid.ko': No such file or directory [root@kobo ~]# /sbin/hciattach -p ttymxc1 any 1500000 flow -t 20 Device setup complete 1991 [root@kobo ~]# dbus-send --system --dest=org.bluez --print-reply / org.freedes ktop.DBus.ObjectManager.GetManagedObjects method return sender=:1.4 -> dest=:1.3 reply_serial=2 array [ dict entry( object path "/org/bluez" array [ dict entry( string "org.freedesktop.DBus.Introspectable" array [ ] ) dict entry( string "org.bluez.AgentManager1" array [ ] ) dict entry( string "org.bluez.ProfileManager1" array [ ] ) ] ) ] [root@kobo ~]# hciconfig hci0 up Can't init device hci0: Connection timed out (110) Last edited by trence; 09-10-2024 at 05:38 PM. |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Bluetooth page turning for Kobo eReaders | tsowell | Kobo Reader | 203 | 10-31-2024 07:10 AM |
A Wi-Fi remote control page turner for Kobo e-readers | sublipri | Kobo Reader | 45 | 10-12-2024 09:37 PM |
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 |