Replies: 4 comments
-
Hi! Could you tell me a few more things about how you are using the robot? I think there might be some confusion about how the interfaces work. If you could provide a terminal log of what you're trying to do when you connect to BLE, and the error messages you get, that could be helpful. To be clear, are you running Linux on a M1 MacBook Pro? As far as plugging the robot directly into your Mac, that will likely not work, as the robot is a USB Host, and likely your computer is, as well. The USB-C connection on the robot is not a tty serial device. Have you tried python.irobot.com? That maintains a continuous BLE connection, as opposed to attempting to disconnect and reconnect from example to example; knowing that would help me to help you debug this. |
Beta Was this translation helpful? Give feedback.
-
Hello thanks for the speedy reply. I have tried connecting from MacOS on the M1 Mac. Running python from the terminal to connect Bluetooth. I did also try the usb-C connection but you are correct it doesn’t appear.
Separately I tried on a raspberry pi 4 running Ubuntu 23. It gave a clearer error log when running the python code from the terminal (attached). (And tried the USB-C route as well to no effect).
Running from the web browser is probably not a possible solution because we are going to be running OpenCV and need the robot state machine code to be in the same code base. (Although maybe a socket connection to the browser is possible? I haven’t done that before).
…-Ben
On Aug 23, 2023, at 7:26 AM, Steven Shamlian ***@***.***> wrote:
EXTERNAL EMAIL: Do not click links or open attachments unless you recognize the sender and know the content is safe. Forward suspicious messages to ***@***.***
________________________________
Hi! Could you tell me a few more things about how you are using the robot? I think there might be some confusion about how the interfaces work. If you could provide a terminal log of what you're trying to do when you connect to BLE, and the error messages you get, that could be helpful. To be clear, are you running Linux on a M1 MacBook Pro? As far as plugging the robot directly into your Mac, that will likely not work, as the robot is a USB Host, and likely your computer is, as well. The USB-C connection on the robot not a tty serial device.
Have you tried python.irobot.com? That maintains a continuous BLE connection, as opposed to attempting to disconnect and reconnect from example to example; knowing that would help me to help you debug this.
—
Reply to this email directly, view it on GitHub<#435 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ABLHKXALTBDMQXZKU3BL5I3XWYHHJANCNFSM6AAAAAA32VCZDE>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
Traceback (most recent call last):
File "/usr/local/lib/python3.11/dist-packages/irobot_edu_sdk/robot.py", line 282, in play
self._loop.run_until_complete(self._main())
File "/usr/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete
return future.result()
^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/irobot_edu_sdk/robot.py", line 156, in _main
await self._backend.connect()
File "/usr/local/lib/python3.11/dist-packages/irobot_edu_sdk/backend/bluetooth_desktop.py", line 43, in connect
devices = await BleakScanner.discover(service_uuids=[self.ROOT_ID_SERVICE, self.UART_SERVICE])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/bleak/__init__.py", line 216, in discover
async with cls(**kwargs) as scanner:
File "/usr/local/lib/python3.11/dist-packages/bleak/__init__.py", line 126, in __aenter__
await self._backend.start()
File "/usr/local/lib/python3.11/dist-packages/bleak/backends/bluezdbus/scanner.py", line 191, in start
self._stop = await manager.active_scan(
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/bleak/backends/bluezdbus/manager.py", line 368, in active_scan
assert_reply(reply)
File "/usr/local/lib/python3.11/dist-packages/bleak/backends/bluezdbus/utils.py", line 20, in assert_reply
raise BleakDBusError(reply.error_name, reply.body)
bleak.exc.BleakDBusError: [org.bluez.Error.InProgress] Operation already in progress
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/pi/demo.py", line 18, in <module>
robot.play()
File "/usr/local/lib/python3.11/dist-packages/irobot_edu_sdk/robot.py", line 295, in play
self._loop.run_until_complete(self._finished())
File "/usr/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete
return future.result()
^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/irobot_edu_sdk/robot.py", line 107, in _finished
await self._backend.disconnect()
File "/usr/local/lib/python3.11/dist-packages/irobot_edu_sdk/backend/bluetooth_desktop.py", line 66, in disconnect
await self._client.disconnect()
^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'disconnect'
***@***.***:~$ python3 demo.py
Traceback (most recent call last):
File "/usr/local/lib/python3.11/dist-packages/irobot_edu_sdk/robot.py", line 282, in play
self._loop.run_until_complete(self._main())
File "/usr/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete
return future.result()
^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/irobot_edu_sdk/robot.py", line 156, in _main
await self._backend.connect()
File "/usr/local/lib/python3.11/dist-packages/irobot_edu_sdk/backend/bluetooth_desktop.py", line 43, in connect
devices = await BleakScanner.discover(service_uuids=[self.ROOT_ID_SERVICE, self.UART_SERVICE])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/bleak/__init__.py", line 216, in discover
async with cls(**kwargs) as scanner:
File "/usr/local/lib/python3.11/dist-packages/bleak/__init__.py", line 126, in __aenter__
await self._backend.start()
File "/usr/local/lib/python3.11/dist-packages/bleak/backends/bluezdbus/scanner.py", line 191, in start
self._stop = await manager.active_scan(
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/bleak/backends/bluezdbus/manager.py", line 368, in active_scan
assert_reply(reply)
File "/usr/local/lib/python3.11/dist-packages/bleak/backends/bluezdbus/utils.py", line 20, in assert_reply
raise BleakDBusError(reply.error_name, reply.body)
bleak.exc.BleakDBusError: [org.bluez.Error.InProgress] Operation already in progress
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/pi/demo.py", line 18, in <module>
robot.play()
File "/usr/local/lib/python3.11/dist-packages/irobot_edu_sdk/robot.py", line 295, in play
self._loop.run_until_complete(self._finished())
File "/usr/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete
return future.result()
^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/irobot_edu_sdk/robot.py", line 107, in _finished
await self._backend.disconnect()
File "/usr/local/lib/python3.11/dist-packages/irobot_edu_sdk/backend/bluetooth_desktop.py", line 66, in disconnect
await self._client.disconnect()
^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'disconnect'
|
Beta Was this translation helpful? Give feedback.
-
OK. I'm going to move this ticket to the python SDK repo because I believe this to be a problem with the use of the SDK and not the robot. Note that the SDK is currently under beta but we'll do our best to get you up and running. Catch you over there |
Beta Was this translation helpful? Give feedback.
-
Just sending another message because I can't |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
How are you connecting to your Create 3?
Bluetooth (Python SDK)
Computer(s) Model(s) and Operating System(s)
M1 MacBook Pro Ventura 13.1
Which version of ROS 2 is installed on your computer?
None
Which firmware version is installed on your robot?
G.5.3
Which RMW is your robot running?
I don't know
Does your robot have an assigned namespace? If so, please share.
No response
Is the robot connected to a network? If so, what is the network type?
No response
Are there multiple Create 3 robots connected to your network?
None
Is multicast enabled?
None
What is the Adapter Board's USB/BLE Toggle currently switched to?
Bluetooth (default)
Describe your question.
I renamed the bluetooth interface via the wifi hotspot to iRobot107 as I need to be able to specify which robot to connect to. Using the python SDK square example (16) and the play frequencies (19) I am occasionally able to get the code to connect, but it seems to get stuck on the disconnect. The SDK examples are very simple, so there seems to be a major issue in the reliability of these connections. I updated python from 3.9 to 3.11 and no effect. Any help would be appreciated.
I also tried plugging into the USB port and switching over to that form, but no serial device appeared under /dev
Has anyone had better luck connecting over USB on linux? I will be mounting a raspberry pi for camera streaming, so it can easily be plugged into that port...
Beta Was this translation helpful? Give feedback.
All reactions