Bluetooth low energy - Input/output error - bluetooth

When I do
hcitool lescan
sometimes I saw this error
Set scan parameters failed: Input/output error
or
Set scan parameters failed: File descriptor in bad state
I know i can reset the bluetooth interface.
However, is it possible to see the log or get any information to know the root cause of this error?
Thanks

You can get more information using BlueZ's hcidump and btmon command line tools. You can find more information here:-
btmon usage
hcidump usage

Related

Enabling static pin for bluetooth authentication BlueZ (Linux) error in bt-agent

I am trying to enable a static pin/password authentication entry for devices that are trying to connect to my raspberry pi. I have tried various methods including using bt-agent tools, while configuring sspmode to 0 using hciconfig. bt-agent tool sometimes works, but often times results in seg faults. Are there any better alternatives to enable a static pin on my bluetooth connection?
I have done some further debugging with bt-agent tool. The bt-agent tool is able to correctly verify the password. The device is able to connect for a fraction of a second, but then error pops up in client device saying incorrect pin. Upon further debugging, I found in /var/log/syslog the following error pertaining to DBUS that happens exactly at pairing time: Agent /org/blueztools replied with an error: org.freedesktop.DBus.Error.NoReply, Message did not receive a reply (timeout by message bus).
FYI, I am using a Raspberry Pi.

bluetoothctl don't find my device whereas hcitool can/Can't find device if not trusted

In relation to this post
Is there any answers to this topic ? Because I have the same problem and HackToHell asked to continue on AskUbuntu chat which is not available anymore
Actually i could find my device on Bluetoothctl, i trusted it once and i could see it everytime, but for now that it is untrusted, i can only see it with btmon, that is painful haha. I set all the devices discovering filters but still no effects. With sudo hcitool lescan --duplicates i can see my devices also
So how can i found it back ?
I tried rebooting, restarting Bluetooth, reconfiguring Bluetooth, putting hci0 to reset, down and up states, etcetc but still nothing comes out ...
and i have the flags -C and --experimental in the file /lib/systemd/system/bluetooth.service after execstart=... line
Benjamin
Upgrade your Linux kernel to 5.1.6 or above.
The issue fixed in this release has to do with buggy Bluetooth controller firmware, that would send a completion event twice, making the kernel turn the scan into a passive scan, therefore not creating device found events.
Kernel -> controller: LE Set Random Address
Controller -> kernel: Command "LE Set Random Address" Complete
Kernel -> controller: LE Set Scan Parameters (active scan)
Controller -> kernel: Command "LE Set Random Address" Complete
The kernel would previously have assumed it could not set the scan to and active scan, so it resumes as a passive scan instead.
Relevant commit is: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=a3d50fb7ce931f08a2c6194fdc4c9a56c9ed4153
You can verify you have this issue by running btmon.

Unable to get connect with bluetooth in sim800

I have Sim800 modem and trying to get connected with the bluetooth of the module but when I send command AT+BTPOWER=1 it returns error so I am unable to get connected.
anyone can help in this????
Your version of Sim800 can be without supporting BT by hardware
If your module has hardware support, try to update firmware
Try command BT+STATUS? probably BT module already powered on
Came late to discussion but I must say that you have to turn it off before turning it on. If you try just setting BTPOWER=1 it'll return ERROR, at least for me.
AT+BTPOWER=1
ERROR
If I set it to 0 before setting to 1 I have success.
AT+BTPOWER=0
OK
AT+BTPOWER=1
OK

Raspberry btmon --server parameter

I am looking for a solution to monitor BLE devices near my raspberry with their RSSI value. So far I am done with monitoring, all devices and the current rssi value is displayed on screen, but I would like to
store the values in a database or
send them to RabbitMQ (either solution is fine).
I am using btmon for monitoring which has a switch "-s" or "--server". Unfortunately I did not find any useful documentation on it (might be my fault). I thought this might start monitoring in a way that I can query it from another application. Any clue?
The other solution could be node.js/noble, but noble installation always fails.
Well, btmon could not be my solution as device discovery needs to be triggered with hcitool lescan which does not have a recurrence parameter (only hcitool scan has). The solution finally was node.js/noble. The installation failed, because I tried to do it with the latest version of noble.js. Going back to 10.x solved the problem.

Fixed bit rate using iwconfig with Tl-WN722N dongle

As the title suggest, then I am trying to set a fixed bit rate on my dongle.
I am using a TP-Link wifi dongle model TL-WN722N. However, when I give the
command: iwconfig wlanX rate 2M fixed iget the following response:
Error for wireless request "Set Bit Rate" (8B20). But if i give it as sudo, then i dont get this error but running iwconfig reveals that it is not set.
My question is do any one have some experience in setting a fixed data rate on their wifi dongle ? ... if yes what kind of dongle are you using ... and also what command (if it is not iwconfig rate)
thx in advance
You should run this command with Sudo as you did.
The command will take, but the driver will not listen to this for the WN722N.
I am sure if you try this with your built in adapter or any other adapter if present; you will see that your command works.
I have personally tested this right now with the WN722N on Ubuntu v14 and I'm getting the same error.
Also, iw may give you more control for setting bitrate: http://linuxwireless.org/en/users/Documentation/iw/#Modifying_transmit_bitrates

Resources