-
Notifications
You must be signed in to change notification settings - Fork 22
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
Connecting with bluetooth only succesfull on 3rd attempt. #27
Comments
Hey @jeromba6 , sadly I'm not a linux user myself (I wasn't even able to compile the plugin on a Ubuntu VM...). Hopefully a more experienced linux user/dev could help on this. |
I'm a Linux user (Ubuntu 20.04) with a Spike Prime, and I landed here trying to make a bluetooth connection work. I couldn't get it to work at all until I saw the hint from @jeromba6 about setting the bluetooth connection to serial. I don't know if this is what that meant, but after some searching, here's what I came up with. I'm adding it here to help others, but also because if it so happens that this is a different approach, maybe it would help with the reported bug?
That worked. I was then able to connect with /dev/rfcomm0 with VSCode. @jeromba6: I don't know if I've provided useful info, or just told you what you already knew. At the very least, thanks for getting me started. And further thanks to @PeterStaev for this fantastic VSCode extension. |
@dmusican thanks for the input on this issue. Just to add to this - the plugin communicates over COM with the Brick and not directly on BLE. This is done automatically for Windows and Mac and for both USB and BLE connections (i.e. when you connect the brick to the computer it automatically opens/creates the COM port). I guess on Linux it is not done automatically :( |
@dmusican I can't get this to work. I could be missing additional drivers. I follow this: https://gist.github.com/0/c73e2557d875446b9603 I can connect to the hub, but I'm unable to complete the |
@TheWendyPower, I think that's by design. It pairs, then disconnects because you're not actually using it. It will then connect again when you actually connect to it from VSCode. |
Exactly. I start the BT on Ubuntu and RI (51515) hub and hub was after while displayed as "LEGO Hub A8:E2:C1:9C:67:16 disconnected" . According instructions from lego-hub-tk , I used command
And bluetoothe state in "explorer" changed to "connected". On hub there is still blue button and "B" letter on display. I can than select I tried instructions from webspace.fh-zwickau.de, to allow any user acces such connection (using UDEV rules). And error changed When I connect hub by USB, I can run |
@foton this is a normal error since the COM ports do not allow simultanious connections. So while you have your screen running or you have connected through the LEGO app, no further connections are allowed. You need to close all and then try to connect through VSCode. Hopefully this helps. |
I have the mindstorms Robot Inventor (51515). When connecting to the brick via USB cable first attempt is always successful. But with bluetooth, which I prefer not having any cables in the way, I first have to set the bluetooth connection to serial.
After this startup VSCode try to connect (it fails)
Close VSCode
startup VSCode try to connect (it fails again)
Close VSCode
startup VSCode try to connect (succes 👍 )
This is aways the case.
My computer is running on Ubuntu 21.10, for now it's my only way to connect to the Lego brick from Ubuntu so I'm very happy to use the plugin.
The text was updated successfully, but these errors were encountered: