Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > KOReader

Notices

Reply
 
Thread Tools Search this Thread
Old 08-20-2024, 07:31 PM   #16
enji
Junior Member
enji has a complete set of Star Wars action figures.enji has a complete set of Star Wars action figures.enji has a complete set of Star Wars action figures.enji has a complete set of Star Wars action figures.enji has a complete set of Star Wars action figures.
 
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:
  1. In bluetooth.koplugin/on.sh, changed `/sbin/hciattach -p ttymxc1 any 1500000 flow -t 20` to `/sbin/rtk_hciattach -s 115200 ttymxc1 rtk_h5`. The different parameters are what dmesg showed when watching Nickel enable bluetooth.
  2. In bluetooth.koplugin/off.sh, changed `pkill hciattach` to `pkill rtk_hciattach`

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.
enji is offline   Reply With Quote
Old 08-20-2024, 11:17 PM   #17
trence
Connoisseur
trence will become famous soon enoughtrence will become famous soon enoughtrence will become famous soon enoughtrence will become famous soon enoughtrence will become famous soon enoughtrence will become famous soon enough
 
Posts: 66
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; Yesterday at 01:01 AM.
trence is offline   Reply With Quote
Old Yesterday, 09:46 AM   #18
lumping-sugar66
Connoisseur
lumping-sugar66 doesn't feed trollslumping-sugar66 doesn't feed trollslumping-sugar66 doesn't feed trollslumping-sugar66 doesn't feed trollslumping-sugar66 doesn't feed trollslumping-sugar66 doesn't feed trollslumping-sugar66 doesn't feed trollslumping-sugar66 doesn't feed trollslumping-sugar66 doesn't feed trollslumping-sugar66 doesn't feed trollslumping-sugar66 doesn't feed trolls
 
lumping-sugar66's Avatar
 
Posts: 75
Karma: 81859
Join Date: Oct 2023
Location: Ontario, Canada
Device: Kobo Aura Edition 2, Kobo Clara 2E
Quote:
Originally Posted by enji View Post
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:
  1. In bluetooth.koplugin/on.sh, changed `/sbin/hciattach -p ttymxc1 any 1500000 flow -t 20` to `/sbin/rtk_hciattach -s 115200 ttymxc1 rtk_h5`. The different parameters are what dmesg showed when watching Nickel enable bluetooth.
  2. In bluetooth.koplugin/off.sh, changed `pkill hciattach` to `pkill rtk_hciattach`

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.

Wow thank you for the contribution and testing this. I'll be sure to add this to the repository as a workaround for Libra!



Quote:
Originally Posted by trence View Post
This is my device.patch.lua, does this look correct?
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; Yesterday at 10:13 AM.
lumping-sugar66 is online now   Reply With Quote
Old Yesterday, 02:46 PM   #19
trence
Connoisseur
trence will become famous soon enoughtrence will become famous soon enoughtrence will become famous soon enoughtrence will become famous soon enoughtrence will become famous soon enoughtrence will become famous soon enough
 
Posts: 66
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; Yesterday at 07:01 PM.
trence is offline   Reply With Quote
Old Yesterday, 10:33 PM   #20
lumping-sugar66
Connoisseur
lumping-sugar66 doesn't feed trollslumping-sugar66 doesn't feed trollslumping-sugar66 doesn't feed trollslumping-sugar66 doesn't feed trollslumping-sugar66 doesn't feed trollslumping-sugar66 doesn't feed trollslumping-sugar66 doesn't feed trollslumping-sugar66 doesn't feed trollslumping-sugar66 doesn't feed trollslumping-sugar66 doesn't feed trollslumping-sugar66 doesn't feed trolls
 
lumping-sugar66's Avatar
 
Posts: 75
Karma: 81859
Join Date: Oct 2023
Location: Ontario, Canada
Device: Kobo Aura Edition 2, Kobo Clara 2E
Quote:
Originally Posted by trence View Post
Success! I was able to connect and turn pages. One last question, and I swear I will never bug you again
Great! I'm glad you have it working. It's not bugging me at all; I don't have access to a wide variety of devices so all feedback is useful for me to make a package that is closer to hands-off. It's a pleasure.


Quote:
Originally Posted by trence View Post
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?
It's not unheard of. I have 3 bluetooth devices and two of them automatically connect while the other do NOT engage the connection automatically for one reason or the other. In those circumstances Kobo device itself need to engage the pairing request by itself.

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>
Is a perfectly good command that would initiate your pairing without getting into the bluetoothctl prompt, making them useful for shell scripting.
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.
lumping-sugar66 is online now   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Bluetooth page turning for Kobo eReaders tsowell Kobo Reader 168 08-18-2024 05:17 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


All times are GMT -4. The time now is 02:58 AM.


MobileRead.com is a privately owned, operated and funded community.