Comments (7)
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?
- Run the command
bluetooth devices
to see the list of paired devices - Then run
sudo rfcomm bind 0 <dev>
, where<dev>
is the hex device id associated with the robot from the above list
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.
from lego-spikeprime-mindstorms-vscode.
@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 :(
from lego-spikeprime-mindstorms-vscode.
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.
from lego-spikeprime-mindstorms-vscode.
@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 sudo rfcomm bind 0 <dev>
step, as it won't stay connected. It pairs and then disconnects.
from lego-spikeprime-mindstorms-vscode.
@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.
from lego-spikeprime-mindstorms-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 commandsudo rfcomm connect /dev/rfcomm0 A8:E2:C1:9C:67:16
.
> sudo rfcomm connect /dev/rfcomm0 A8:E2:C1:9C:67:16
Connected /dev/rfcomm0 to A8:E2:C1:9C:67:16 on channel 1
Press CTRL-C for hangup
And bluetoothe state in "explorer" changed to "connected". On hub there is still blue button and "B" letter on display.
I can than select /dev/rfcomm0
from extension menu.... but it will throw VScode error Connecting to Hub Failed! Error: Operace zamítnuta, cannot open /dev/rfcomm0
( "Operace zamítnuta" is in czech language, translated to english it is "Operation denied/forbidden") .
I tried instructions from webspace.fh-zwickau.de, to allow any user acces such connection (using UDEV rules).
And error changed Connecting to Hub Failed! Error Prostředek je dočasně nepřístupný Cannot lock port
When I connect hub by USB, I can run screen /dev/ttyACM0 115200
and it returns some number, which are changing when I move the hub. But VScode still says, that Connecting to Hub Failed! Error: Zařízení nebo zdroj jsou používány, cannot open /dev/ttyACM0
("Zařízení nebo zdroj jsou používány" => "device or source is used")
from lego-spikeprime-mindstorms-vscode.
When I connect hub by USB, I can run screen /dev/ttyACM0 115200 and it returns some number, which are changing when I move the hub. But VScode still says, that Connecting to Hub Failed! Error: Zařízení nebo zdroj jsou používány, cannot open /dev/ttyACM0 ("Zařízení nebo zdroj jsou používány" => "device or source is used")
@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.
from lego-spikeprime-mindstorms-vscode.
Related Issues (20)
- How to make the program exit after it's finished HOT 4
- Importing self made modules. HOT 2
- How to download to the brick? HOT 3
- Can't Upload program when unplug USB cable and Plugged again HOT 4
- automatic saving in slot HOT 2
- List more advanced features :-) HOT 1
- Bluetooth not showing up on windows 10 HOT 4
- Cannot find imports. HOT 5
- FLL Coach here (not an actual "issue") HOT 1
- Is it works? HOT 2
- MemoryError when uploading and starting files multiple times HOT 5
- Support for HubOS 3 HOT 14
- question about usage HOT 2
- Enhance COM ports lists HOT 6
- Reconnection over BT fails after disconnect from VScode extension for some time
- spike prime new os connect HOT 1
- Trouble uploading code via VSC HOT 6
- Extension creates *.assembled.py file HOT 1
- Connection to Spike Prime HUB fails over USB without error message HOT 22
- Inlcude a screen shot of the run buttons
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lego-spikeprime-mindstorms-vscode.