Yet another bluetooth thread

Description


Environment:

I have recently got MOD Duo X.
It has latest release on board - 1.11.2.2676

I have two bluetooth 5.0 dongles, one bought just after first one did not work.
They look differently and different manufacturer are stated on the package, but in dmesg they look the same. I dont feel like I should go and buy a bunch of another dongles - I can just end up having a pile of the dongles that are the same internally, nobody writes what chip is inside.

[ 970.488040] usb 2-1: New USB device found, idVendor=0a12, idProduct=0001
[ 970.488052] usb 2-1: New USB device strings: Mfr=0, Product=2, SerialNumber=0
[ 970.488057] usb 2-1: Product: CSR8510 A10

and as Bus 002 Device 004: ID 0a12:0001
in lsusb

I have two android phones (xiaomi poco x3, xiaomi mi max 2) and one lenovo yoga laptop with bluetooth on board.

Combination of any of two dongles plugged and any of these devices do not connect.

[CHG] Controller 00:1A:7D:DA:71:10 Discover

How to reproduce


  1. Insert the dongle, enable discovery, try to pair from the phone.
  2. Enter 0000 pin to the pin request
  3. Recieve message that can be translated as “Could not connect to MOD duo X 3-0126 because of incorrect pin or access key”

Same happens from the windows laptop, I recieve message that translates as "Something is wrong with a secret code, try again.

That’s how it looks on the DUO side: (please let me know if I can get more verbosity here)

[root@modduox ~]# bluetoothctl
[NEW] Controller 00:1A:7D:DA:71:10 MOD Duo X [default]
[CHG] Controller 00:1A:7D:DA:71:10 Discoverable: yes
[CHG] Controller 00:1A:7D:DA:71:10 Class: 0x020000
[NEW] Device 34:1C:F0:32:E1:F3 POCO X3 NFC
[CHG] Device 34:1C:F0:32:E1:F3 Trusted: yes
[DEL] Device 34:1C:F0:32:E1:F3 POCO X3 NFC

Additional information

Interesting part is that was able to pair one phone device manually through SSH console once with the following procedure:

Searching for my phone via hcitool:

[root@modduox ~]# hcitool scan
Scanning ...
        34:1C:F0:32:E1:F3       POCO X3 NFC     <---- this is my phone
        B4:D5:BD:F0:17:5B       DESKTOP-OK679RL

Use bluetoothctl to scan the devices around:

[root@modduox ~]# bluetoothctl
[NEW] Controller 00:1A:7D:DA:71:10 MOD Duo X 3-0126 [default]
[bluetooth]# pair 34:1C:F0:32:E1:F3
Device 34:1C:F0:32:E1:F3 not available
[bluetooth]# scan on
Discovery started
[CHG] Controller 00:1A:7D:DA:71:10 Discovering: yes
[NEW] Device 34:1C:F0:32:E1:F3 POCO X3 NFC
[NEW] Device 24:FC:E5:9C:25:11 [TV] Samsung Q60 Series (49)

Use bluetoothctl to pair my Poco X3 knowing it’s MAC:

[bluetooth]# pair 34:1C:F0:32:E1:F3
Attempting to pair with 34:1C:F0:32:E1:F3
[CHG] Device 34:1C:F0:32:E1:F3 Connected: yes
[CHG] Device 34:1C:F0:32:E1:F3 Trusted: yes
[CHG] Device 34:1C:F0:32:E1:F3 Modalias: bluetooth:v038Fp1200d1436
[CHG] Device 34:1C:F0:32:E1:F3 UUIDs: 00001105-0000-1000-8000-00805f9b34fb
[CHG] Device 34:1C:F0:32:E1:F3 UUIDs: 0000110a-0000-1000-8000-00805f9b34fb
[CHG] Device 34:1C:F0:32:E1:F3 UUIDs: 0000110c-0000-1000-8000-00805f9b34fb
[CHG] Device 34:1C:F0:32:E1:F3 UUIDs: 00001112-0000-1000-8000-00805f9b34fb
[CHG] Device 34:1C:F0:32:E1:F3 UUIDs: 00001115-0000-1000-8000-00805f9b34fb
[CHG] Device 34:1C:F0:32:E1:F3 UUIDs: 00001116-0000-1000-8000-00805f9b34fb
[CHG] Device 34:1C:F0:32:E1:F3 UUIDs: 0000111f-0000-1000-8000-00805f9b34fb
[CHG] Device 34:1C:F0:32:E1:F3 UUIDs: 0000112f-0000-1000-8000-00805f9b34fb
[CHG] Device 34:1C:F0:32:E1:F3 UUIDs: 00001132-0000-1000-8000-00805f9b34fb
[CHG] Device 34:1C:F0:32:E1:F3 UUIDs: 00001200-0000-1000-8000-00805f9b34fb
[CHG] Device 34:1C:F0:32:E1:F3 UUIDs: 00001800-0000-1000-8000-00805f9b34fb
[CHG] Device 34:1C:F0:32:E1:F3 UUIDs: 00001801-0000-1000-8000-00805f9b34fb
[CHG] Device 34:1C:F0:32:E1:F3 Paired: yes
Pairing successful
[NEW] Device FF:21:07:08:F0:04 SP621E
[NEW] Device 40:4E:36:A4:5F:4B HTC BS 4B40CF
[CHG] Device 24:FC:E5:9C:25:11 RSSI is nil
[CHG] Device 24:FC:E5:9C:25:11 RSSI: -50
[CHG] Device 24:FC:E5:9C:25:11 RSSI is nil
[NEW] Device FD:F8:FC:A4:B1:70 nut
[NEW] Device C4:B2:FE:BE:59:7B nut
[NEW] Device D7:68:33:0A:D5:2E nut
[NEW] Device CC:51:5D:1A:80:05 nut
[NEW] Device F2:47:B4:37:DF:0E nut
[CHG] Device 24:FC:E5:9C:25:11 RSSI: -72
[CHG] Device 24:FC:E5:9C:25:11 RSSI is nil
[POCO X3 NFC]#

After this action, phone asks for the pin and actually accepts 0000 pin.

Do the trust:

[POCO X3 NFC]# trust 34:1C:F0:32:E1:F3
Changing 34:1C:F0:32:E1:F3 trust succeeded

After this actions I’ve got a working connection when trying them first time and get the MOD UI in phone’s chrome browser by 192.168.50.1

Unfortunately, after removing the dongle and inserting it back, I was not able to repeat the success again, even with removing the pairing via bluetoothctl and starting from the scratch.
Might be possible that I’ve missed some vital step.

Swapping dongles, phones, whatever - does not help. Not sure what I am doing wrong at this point, but looks like connecting to MOD Duo with this dongle is possible, but something is missing.

After connection attempts from the phone i have bluetoothctl showing “Connected yes” and then disconnect in a several seconds:

[bluetooth]# paired-devices
Device 34:1C:F0:32:E1:F3 POCO X3 NFC
[CHG] Controller 00:1A:7D:DA:71:10 Discoverable: no
[CHG] Device 34:1C:F0:32:E1:F3 Connected: yes
[CHG] Device 34:1C:F0:32:E1:F3 Connected: no
[bluetooth]#

Are there any suggestions how to make dongle working on Duo X ?
Or at least I can do something on my end to troubleshoot this with more verbosity? Maybe I can somehow return my DuoX bluetooth configuration to the original state to try to reproduce my occasional success? As far as I can see - firmware manual update does not rewrite bluetooth settings to the original state.

1 Like

Ive traded one of my 5.0 dongles for the dongle marked as 4.0.

Funny thing that it reports as Product: CSR8510 A10 in dmesg and Bus 002 Device 002: ID 0a12:0001 in lsusb as well.

Also looks like bluetooth settings can be restored (all I found at the moment) by removing /data/bluetooth/ [mac addresses of the dongles]

Regardless of the same VID/PID, when using this 4.0 dongle - PIN 0000 pairing works fine with no manual bluetoothctl ssh paring / trusting.

However, after paring everything else the same - “Connected: no” just in a couple of seconds after “Connected: yes” seen in bluetoothctl after connection attempt.

Detailed btmon output when trying to connect from phone looks as below:
Looks like something related to authenticaion goes wrong.

t[root@modduox ~]# btmon
Bluetooth monitor ver 5.37
= New Index: 00:1A:7D:DA:71:13 (BR/EDR,USB,hci0)                                                                                                                                                                             [hci0] 0.658104
= Open Index: 00:1A:7D:DA:71:13                                                                                                                                                                                              [hci0] 0.658105
= Index Info: 00:1A:7D:DA:71:13 (Cambridge Silicon Radio)                                                                                                                                                                    [hci0] 0.658106
> HCI Event: Connect Request (0x04) plen 10                                                                                                                                                                                 [hci0] 19.102107
        Address: 34:1C:F0:32:E1:F3 (OUI 34-1C-F0)
        Class: 0x5a020c
          Major class: Phone (cellular, cordless, payphone, modem)
          Minor class: Smart phone
          Networking (LAN, Ad hoc)
          Capturing (Scanner, Microphone)
          Object Transfer (v-Inbox, v-Folder)
          Telephony (Cordless telephony, Modem, Headset)
        Link type: ACL (0x01)
< HCI Command: Accept Connection Request (0x01|0x0009) plen 7                                                                                                                                                               [hci0] 19.102166
        Address: 34:1C:F0:32:E1:F3 (OUI 34-1C-F0)
        Role: Master (0x00)
> HCI Event: Command Status (0x0f) plen 4                                                                                                                                                                                   [hci0] 19.107082
      Accept Connection Request (0x01|0x0009) ncmd 1
        Status: Success (0x00)
> HCI Event: Role Change (0x12) plen 8                                                                                                                                                                                      [hci0] 19.265092
        Status: Success (0x00)
        Address: 34:1C:F0:32:E1:F3 (OUI 34-1C-F0)
        Role: Master (0x00)
> HCI Event: Connect Complete (0x03) plen 11                                                                                                                                                                                [hci0] 19.286093
        Status: Success (0x00)
        Handle: 70
        Address: 34:1C:F0:32:E1:F3 (OUI 34-1C-F0)
        Link type: ACL (0x01)
        Encryption: Disabled (0x00)
< HCI Command: Read Remote Supported Features (0x01|0x001b) plen 2                                                                                                                                                          [hci0] 19.286218
        Handle: 70
> HCI Event: Page Scan Repetition Mode Change (0x20) plen 7                                                                                                                                                                 [hci0] 19.287082
        Address: 34:1C:F0:32:E1:F3 (OUI 34-1C-F0)
        Page scan repetition mode: R1 (0x01)
> HCI Event: Command Status (0x0f) plen 4                                                                                                                                                                                   [hci0] 19.291081
      Read Remote Supported Features (0x01|0x001b) ncmd 0
        Status: Success (0x00)
> HCI Event: Max Slots Change (0x1b) plen 3                                                                                                                                                                                 [hci0] 19.296086
        Handle: 70
        Max slots: 5
> ACL Data RX: Handle 70 flags 0x02 dlen 10                                                                                                                                                                                 [hci0] 19.299086
      L2CAP: Information Request (0x0a) ident 2 len 2
        Type: Extended features supported (0x0002)
> HCI Event: Command Status (0x0f) plen 4                                                                                                                                                                                   [hci0] 19.318096
      NOP (0x00|0x0000) ncmd 1
        Status: Success (0x00)
> HCI Event: Read Remote Supported Features (0x0b) plen 11                                                                                                                                                                  [hci0] 19.356091
        Status: Success (0x00)
        Handle: 70
        Features: 0xff 0xfe 0x8f 0xfe 0xd8 0x3f 0x5b 0x87
          3 slot packets
          5 slot packets
          Encryption
          Slot offset
          Timing accuracy
          Role switch
          Hold mode
          Sniff mode
          Power control requests
          Channel quality driven data rate (CQDDR)
          SCO link
          HV2 packets
          HV3 packets
          u-law log synchronous data
          A-law log synchronous data
          CVSD synchronous data
          Paging parameter negotiation
          Power control
          Transparent synchronous data
          Broadcast Encryption
          Enhanced Data Rate ACL 2 Mbps mode
          Enhanced Data Rate ACL 3 Mbps mode
          Enhanced inquiry scan
          Interlaced inquiry scan
          Interlaced page scan
          RSSI with inquiry results
          Extended SCO link (EV3 packets)
          AFH capable slave
          AFH classification slave
          LE Supported (Controller)
          3-slot Enhanced Data Rate ACL packets
          5-slot Enhanced Data Rate ACL packets
          Sniff subrating
          Pause encryption
          AFH capable master
          AFH classification master
          Enhanced Data Rate eSCO 2 Mbps mode
          Extended Inquiry Response
          Simultaneous LE and BR/EDR (Controller)
          Secure Simple Pairing
          Encapsulated PDU
          Non-flushable Packet Boundary Flag
          Link Supervision Timeout Changed Event
          Inquiry TX Power Level
          Enhanced Power Control
          Extended features
< HCI Command: Read Remote Extended Features (0x01|0x001c) plen 3                                                                                                                                                           [hci0] 19.356117
        Handle: 70
        Page: 1
> HCI Event: Command Status (0x0f) plen 4                                                                                                                                                                                   [hci0] 19.361084
      Read Remote Extended Features (0x01|0x001c) ncmd 1
        Status: Success (0x00)
> HCI Event: Read Remote Extended Features (0x23) plen 13                                                                                                                                                                   [hci0] 19.374087
        Status: Success (0x00)
        Handle: 70
        Page: 1/0
        Features: 0x0b 0x00 0x00 0x00 0x00 0x00 0x00 0x00
          Secure Simple Pairing (Host Support)
          LE Supported (Host)
          Secure Connections (Host Support)
< HCI Command: Remote Name Request (0x01|0x0019) plen 10                                                                                                                                                                    [hci0] 19.374124
        Address: 34:1C:F0:32:E1:F3 (OUI 34-1C-F0)
        Page scan repetition mode: R2 (0x02)
        Page scan mode: Mandatory (0x00)
        Clock offset: 0x0000
< ACL Data TX: Handle 70 flags 0x00 dlen 10                                                                                                                                                                                 [hci0] 19.374141
      L2CAP: Information Request (0x0a) ident 1 len 2
        Type: Extended features supported (0x0002)
< ACL Data TX: Handle 70 flags 0x00 dlen 16                                                                                                                                                                                 [hci0] 19.374155
      L2CAP: Information Response (0x0b) ident 2 len 8
        Type: Extended features supported (0x0002)
        Result: Success (0x0000)
        Features: 0x000002b8
          Enhanced Retransmission Mode
          Streaming Mode
          FCS Option
          Fixed Channels
          Unicast Connectionless Data Reception
> HCI Event: Command Status (0x0f) plen 4                                                                                                                                                                                   [hci0] 19.381078
      Remote Name Request (0x01|0x0019) ncmd 1
        Status: Success (0x00)
> HCI Event: Number of Completed Packets (0x13) plen 5                                                                                                                                                                      [hci0] 19.384081
        Num handles: 1
        Handle: 70
        Count: 1
> ACL Data RX: Handle 70 flags 0x02 dlen 16                                                                                                                                                                                 [hci0] 19.387086
      L2CAP: Information Response (0x0b) ident 1 len 8
        Type: Extended features supported (0x0002)
        Result: Success (0x0000)
        Features: 0x000000b8
          Enhanced Retransmission Mode
          Streaming Mode
          FCS Option
          Fixed Channels
< ACL Data TX: Handle 70 flags 0x00 dlen 10                                                                                                                                                                                 [hci0] 19.387110
      L2CAP: Information Request (0x0a) ident 2 len 2
        Type: Fixed channels supported (0x0003)
> HCI Event: Number of Completed Packets (0x13) plen 5                                                                                                                                                                      [hci0] 19.387109
        Num handles: 1
        Handle: 70
        Count: 1
> ACL Data RX: Handle 70 flags 0x02 dlen 10                                                                                                                                                                                 [hci0] 19.389072
      L2CAP: Information Request (0x0a) ident 3 len 2
        Type: Fixed channels supported (0x0003)
< ACL Data TX: Handle 70 flags 0x00 dlen 20                                                                                                                                                                                 [hci0] 19.389091
      L2CAP: Information Response (0x0b) ident 3 len 12
        Type: Fixed channels supported (0x0003)
        Result: Success (0x0000)
        Channels: 0x0000000000000006
          L2CAP Signaling (BR/EDR)
          Connectionless reception
> ACL Data RX: Handle 70 flags 0x02 dlen 20                                                                                                                                                                                 [hci0] 19.394075
      L2CAP: Information Response (0x0b) ident 2 len 12
        Type: Fixed channels supported (0x0003)
        Result: Success (0x0000)
        Channels: 0x0000000000000082
          L2CAP Signaling (BR/EDR)
          Security Manager (BR/EDR)
> ACL Data RX: Handle 70 flags 0x02 dlen 12                                                                                                                                                                                 [hci0] 19.396074
      L2CAP: Connection Request (0x02) ident 4 len 4
        PSM: 15 (0x000f)
        Source CID: 81
< ACL Data TX: Handle 70 flags 0x00 dlen 16                                                                                                                                                                                 [hci0] 19.396104
      L2CAP: Connection Response (0x03) ident 4 len 8
        Destination CID: 0
        Source CID: 81
        Result: Connection refused - security block (0x0003)
        Status: No further information available (0x0000)
@ Device Connected: 34:1C:F0:32:E1:F3 (0) flags 0x0000
        04 0d 0c 02 5a                                   ....Z
> HCI Event: Remote Name Req Complete (0x07) plen 255                                                                                                                                                                       [hci0] 19.406078
        Status: Success (0x00)
        Address: 34:1C:F0:32:E1:F3 (OUI 34-1C-F0)
        Name: POCO X3 NFC
> HCI Event: Number of Completed Packets (0x13) plen 5                                                                                                                                                                      [hci0] 19.408075
        Num handles: 1
        Handle: 70
        Count: 1
> HCI Event: Number of Completed Packets (0x13) plen 5                                                                                                                                                                      [hci0] 19.409083
        Num handles: 1
        Handle: 70
        Count: 1
> HCI Event: Number of Completed Packets (0x13) plen 5                                                                                                                                                                      [hci0] 19.410073
        Num handles: 1
        Handle: 70
        Count: 1
< HCI Command: Disconnect (0x01|0x0006) plen 3                                                                                                                                                                              [hci0] 23.383026
        Handle: 70
        Reason: Authentication Failure (0x05)
> HCI Event: Command Status (0x0f) plen 4                                                                                                                                                                                   [hci0] 23.385084
      Disconnect (0x01|0x0006) ncmd 1
        Status: Success (0x00)
> HCI Event: Disconnect Complete (0x05) plen 4                                                                                                                                                                              [hci0] 23.464087
        Status: Success (0x00)
        Handle: 70
        Reason: Connection Terminated By Local Host (0x16)
@ Device Disconnected: 34:1C:F0:32:E1:F3 (0) reason 2

Hi .
I have exactly the same problem with my ModDuo x but I tried 3 bluetooth dongle and more than 3 android device with old and most recent android version.
Nothing work.
But my unit have a issue with input 1 so I’ll send it for repair. @jon said they will look what’s the problem with bluetooth and this unit, thinking my unit have an issue. But I see now I’m not alone.
I finally found a better alternative to bluetooth , Wifi .
Just buy this Wifi router
www.gl-inet.com/products/gl-mt300n-v2/
Connect to your Mod device, set up the router to share connection the router will automaticaly set up found it , open your computer Ipad or android device, connect to the wifi router and voila!

Now I have the Web Ui when browsing the IP 192.168.51.1 on every device I want and with the same speed as USB connection.

5 Likes

How are you connecting your DuoX to the router?

With a usb cable.

1 Like

Bluetooth 5.0 may be problematic here - we didn’t test it enough yet.
Are you using what OS on the host? Are you able to try another OS or/and host?

Bluetooth 5.0 may be problematic here

  1. MOD Wiki states: **Note:** Your Bluetooth dongle should be with version 3 or higher

If v5 does not work for anybody, I consider this statement to be misleading, and some warning should be added, untill v5 will start working.

  1. Actually it is already harder to find dongles locally with less then 5.0, and shops do not fill stores with 4.0 as they are considered to be outdated.I was only able to obtain one by trading my new to friend’s old. Was not a deal of the century. No pushing, but feels like 5.0 is more actual now.

Are you using what OS on the host?

  1. Android 10 on phone 1 and phone 2 - both do not work with either v4 and v5 dongles.
    Pairing does not work with v5 unless I do bluetoothctl magic manually via ssh.
    Pairing starts to work with v4, but connection does not.

Unfortunately, I’ve found no parameters from the Android side to play with. Just can tell that I have quite a lot of devices that work fine with these phones via bluetooth: 3 smartwatches, 2 bluetooth audio speakers, 2 esp32 based mesh radio stations, 2 my own esp32 based DIY bluetooth macros keyboards, 1 OBD car scanner, 1 car bluetooth battery monitor, 4 nut blueooth tags, 1 smart LED controller - and all of these devices have not problems with bluetooth connections. Only device i’ve stucked with is Mod Duo X, so I doubt that andriod devices are the root cause on their own.

  1. Windows 10 on the laptop - cannot even pair with v5.0 dongle, but seems to work with v4.0. However, laptop can have better connection with USB anyway, and is included just for testing, as the the whole idea was to reduce rig weight and get rid of the laptop, while to be able to do minor pedalboard tunings if I’ve forgot to assign some button for example.

Is there any other information I can provide? Logs, verbose output of any tools, sniffing traffic?
I am quite a nerd with some linux background, so I have no problems with following instructions and CLI if it might help to solve the issue and make ModDuoX better for everyone.

1 Like

Thank you, will consider this as a plan B f̶̶r̶̶o̶̶m̶̶ o̶̶u̶̶t̶̶e̶̶r̶̶ s̶̶p̶̶a̶̶c̶̶e̶̶ if there will be not joy with bluetooth and wifi dongles.

I’ve already tried 3 BT dongles and a new 1 wifi dongle, and princess is still in the other castle.

I see a probable solution for the wifi dongle I have, but it is a matter for the separate topic.

3 Likes

I decided to forget bluetooth.
The Wifi router is mounted on my pedalboard and permanently connected to the Mod Duo X. I just have to connect to wifi router to have the web ui. It’s much more easy and a way faster than bluetooth.

1 Like

At the time that it was wrote just 4.1 max was common. We didn’t change it because the problem with Bluetooth 5 is mainly lack of testing, I believe.

You are right. I will double-check if there were more tests and if not I will add at least a note over there.

Of course. You are completely right about this. Is one of the typical issues of set and forget, most people got it working with older versions and that is fine for them so they don’t update. Up to now, that was the majority of our users so with so much work on other fronts we also didn’t put much effort into it. Anyway, I’m checking what is the current stage of Bluetooth 5 on MOD side.

Are you setting the android to “access the internet” via that Bluetooth connection?

1 Like

Yep, but that switch turns off in a second back. From the bluetoothctl it looks the same - Connect: yes, with a following Connect: no.

I did a bit of what I call “dummy Google search” typing something like “Why my Android devices keep switching off Bluetooth access to the Internet” and I found this article. I didn’t read it all or tried it because with my devices everything works fine so I can’t replicate it. Anyway, three things popped up to my eyes:

  • Bluetooth Visibility Timeout
  • Battery Optimization
  • Network Settings

Also apps, but that requires quite a bit more digging on your side.

I’m not sure if it helps. Please let me know

I had exactly the same issue with my Mod Duo X and one of my android device.
I really think the problem is from the Mod Duo X.
Here all is working fine with the Mod Dwarf and not at all with the Mod Duo X.
I’ll send my device with 2 bluetooth dongle that don’t work so Mod team could investigate this issue.

1 Like

As I already told you before is really weird if that’s the case since the implementation is pretty much the same on both devices (either on software or hardware levels). Yet, not impossible that something weird could be happening.

I’ve read the article, and seems like I’ve already tried most the advices or they are just not applicable due to absence of the options in interface. (I’ve looked into developer options as well)

Also, as soon as btmon log says
Result: Connection refused - security block (0x0003) Status: No further information available (0x0000)
and Reason: Authentication Failure (0x05) it is more likely to be related to some handshake fail during establishing connection or pairing, rather than any power management timeouts. (if it was power management - it should work for some time and then loose connection, but it is disconnect is immediate)

I am no bluetooth expert, but for anology - I had to troubleshoot enough of SSL issues, that usually are result of mismatch between client and server capabilites/ciphers/auth methods.
My guess at the moment is that phone requires some auth mechanism that is not available on mod duo x, some mode is not supported or something like that.

Anyway, probably my main way out is to get more and more verbose logs until some messages will lead to the usefull infromation or solution to be googled.

I’ve also recorded bluetooth snoop (trace) , where it is better visibility on destination and source for the traffic packets in Wireshark. As far as I can see, phone is requesting connection and mod duox is rejecting it:

I’ve uploaded this trace to google drive trace - Google Drive just in case. (forum does not allow to attach anything but pictures)

At this point I am trying to understand how bluetoothd is launched on the device, to configure it to get some logs from this service as well.

It could help if you could point me into parts of the mod duo bluetooth stack where I can retrieve more information.

2 Likes

Fair enough. As I said I didn’t really dig deep into the article and just took an overview.

Thanks a lot for all the info. As we already had a couple of reports of this happening, particularly with the MOD DuoX, I guess that maybe an investigation is worthed. I will ping the developers for that.

1 Like

Okay, looks like I found a solution for my 4.0 dongle at least.
I will share my findings, but if somebody except for MOD devs is going to follow my steps - be warned, I have no idea on the side effects, not an expert on the mod devices and bluetooth, I am just a nerd with access to google, and you can break something on your mod device by applying such changes. I am doing this on Mod Duo X to fix my particular issue with a particular dongle.
Also, sadly it did not fix anything for my 5.0 dongle.

With disclaimers done, here is my yet another dirty hack solution, now for the CSR8510 A10 0a12:0001 4.0 dongle.

Preflight check:

You can -probably- more or less safely check if it is a solution in your case by enabling Simple Paring mode just on the fly. It is enabled by running /usr/bin/hciconfig hci0 sspmode 1 when your dongle is plugged in. After running this command, you can try to re-pair your phone to the Mod Duo X , it should not ask for pin code during pairing.

This simple pairing mode will be washed away by replugging the dongle or device reboot/powerycle, and new pairings will fail. Existing pairing information might be preserved though (not sure, i was too concentrated on the permament fix to test it properly, but my foggy memories tell me that I still was able to connect to the mod device with the already properly paired phone even after reboot. Not sure, actually, it was 4am when I was doing this.)

If it does not work, you might also try remove your dongle’s MAC folder in /data/bluetooth by rm /data/bluetooth/YOUR_DONGLES_MAC_ADDRESS_IN_UPPERCASE and powercycle the device and try setting Simple pairing mode again.

Permanent fix

All these actions below are to ensure that Simple Paring mode is enabled on the hci bluetooth device automatically when dongle is being inserted or device is starting. The instruction below is going to modify the system to apply this change permanently for all future pairings and dongles. Therefore it is a potentially dangerous change.

I expect these changes to be washed away with a firmware update though.

  • First of all, I am creating a script /data/fixbt.sh that waits a couple of seconds (allowing bnep service to start up) and enables Simple pairing on the dongle. Waiting is implemented as a ping, lol, because there was no sleep command out the box. Code below uses echo to create this script per line:
echo  "#!/bin/bash"                                    > /data/fixbt.sh
echo  "ping localhost -w 2"                            >> /data/fixbt.sh
echo  "/usr/bin/hciconfig hci0 sspmode 1"    >> /data/fixbt.sh
chmod ugo+x  /data/fixbt.sh
cat /data/fixbt.sh
  • Second, we are going to modify UDEV rules to invoke this script after dongle is connected.
mount / -o remount,rw     # remount filesystem to write mode
cp /etc/udev/rules.d/96-bnep.rules  /data/96-bnep.rules.bkp  #make backup copy of the file we are going to modify.
nano /etc/udev/rules.d/96-bnep.rules     #edit udev rule. Hope you know how to work with nano editor.

We should add the following text to the end of the first line:

, RUN+="/bin/bash /data/fixbt.sh"
Pay attention to the comma , that divides multiple RUNs for the single “add” acion.

This modification forces UDEV to invoke our fix script when dongle is connected.

  • Also I am always cleaning all 00:… folders in /data/bluetooth/ folder between bluetooth experiments.
    These folders are named after mac addreses of your bluetooth dongles, and contain some information on the dongles and other bluetooth devices mod duo is communicating with. My guess is that cleaning these folder forces mod duo x to forget all the faulty pairings I’ve done before
    I am not sure if it matters, actually, or will you even have MACs starting with 00: as well as me.
    Probably you should see folder content by ls /data/bluetooth to make your own opinion on that.

image

Anyway, I clean them with rm /data/bluetooth/00* -r

  • Now let’s reboot the box (maybe I am wrong, but seems like chances are that nothing will be saved on the filesystem if you will just cut the power using power switch. Also it might be not good for the filesystem, i guess.

reboot

  • NOW we can do the powercycle by toggling the power switch back and forth.

  • Actually that’s all. Now, as result, my phone pairs with ModDuoX easilly, it even does not ask for pin. Browser access works via 192.168.50.1 just fine. (slow, but that’s bluetooth)

P.S.

Also, you can check if my fix script is actually doing what it is supposed to do by starting
watch /usr/bin/hciconfig hci0 sspmode

image

  1. unplug bluetooth dongle,
  2. start watching,
  3. plug bluetooth dongle.
  4. watched hciconfig output will appear and write that Simple Paring mode: Disabled
  5. after a couple of seconds it will start showing Simple Pairing mode: Enabled.

If behaviour is as above, my script does what I expect from it and is called by UDEV rule properly.


@jon I guess this proves that issue can be potentionaly fixed on the mod device side. Might it be possible to have this simple pairing mode added to system->bluetooth menu as an option to enable?

4 Likes

Thank you a lot for all the research and sharing this with us @ignis32! :slight_smile:
I will pass it to the dev team since maybe this may help solving certain issues permanently (if it does not break anything else).

Certainly! Also that the issue may be on the MOD device side (what we were not expecting before).

I will save the request…but I guess yes :slight_smile:

2 Likes

I’m wondering if there is an update. I just bought a bluetooth adapter (BT 5, since I thought anything 3 and above would work) and it’s listed as unsupported. It came with directions on how to download the firmware and everything above in this thread is well above my skill set, so I’m not sure what I would do with the firmware. What’s the easiest way to find a BT dongle that will work? Other options (Wifi looks kind of complicated). Here’s the link to the device: https://avantree.com/dg45-usb-bluetooth-dongle-for-pc

Thanks!

1 Like

Bluetooth 5.0 dongles are indeed lagging and require some more testing on our side.

We have a few forum post on that and also a wiki para that is outdated:

2 Likes