pybricksdev icon indicating copy to clipboard operation
pybricksdev copied to clipboard

run command Bluetooth timeout issue on Linux

Open Eggmanplant opened this issue 2 years ago • 5 comments

Read the title. Distro: Fedora Linux 39

Eggmanplant avatar Jan 18 '24 16:01 Eggmanplant

This is not very much details to go on. Can you please give the exact steps to reproduce the problem and share the full output of the error?

dlech avatar Jan 18 '24 16:01 dlech

Trying to connect with my boost hub, the light stops blinking, but the script is still searching, and some seconds after the script throws out an timeout error, and the hub light starts blinking again.

Eggmanplant avatar Jan 19 '24 08:01 Eggmanplant

For comparison, does everything work normally if you code it with https://code.pybricks.com/ ?

laurensvalk avatar Jan 19 '24 08:01 laurensvalk

Sometimes, but I want to code with an other IDE.

Eggmanplant avatar Jan 19 '24 08:01 Eggmanplant

I'm now using the Pybricks Code IDE but built on the pc using yarn because that paid features are distracting me.

Eggmanplant avatar Jan 19 '24 08:01 Eggmanplant

I had similar issues with Linux (Debian based). The bluetooth connection times out very fast, at least compared to Windows. I have reconnect the hub (bluetooth) after a few minutes of inactivity. I quess it is a Linux issue and not pybricksdev related. However, if someone has an idea how to prolong the blu connection, I would be very grateful.

panthertrader avatar May 27 '24 11:05 panthertrader

Can you please give the exact steps needed to reproduce the problem?

dlech avatar May 27 '24 14:05 dlech

I have reconnect the hub (bluetooth) after a few minutes of inactivity

The hub automatically turns itself off after 3 minutes of not being connected to a computer.

With pybricksdev (unlike the online Pybricks Code editor), it disconnects after the program completes. So if you spend a few minutes coding, the hub will be off when you try to start code again.

laurensvalk avatar May 27 '24 15:05 laurensvalk

Thank you very much.

One more think just for documentation purposes:

Using Linux Mint 21.3, I could not see the Spike Hub in the bluetooth manager. After starting the Pybricks Code Editor, is appears in the manger and you can develop in the Code Editor. Still I can not use VSC, get the following error. But it is for sure an hardware / firmware issues, as it works well on two other Linux Mint 21.3 systems.

File "/usr/local/lib/python3.10/dist-packages/pybricksdev/cli/__init__.py", line 380, in main
    asyncio.run(subparsers.choices[args.tool].tool.run(args))
  File "/usr/lib/python3.10/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/usr/lib/python3.10/asyncio/base_events.py", line 649, in run_until_complete
    return future.result()
  File "/usr/local/lib/python3.10/dist-packages/pybricksdev/cli/__init__.py", line 192, in run
    device_or_address = await find_device(args.name)
  File "/usr/local/lib/python3.10/dist-packages/pybricksdev/ble/__init__.py", line 68, in find_device
    raise asyncio.TimeoutError
asyncio.exceptions.TimeoutError

milad-asrar avatar May 30 '24 07:05 milad-asrar

Fixed by not using pipx.

Eggmanplant avatar Jun 01 '24 10:06 Eggmanplant