Skip to content
View in the app

A better way to browse. Learn more.

Armbian Community Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

RTL8723BS Bluetooth

Featured Replies

If someone is interested I found the way to have BT working on orange pi Prime.

 

Unfortunately default kernel config is missing the following options and need to be manually recompiled:

 

CONFIG_SERIAL_DEV_BUS=m
CONFIG_BT_HCIUART_SERDEV=y
CONFIG_BT_HCIUART_3WIRE=y

 

With these changes and adding "uart1" to the overlays in armbianEnv.txt  it's possible to use the driver in:

 

https://github.com/lwfinger/rtl8723bs_bt.git

 

and start manually with:

 

./rtk_hciattach -n -s 115200 /dev/ttyS1 rtk_h5

 

to have bluetooth working.

 

Alternatively it's possible to use a modified driver and some startup scripts originally developed by NextThings C.H.I.P.  that i have modified to run on Orange pi Prime board.

 

https://www.dropbox.com/s/swv2ylw6lnhljxk/rtl8723bs_bt.tar.gz?dl=0

 

 What about to add these kernel options to default next sunxi64  kernel config ?

 

I does not seem to work.

 

I'll try again with HCIUART_SERDEV=y and HCIUART_3WIRE=y instead of modules and see how it goes.

 

Or my ttyS1 is not the good one.

  • Author

Probably you are missing the first one:

 

CONFIG_SERIAL_DEV_BUS=m

 

without this option the other two are ignored.

Rebuild this morning and it now works !

 

Thanks a lot to you two for that. I'll give a look to what's done for Tinkerboard to see if we can have a proper service doing that.

@Raffa

As I said your method works fine on my Pine64 but only after the first poweron -> if I reboot (typing reboot on the console) then rtk_hciattach fail after 99 tries.

 

Do you have the same problem with your Orange Pi Prime ?

2 hours ago, vlad59 said:

then rtk_hciattach fail after 99 tries.

 

For the Tinker Board myself, @Myy, and someone else on GitHub (bad memory) worked out a user-space solution to toggle the reset line on the module.  This is the issue you are experiencing, if I had to guess, that the Bluetooth is not reset on boot.  

It's in our build system, I'll post links after bit, I simplified somewhat.  You'll need to find your gpio's that correspond to the ones used on tinker

 

https://github.com/armbian/build/blob/master/packages/bsp/rockchip/start_bt.sh

https://github.com/armbian/build/blob/master/packages/bsp/rockchip/tinker-bluetooth.service

PineA64 has those GPIO's here:

 

image.png.2eb539ccdaa359d8c3df0f980b2a9242.png

 

The script doesn't match the schematic : script is using gpio149 while PL4 should be gpio356
The script is for the tinker board, I referenced it as an example, the gpio's have to be adjusted for the Pine. (I don't have one or I'd just do it)

Sent from my Pixel using Tapatalk

  • Author
On 12/14/2018 at 1:54 PM, vlad59 said:

@Raffa

As I said your method works fine on my Pine64 but only after the first poweron -> if I reboot (typing reboot on the console) then rtk_hciattach fail after 99 tries.

 

Do you have the same problem with your Orange Pi Prime ?

 

Yes as I said on the first post I use the scripts originally developed for C.H.I.P. board with the reset pin changed:

 

Quote

 

#!/bin/sh

BT_RST_N=80

 

failed () {

        status=$2

 

        echo ${1}

        echo ${BT_RST_N} > /sys/class/gpio/unexport

        exit ${status}

}

 

# Make sure this is a Crumb

[ "$(cat /proc/device-tree/model)" = "Xunlong Orange Pi Prime" -o \

  "$(cat /proc/device-tree/model)" = "Xunlong Orange Pi Prime" ] || \

        failed "This is not a Crumb ... exiting" $?

 

# Make the BT_RST_N GPIO available to userspace

if [ ! -e /sys/class/gpio/gpio${BT_RST_N} ]; then

        echo ${BT_RST_N} > /sys/class/gpio/export || \

                failed "Failed to export BT_RST_N" $?

fi

 

# Set BT_RST_N to be an output

echo out > /sys/class/gpio/gpio${BT_RST_N}/direction || \

        failed "Failed to set BT_RST_N direction = out" $?

 

# Toggle BT_RST_N to reset Bluetooth

{

        echo 1 > /sys/class/gpio/gpio${BT_RST_N}/value;

        sleep 0.1;

        echo 0 > /sys/class/gpio/gpio${BT_RST_N}/value;

        sleep 0.1;

        echo 1 > /sys/class/gpio/gpio${BT_RST_N}/value;

} || failed "Failed to toggle Bluetooth reset" $?

 

# Cleanup BT_RST_N direction and unexport it

echo in > /sys/class/gpio/gpio${BT_RST_N}/direction || \

        failed "Failed to set BT_RST_N direction = in" $?

 

echo ${BT_RST_N} > /sys/class/gpio/unexport || \

        failed "Failed to unexport BT_RST_N" $?

 

echo "Bluetooth reset successfully!"

 

 

 

 

The script use GPIO to generate a reset pulse on the line and it is necessary if you try to reconfigure the bluetooth module after each initial configuration.

 

6 hours ago, martinayotte said:

The script doesn't match the schematic : script is using gpio149 while PL4 should be gpio356

 

Thanks all, indeed I was not clear at all.

 

I'll update the script to use gpio356 and try to provide a patch soon

I can confirm that running theses lines make bluetooth work even after a reboot :

 

root@pine64:~# echo 356 > /sys/class/gpio/export
root@pine64:~# echo high > /sys/class/gpio/gpio356/direction
root@pine64:~# echo 0 > /sys/class/gpio/gpio356/value && sleep 1
root@pine64:~# echo 1 > /sys/class/gpio/gpio356/value

I'll clean that up and do a PR

Guest
This topic is now closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.