Git Product home page Git Product logo

lego-spikeprime-mindstorms-vscode's People

Contributors

balva avatar blockog avatar greengithub99 avatar lesbass avatar m4rku5-c0d3 avatar nkarstens avatar peterstaev avatar rantingdemon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

lego-spikeprime-mindstorms-vscode's Issues

Several issues with bare print() feature

First of all, thanks for adding the print() without importing spikeprint(). Following illustrate a few issues:

# LEGO type:standard slot:18 autostart
from util.print_override import spikeprint 

for i in range(10):
    print('A: bare hello', i)
    
for i in range(10):
    spikeprint('B: spike hello', i)

for i in range(10):
    print('C: bare hello no end', i, end='')
print('\ndone')
    
for i in range(10):
    spikeprint('D: spike hello no end', i, end='')
print('\ndone')

raise SystemExit
  1. Bare print have extra newlines (compare case A with case B)
  2. Bare print with end='' has extra RPC messages (I am not sure if it can be fixed)
  3. Spike print with end='' overwrites the current line. This I have observed before the addition of bare print(). After some debugging, it has to do with \r vs \n, IMO.

Connecting with bluetooth only succesfull on 3rd attempt.

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.

Reconnection over BT fails after disconnect from VScode extension for some time

Hi, I really like this VScode extension and have been playing with it for the past few days. It works great for me most of the time. The only issue I encountered so far is like this:

I am running VSCode 1.81.1 on MacOSX with extension 1.6.1. I was always able to connect to the SP Robot over BT after a fresh reboot of my MacBook Pro.

However if I disconnect from SP from the extension and shutdown the Robot for the night, when I power on the same SP Robin the next day, the VSCode extension can no longer connect over BT. I did find out the LEGO SP App can still connect over BT for the same situation. The only way for me to recover the BT connection is to reboot my MacBookPro.

Not sure if this is something others have noticed and what might be a good workaround without rebooting the laptop.

Can't Upload program when unplug USB cable and Plugged again

When I plugged USB cable and choose COM. It connected and I can upload program. After I unplug USB cable and plugged again, I can't upload program during Status bar showing it still connected. I have to reconnect COM and upload.
p/s: I know how to set # LEGO type:standard slot:5, and Can I set default COM like that.
thanks for your Extensions

FLL Coach here (not an actual "issue")

Hello Peter. I thought you might be interested to know how I use your plugin. I am an FLL coach and we used your plugin all season, and it worked perfectly. Middle school kids were able to pick up the coding in no time at all. We advanced past our qualifier and did pretty good at our regioal championship (VA-DC).

I guess if anything that I could ask of you is, do you know a good online place where FLL coaches using Python on the Spike Prime hangout? I'd love to see how other coaches are doing this, and what kinds of cool programs they have written.

Anyway, sorry to hijack your support issues here, but please keep up the great work!

Skip Morrow
Coach Team 24277

Importing self made modules.

I'd like to import my own modules but every time I do it raises this error: ImportError: no module named 'TestModule'. I checked the name of the module and it matches all up.
Main.py is located in the same folder/directory as TestModule.py. Does anyone have a solution? Thanks

List more advanced features :-)

I was thinking of a web-based IDE for Mindstorms (similar to Pybricks Code, but for original firmware) and encountered your project. Very impressive!

You might want to list more features of the advanced API. I have decoded pretty much all interesting word blocks, I think it should be a good resource for finding out what's possible: https://github.com/azzieg/mindstorms-inventor/tree/main/word_blocks Or maybe just link to my GitHub repo from your ADVANCED-FEATURES.md or README.md? ;-)

Activation error on Apple silicon (?)

VS Code Version: 1.60.0
Commit: e7d7e9a9348e6a8cc8c03f877d39cb72e5dfb1ff
Date: 2021-09-01T10:56:36.444Z (M1 build vs 2021-09-01T10:54:53.442Z Intel build ??)
Electron: 13.1.8
Chrome: 91.0.4472.164
Node.js: 14.16.0
V8: 9.1.269.39-electron.0
OS: Darwin arm64 20.6.0

$onExtensionActivationError
mainThreadExtensionService.ts:95

workbench.desktop.main.js:sourcemap:1992 Activating extension 'PeterStaev.lego-spikeprime-mindstorms-vscode' failed: Could not locate the bindings file. Tried:
β†’ /Users/alex/.vscode/extensions/peterstaev.lego-spikeprime-mindstorms-vscode-1.2.1/node_modules/@serialport/bindings/build/bindings.node
β†’ /Users/alex/.vscode/extensions/peterstaev.lego-spikeprime-mindstorms-vscode-1.2.1/node_modules/@serialport/bindings/build/Debug/bindings.node
β†’ /Users/alex/.vscode/extensions/peterstaev.lego-spikeprime-mindstorms-vscode-1.2.1/node_modules/@serialport/bindings/build/Release/bindings.node
β†’ /Users/alex/.vscode/extensions/peterstaev.lego-spikeprime-mindstorms-vscode-1.2.1/node_modules/@serialport/bindings/out/Debug/bindings.node
β†’ /Users/alex/.vscode/extensions/peterstaev.lego-spikeprime-mindstorms-vscode-1.2.1/node_modules/@serialport/bindings/Debug/bindings.node
β†’ /Users/alex/.vscode/extensions/peterstaev.lego-spikeprime-mindstorms-vscode-1.2.1/node_modules/@serialport/bindings/out/Release/bindings.node
β†’ /Users/alex/.vscode/extensions/peterstaev.lego-spikeprime-mindstorms-vscode-1.2.1/node_modules/@serialport/bindings/Release/bindings.node
β†’ /Users/alex/.vscode/extensions/peterstaev.lego-spikeprime-mindstorms-vscode-1.2.1/node_modules/@serialport/bindings/build/default/bindings.node
β†’ /Users/alex/.vscode/extensions/peterstaev.lego-spikeprime-mindstorms-vscode-1.2.1/node_modules/@serialport/bindings/compiled/14.16.0/darwin/arm64/bindings.node
β†’ /Users/alex/.vscode/extensions/peterstaev.lego-spikeprime-mindstorms-vscode-1.2.1/node_modules/@serialport/bindings/addon-build/release/install-root/bindings.node
β†’ /Users/alex/.vscode/extensions/peterstaev.lego-spikeprime-mindstorms-vscode-1.2.1/node_modules/@serialport/bindings/addon-build/debug/install-root/bindings.node
β†’ /Users/alex/.vscode/extensions/peterstaev.lego-spikeprime-mindstorms-vscode-1.2.1/node_modules/@serialport/bindings/addon-build/default/install-root/bindings.node
β†’ /Users/alex/.vscode/extensions/peterstaev.lego-spikeprime-mindstorms-vscode-1.2.1/node_modules/@serialport/bindings/lib/binding/node-v89-darwin-arm64/bindings.node.

spike could not be resolved

First things first: I am a python newbie. I've been programming Java for many years, but this is my first time doing any python. Our FIRST Lego League team just got some Spike Primes and some of the kids want to use python. What's more, some of them are familiar with python and have used VS code, so this is the platform they'd like to use. So I am doing some testing so I can understand and the first thing I am seeing are two errors that imports spike and spike.control could not be resolved. I understand that this can be ignored and in fact, the play button works and I can run my little program on the Spike Prime. But I can't seem to figure out how to use debug. When I try debugging, it halts on the first import and I can't seem to make it continue.

So I have two questions:

  1. How should I deal with the two errors? Do I just leave them there and ignore them, and tell the kids that they aren't a problem?
  2. And given that I have these two errors, is it possible to debug Spike Prime programs?

Thanks in advance!
Skip
Spike VS Code

Beginner quick start?

Hi guys,

Sorry I'm a total noob with visual studio.

I've installed the plugin on a fresh visual studio install, under ubuntu 21.10.

Now I'm pretty lost, I dont have the icon "hub disconnected" in the bottom status bar nor I know how to start a "spike project". I have done a quick google search but with no lucky.

I went trough the README.md multiple times but still I have no clue where to start :/

The hub is connected trough an USB cable to the laptop, I'm able to use the lego spike web application to run some code, I also used the screen command to interact with the python on /dev/ttyACM0 device .

Thanks in advice!

image

How to download to the brick?

Hi there!

The instructions read, "Once connected you can start a running program by choosing its slot."

However it doesn’t say where or how to choose its slot. Can you please elaborate?

Thanks in advance!
Philip

Bluetooth not showing up on windows 10

When I try to connect to the spike prime (either via the command pallette, or the button on the bottom), only the COM ports show up. How do I connect through bluetooth?

add pybricks compatibility

it would be cool if this also supported pybricks uploads using https://github.com/pybricks/pybricksdev

Run script on the first device we find called Pybricks hub

pybricksdev run ble --name "Pybricks Hub" demo/shortdemo.py

Run script on ev3dev at 192.168.0.102

pybricksdev run ssh --name 192.168.0.102 demo/shortdemo.py

Python Advanced detect Exit?

Hello πŸ‘‹

This is not an issue but I have a question about the EventLoop. I created a library to handle the Lego Handset and currently I rework it so that it works with the latest version of Micropython for Spike and Inventor Hub. So do you know if it's possible to detect if a stack is stopped to run some cleanup code? I saw there are some events but I didn't saw something for end of a program

thank you and best regards

Support for HubOS 3

In December 2022, Lego released a new HubOS and Spike Prime Version v3.

After upgrading to HubOS 3, we were no longer able to connect the brick with VS Code using this extension. Reverting back to HubOS 2 resolved the issue.

Will there be support for HubOS 3+? Or do I need to stay on version 2 in order to continue using VSCode for programming python?

ChromeOS/Chromebook support?

I was trying the linux container in ChromeOS and installed vscode. The lego extension installed without errors but the extension does not show up on the bottom status bar and running the command(s) would give:

image

Support for VSCode 1.59+

Can repro on two systems where the extension has worked before. May be related to the VS Code upgrade.

Can repro with both v.1.1.0 and v.1.0.3.

macOS 11.5.1 (20G80)

VS Code
Version: 1.59.0
Commit: 379476f0e13988d90fab105c5c19e7abc8b1dea8
Date: 2021-08-04T23:14:40.191Z
Electron: 13.1.7
Chrome: 91.0.4472.124
Node.js: 14.16.0
V8: 9.1.269.36-electron.0
OS: Darwin x64 20.5.0

[2021-08-06 22:02:26.795] [exthost] [info] ExtensionService#_doActivateExtension PeterStaev.lego-spikeprime-mindstorms-vscode {"startup":false,"extensionId":{"value":"PeterStaev.lego-spikeprime-mindstorms-vscode","_lower":"peterstaev.lego-spikeprime-mindstorms-vscode"},"activationEvent":"*"}
[2021-08-06 22:02:26.795] [exthost] [info] ExtensionService#loadCommonJSModule file:///Users/alex/.vscode/extensions/peterstaev.lego-spikeprime-mindstorms-vscode-1.1.0/out/extension.js
[2021-08-06 22:02:26.806] [exthost] [error] Activating extension PeterStaev.lego-spikeprime-mindstorms-vscode failed due to an error:
[2021-08-06 22:02:26.806] [exthost] [error] Error: Could not locate the bindings file. Tried:
β†’ /Users/alex/.vscode/extensions/peterstaev.lego-spikeprime-mindstorms-vscode-1.1.0/node_modules/@serialport/bindings/build/bindings.node
β†’ /Users/alex/.vscode/extensions/peterstaev.lego-spikeprime-mindstorms-vscode-1.1.0/node_modules/@serialport/bindings/build/Debug/bindings.node
β†’ /Users/alex/.vscode/extensions/peterstaev.lego-spikeprime-mindstorms-vscode-1.1.0/node_modules/@serialport/bindings/build/Release/bindings.node
β†’ /Users/alex/.vscode/extensions/peterstaev.lego-spikeprime-mindstorms-vscode-1.1.0/node_modules/@serialport/bindings/out/Debug/bindings.node
β†’ /Users/alex/.vscode/extensions/peterstaev.lego-spikeprime-mindstorms-vscode-1.1.0/node_modules/@serialport/bindings/Debug/bindings.node
β†’ /Users/alex/.vscode/extensions/peterstaev.lego-spikeprime-mindstorms-vscode-1.1.0/node_modules/@serialport/bindings/out/Release/bindings.node
β†’ /Users/alex/.vscode/extensions/peterstaev.lego-spikeprime-mindstorms-vscode-1.1.0/node_modules/@serialport/bindings/Release/bindings.node
β†’ /Users/alex/.vscode/extensions/peterstaev.lego-spikeprime-mindstorms-vscode-1.1.0/node_modules/@serialport/bindings/build/default/bindings.node
β†’ /Users/alex/.vscode/extensions/peterstaev.lego-spikeprime-mindstorms-vscode-1.1.0/node_modules/@serialport/bindings/compiled/14.16.0/darwin/x64/bindings.node
β†’ /Users/alex/.vscode/extensions/peterstaev.lego-spikeprime-mindstorms-vscode-1.1.0/node_modules/@serialport/bindings/addon-build/release/install-root/bindings.node
β†’ /Users/alex/.vscode/extensions/peterstaev.lego-spikeprime-mindstorms-vscode-1.1.0/node_modules/@serialport/bindings/addon-build/debug/install-root/bindings.node
β†’ /Users/alex/.vscode/extensions/peterstaev.lego-spikeprime-mindstorms-vscode-1.1.0/node_modules/@serialport/bindings/addon-build/default/install-root/bindings.node
β†’ /Users/alex/.vscode/extensions/peterstaev.lego-spikeprime-mindstorms-vscode-1.1.0/node_modules/@serialport/bindings/lib/binding/node-v89-darwin-x64/bindings.node
at bindings (/Users/alex/.vscode/extensions/peterstaev.lego-spikeprime-mindstorms-vscode-1.1.0/node_modules/bindings/bindings.js:126:9)
at Object. (/Users/alex/.vscode/extensions/peterstaev.lego-spikeprime-mindstorms-vscode-1.1.0/node_modules/@serialport/bindings/lib/darwin.js:2:36)
at Module.u._compile (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/loader.js:4:1315)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1155:10)
at Module.load (internal/modules/cjs/loader.js:982:32)
at Module._load (internal/modules/cjs/loader.js:823:14)
at Function.f._load (electron/js2c/asar_bundle.js:5:12913)
at Function.n._load (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:104:28060)
at Function.P._load (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:104:24648)
at Function.l._load (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:94:59608)
at Module.require (internal/modules/cjs/loader.js:1006:19)
at Module.require (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/microsoft-authentication/dist/extension.js:1:38760)
at v (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/loader.js:4:698)
at Object. (/Users/alex/.vscode/extensions/peterstaev.lego-spikeprime-mindstorms-vscode-1.1.0/node_modules/@serialport/bindings/lib/index.js:10:22)
at Module.u._compile (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/loader.js:4:1315)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1155:10)
at Module.load (internal/modules/cjs/loader.js:982:32)
at Module._load (internal/modules/cjs/loader.js:823:14)
at Function.f._load (electron/js2c/asar_bundle.js:5:12913)
at Function.n._load (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:104:28060)
at Function.P._load (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:104:24648)
at Function.l._load (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:94:59608)
at Module.require (internal/modules/cjs/loader.js:1006:19)
at Module.require (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/microsoft-authentication/dist/extension.js:1:38760)
at v (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/loader.js:4:698)
at Object. (/Users/alex/.vscode/extensions/peterstaev.lego-spikeprime-mindstorms-vscode-1.1.0/node_modules/serialport/lib/index.js:2:17)
at Module.u._compile (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/loader.js:4:1315)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1155:10)
at Module.load (internal/modules/cjs/loader.js:982:32)
at Module._load (internal/modules/cjs/loader.js:823:14)
at Function.f._load (electron/js2c/asar_bundle.js:5:12913)
at Function.n._load (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:104:28060)
at Function.P._load (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:104:24648)
at Function.l._load (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:94:59608)
at Module.require (internal/modules/cjs/loader.js:1006:19)
at Module.require (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/microsoft-authentication/dist/extension.js:1:38760)
at v (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/loader.js:4:698)
at Object. (/Users/alex/.vscode/extensions/peterstaev.lego-spikeprime-mindstorms-vscode-1.1.0/out/extension.js:25:20)
at Module.u._compile (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/loader.js:4:1315)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1155:10)
at Module.load (internal/modules/cjs/loader.js:982:32)
at Module._load (internal/modules/cjs/loader.js:823:14)
at Function.f._load (electron/js2c/asar_bundle.js:5:12913)
at Function.n._load (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:104:28060)
at Function.P._load (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:104:24648)
at Function.l._load (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:94:59608)
at Module.require (internal/modules/cjs/loader.js:1006:19)
at Module.require (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/microsoft-authentication/dist/extension.js:1:38760)
at require (internal/modules/cjs/helpers.js:88:18)
at Function.t [as __$__nodeRequire] (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/loader.js:5:101)
at v._loadCommonJSModule (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:104:26057)
at v._doActivateExtension (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:90:12603)
at v._activateExtension (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:90:11704)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async Promise.all (index 0)
at async v.$activate (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:90:20144)

How can I see the programs on the hub?

How can I see the programs on the hub and choose between standard / advanced python?
And can I code similar to the python beta in the app?
I am using Linux and it would be cool to be able to code from my pc.
Thanks!

Cannot find imports.

When I enter code into VScode the import of hub and utime or PrimeHub are not found.

What am I doing wrong?

image

Enhance COM ports lists

If this is going is going to take a revision to the plugin (pretty likely, I think), I would like to toss in a feature request. This is all based on the user experience with regular BT, so this could all change given the new BTLE usage. For my situation, I coach an FLL team and we have seven laptops and robots for practice. Most of the time a single team member will use the laptop and robot assigned to them. But from time to time a laptop will be used to control a different robot than the one assigned. What that means is the list of BT COM ports gets longer and longer. And with an incoming and outgoing port for each hub, the list is twice as long as it needs to be. It would be great if the list could first of all, only show the outgoing ports because that is the port needed to upload the code. Also, it would be great if the list would show at least the MAC address (prehaps last four) or even better, perhaps show the robot name. Just think about it.
In any case, count me in if you need any help with testing or have questions about how teams are using your code.

Originally posted by @MrGibbage in #55 (comment)

question about usage

Hello.
I am a Japanese student.
I would very much like to use this extension, but I did not understand how to use it. Could you please tell me how to connect to the hub?

Potential performance improvement by not writing mpy-cross buffer to disk

fs.writeFileSync(compileFilePath, compileResult.mpy);

compileResult.mpy could potentially be using here:

const stream = fs.createReadStream(compileFilePath ?? currentlyOpenTabFilePath, { highWaterMark: blockSize });

This will avoid writing to file and unlinking when done. But of course there will be insignificant coding effort (unless there is a buffer stream in typescript). May not be worth it.

Error out if cross-compile fails

I found it useful to error out and not upload to hub if cross-compile fails (i used my python program which do that). It should print out the location of the syntax error and user can then click on the file link and go directly to the code/line. Try to compare the error message from the hub (i think currently the py file will be uploaded when cross-compile fails).

try this example (line 3 has syntax error):

# LEGO type:standard slot:5 autostart
from util.print_override import spikeprint as print
print('hello')x
raise SystemExit

automatic saving in slot

Very good AddOn for connecting the SPIKE hardware with VSC. πŸ˜ŽπŸ‘Œ

One observation:
I can no longer select in which memory slot the source should be loaded - this happens "automatically" - with an added note in which slot the source has been stored in the program header.

How can I change this back to "manual selection"?

I have the same behavior on three computers.

Command not found

Hello, thanks for making this. When I try any of the commands in VSCode, such as 'Lego Hub: Upload Program' I get the error: command 'lego-spikeprime-mindstorms-vscode.uploadProgram' not found. Is there something I should install first?

Besides this, I have the LEGO Mindstorms app from the Windows Store installed, as well as spikeprime-tools from https://github.com/sanjayseshan/spikeprime-tools.

Can't exit program after uploading and starting

On macOS Monterey 12.2.1. Upon running a program, if I terminate the program, it doesn't appear to exit the program on the hub. Pressing the center button does nothing either, so I need to hold the button down to restart the hub. I have my hub plugged in via USB. Don't know if this could have any bearing on the problem, but I did go back and forth between the Pybricks firmware, and the default firmware (as in, uninstalling and reinstalling). Unsure if that could have affected the brick in any way.

Unable to load the extension on Mac OS X, with M1 architecture

Hello, I was very glad to see this extension! It would help a lot with writing Python for my new Robot Inventors set.

However, the extension fails to load on my Macbook Air, (M1 ARM64 arch). This is the output from the console:

Activating extension 'PeterStaev.lego-spikeprime-mindstorms-vscode' failed: Could not locate the bindings file. Tried:
β†’ /Users/rantingdemon/.vscode/extensions/peterstaev.lego-spikeprime-mindstorms-vscode-1.0.2/node_modules/@serialport/bindings/build/bindings.node
β†’ /Users/rantingdemon/.vscode/extensions/peterstaev.lego-spikeprime-mindstorms-vscode-1.0.2/node_modules/@serialport/bindings/build/Debug/bindings.node
β†’ /Users/rantingdemon/.vscode/extensions/peterstaev.lego-spikeprime-mindstorms-vscode-1.0.2/node_modules/@serialport/bindings/build/Release/bindings.node
β†’ /Users/rantingdemon/.vscode/extensions/peterstaev.lego-spikeprime-mindstorms-vscode-1.0.2/node_modules/@serialport/bindings/out/Debug/bindings.node
β†’ /Users/rantingdemon/.vscode/extensions/peterstaev.lego-spikeprime-mindstorms-vscode-1.0.2/node_modules/@serialport/bindings/Debug/bindings.node
β†’ /Users/rantingdemon/.vscode/extensions/peterstaev.lego-spikeprime-mindstorms-vscode-1.0.2/node_modules/@serialport/bindings/out/Release/bindings.node
β†’ /Users/rantingdemon/.vscode/extensions/peterstaev.lego-spikeprime-mindstorms-vscode-1.0.2/node_modules/@serialport/bindings/Release/bindings.node
β†’ /Users/rantingdemon/.vscode/extensions/peterstaev.lego-spikeprime-mindstorms-vscode-1.0.2/node_modules/@serialport/bindings/build/default/bindings.node
β†’ /Users/rantingdemon/.vscode/extensions/peterstaev.lego-spikeprime-mindstorms-vscode-1.0.2/node_modules/@serialport/bindings/compiled/14.16.0/darwin/arm64/bindings.node
β†’ /Users/rantingdemon/.vscode/extensions/peterstaev.lego-spikeprime-mindstorms-vscode-1.0.2/node_modules/@serialport/bindings/addon-build/release/install-root/bindings.node
β†’ /Users/rantingdemon/.vscode/extensions/peterstaev.lego-spikeprime-mindstorms-vscode-1.0.2/node_modules/@serialport/bindings/addon-build/debug/install-root/bindings.node
β†’ /Users/rantingdemon/.vscode/extensions/peterstaev.lego-spikeprime-mindstorms-vscode-1.0.2/node_modules/@serialport/bindings/addon-build/default/install-root/bindings.node
β†’ /Users/rantingdemon/.vscode/extensions/peterstaev.lego-spikeprime-mindstorms-vscode-1.0.2/node_modules/@serialport/bindings/lib/binding/node-v87-darwin-arm64/bindings.node.

I've tried googling around on how to solve this, but I'm at a bit of a loss - I have never tried or needed to use either NodeJs or to build a VS extension. If you could help me with some tips I would be happy to try and fix it and submit a pull request with my changes.

Thank you!

Print doesn't cause newline on Linux

When I put a print statement I see this in my terminal

Welcome to the LEGO Hub Log Terminal!
hello world
           hello world
                      hello world

When I do print("hello world\r") it works as expected.

I'm pretty sure that the fix a missing .replace(/\n/gi, "\r\n") here

logger?.log(Buffer.from(json!["p"]["value"], "base64").toString());

However, I'm unable to build this extension from source. Would be great if there were some instructions for that. Because while I know some JS I'm not to familiar with VS Code extensions and NodeJS.

Is it works?

Dear Sir

  1. Install Extension v1.6.1
  2. And next? what am I to do?
    Your explain :
    "Clicking on the status will either connect or disconnect (if already connected). Support connecting to USB and Bluetooth (see Known Issues for limitations)."

Where is this?

USB connection failed on Linux

Hi,

First of all, many thanks for this contribution to make the 51515 usable outside of the MacDows world. Very much appreciated here.

I've installed the latest version of the extension (v1.6.1) on the latest version of VSCOde (v1.68.1) but cannot connect to the hub via USB. All attempts end with the "Connecting to Hub Failed" message, even after having restarted all that can be restated (including the hub).

The hub appears consistently as /dev/ttypACM0 and the user is member of the dialout group (I'm used to program for Arduinos and alike that communicate over USB for programming).

Here is the environment detail provided by VSCode :
Version: 1.68.1
Commit: 30d9c6cd9483b2cc586687151bcbcd635f373630
Date: 2022-06-15T02:58:26.441Z
Electron: 17.4.7
Chromium: 98.0.4758.141
Node.js: 16.13.0
V8: 9.8.177.13-electron.0
OS: Linux x64 5.4.0-121-generic

I'm using Linux Mint 30.3.

Is there somewhere I can get more information from (e.g. some log) about what is going on during the connection process and where it fails ?

How to get a print-command output?

Hello.

I would like to use "print" in my program to track some variables, but in terminal I only get error messages(no standard output). This is possible in the official app. Is it possible in your? I use standard type of uploading.

Also it will be great to add download/upload file feature.

Thanks.

Cannot connect Lego Hub

This extension doesn't seem to work for me. Is it supposed to be "plug and play"?
I don't see any connection status in the bottom status bar.
I tried both USB cable and Bluetooth.
If I try to activate "Lego Hub: Connect to hub" via Command Palette, I get the following error
image

MemoryError when uploading and starting files multiple times

When I upload and run my program (ca 1000 lines), it works just fine. When i do this again now, it gives me an MemoryError. If I restart the robot it will work again, but only once every restart. Please tell me what additional infos you need.

printing to log terminal takes 1 second per line

thanks for the extension!

# LEGO type:standard slot:18 autostart
from util.print_override import spikeprint as print


for i in range(10):
    print('hi', i)


raise SystemExit

if you comment out the from line the program will finish very fast. I am pretty sure the hub is waiting for the extension to send back an acknowledgement. I fixed a similar problem here: smr99/lego-hub-tk@b1a4e94

If we are not sending the response of Hub's print message back to the hub, it will wait and timeout after 1 second. Please message me if you have any questions

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.