Following the instructions for the mangoh yocto bluetooth driver build, I can get the bluetooth drivers to load and initialize correctly on my FX30S running legato 16.10.1:
But I can’t get the WL1831 IOT card to show up: hciattach times out trying to attach any of the available devices.
Does anyone know how to attach to the bluetooth driver on the FX30S?
The FX30S has /dev/ttyHS0 as it’s serial port and /dev/ttyHSL1 as it’s other multiplexed UART port: I’ve tried mapping both UARTs to legato applications ( AT!MAPUART? gives 17,17 ):
./hciattach -r /dev/ttyHS0 bcsp 115200
BCSP initialization timed out
yes, it was HSL0…if you get that modprobe error, try doing
dmesg | grep -i 'bluetooth'
and see if the bluetooth drivers show up. That error means that the bluetooth drivers didn’t get built in to the yocto image. If you followed the guide you made have run into this problem here . It will require rebuilding the image but this time with a -f (minus f) in the first bitbake command:
I tried that but no luck. But I am using an FX30S which is not the same as the FX30 as far as UART mappings go, surely ? And also, there is an issue with the FX30/ FX30S and tiwifi, so that may have something to do with it (but I don’t know for sure). I’ll try an FX30 tomorrow instead of an FX30S.
tiwifi - as pre-installed - is configured for mangoh. It has to be changed as per this post .
I don’t know if that also affects the bluetooth driver, I’ve just started looking at it, but they are on the same card so maybe that could be relevant to this problem.
Hello,
First, thank you @mahtab
I tried the same on my FX30 and I got the same initialization error when I start the application: =ERR= | bt-init.sh[5492] | Initialization timed out. =ERR= | bt-init.sh[5492] | Can't get device info: No such device
My UART is configured in mode 17: root@fx30:~# microcom -E /dev/ttyAT at!mapuart? !MAPUART: 17,17
OK
And I connect on HSL1.
I did not make any change regarding twifi on my FX30 if that is of importance.
About the bluetooth util app, I commented the following lines: if [ ! -d "/sys/class/gpio/gpio13" ]; then echo 13 > /sys/class/gpio/export fi echo up > /sys/class/gpio/gpio13/pull sleep 1
mux 1 # UART1 to IoT slot 0 mux 15 # Take IoT slot 0 out of reset sleep 1
Because there is no mux command on the FX30 and there is only 1 IoT Card port. So maybe there is an issue related to this part I had to comment. @mahtab, did you do the same?
Yeah I’m basically at the same place you are…and stuck too. The configuration has to be different for the FX30 than it is for mangOH, more than just using a different /dev/tty* to attach to. I notice that gpio47 is no longer available on the FX30 when it has that cwe flashed on it, I think that’s a clue that somewhere some tweaking needs to be done. Changing the tiwifi script hasn’t helped, I will try to investigate but if anyone else has any solutions it would be really helpful.
@cchenry I’ve done that, and something does happen - the firmware file gets picked up. The subsequent error is a different one, as below:
root@fx30:/legato/systems/current/appsWriteable/bluetoothUtil/bin# sh ./bt-init.sh
PWD is: /legato/systems/current/appsWriteable/bluetoothUtil/bin
Found a Texas Instruments' chip!
Firmware file : /legato/systems/current/apps/bluetoothUtil/read-only/bin/TIInit_11.8.32.bts
Loaded BTS script version 1
texas: changing baud rate to 3000000, flow control to 1
Can't init device hci0: Cannot assign requested address (99)Can't initialize device: Cannot assign requested address
Can't get device info: No such device:
According to the TI wilink website, the chip looks for the firmware file in the /lib/firmware directory, is there any way to put it there by default ( putting the card in and out is a tad impractical )
I also tried building the TI_ST driver in to the yocto build, but I don’t think it’s worked
OK, a bit of further investigation reveals that hciattach is complaining about initializing the MAC address of the bluetooth part of the TI wl1832 IOT card. I suspect the problem is a bit deeper than that though because trying to manually set the MAC address with, for example:
doesn’t work; hcitool complains about ‘a bad file descriptor’. Rebuilding the binaries in the bluetoothUtils project by dpfrey with the latest versions also doesn’t work.
I also tried but still the same root@fx30:/legato/systems/current/appsWriteable/bluetoothUtil/bin# ./bt-init.sh PWD is: /legato/systems/current/appsWriteable/bluetoothUtil/bin Initialization timed out. Can't get device info: No such device
I do not have a texas sensor but I have another bluetooth sensor, maybe it could explain why I do not have anything even if I suppose the bluetoothUtil should be universal for all bluetooth sensors
If you don’t have a texas sensor, you may have to change the bletoothUtil app. The TIInit_11.8.32.bts file in the bluetoothUtil/bin directory is specifically for TI Wilink chips and even then a specific subset of them. Also I guess you’d need to change the ‘texas’ in
hciattach /dev/ttyHS0 texas 115200 flow
to whichever your device is ( you can check this man page here or search further for your device…i think ‘any’ is an acceptable parameter as well
There should be a patch (bluez-00-custom_ti_firmware_directory.patch) that changes the location of the firmware file to:
/legato/systems/current/apps/bluetoothUtil/read-only/bin
The build_bluez_util script doesn’t work. I have tried it on different legato versions. On 16.10.1 it builds but hciattach doesn’t run. On 17.6.0 it doesn’t build, crashes out with the error:
config.status: error: cannot find input file: `expat_config.h.in'
Failed in build_bluez_utils.sh:68
But anyway, the versions of the bluez binaries packaged in the demo are already patched ones aren’t they ?
that’s missing a comma - and there’s a compiler warning, but it goes ahead and builds anyway. I changed it and hardcoded the string to the directory and filename, the warning goes away and it builds, but I still have some either shell issues or compile issues on my system, because I get errors like
./hciattach: line 1: syntax error: unexpected ")"
./hciconfig: line 4: syntax error: unexpected ")"
I’d like to fix those and get the hci tools going with everything up to date.
Hi,
So, I finally get the time to try with any, and I get an error at the end: root@fx30:/legato/apps/e0d0a1631b75f51c01a659e398b5c876/read-only/bin# ./bt-init.sh PWD is: /legato/apps/e0d0a1631b75f51c01a659e398b5c876/read-only/bin Device setup complete hci0: Type: BR/EDR Bus: UART BD Address: 00:00:00:00:00:00 ACL MTU: 0:0 SCO MTU: 0:0 DOWN INIT RUNNING RX bytes:0 acl:0 sco:0 events:0 errors:0 TX bytes:4 acl:0 sco:0 commands:1 errors:0 Can't init device hci0: Connection timed out (110)
I do not know if this is due to my bluetooth device requiring some action or something else to be attached.
I will try with another bluetooth device tomorrow.
And after hci0 get initialized, I am not sure how to talk with the bluetooth device…