Replies: 38 comments 2 replies
-
In addition to the online IDE we provide a Python package called So your setup could work if you don't mind that your gamepad is connected to your computer. We've recently simplified the process of sending things to the hub in #154 . Combined with In the mean time, if you install |
Beta Was this translation helpful? Give feedback.
-
Thanks. Unfortunately
|
Beta Was this translation helpful? Give feedback.
-
Got it installed now. Had to uninstall python, install libz2-dev and then reinstall python. |
Beta Was this translation helpful? Give feedback.
-
Could you please confirm if the mindstorms hub uses the same firmware as spike prime before i reflash? Wouldn't want to brick my $400 brick by reflashing... :D @laurensvalk |
Beta Was this translation helpful? Give feedback.
-
Oof, the link in the pybricksdev readme to original firmware files is broken.. this is a bit scary |
Beta Was this translation helpful? Give feedback.
-
I've installed Pybricks on an Inventor hub already. However, we currently don't have low battery protection, so you will need to be careful not to damage your battery by running it too low. https://github.com/gpdaniels/spike-prime still has various firmware files. The files were just moved. |
Beta Was this translation helpful? Give feedback.
-
Great, thanks. I see that gpdaniels has separate firmware files for spike and mindstorms, but I assume they use the same pybricks firmware? |
Beta Was this translation helpful? Give feedback.
-
Yes, same Pybricks firmware. |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
Did you set up udev rules? This is my # SPIKE Prime hub in firmware update mode
SUBSYSTEM=="usb", ATTRS{idVendor}=="0694", ATTRS{idProduct}=="0008", SYMLINK+="spike-prime-dfu-%k", MODE="0666"
# SPIKE Prime hub
SUBSYSTEM=="usb", ATTRS{idVendor}=="0694", ATTRS{idProduct}=="0009", SYMLINK+="spike-prime-%k", MODE="0666"
# MINDSTORMS Inventor hub
SUBSYSTEM=="usb", ATTRS{idVendor}=="0694", ATTRS{idProduct}=="0010", SYMLINK+="mindstorms-inventor-%k", MODE="0666"
# MINDSTORMS Inventor hub in firmware update mode
SUBSYSTEM=="usb", ATTRS{idVendor}=="0694", ATTRS{idProduct}=="0011", SYMLINK+="mindstorms-inventor-dfu-%k", MODE="0666" |
Beta Was this translation helpful? Give feedback.
-
I did not. Was that in some guide that i missed? Tried just adding your file and restarting and it still throws the same error unfortunately. |
Beta Was this translation helpful? Give feedback.
-
It will take me some time to look into that. But as a workaround:
If that lists the device, then we know the problem is in |
Beta Was this translation helpful? Give feedback.
-
without hub plugged in, it shows me nothing. when connected in flash mode, i get this:
|
Beta Was this translation helpful? Give feedback.
-
Wait, didn’t the original post mention Control+ (technic hub)? That’s what I would recommend for now. That’s the most user friendly to install at this point. There’s no Bluetooth support for Pybricks on SPIKE and MINDSTORMS yet, so I don’t really see this being useful for this project just yet. |
Beta Was this translation helpful? Give feedback.
-
yeah i did use a control+ hub before but the result wasn't very good so i bought the mindstorms hub today because of the advertised bluetooth support, which wasn't there :( |
Beta Was this translation helpful? Give feedback.
-
Thanks everyone. It's now working! |
Beta Was this translation helpful? Give feedback.
-
No you don't have to, but that's not related to the problem. Jupyter Notebook is mostly just an editor. And pretty convenient for this purpose.
To add
|
Beta Was this translation helpful? Give feedback.
-
Very nice! And if you need ideas to make it smoother, feel free to open a dedicated issue for that. The communication is probably already as fast as it gets, so then it might come down to changing a few parameters on the hub side. Depending on what you want to do, you can limit the acceleration, so that sudden changes to your signal smooth out. |
Beta Was this translation helpful? Give feedback.
-
Ah, adding the package with poetry will certainly be cleaner than pip in the notebook. I am currently limiting to 20 messages per second, will experiment with different intervals once i got the other motors set up too. I'll play with the pid values and acceleration once i got some load on the servo :) Hoping that one day I can communicate directly between the mindstorms hub and controller so that latency will be reduced further! |
Beta Was this translation helpful? Give feedback.
-
What is preventing us from using the ubluetooth module on the control+ or spike/mindstorms hubs? |
Beta Was this translation helpful? Give feedback.
-
Nothing technical, just a lot of work and time, and some design aspects. It's not as trivial as simply enabling a MicroPython module. In case of SPIKE/MINDSTORMS, bluetooth needs to be implemented first. It's a different chip than the one in Control+. We've got most of that step figured out by now, but there's some implementation work to be done here. And we'll need to look at how to integrate it with the rest of Pybricks. We use MicroPython a bit differently than most MicroPython boards. On most of those, when you stop MicroPython, everything stops. In our case, we want the "system code" to keep running, so you can at least still run your next program without having to reset. |
Beta Was this translation helpful? Give feedback.
-
Thanks for the clarification. Let me know if there's anything I can do to help. I am very keen on getting this to work on the mindstorms hub. Would also be nice if the default telemetry was optional to reduce load. |
Beta Was this translation helpful? Give feedback.
-
Cool. We'll keep you posted and thanks for taking the time try these new features.
Which telemetry? At the moment, there is no telemetry while a program is running unless you |
Beta Was this translation helpful? Give feedback.
-
I was just referring to the spike telemetry. It constantly sends sensor data, but perhaps that is not the case with your firmware. |
Beta Was this translation helpful? Give feedback.
-
Ah, got it. We don't send any data at the moment, but if we ever do, making it optional sounds like a good idea 👍 . |
Beta Was this translation helpful? Give feedback.
-
Sending the number |
Beta Was this translation helpful? Give feedback.
-
Ah, I forgot to mention that. Yes, 3 is equivalent to sending CTRL+C, which stops the program. This will be resolved once program run logic and messaging use separate “channels”. Right now, there is just a single serial input/output stream used for everything. |
Beta Was this translation helpful? Give feedback.
-
Hehe okay, great :) |
Beta Was this translation helpful? Give feedback.
-
I have now hit a wall regarding the number of io ports. Will either need to hook up a second control+ hub or use the technic large hub. I got three questions:
Is this assumption correct? What do I need to do to rename the hub? Or do all hubs have some unique value like a mac address I can use instead?
|
Beta Was this translation helpful? Give feedback.
-
Yes. So print the result of hub_2 = BLEPUPConnection()
await hub_2.connect('90:84:2B:4A:2B:75')
If you mean the mailboxes in I've also just pushed something new you can use already. You can now read e.g.
Pretty close. Try this: await hub.wait_until_state(hub.RUNNING) Pybricksdev has mainly been a testing tool thus far and hasn't been optimized for performance. Using the PC as the middle man might not get great performance at this point, so keep that in mind :) |
Beta Was this translation helpful? Give feedback.
-
Hey everyone, I'm currently working on my childhood dream project: an lpe (lego pneumatic engine) powered rc car.
I just got the new mindstorms set because I thought it would solve the issues I had with the control+ hub, but I have been disappointed. There seems to be no bluetooth functions in the official mindstorms app.
I am looking to control several functions of the car with a bluetooth gamepad. With the control+ hub I could barely even get the steering working smoothly. In the end I had to write my own PID controller with node-poweredup but since the logic runs on my computer, the performance is still not top notch (and i would need another fast acting servo motor for the throttle). Sending any more than 10-20 commands per second causes the control+ hub to go crazy, then freeze.
What I am looking for now is a way to control my motors as fast and smooth servos using micropython. Ideally the controller would connect straight to the hub but I am fine with the hub just receiving bluetooth input from my laptop. The controls need to be analog so I can't really use the keyboard thing posted here recently.
TLDR:
Any pointers to how I can use bluetooth communication in python programs running on the mindstorms hub would be appreciated.
Beta Was this translation helpful? Give feedback.
All reactions