Jump to content

BPi-M2+ Problem to pair bluetooth speaker in command line


miguipda

Recommended Posts

Hi,

 

I am trying to pair a Bluetooth speaker with my Banana Pi M2+ (in command line because I can not connect it to a display and/or keyboard. I use it as a remote machine I connect through SSH).

It is the first time I do this in command line then I need help to accomplish it successfully.

 

Here is my situation :

1) I saw that the only two available command line for Bluetooth on Armbian are bluetoothctl and bluetoothd

2) I saw in the file /etc/default/bluetooth that the bluetooth will automatically start at boot through the variable "BLUETOOTH_ENABLED=1"

3) I controlled the Bluetooth is well started by using the command line "systemctl status bluetooth" and it returned : Started Bluetooth service (complete text here below)

4) I know the MAC Address of my Bluetooth speaker (I will simply call here x:x:x:x:x:x)

5) I then followed the recommendations explained in the paragraph "Pairing using cli" (from this debian wiki page) by "Using the bluetoothctl" and :

    a. "power on" succeeded and returned this text message :

            Changing power on succeeded
            [CHG] Controller w:w:w:w:w:w Powered: yes

    b. "devices"   did not returned anything

    c. "scan on" returned this text message :

           Discovery started
           [CHG] Controller w:w:w:w:w:w Discovering: yes

    d. "agent on" command returned this text message :

           Agent is already registered

    e. "pair x:x:x:x:x:x" returned this text message :

           Device x:x:x:x:x:x not available

6) As the (speaker) device could not be available (even if I put them together on the same table) I can not finish the two next steps ("trust x:x:x:x:x:x" then "connect x:x:x:x:x:x")

7) I set back "power off" to its default status

 

Then could you please tell me how to solve this pairing problem ?

 

Sincerely thanks and have a nice day,

 

Miguipda ;-)

 

 

Text returned by "systemctl status bluetooth" :

---------------------------------------------------------

          ● bluetooth.service - Bluetooth service
          Loaded: loaded (/lib/systemd/system/bluetooth.service; enabled)
          Active: active (running) since Sat 2017-04-22 10:47:45 CEST; 20h ago
               Docs: man:bluetoothd(8)
           Main PID: 858 (bluetoothd)
             Status: "Running"
             CGroup: /system.slice/bluetooth.service
                     └─858 /usr/lib/bluetooth/bluetoothd

          Apr 22 10:47:45 bananapim2plus bluetoothd[858]: Bluetooth daemon 5.23
          Apr 22 10:47:45 bananapim2plus bluetoothd[858]: Starting SDP server
          Apr 22 10:47:45 bananapim2plus bluetoothd[858]: Bluetooth management interface 1.0 initialized
          Apr 22 10:47:45 bananapim2plus bluetoothd[858]: Sap driver initialization failed.
          Apr 22 10:47:45 bananapim2plus bluetoothd[858]: sap-server: Operation not permitted (1)
          Apr 22 10:47:45 bananapim2plus systemd[1]: Started Bluetooth service.

Link to comment
Share on other sites

Mainline or legacy? IIRC BT works well only on mainline kernel ...  at least this is the case with Cubietruck where I did most of those tests.

Link to comment
Share on other sites

Euh...

 

I presume you are talking about the OS source I downloaded and installed.

 

On this page there is only stable version with legacy (Debian Jessie). And it was the only needed OS to use it as central remote server.

 

Then what is the solution to pair them ?

 

Sincerely thanks.

 

Miguipda ;-)

 

P.S. : if it only works well on mainline, why bluetooth was enabled on legacy. It should be better to disable it to reduce consumption. Is not it ;-)

Link to comment
Share on other sites

Well ... BT works on kernel 3.4 but it's buggy and I haven't seen any interest in fixing it. IIRC you might get some BT mouse working, while audio won't work ... I had done everything what was in my power / knowledge. in this area.

 

Mainline kernel for H3 boards ... check if nightly version exists otherwise you need to build on your own. No other way I am afraid. But beware that mainline kernel has other limitations ... if you use it for server, than you should mostly be fine. 

 

Add: there is yet another problem related to Wifi / BT with this particular board. One / first revision of this board has broken chip. Don't know exactly how, but it has some issues.

Link to comment
Share on other sites

I did not took mailine because it was unstable and mentionned there is no given support for it.

 

The interest of using its onboard bluetooth is especially to be able to have a portable speaker I may put where I need without having to use wire.

And as I use it as Home Assistant I need it may talk to me when it detect some events.

 

In other words you are telling me  I may test the mainline without support or build on my own...

 

It means for me I will not be able to use it as "a talking assistant". Bad news.

 

Link to comment
Share on other sites

It's not that bad as it might sound ;) If you don't need advanced graphics / video acceleration, than mainline kernel is a good choice for such operation. There are some (basic) things which are still WIP but I encourage you to play with it. More people will use it, more people will be able to exchange help and ideas. It's getting improved on daily base, while legacy stay as is. We are probably among the only one, that still apply patches to it. But also rarely.

 

Bottom up. You will probably waste less time by using development kernel for this particular job.

 

Link to comment
Share on other sites

- do you use AP6212 or usb key controller ?

- if you use AP6212, did you connect the aerial ?

- if you use external usb key, check your logs (you may need to disable AP6212 in fex)

- until the discovery report the device has been seen, you cannot pair it. Do you know your device pairing procedure - has it already been paired (it may try to connect old source and reject pairing requests)

 

Link to comment
Share on other sites

31 minutes ago, miguipda said:

Is there a problem in this case ?

Maybe. This 'famous' vendor is known to ship out trash (partially broken hardware) for developers or as 'giveaways' (in the latter case usually asking for insanely high shipping fees for their 'freebies') 

Link to comment
Share on other sites

Dear tkaiser,

 

I did know for the broken hardware gift but you right for the insane fees.

When I won it they ask me 20 USD as fees (or 25 USD I forgot it). But I explained (without telling it comes from you) that this H3 board is known to heat.

During many mails where they come back three times to me to send me it after paying the fees I remebered them I won it. And then they must send me it without fees.

 

They finally send it to me ;-)

 

I just now hope it will not be broken hardware because I buyed a case and the OV5640 (12 USD) camera.

 

Thank you for your remarks ;-)

 

Have a nice day,

 

Miguipda

Link to comment
Share on other sites

Dear arox,

 

you said :

- do you use AP6212 or usb key controller ?

> I use the onboard bluetooth module (mentionned here as indeed a Ampack AP6212)

 

- if you use AP6212, did you connect the aerial ?

> What are you talking about ?

 

Thank you

 

Link to comment
Share on other sites

@tkaiser

 

as you said this board heats I first used your h3consumption tool. And it stay around 26°C till 33°C (until now).

 

But I just realize now my bluetooth problem may be come from this. I explain.

 

I used this "h3consumption -w off" because I though it will disable the Wifi (2.4 gHz).

But now I am asking myself if it will not also switch off the bluetooth ?

 

Could you confirm or not that bluetooth still work after having used this command line or must I switch it back on ?

 

Sincerely thanks.

 

 

Link to comment
Share on other sites

27 minutes ago, miguipda said:

Dear arox,

 

you said :

- do you use AP6212 or usb key controller ?

> I use the onboard bluetooth module (mentionned here as indeed a Ampack AP6212)

 

- if you use AP6212, did you connect the aerial ?

> What are you talking about ?

 

Thank you

 

 

When you put your controller in scan mode, you should get message of "discovered" hosts. I never checked with (my) BMP M2+, but it should be the same as with nanopi neo air : if you don't connect the piece of wire that serves as aerial for wifi AND bluetooth on the ipex connector, you cannot get a reception at more than 5 centimeters !

Link to comment
Share on other sites

Dear arox,

 

I am talking about using my Banana Pi M2+ (and not a nanopi nea air. Perhaps are you switching between two thread ;-)).

 

But you right when you talk about aerial. But it also means I need to buy one because I do not have one.

 

As previously said perhaps does it come from my previous use of h3consumption (if it will also switch bluetooth off and not only wifi (2.4 gHz).

 

Then I will wait the tkaiser response and if I need to first switch it on I will test it at 5 cm as you recommend. Then if it works I will order an aerial (antenna).

 

Have a nice day and sincerely thanks for your recommendations.

 

 

Link to comment
Share on other sites

19 minutes ago, miguipda said:

Dear arox,

 

I am talking about using my Banana Pi M2+ (and not a nanopi nea air. Perhaps are you switching between two thread ;-)).

 

But you right when you talk about aerial. But it also means I need to buy one because I do not have one.

 

As previously said perhaps does it come from my previous use of h3consumption (if it will also switch bluetooth off and not only wifi (2.4 gHz).

 

Then I will wait the tkaiser response and if I need to first switch it on I will test it at 5 cm as you recommend. Then if it works I will order an aerial (antenna).

 

Have a nice day and sincerely thanks for your recommendations.

 

 

 

You should have received a piece of wire with a tiny ipex connector with your board. Be warned that without it you cannot use bluetooth or even pair devices.

Link to comment
Share on other sites

1 hour ago, miguipda said:

Could you confirm or not that bluetooth still work after having used this command line or must I switch it back on ?

 

Sorry, I can't confirm anything related to this board since I consider this being a pile of crap (and I regret that we started to support this shitty overheating thing). At least h3consumption -w setting is unrelated to BT but I would still recommend to throw that board away, get something else and save a lot of time.

Link to comment
Share on other sites

10 minutes ago, miguipda said:

I did not receive it with it. I just won the board (alone).

 

But I asked this seller to see if this one could be used with the BPi-M2+ model.

 

Any piece of wire with a quarter of wave length should do the trick for any 2.4 GHz communication (27 millimeters). My BPI M2+ was packaged with one in the cardboard box. I don't have any other ipex antenna to compare with. 1.43 Euro is a bargain in comparison of the price FA or others charges you. But I think the correct price should be 10 cents ... for the connector !

 

Be warned also that you will have to raise speed in hciattach in order to use a2dp (bluetooth audio profile) without packet drop.

Link to comment
Share on other sites

18 minutes ago, tkaiser said:

 

Sorry, I can't confirm anything related to this board since I consider this being a pile of crap (and I regret that we started to support this shitty overheating thing). At least h3consumption -w setting is unrelated to BT but I would still recommend to throw that board away, get something else and save a lot of time.

 

Well I suppose the Nanopi M1 Plus is quite the same with a lower price and better hadware ? But the cam connector is surely different.

Link to comment
Share on other sites

Dear Arox,

 

I am currently looking to the Orange Pi and the problem now (following the recommendations of tkaiser) is to find a board that will perfectly support armbian.

A comparaison page should be good to make the best choice but does not exist on armbian. Than I could also encounter the same problem by choosing another board that may give some problems on specific hardware.

 

Of course the well known RPi must solve this problem and of course I do not want to spend money to many boards to finally found that it should be better to first buy a RPi.

 

Now I have the CSI OV5640 I will check wich board wille have enough RAM (1 Gb) and Bluetooth (to pair speaker) to allow me to use it as Home Assistant and door peehole (face recognition and motion detection : this is why I at least need 1 Gb of RAM).

 

Have a nice day.

Link to comment
Share on other sites

3 minutes ago, arox said:

Well I suppose the Nanopi M1 Plus is quite the same with a lower price and better hadware ?

 

Exactly. And there the 4th USB port is exposed on pin headers which makes it easier to use. And on M1 Plus FriendlyELEC implemented voltage regulation correctly while those Banana morons simply forgot it and wrote wrong values to their released schematics and simply don't give a sh*t about correcting this mistake.

 

The biggest problem miguipda is facing is that he deals with a 'gift from SinoVoip' since someone on IRC mentioned this famous vendor would convert trash into 'gifts' and sells it for half the price ($20 or even $25 shipping fees) to clueless people (IIRC he mentioned those M2+ giveaways would have broken Wi-Fi or something like that). The best thing you can do with such a 'gift' is to throw it away immediately.

Link to comment
Share on other sites

I did not want to hurt anyone when I said I did not (look and then) found a comparaison table. I forgot the tkaiser comparaison because I was just thinking about a simple speaking table showing which board have wich RAM size, with or without Wifi, Bluetooth, CSI, ...

 

I thank you for your help and will just have a look by myself.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines