09-10-2024, 05:51 PM | #31 |
Connoisseur
Posts: 72
Karma: 548
Join Date: Nov 2018
Device: Likebook Mars
|
FWIW,
I swapped back to the first version, and no issues. The on.sh on both of them are identical |
09-10-2024, 08:41 PM | #32 |
Connoisseur
Posts: 95
Karma: 81981
Join Date: Oct 2023
Location: Ontario, Canada
Device: Kobo Aura Edition 2, Kobo Clara 2E
|
Ahh, it looks like the on.sh modifications for Libra devices are not applied. You may have overwritten them when you were upgrading to the new version. Can you refer to @enji’s comment above?
You need`rtk_hciattach` instead of `hciattach on Libra devices. Sounds like you have your previous on.sh Script as a back up, you can refer to that for the right commands. Bluetoothctl is not responding because Bluetooth is not properly up yet. Uhid.ko is not found because it’s not being run from the right directory. Both of these points will be non-issues once you have the fixed on.sh in there. Let me know how it goes! |
09-10-2024, 09:42 PM | #33 |
Connoisseur
Posts: 72
Karma: 548
Join Date: Nov 2018
Device: Likebook Mars
|
I'm sorry for the confusing word salad above. What I meant to say is the On.sh is line for line the same in both the working version (v1) and this newest one that gives the error (v3). This includes the change for the Libra 2.
#!/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 |
09-10-2024, 11:00 PM | #34 |
Connoisseur
Posts: 95
Karma: 81981
Join Date: Oct 2023
Location: Ontario, Canada
Device: Kobo Aura Edition 2, Kobo Clara 2E
|
Ok, I’m not sure what’s happening at this point, and the code is lacking in log generation to help. Are you ensuring you turn on WiFi manually? The new version is expecting you to turn WiFi on by yourself. Although I have implemented a basic method of checking whether it’s on or not, maybe there are differences in between devices.
Can you execute “iwconfig” on the terminal emulator when WiFi is off and show me the result? If you run iwconfig on the emulator and wifi is turned off, the message should not include the text ESSID. If it does, then the way I detect WiFi is incorrect. If this doesn’t yield any results, I’ll provide a version of the code that produces an excess amount of logs so that we can see more clearly. |
09-10-2024, 11:47 PM | #35 |
Connoisseur
Posts: 72
Karma: 548
Join Date: Nov 2018
Device: Likebook Mars
|
The message it gives is:
lo no wireless extensions |
09-14-2024, 08:03 PM | #36 |
Junior Member
Posts: 1
Karma: 10
Join Date: Sep 2024
Device: Kobo Clara BW
|
Hi, this looks really cool !
I'm trying to get it to work on my Clara BW. I got the 'No result from the Bluetooth script' error so I tried running it manually, via SSH. Output of running on.sh: Code:
# pwd /mnt/onboard/.adds/koreader/plugins/bluetooth.koplugin # ash ./on.sh insmod: can't insert '/drivers/mx6sll-ntx/wifi/sdio_bt_pwr.ko': No such file or directory insmod: can't insert './uhid/uhid.ko': invalid module format Realtek Bluetooth ERROR: Can't open serial port, 2, No such file or directory Realtek Bluetooth ERROR: Can't initialize device 2, No such file or directory Error org.freedesktop.DBus.Error.NoReply: Message did not receive a reply (timeout by message bus) Can't open HCI socket.: Address family not supported by protocol Code:
# pwd && ls /drivers/mt8113t-ntx/mt66xx wlan_drv_gen4m.ko wmt_cdev_bt.ko wmt_chrdev_wifi.ko wmt_drv.ko I don't know if these are equivalent, but I tried the following: Code:
# insmod /drivers/mt8113t-ntx/mt66xx/wmt_cdev_bt.ko insmod: can't insert '/drivers/mt8113t-ntx/mt66xx/wmt_cdev_bt.ko': File exists Anyways, if you could point me in the right direction (or tell me there's no easy solution) that would be greatly appreciated.. Thank you! |
10-30-2024, 02:33 PM | #37 |
Junior Member
Posts: 1
Karma: 10
Join Date: Oct 2024
Device: Kobo Clara Bw
|
Hi There,
New to mobileread and koreader, I am using kobo clara bw, and I've met the same issue that evtest says the event is just a ScanCode. And `bluetoothctl devices` hangs, so I try this `rtk_hciattach` directly and it tells ``` [root@kobo bluetooth.koplugin]# ash on.sh insmod: can't insert '/drivers/mx6sll-ntx/wifi/sdio_bt_pwr.ko': No such file or directory insmod: can't insert './uhid/uhid.ko': invalid module format Realtek Bluetooth ERROR: Can't open serial port, 2, No such file or directory Realtek Bluetooth ERROR: Can't initialize device 2, No such file or directory Error org.freedesktop.DBus.Error.NoReply: Message did not receive a reply (timeout by message bus) Can't open HCI socket.: Address family not supported by protocol ``` I also tried to watch dmesg output when kobo native bluetooth turned on and connected. ``` [ 40.837592] .(0)[998:main_thread][wlan][998]nicEventLayer0ExtMagicNIC INFO) Amsdu update event ucWlanIdx[1] ucLen[3] ucMaxMpduCount[3] [ 42.065342] .(0)[1072:hci_thread][MTK-BT] BT_open: major 192 minor 0 (pid 1072) [ 42.065363] .(0)[1072:hci_thread][HIF-SDIO][I]mtk_wcn_wmt_func_ctrl:wmt-exp: OPID(3) type(0) start [ 42.065499] .(0)[1072:hci_thread][STP-PSM] [I]_stp_psm_do_wait: STP is waiting state for ACT, i=1, state = 3 [ 42.101634] .(0)[1072:hci_thread][STP-PSM] [I]_stp_psm_do_wait: +Total waits for ACT takes 36128 usec [ 42.113669] .(0)[987:mtk_wmtd][WMT-CORE][I]opfunc_utc_time_sync:Send WMT_UTC_SYNC_CMD command OK! [ 42.113689] .(0)[987:mtk_wmtd][WMT-CORE][I]wmt_core_dump_func_state:[AF FUNC ON]status(b:2 f:0 g:0 w:2 lpbk:2 coredump:0 wmt:2 ant:0 sd1:0 sd2:0 stp:0) [ 42.113765] .(0)[1072:hci_thread][HIF-SDIO][I]mtk_wcn_wmt_func_ctrl:OPID(3) type(0) ok [ 42.113775] .(0)[1072:hci_thread][MTK-BT] BT_open: WMT turn on BT OK! [ 42.113780] .(0)[1072:hci_thread][MTK-BT] BT_open: Now it's in MTK Bluetooth Mode [ 42.113784] .(0)[1072:hci_thread][MTK-BT] BT_open: STP is ready! [ 42.113790] .(0)[1072:hci_thread][BTFWLOG]bt_state_notify: g_bt_on 0, on_off 255 [ 42.727150] .(0)[102:kworker/0:2]bd71827-power bd_work_callback():soc(c=43,v=43,clamp_soc=42),vba t(stat=(32,2),v=3756800,vmin=3750200),vsys(v=37470 00,vmin=3738400),curr=-146188(avg=-113022),cc=47084698,dcap=1658,fcap=1657 [ 44.924665] .(0)[102:kworker/0:2]input: COIDEA KM as /devices/virtual/misc/uhid/0005:07D7:0000.0001/input/input3 [ 44.931675] .(0)[102:kworker/0:2]hid-generic 0005:07D7:0000.0001: input,hidraw0: BLUETOOTH HID v1.11 Mouse [COIDEA KM] on ``` summary: 0. kobo clara bw, use this plugin commit 071cb56 1. bluetoothctl devices - hang 2. /dev/input/event3 - check 3. evtest /dev/input/event3, receive EventType(Misc=4), Scan Code=4 4. main.lua, kobo clara bw section, hasKeys = yes - check 5. main.lua, event_map, add BTLeft, BTRight - check 6. open /dev/input/event3 right behind fake - check |
11-11-2024, 03:55 PM | #38 |
Junior Member
Posts: 8
Karma: 10
Join Date: Jun 2022
Device: Kobo Libra 2 / Kobo Clara HD
|
Unfortunately I am getting the 'Error: No result from Bluetooth script' message also
Output from SSH below: Code:
[root@kobo bluetooth.koplugin]# sh on.sh Realtek Bluetooth :Realtek Bluetooth init uart with init speed:115200, type:HCI UART H5 Realtek Bluetooth :Realtek hciattach version 3.1.8905594.20200610-155147 Realtek Bluetooth :Use epoll Realtek Bluetooth WARN: OP_H5_SYNC Transmission timeout Realtek Bluetooth :[SYNC] Get SYNC Resp Pkt Realtek Bluetooth :[CONFIG] Get SYNC pkt Realtek Bluetooth :[CONFIG] Get CONFG pkt Realtek Bluetooth :[CONFIG] Get CONFG resp pkt Realtek Bluetooth :dic is 1, cfg field 0x14 Realtek Bluetooth :H5 init finished Realtek Bluetooth :Realtek H5 IC Realtek Bluetooth :Receive cmd complete event of command: 1001 Realtek Bluetooth :HCI Version 0x08 Realtek Bluetooth :HCI Revision 0x000d Realtek Bluetooth :LMP Subversion 0x8723 Realtek Bluetooth :Receive cmd complete event of command: fc6d Realtek Bluetooth :Read ROM version 02 Realtek Bluetooth :LMP Subversion 0x8723 Realtek Bluetooth :EVersion 2 Realtek Bluetooth :IC: RTL8723DS Realtek Bluetooth :Firmware/config: rtl8723d_fw, rtl8723d_config Realtek Bluetooth :Couldnt open extra config /opt/rtk_btconfig.txt, No such file or directory Realtek Bluetooth :Couldnt access customer BT MAC file /opt/bdaddr Realtek Bluetooth :Origin cfg len 33 Realtek Bluetooth :55 ab 23 87 1b 00 0c 00 10 02 80 92 04 50 c5 ea Realtek Bluetooth :19 e1 1b fd af 5b 01 a4 0b d9 00 01 0f e4 00 01 Realtek Bluetooth :08 Realtek Bluetooth :Config baudrate: 04928002 Realtek Bluetooth :uart flow ctrl: 0 Realtek Bluetooth :Vendor baud from Config file: 04928002 Realtek Bluetooth :New cfg len 33 Realtek Bluetooth :55 ab 23 87 1b 00 0c 00 10 02 80 92 04 50 c5 ea Realtek Bluetooth :19 e1 1b fd af 5b 01 a4 0b d9 00 01 0f e4 00 01 Realtek Bluetooth :08 Realtek Bluetooth :Load FW /lib/firmware/rtlbt/rtl8723d_fw OK, size 54980 Realtek Bluetooth :rtb_get_fw_project_id: opcode 0, len 1, data 9 Realtek Bluetooth :FW version 0xaaa82df5, Patch num 3 Realtek Bluetooth :Chip id 0x0001 Realtek Bluetooth :Chip id 0x0002 Realtek Bluetooth :Chip id 0x0003 Realtek Bluetooth :Patch length 0x8cfc Realtek Bluetooth :Start offset 0x00004980 Realtek Bluetooth :Svn version: 24645 Realtek Bluetooth :Coexistence: BTCOEX_20210106-3b3b Realtek Bluetooth :FW exists, Config file exists Realtek Bluetooth :Total len 36125 for fwc Realtek Bluetooth :baudrate in change speed command: 0x02 0x80 0x92 0x04 Realtek Bluetooth :Receive cmd complete event of command: fc17 Realtek Bluetooth :Received cc of vendor change baud Realtek Bluetooth :Final speed 1500000 Realtek Bluetooth :end_idx: 143, lp_len: 89, additional pkts: 4 Realtek Bluetooth :Start downloading... Realtek Bluetooth :Send additional packet 17 Realtek Bluetooth :Send additional packet 18 Realtek Bluetooth :Send additional packet 19 Realtek Bluetooth :Last packet 148 Realtek Bluetooth :Send last pkt Realtek Bluetooth :Disable host hw flow control Realtek Bluetooth :h5_hci_reset: Issue hci reset cmd Realtek Bluetooth :Receive cmd complete event of command: 0c03 Realtek Bluetooth :Received cc of hci reset cmd Realtek Bluetooth :Init Process finished Realtek Bluetooth :Realtek Bluetooth post process Realtek Bluetooth :Device setup complete method return sender=:1.7 -> dest=:1.6 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 [ ] ) ] ) ] |
11-12-2024, 05:43 AM | #39 |
Junior Member
Posts: 8
Karma: 10
Join Date: Jun 2022
Device: Kobo Libra 2 / Kobo Clara HD
|
Sorry I would edit my post but I can't see the option.
I managed to get it working, with a few hacks. The major problems were: 1. The path the the plugin folder is set on an absolute basis - my folder directory was different (i.e. '/mnt/onboard/.adds/koreader/...') so I changed it as such. That meant at least the on.sh script would begin to run 2. For whatever reason, the on.sh script doesn't return the right variables and so the plugin thinks that Bluetooth isn't on (although it is). So I turned off the checks and just forced it to try to connect to my device (which works) 3. For good measure, I also added a call to off.sh at the start of on.sh Anyway thanks very much for your hard work - so happy it's working now, even if it's being held together with sticky tape! |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Bluetooth page turning for Kobo eReaders | tsowell | Kobo Reader | 214 | 11-14-2024 09:49 PM |
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 |