Bluetooth WL18xx driver for mangOH issue

Hi @dfrey, once R11 is installed, do you have the steps to get BT to work on mangOH Red+WL18 IoT card? Thanks.

when I run bluetoothUtil I got:

Jan 6 00:07:29 | bt-init.sh[2059] | | modprobe: module hidp not found in modules.dep
*Jan 6 00:07:32 | bt-init.sh[2059] | | /legato/systems/current/apps/bluetoothUtil/read-only/bin/bt-init.sh: *
*Jan 6 00:07:32 | bt-init.sh[2059] | | line 27: *
Jan 6 00:07:32 | bt-init.sh[2059] | | mux: not found
*Jan 6 00:07:32 | bt-init.sh[2059] | | *
*Jan 6 00:07:32 | bt-init.sh[2059] | | /legato/systems/current/apps/bluetoothUtil/read-only/bin/bt-init.sh: *
*Jan 6 00:07:32 | bt-init.sh[2059] | | line 28: *
Jan 6 00:07:32 | bt-init.sh[2059] | | mux: not found

and ‘bluetoothctl’ fails on any command:
root@swi-mdm9x28-wp:~# bluetoothctl
process 2027: arguments to dbus_connection_get_object_path_data() were incorrect, assertion “connection != NULL” failed in file …/…/dbus-1.10.10/dbus/dbus-connection.c line 5904.
This is normally a bug in some application using the D-Bus library.

I installed “9999999_9907618_SWI9X06Y_02.22.12.00_00_GENERIC_001.051_000-full.spk”. I copied “TIInit_11.8.32.bts” from the mangOH git repo into “/lib/firmware/ti-connectivity/”.

  1. Ensure that UART1 is set for embedded application use.
    AT!MAPUART=17,1
    AT!RESET
    at!mapuart?
    !MAPUART: 17,16
    I got a little bit further with the below script.

modprobe hci_uart
sleep 1
modprobe bluetooth
sleep 1
modprobe rfcomm
sleep 1
modprobe hidp
sleep 1
modprobe bnep
sleep 1

#Set IoT card GPIO3 to high
if [ ! -d “/sys/class/gpio/gpio7” ]; then
echo 7 > /sys/class/gpio/export
fi
echo out > /sys/class/gpio/gpio7/direction
echo 1 > /sys/class/gpio/gpio7/value
sleep 1

#Take the IoT card out of reset
if [ ! -d “/sys/class/gpio/gpio2” ]; then
echo 2 > /sys/class/gpio/export
fi
echo out > /sys/class/gpio/gpio2/direction
echo 1 > /sys/class/gpio/gpio2/value
sleep 1

hciattach /dev/ttyHS0 texas 115200 flow
sleep 1

root@swi-mdm9x28-wp:~# sh red-bt-init.sh
modprobe: module hidp not found in modules.dep
Found a Texas Instruments’ chip!
Firmware file : /lib/firmware/ti-connectivity/TIInit_11.8.32.bts
Loaded BTS script version 1
texas: changing baud rate to 3000000, flow control to 1
Device setup complete
root@swi-mdm9x28-wp:~# hciconfig
hci0: Type: Primary Bus: UART
BD Address: 5C:31:3E:DF:D7:57 ACL MTU: 1021:6 SCO MTU: 180:4
UP RUNNING
RX bytes:891 acl:0 sco:0 events:33 errors:0
TX bytes:415 acl:0 sco:0 commands:33 errors:0

root@swi-mdm9x28-wp:~# hciconfig hci0 up

But then I run into the bluetoothctl issue that you are facing :frowning:

You have to start the daemon before running bluetoothctl:

root@swi-mdm9x28-wp:~# ./bt-gpio.sh
root@swi-mdm9x28-wp:~# hciattach /dev/ttyHS0 texas 115200 flow
Found a Texas Instruments’ chip!
Firmware file : /lib/firmware/ti-connectivity/TIInit_11.8.32.bts
Loaded BTS script version 1
texas: changing baud rate to 3000000, flow control to 1
Device setup complete
root@swi-mdm9x28-wp:~# /usr/libexec/bluetooth/bluetoothd &
root@swi-mdm9x28-wp:~# bluetoothctl
[NEW] Controller 10:CE:A9:FF:FE:A7 BlueZ 5.41 [default]
[bluetooth]#

The daemon is having issues with D-Bus. I need to spend some time to understand why. I am able to scan and find devices though :slight_smile:

root@swi-mdm9x28-wp:~# hcitool -i hci0 scan
Scanning …
E0:33:8E:2F:63:9D iPhoneXS
root@swi-mdm9x28-wp:~# /usr/libexec/bluetooth/bluetoothd &
root@swi-mdm9x28-wp:~# D-Bus setup failed: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory

[1]+ Done(1) /usr/libexec/bluetooth/bluetoothd
root@swi-mdm9x28-wp:~#

thank you!.
may I ask where you got this .spk?
using leaf command I have found 9999999_9907618_SWI9X06Y_02.22.12.00_00_GENERIC_001.051_000.spk
(without ‘-full’ at the end)
is it same as yours? you have copied it to /tmp folder of device and do ‘fwupdate download …’ ?
‘red-bt-init.sh’ comes with this spk?

bt-gpio.sh is the same as these GPIO enables a few posts back, it also includes an enable on GPIO 13 but maybe that’s not needed.

#Set IoT card GPIO3 to high
if [ ! -d “/sys/class/gpio/gpio7” ]; then
echo 7 > /sys/class/gpio/export
fi
echo out > /sys/class/gpio/gpio7/direction
echo 1 > /sys/class/gpio/gpio7/value
sleep 1
#Take the IoT card out of reset
if [ ! -d “/sys/class/gpio/gpio2” ]; then
echo 2 > /sys/class/gpio/export
fi
echo out > /sys/class/gpio/gpio2/direction
echo 1 > /sys/class/gpio/gpio2/value

this fails:

root@swi-mdm9x28-wp:~# ./bt-init.sh
PWD is: /home/root
modprobe: module hidp not found in modules.dep
./bt-init.sh: line 41: mux: not found
./bt-init.sh: line 42: mux: not found
Found a Texas Instruments’ chip!
Firmware file : /lib/firmware/ti-connectivity/TIInit_11.8.32.bts
Loaded BTS script version 1
texas: changing baud rate to 3000000, flow control to 1
Device setup complete
hci0: Type: Primary Bus: UART

  •    BD Address: C8:DF:84:44:B4:D4  ACL MTU: 1021:6  SCO MTU: 180:4*
    
  •    UP RUNNING*
    
  •    RX bytes:609 acl:0 sco:0 events:30 errors:0*
    
  •    TX bytes:401 acl:0 sco:0 commands:30 errors:0*
    

root@swi-mdm9x28-wp:~# /usr/libexec/bluetooth/bluetoothd &
root@swi-mdm9x28-wp:~# D-Bus setup failed: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory

[1]+ Done(1) /usr/libexec/bluetooth/bluetoothd
root@swi-mdm9x28-wp:~# bluetoothctl
process 1963: arguments to dbus_connection_get_object_path_data() were incorrect, assertion “connection != NULL” failed in file …/…/dbus-1.10.10/dbus/dbus-connection.c line 5904.
This is normally a bug in some application using the D-Bus library.

  • D-Bus not built with -rdynamic so unable to print a backtrace*
    Aborted
    root@swi-mdm9x28-wp:~#

I have repeated all step and see same as you have described. I can scan BT devices, but ‘D-Bus setup failed’

thank you!

Hi @mango, It looks like the R11 WP77 Linux still has some drivers/tools missing which are needed by bluez. I’ve not tried the customizing the Yocto/Linux approach yet. Looking at different threads, the mangOH yellow with WP77 should have all the tools integrated with it.

in other words, it means that in fact mangOH Red with WP7702 and WL18 IoT does not have Bluetooth capability, right?

in fact android BLE scanner can see mangOH BLE endpoint and mangOH can see android, but ‘connect’ fails on both sides :frowning:

Do you have a WP76? If you do, you can try the recently release WP76 R13 FW(https://source.sierrawireless.com/resources/airprime/software/wp76xx/wp76xx-firmware-latest-release/) which includes all the BT tools by default. I was able to use R13 out of the box using red-bt-init.sh (707 Bytes) and pair with a Ti Sensor Tag.

root@swi-mdm9x28-wp:~# cm info
Device: WP7603
IMEI:
IMEISV: 6
FSN:
Firmware Version: SWI9X07Y_02.28.03.01 000000 jenkins 2019/04/17 03:08:11
Bootloader Version: SWI9X07Y_02.28.03.01 000000 jenki[ 52.979412] i2c-msm-v2 78b8000.i2c: NACK: slave not responding, ensure its powered: msgs(n:1 cur:0 tx) bc(rx:0 tx:2) mode:FIFO slv_addr:0x3a MSTR_STS:0x0c1300c8 OPER:0x00000090
ns 2019/04/17 03:08:11
MCU Version: 002.011
PRI Part Number (PN): 9909063
PRI Revision: 001.000
Carrier PRI Name: ATT
Carrier PRI Revision: 002.071_000
SKU: 1104338
Last Reset Cause: Reset, User Requested
Resets Count: Expected: 61 Unexpected: 1
root@swi-mdm9x28-wp:~# cat /etc/legato/version
Build created at 2019-04-17_04:25:07

Yocto build version: SWI9X07Y_02.28.03.01

Build host: jenkins
Versions:
firmware: SWI9X07Y_02.28.03.01
poky: yocto-2.5.2-57-g58e82c4
meta-openembedded: 8760fac
meta-swi: (SWI9X07Y_02.27.01.00) 70ce21c
meta-swi-extras: (SWI9X07Y_02.27.01.00) 06ea5c6
linux-quic-quic: 3.18.131
root@swi-mdm9x28-wp:~# ./red-bt-init.sh
ash: write error: Device or resource busy
Found a Texas Instruments’ chip!
Firmware file : /lib/firmware/ti-connectivity/TIInit_11.8.32.bts
Loaded BTS script version 1
texas: changing baud rate to 3000000, flow control to 1
Device setup complete
hci0: Type: Primary Bus: UART
BD Address: 5C:31:3E:DF:D7:57 ACL MTU: 1021:6 SCO MTU: 180:4
UP RUNNING
RX bytes:609 acl:0 sco:0 events:30 errors:0
TX bytes:401 acl:0 sco:0 commands:30 errors:0

Go for it!
root@swi-mdm9x28-wp:~# bluetoothctl
Agent registered
[bluetooth]# agent on
Agent is already registered
[bluetooth]# scan on
Discovery started
[CHG] Device 50:D5:B4:44:B8:17 RSSI: -82
[CHG] Device 50:D5:B4:44:B8:17 RSSI: -93
[NEW] Device 24:71:89:C0:2C:83 24-71-89-C0-2C-83
[CHG] Device 50:D5:B4:44:B8:17 RSSI: -68
[CHG] Device 24:71:89:C0:2C:83 TxPower: 0
[CHG] Device 24:71:89:C0:2C:83 Name: CC2650 SensorTag
[CHG] Device 24:71:89:C0:2C:83 Alias: CC2650 SensorTag
[CHG] Device 50:D5:B4:44:B8:17 RSSI: -76
[bluetooth]# scan off
Discovery stopped
[bluetooth]# pair 24:71:89:C0:2C:83
Attempting to pair with 24:71:89:C0:2C:83
[CHG] Device 24:71:89:C0:2C:83 Connected: yes
Pairing successful
[CHG] Device 24:71:89:C0:2C:83 Name: SensorTag 2.0
[CHG] Device 24:71:89:C0:2C:83 Alias: SensorTag 2.0
[CHG] Device 24:71:89:C0:2C:83 Modalias: bluetooth:v000Dp0000d0110

The next WP77 FW release should also include all the tools by default for BT.

no we do not have WP76 :frowning: but what is major difference between WP77 and WP76 ?
Can it be that WP76 firmware will work on WP77 (at least bluetooth part) ?

when it is planned? we have limited timeframe and should provide solution to customer with WP7702 and BT.
Would linux.cwe from WP76 release work on WP7702 ? or may be somebody could port changes from WP76 linux branch to WP77 to get it fast?
thank you

The WP76’s FW cannot be used with WP77 as they are 2 different modem families. WP76s are CAT1/CAT4 and WP77s are CAT-M/NB/2G. You can refer the spec sheets for the modems at https://source.sierrawireless.com/.
I don’t know the release dates for the next WP77 firmware but it should be available in next couple of months or so.

will it be correct to say that ‘bluetooth’ officially not supported on WP7702 until next firmware release ?

What’s your use case? Are you planning to discover other sensors ?

our application exchange data with smartphone over BLE and with SIM using APDU commands, no other sensors used