Skip to content
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

Device with address MA:CA:DD:RE:SS:12 was not found. It may have been removed from BlueZ when scanning stopped. #23

Closed
JEREDEK opened this issue Jul 25, 2023 · 12 comments
Assignees
Labels
invalid This doesn't seem right question Further information is requested

Comments

@JEREDEK
Copy link

JEREDEK commented Jul 25, 2023

I cannot start any example, as when i try running any, i get this error.

Connecting to MA-CA-DD-RE-SS-12 (MA:CA:DD:RE:SS:12)
Traceback (most recent call last):
File "/home/pekabex/lidar.py", line 28, in
robot.play()
File "/home/pekabex/.local/lib/python3.10/site-packages/irobot_edu_sdk/robot.py", line 282, in play
self._loop.run_until_complete(self._main())
File "/usr/lib/python3.10/asyncio/base_events.py", line 646, in run_until_complete
return future.result()
File "/home/pekabex/.local/lib/python3.10/site-packages/irobot_edu_sdk/robot.py", line 156, in _main
await self._backend.connect()
File "/home/pekabex/.local/lib/python3.10/site-packages/irobot_edu_sdk/backend/bluetooth_desktop.py", line 58, in connect
if await self._client.connect():
File "/home/pekabex/.local/lib/python3.10/site-packages/bleak/init.py", line 471, in connect
return await self._backend.connect(**kwargs)
File "/home/pekabex/.local/lib/python3.10/site-packages/bleak/backends/bluezdbus/client.py", line 185, in connect
raise BleakDeviceNotFoundError(
bleak.exc.BleakDeviceNotFoundError: Device with address MA:CA:DD:RE:SS:12 was not found. It may have been removed from BlueZ when scanning stopped.

@shamlian
Copy link
Collaborator

Can you show what you are typing to get this error? It looks like you are specifying an invalid robot MAC address.

@shamlian shamlian self-assigned this Jul 25, 2023
@shamlian shamlian added invalid This doesn't seem right question Further information is requested labels Jul 25, 2023
@shamlian
Copy link
Collaborator

shamlian commented Aug 7, 2023

Closing as invalid, please re-open if you can give me more info to reproduce.

@shamlian shamlian closed this as not planned Won't fix, can't repro, duplicate, stale Aug 7, 2023
@DenizAydin99
Copy link

DenizAydin99 commented Jan 3, 2024

I'm having the exact same problem on my raspberry pi 3. I'm trying to establish connection using the Bluetooth function of irobot-edu-sdk in my python script (it worked on my macbook and I was able to control the create3 using the keyboard). I ran a ble scan on raspberry pi to check if create3 was dicoverable via Bluetooth and the robot was listed there with the correct MAC address (the same address that I saw on my macbook when I ran the script).

@shamlian shamlian reopened this Jan 3, 2024
@shamlian
Copy link
Collaborator

shamlian commented Jan 3, 2024

Could you please give me your BlueZ version? I'm wondering if this is related to #3 or https://bleak.readthedocs.io/en/latest/troubleshooting.html#id4 ; unfortunately in BlueZ prior to 5.62, it was necessary to explicitly remove devices from the GATT cache.

@DenizAydin99
Copy link

My BlueZ version seems to be 5.55

I ran “sudo apt-get upgrade bluez” on raspberry pi and it still prints 5.55 after the update. Would you in this case recommend to remove devices from the GATT cache? As far as I can remember, the Bluetooth connection worked for once on pi. So it probably should be removed manually, since the first try was successful.

@shamlian
Copy link
Collaborator

shamlian commented Jan 4, 2024

You have two options, I think: either to upgrade BlueZ without the package manager, or to explicitly remove the device from the GATT cache before each run. Neither is great but both are doable. You can confirm that the latter works by typing bluetoothctl remove MA:CA:DD:RE:SS:## (where MA:CA:DD:RE:SS:## is your mac address) and then seeing if the program works. If you want to try updating BlueZ without the package manager, there was a user who I helped to do that here #24 , explicitly in this comment.

@DenizAydin99
Copy link

DenizAydin99 commented Jan 6, 2024

I tried to remove the mac address manually but got an error like “‘mac address’ - device not available”. Then I uninstalled the blueZ and installed the blueZ 5.66. I’m now able to connect via bluetooth without any issues. Thank you for responding so quick

@DenizAydin99
Copy link

I rebooted the raspberry pi today and I found out that the raspberry pi can no longer find the bluetooth device (it has the receiver installed on it). hciconfig and hcitool commands could not be found and bluetoothctl gets stuck in terminal. In addition to that, systemctl status bluetooth returned the status as inactive (dead).

I tried to uninstall the BlueZ again but package manager could not find the BlueZ and didn’t remove any files since I installed it manually (it couldn’t find the new path I think)

@shamlian
Copy link
Collaborator

shamlian commented Jan 9, 2024

Sounds like something went wrong with your BlueZ installation from source. You could try

sudo make install
sudo systemctl daemon-reload
sudo systemctl unmask bluetooth.service
sudo systemctl restart bluetooth

from the directory you had previously made BlueZ in, or else you could sudo make uninstall the custom version and then reinstall the package manager version (which is pinned to whatever it was when you started), but then you will have to remove the device from the cache before each time you run the script.

@shamlian shamlian closed this as completed Jan 9, 2024
@shamlian shamlian reopened this Jan 9, 2024
@shamlian
Copy link
Collaborator

shamlian commented Jan 9, 2024

sorry -- keeping this open in case you have any questions -- but this is not a problem with the library itself, as far as I can tell.

@DenizAydin99
Copy link

Yes, you were right. Everything was fine after manually installing the BlueZ again.

Appreciate your guidance

@shamlian
Copy link
Collaborator

Closing invalid, again.

@shamlian shamlian closed this as not planned Won't fix, can't repro, duplicate, stale Jan 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This doesn't seem right question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants