-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bluetooth.btcommon.BluetoothError: [Errno 111] Connection refused #76
Comments
Did u find any fixes? |
@MadFlasheroo7 no I haven't yet, waiting for the author of the project to respond. |
This error could be caused by many reasons. Some devices are not supported by this script and some have issues. I need to have access to the specific device in order to debug and test. You can try the workarounds mentioned in the readme file, maybe that fixes the issue. |
Same issue here, would like to help on this although i can't send you a phone. Telegram @toxicbyte The actual failure is when its trying to itterate through sock object: I've been doing some smalll debugging and noticed the UUID isn't listed on my device (Galaxy S10 - OS: 9.0) Here's what it lists though: Please contact me if you want help with resolving. I can help debug a bit. |
Connection is opening and connecting: Under class SocketDataIterator return the received socket data is being held up. have tried different chunk sizes, etc. Any ideas why the socket is unable to receive data back? EDIT: Here's the AT command to fetch battery info via AT on samsung: |
@P3nguin-M Good job with the debugging. Can you also sniff the commands using this trick and send me the capture file? Include your logcat as well. |
I just wanted to clarify -- I'm using this tool not to read battery but just communicate with bluetooth stack using linux PC with bluetooth USB chip and bluetoothctl. Although I believe it's sending the AT commands I am not seeing ANY in the log i dumped after connecting it to my machine and running your script on it. I get past the socket connection, but it freezes on the read. |
This script is written only with battery level in mind. The commands which are being sent to the device might be wrong, and the device stops answering back. You can add debug prints to the program to see what is being sent/received. You can also look for similar commands in the logcat that you found before, and update the code. |
I figured if i can get the bluetooth battery stuff working i can modify afterwards to send the AT commands i extracted from the device's firmware. |
The code is fairly small. You can remove all the battery stuff and replace your own commands. I don't remember any script that does what you want but there was a java app called 'AT Command Tester' I think.
The headset sends commands with the 'at+' prefix but the response doesn't have that. We got these commands and their responses mostly by reading Bluetooth captures, and that's what we found there. I'm not an expert in this. |
how can i contribute add support for my devices |
@MadFlasheroo7 By capturing the Bluetooth connection from your phone and the headset, then analyzing the commands being sent/received. Then you can change code in order to support your device. It needs a lot of debugging and trial and error to get things working, plus there is no guarantee that it will work. |
What mode is this bluetooth device supposed to be in? When i issue MAC.2 -> "Connected for calls" is shown. |
For Bluetooth headsets, we'll use the RFCOMM uuid to get the desired port number. Perhaps you can use the UUIDs that you have to find the port that suits your needs. |
Pulled apart the bluetooth apk on this S10 i have and found the commands it will take:
output: |
Should my android device be rooted? And kindly tell the process to log commands too |
No I don't think so. You can check this comment for more info. |
interestingly, |
@TheWeirdDev I don't know if it's the right place where to post this, but I experience If you can't fix it yourself, can you guide me on how to do it myself? Thanks in advance!
in my experience you have to. On my Android 11 it got saved in |
@carlocastoldi Your log file seems OK and the script should work, but the error 111 happens when the socket connection wasn't successful, so there was no way to send or receive commands. Did you try changing the port number? Try to figure out why it can't connect, then you can check if commands work. |
i actually got busy with my college stuff so once i root my device ill let u know |
i have a Soundcore Anker Life Q20 this testing was done one a brand new pair, first thing i did upon receiving them in the mail was to pair and connect them to my computer and play some music on them while i did this testing |
Installation is done with
yay -S python-bluetooth-battery
command run
bluetooth_battery $(bluetoothctl info | awk '/^Device/ {print $2}')
and
sudo bluetooth_battery $(bluetoothctl info | awk '/^Device/ {print $2}')
Error received
---- Update ----
Tried Manual installation, returned with the same error
Also tried to run with docker, returned with the same error.
---- Conculsion ----
Problem lies in the project/script not in the underlying or user's OS.
The text was updated successfully, but these errors were encountered: