WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Bluetooth Keyboard  (Read 9419 times)

Offline michiil

  • Newbie
  • *
  • Posts: 21
Re: Bluetooth Keyboard
« Reply #15 on: January 16, 2016, 08:37:56 AM »
Okay so 2 more questions:
  • the extension audit script doesn't seem t owork on piCore. I always get 'Install the squashfs-tools extension.', but i already have it installed.
  • whats the best way to start the init.d script on boot? and should this be included in the extension?

Offline michiil

  • Newbie
  • *
  • Posts: 21
Re: Bluetooth Keyboard
« Reply #16 on: January 16, 2016, 10:36:05 AM »
I manages to autostart by adding it to /opt/bootlocal.sh is this okay?

Also how do i reconnect my keaboard on boot?

Thanks in advance

Offline michiil

  • Newbie
  • *
  • Posts: 21
Re: Bluetooth Keyboard
« Reply #17 on: January 18, 2016, 10:10:22 AM »
Okay i'm just going to share what i have until now:

https://drive.google.com/folderview?id=0B1Ekntw8HsBXaWVqeXdod0VPYjA&usp=sharing

Everything that i tested works. I have to re-pair on every boot maybe someone could find a soloution to this?
buetoothctl needs to be executed as sudo!

Offline Greg Erskine

  • Sr. Member
  • ****
  • Posts: 402
Re: Bluetooth Keyboard
« Reply #18 on: January 18, 2016, 12:17:31 PM »
...I have to re-pair on every boot maybe someone could find a soloution to this?

Hi michiil,

Is there a configuration file that needs to be added to /opt/.filetool.lst so it is backed up?

regards
Greg

Offline michiil

  • Newbie
  • *
  • Posts: 21
Re: Bluetooth Keyboard
« Reply #19 on: January 18, 2016, 10:55:44 PM »
Okay it seems like the paired devices are store in: /var/lib/bluetooth/nn:nn:nn:nn:nn:nn
Where nn:nn:nn:nn:nn:nn is the mac of the bluetooth adapter.
At least its like that on bluez 4, didn't find anything about bluez 5..
I will try it when i get home.
How would i backup this directroy?

Thanks for the tipp greg

Btw im on picoreplayer if this makes any differences

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11213
Re: Bluetooth Keyboard
« Reply #20 on: January 18, 2016, 11:08:08 PM »
Hi michiil
Add:
Code: [Select]
var/lib/bluetooth/nn:nn:nn:nn:nn:nnto your  /opt/filetool.lst  file and then run a backup.


Offline michiil

  • Newbie
  • *
  • Posts: 21
Re: Bluetooth Keyboard
« Reply #21 on: January 18, 2016, 11:27:04 PM »
Thanks rich!
Will try when i get home and report back (:
What about the extension audit script? I would like to submit my extension to the repo..

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11213
Re: Bluetooth Keyboard
« Reply #22 on: January 18, 2016, 11:48:02 PM »
Hi michiil
Depending on which version of the audit scrip you are using it may be looking for  squashfs-tools-4.x.tcz  or
squashfs-tools.tcz. I don't run ARM myself so I don't know whether the audit script is compatible or not.

Offline michiil

  • Newbie
  • *
  • Posts: 21
Re: Bluetooth Keyboard
« Reply #23 on: January 20, 2016, 08:48:06 AM »
UPDATE:

Okay the files for bluez are in /usr/local/var/lib/bluetooth/... and if i back this foler up the device is still paired afer a reboot. YEY (:
but thats not enough as it seems /:
When i try to reconnect if jumps back and forth between 'connected yes' and 'connected no'.. If i disconnect and reconnect without rebooting it works so it seems like there is still something missing..

I will have to play around some more it seems..

Offline michiil

  • Newbie
  • *
  • Posts: 21
Re: Bluetooth Keyboard
« Reply #24 on: January 20, 2016, 10:03:08 AM »
this is from bluetoothd with debugging enabled:
Code: [Select]
bluetoothd[1222]: src/adapter.c:connected_callback() hci0 device 00:04:20:F2:46:E6 connected eir_len 23
bluetoothd[1222]: profiles/input/server.c:connect_event_cb() Incoming connection from 00:04:20:F2:46:E6 on PSM 17
bluetoothd[1222]: profiles/input/device.c:input_device_set_channel() idev (nil) psm 17
bluetoothd[1222]: Refusing input device connect: No such file or directory (2)
bluetoothd[1222]: profiles/input/server.c:confirm_event_cb()
bluetoothd[1222]: Refusing connection from 00:04:20:F2:46:E6: unknown device
bluetoothd[1222]: src/adapter.c:dev_disconnected() Device 00:04:20:F2:46:E6 disconnected, reason 3
bluetoothd[1222]: src/adapter.c:adapter_remove_connection()
bluetoothd[1222]: plugins/policy.c:disconnect_cb() reason 3
bluetoothd[1222]: src/adapter.c:bonding_attempt_complete() hci0 bdaddr 00:04:20:F2:46:E6 type 0 status 0xe
bluetoothd[1222]: src/device.c:device_bonding_complete() bonding (nil) status 0x0e
bluetoothd[1222]: src/device.c:device_bonding_failed() status 14

I have no idea whats going on there..

Code: [Select]
bluetoothd[1314]: src/adapter.c:get_ltk_info() 00:04:20:F2:46:E6
bluetoothd[1314]: src/device.c:device_create_from_storage() address 00:04:20:F2:46:E6
bluetoothd[1314]: src/device.c:device_new() address 00:04:20:F2:46:E6
bluetoothd[1314]: src/device.c:device_new() Creating device /org/bluez/hci0/dev_00_04_20_F2_46_E6
bluetoothd[1314]: src/device.c:btd_device_set_temporary() temporary 0
bluetoothd[1314]: src/device.c:device_set_bonded()
bluetoothd[1314]: src/adapter.c:load_link_keys() hci0 keys 1 debug_keys 0
bluetoothd[1314]: src/adapter.c:load_ltks() hci0 keys 0
bluetoothd[1314]: src/adapter.c:load_irks() hci0 irks 0
bluetoothd[1314]: src/adapter.c:load_conn_params() hci0 conn params 0
bluetoothd[1314]: src/device.c:device_probe_profiles() Probing profiles for device 00:04:20:F2:46:E6
bluetoothd[1314]: profiles/input/device.c:input_device_register() /org/bluez/hci0/dev_00_04_20_F2_46_E6
bluetoothd[1314]: input-hid profile probe failed for 00:04:20:F2:46:E6

this part looks promising.. but still no idea whats going on..
« Last Edit: January 20, 2016, 10:22:47 AM by michiil »

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14535
Re: Bluetooth Keyboard
« Reply #25 on: January 21, 2016, 03:18:10 AM »
Maybe it would have been better to use "--localstatedir=/var" as the base and most other extensions would use that?

Offline michiil

  • Newbie
  • *
  • Posts: 21
Re: Bluetooth Keyboard
« Reply #26 on: January 21, 2016, 10:38:49 PM »
Maybe it would have been better to use "--localstatedir=/var" as the base and most other extensions would use that?
With ./configure ? Okay will recompile today (:
Also my package is rather big compared to the x64 one (4mb vs 1mb) is that a problem?

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14535
Re: Bluetooth Keyboard
« Reply #27 on: January 21, 2016, 10:48:43 PM »
The bluetooth libs are a separate extension in x86_64.

Did you strip the binaries (strip-all) and libs (strip-unneeded)?

Offline michiil

  • Newbie
  • *
  • Posts: 21
Re: Bluetooth Keyboard
« Reply #28 on: January 22, 2016, 05:21:25 AM »
The bluetooth libs are a separate extension in x86_64.

Did you strip the binaries (strip-all) and libs (strip-unneeded)?

Okay i recompiled with "--localstatedir=/var" but that didn't help at all...
But i found the Problem FINALLY!

Before Reboot:
Code: [Select]
tc@Wohnzimmer:~$ sudo ls -lsahR /var/lib/bluetooth/
/var/lib/bluetooth/:
total 0
     0 drwx------    3 root     root          60 Jan  1  1970 .
     0 drwxrwxr-x    6 root     staff        120 Jan  1  1970 ..
     0 drwx------    4 root     root         100 Jan 22 14:13 00:15:83:D2:28:ED

/var/lib/bluetooth/00:15:83:D2:28:ED:
total 0
     0 drwx------    4 root     root         100 Jan 22 14:13 .
     0 drwx------    3 root     root          60 Jan  1  1970 ..
     0 drwx------    2 root     root          80 Jan 22 14:14 00:04:20:F2:46:E6
     0 drwx------    2 root     root         120 Jan 22 14:14 cache
     0 -rw-------    1 root     root           0 Jan 22 14:00 settings

/var/lib/bluetooth/00:15:83:D2:28:ED/00:04:20:F2:46:E6:
total 8
     0 drwx------    2 root     root          80 Jan 22 14:14 .
     0 drwx------    4 root     root         100 Jan 22 14:13 ..
     4 -rw-------    1 root     root         187 Jan 22 14:14 attributes
     4 -rw-------    1 root     root         292 Jan 22 14:14 info

/var/lib/bluetooth/00:15:83:D2:28:ED/cache:
total 16
     0 drwx------    2 root     root         120 Jan 22 14:14 .
     0 drwx------    4 root     root         100 Jan 22 14:13 ..
     4 -rw-------    1 root     root        1.5K Jan 22 14:14 00:04:20:F2:46:E6
     4 -rw-------    1 root     root          28 Jan 22 14:13 A8:54:B2:39:BC:F7
     4 -rw-------    1 root     root          21 Jan 22 14:14 CC:FE:3C:D6:88:59
     4 -rw-------    1 root     root          21 Jan 22 14:14 F8:95:C7:83:DA:40

After Reboot:
Code: [Select]
tc@Wohnzimmer:~$ sudo ls -lsahR /var/lib/bluetooth/
/var/lib/bluetooth/:
total 0
     0 drwx------    3 root     root          60 Jan  1  1970 .
     0 drwxrwxr-x    6 root     staff        120 Jan  1  1970 ..
     0 drwx------    3 root     root          80 Jan  1  1970 00:15:83:D2:28:ED

/var/lib/bluetooth/00:15:83:D2:28:ED:
total 0
     0 drwx------    3 root     root          80 Jan  1  1970 .
     0 drwx------    3 root     root          60 Jan  1  1970 ..
     0 drwx------    2 root     root          80 Jan 22 14:08 00:04:20:F2:46:E6
     0 -rw-------    1 root     root           0 Jan 22 14:00 settings

/var/lib/bluetooth/00:15:83:D2:28:ED/00:04:20:F2:46:E6:
total 8
     0 drwx------    2 root     root          80 Jan 22 14:08 .
     0 drwx------    3 root     root          80 Jan  1  1970 ..
     4 -rw-------    1 root     root         187 Jan 22 14:01 attributes
     4 -rw-------    1 root     root         292 Jan 22 14:08 info

As you can see: the cache folder is missing after the reboot. But why? I added the whole var/lib/bluetooth folder to the filetool.lst..
What am I missing?

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11213
Re: Bluetooth Keyboard
« Reply #29 on: January 22, 2016, 05:29:46 AM »
Hi michiil
There is a  cache  entry in  /opt/.xfiletool.lst  to prevent browser caches from being backed up. See if adding this to
/opt/.filetool.lst  overrides that:
Code: [Select]
var/lib/bluetooth/00:15:83:D2:28:ED/cache