PINE64
RTL8723bs Bluetooth - Printable Version

+- PINE64 (https://forum.pine64.org)
+-- Forum: PINE A64(+) (https://forum.pine64.org/forumdisplay.php?fid=4)
+--- Forum: Pine A64 Hardware, Accessories and POT (https://forum.pine64.org/forumdisplay.php?fid=32)
+---- Forum: Wifi/BT Module (https://forum.pine64.org/forumdisplay.php?fid=33)
+---- Thread: RTL8723bs Bluetooth (/showthread.php?tid=1392)

Pages: 1 2 3


RTL8723bs Bluetooth - xalius - 06-15-2016

Hi, I was playing a bit with the bluetooth part on the RTL8723bs. What I gather from the documentation and the web it's just a normal serial interface and needs to be initialized correctly. I used a small program from https://github.com/lwfinger/rtl8723bs_bt and was able to talk to the BT module on /dev/ttyS1 (physical UART is UART1 on Port G of the A64) and it seems it was able to initialize the BT and hook it up to the Linux BT subsystem. (see http://pastebin.com/Z3RUS9kc for output and dmesg). Now I have to see if it actually works :-)

Edit: while the initialization seems to work, the Linux BT stack doesnt register any new adapters, I have to look into how to debug that....


RE: RTL8723bs Bluetooth - Faye - 06-16-2016

ubuntu@fjords:~$ rfkill list
0: sunxi-bt: Bluetooth
Soft blocked: no
Hard blocked: no
1: phy0: Wireless LAN
Soft blocked: no
Hard blocked: no
2: phy1: Wireless LAN
Soft blocked: no
Hard blocked: no
3: hci0: Bluetooth
Soft blocked: no <- was yes
Hard blocked: no
$ sudo rfkill unblock 3
$ hcitool dev

Bluetooth LE scan works!


RE: RTL8723bs Bluetooth - xalius - 06-16-2016

D'oh... I totally forgot about the rfkill switches... Thanks for pointing that out...


RE: RTL8723bs Bluetooth - xalius - 06-16-2016

Ok back from work... time to test this some more...

I successfully initialized and attached the BT module today and it seems to be able to scan for devices:


Code:
[bluetooth]# list
Controller 34:C3:D2:E4:60:D8 pine64 [default]
[bluetooth]# devices
[NEW] Device DC:2C:26:0B:3C:08 DC-2C-26-0B-3C-08
[CHG] Device DC:2C:26:0B:3C:08 Connected: no
[DEL] Device DC:2C:26:0B:3C:08 DC-2C-26-0B-3C-08
[NEW] Device 00:02:76:32:1E:53 00-02-76-32-1E-53
[NEW] Device DC:2C:26:0B:3C:08 DC-2C-26-0B-3C-08
[CHG] Device 00:02:76:32:1E:53 Connected: no
[DEL] Device 00:02:76:32:1E:53 00-02-76-32-1E-53
[NEW] Device 00:02:76:32:1E:53 00-02-76-32-1E-53
[bluetooth]# devices
Device DC:2C:26:0B:3C:08 DC-2C-26-0B-3C-08
Device 00:02:76:32:1E:53 00-02-76-32-1E-53
[CHG] Device 00:02:76:32:1E:53 LegacyPairing: no
[CHG] Device 00:02:76:32:1E:53 Name: ThinkPad Bluetooth Laser Mouse
[CHG] Device 00:02:76:32:1E:53 Alias: ThinkPad Bluetooth Laser Mouse
[CHG] Device 00:02:76:32:1E:53 LegacyPairing: yes
[CHG] Device 00:02:76:32:1E:53 RSSI: -82
[CHG] Device 00:02:76:32:1E:53 RSSI: -74
[CHG] Device 00:02:76:32:1E:53 RSSI: -82

Edit: I was able to pair my BT mouse and keyboard using blueman on the Mate Desktop and they both work, so this doesnt look so bad anymore... blueman is sometimes crashing when trying to scan for devices, but using the shell bluetoothctl / hciconfig seems to work reliably...


RE: RTL8723bs Bluetooth - longsleep - 06-16-2016

Thats nice, if someone cares to create dkms packaging , post a link to a Git repository (preferably with Gbp support) and i will happily upload to launchpad. Look at https://github.com/longsleep/bcmwl-ubuntu for inspiration.


RE: RTL8723bs Bluetooth - Faye - 06-16-2016

(06-16-2016, 03:07 PM)longsleep Wrote: Thats nice, if someone cares to create dkms packaging , post a link to a Git repository (preferably with Gbp support) and i will happily upload to launchpad. Look at https://github.com/longsleep/bcmwl-ubuntu for inspiration.

I'm either missing something or this is entirely contained within the current kernel config (as you've included HCI H5 support and the appropriate UART)
This is a modified (compatible?) hciattach and a firmware blob or two, with a script to install the firmware into /lib/firmware and a 'detection' for some compatible boards.


RE: RTL8723bs Bluetooth - longsleep - 06-16-2016

(06-16-2016, 03:54 PM)Faye Wrote:
(06-16-2016, 03:07 PM)longsleep Wrote: Thats nice, if someone cares to create dkms packaging , post a link to a Git repository (preferably with Gbp support) and i will happily upload to launchpad. Look at https://github.com/longsleep/bcmwl-ubuntu for inspiration.

I'm either missing something or this is entirely contained within the current kernel config (as you've included HCI H5 support and the appropriate UART)
This is a modified (compatible?) hciattach and a firmware blob or two, with a script to install the firmware into /lib/firmware and a 'detection' for some compatible boards.
I do not get what you mean.


RE: RTL8723bs Bluetooth - xalius - 06-17-2016

I think what Faye wanted to say is that https://github.com/lwfinger/rtl8723bs_bt is not a Linux kernel driver. It just provides a small tool to handshake with the BT module via the UART and upload a firmware blob to the internal BT MCU. After that, the module can be attached to the BT stack (which already speaks HCI H5) available from the current kernel/userland. So the question is rather, how would this workaround be implemented in a proper way? Make a kernel side driver that just does the handshake and firmware loading? Or have something in userland that just calls the tool from lwfinger if a rtl8723bs wifi adapter is detected? I am only a embedded hardware developer with a bit of Linux experience so I dont know what the "right" way is to do this...


RE: RTL8723bs Bluetooth - MarkHaysHarris777 - 06-17-2016

My ubuntu load is very confused... thinks the blue tooth is a secondary wifi (it really is I suppose) calls it wlan1 and then disables it !

I'll think about it tomorrow.


RE: RTL8723bs Bluetooth - xalius - 06-17-2016

(06-17-2016, 06:53 AM)MarkHaysHarris777 Wrote: My ubuntu load is very confused... thinks the blue tooth is a secondary wifi (it really is I suppose) calls it wlan1 and then disables it !

I'll think about it tomorrow.

The secondary wifi interface is just a duplicate because of network configuration / udev rules I think, I got that too. The BT interface is not via SDIO, it's just a three wire UART interface that is directly connected to UART1 on the A64 which is mapped to /dev/ttyS1...