-
Notifications
You must be signed in to change notification settings - Fork 23
Description
Many thanks for your time in writing this extension -- I'm planning to use it to help our FLL team learn Python programming on the Spike hub next year.
I installed your extension first on a Windows laptop and it worked great out of the box.
Now I've been working on installing it on a Linux laptop running Debian 12 and VSCode 1.100.3, and the process was not straightforward. I thought I'd document here what I had to do and ask if there is anything to be done in the code base itself to address these issues.
When I first installed this extension in VSCode on Linux, there were no errors and it was listed as installed but none of the additional widgets appeared. The exthost.log
included (abbreviated):
2025-06-08 14:00:51.790 [error] Activating extension PeterStaev.lego-spikeprime-mindstorms-vscode failed due to an error:
2025-06-08 14:00:51.790 [error] Error: Cannot find module '@abandonware/bluetooth-hci-socket'
After installing NodeJS/NPM and quite a bit of trial and error which I won't go into here, I was able to get this module installed by switching to the extension install directory and running the following:
cd $HOME/.vscode/extensions/peterstaev.lego-spikeprime-mindstorms-vscode-3.0.0
npm install @abandonware/bluetooth-hci-socket
# the following two steps were necessary to avoid NodeJS version mismatch errors
npm install --save-dev @electron/rebuild
node_modules/.bin/electron-rebuild -v 34.5.8
After this, everything seems to be working properly. No doubt the electron version number (34.5.8) will change depending on the VSCode version installed and which version of electron is compiled into it.
Is there a reason that @abandonware/bluetooth-hci-socket
is not included in the installed extension by default?
Activity
PeterStaev commentedon Jun 8, 2025
Hey @jvolkening thanks for your feedback! The problem is that I'm not a linux user myself. While building the plugin on macOS and Windows I came across a problem exactly with the HCI socket. And since the plugin was working w/o it, I had to add to the externals in the webpack config so it can build correctly:
lego-spikeprime-mindstorms-vscode/webpack.config.js
Line 26 in f0c37b4
Sadly I'm not entirely sure how to make this so it works on all platforms for the time being.
jvolkening commentedon Jun 8, 2025
Completely understandable. Most VSCode users are probably on Windows so the time investment to fix might not be worthwhile. I only installed it myself specifically for using your extension, and our students will all be using Windows.
Feel free to close this issue for now as wont-fix if you want. If I ever have time to work on it myself and make any progress, I'll report back here.
jvolkening commentedon Jun 8, 2025
I was able to build your extension from source on Linux into a VSIX file that appears to install and work correctly. However, I have no idea how to adapt the steps I took into whatever deployment workflow you are using, and don't know if this will break anything on other platforms. Steps were as follows (within a fresh checkout of the
master
branch):Modify
webpack.config.js
:Then,
PeterStaev commentedon Jun 9, 2025
Thanks for the troubleshooting @jvolkening ! I will give it a try when I have a moment and see if a the compile will work as expected.
PeterStaev commentedon Jun 14, 2025
Hey @jvolkening, I've just tried this and here is what happens - when I try to install the HCI socket it complains for an incorrect OS:
I tried to install it using
--force
but then it fails to load/find it. I suspect that I will have to split my build and do one build for macOS/win and then another build and package for linux. I will have to see how to automate this using GH actions as right now I'm manually building and publishing the package from my dev machine.fix: Fix linux package
PeterStaev commentedon Jun 15, 2025
Hey @jvolkening , please try build 3.0.1 - this should include platform specific version for linux that includes the HCI package and should work out of the box on linux systems.
jvolkening commentedon Jun 17, 2025
Thank you -- tested 3.0.1 on Linux. and there is progress but this error now remains:
When I built your extension locally, I ran into this error also and it necessitated these extra steps:
prior to packaging in order to compile the extension with the same version of Electron that my VS Code installation uses.
PeterStaev commentedon Jun 17, 2025
Well this will be a problem - in general all the other native bindings have been compiled using pre-builds and have been working in the last dozen of version of vscode w/o the need to rebuild for each new vscode version. I will review the HCI code again and see it can somehow be overcome.
Thank you for providing the feedback!
PeterStaev commentedon Jun 21, 2025
Hey @jvolkening , I've just pushed version 3.1.0 in which I've replace the bluetooth package with another fork that seems better supported and provides prebuilds for the HCI socket too. Can you please try and see if that will work better on linux?
jvolkening commentedon Jun 23, 2025
Thanks, I appreciate the work you're putting into it. Tried 3.1.0 on Linux and got:
PeterStaev commentedon Jun 24, 2025
Hey @jvolkening , last try 😆 - seems I forgot to add the HCI socket prebuilds. Can you try version 3.1.1? Hopefully it will work 🤞
jvolkening commentedon Jun 26, 2025
Updated to v3.1.1: no errors this time and the expected LEGO Hub bits show up in the UI. I haven't been able to try actually connecting to a LEGO hub, but as soon as I can I'll return here with an update.
Thanks again!