Pybricks Posted May 15, 2023 Author Posted May 15, 2023 That's a great design! As you have perhaps already figured out on the other thread, the `Broadcast` class is still being worked on. It should get stable pretty soon :) Quote
nikzagvit Posted May 15, 2023 Posted May 15, 2023 hi, I'm trying to install the numpy package on ev3, in the terminal. I get an error. Tell me what could be the problem? robot@ev3dev:~$ sudo apt-get install python3-numpy [sudo] password for robot: Reading package lists... Done Building dependency tree Reading state information... Done Package python3-numpy is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source E: Package 'python3-numpy' has no installation candidate Quote
HectorMB Posted May 15, 2023 Posted May 15, 2023 5 hours ago, Pybricks said: That's a great design! As you have perhaps already figured out on the other thread, the `Broadcast` class is still being worked on. It should get stable pretty soon :) Thanks! Using the new firmware it's pretty stable now. I'm doing now some test so each unit is indeed sending and receiving information (will see if I make it work!). But pretty happy now! Thanks a lot for the support! Quote
nikzagvit Posted May 16, 2023 Posted May 16, 2023 (edited) 19 hours ago, nikzagvit said: hi, I'm trying to install the numpy package on ev3, in the terminal. I get an error. Tell me what could be the problem? robot@ev3dev:~$ sudo apt-get install python3-numpy [sudo] password for robot: Reading package lists... Done Building dependency tree Reading state information... Done Package python3-numpy is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source E: Package 'python3-numpy' has no installation candidate I figured it out, Debian moved everything to the archive.To solve the problem, add a new line to file the sources.listdeb http://archive.debian.org/debian stretch main contrib non-free perhaps someone will come in handy Edited May 16, 2023 by nikzagvit Quote
HectorMB Posted May 17, 2023 Posted May 17, 2023 Hello there! I did a little search but unproductive, so i leave the question here: is possible communication between hubs (with Pybricks firmware) and ps4 controller? If not, there's any plan to add this feature in the future? Thanks!!! Quote
Mr Jos Posted May 17, 2023 Posted May 17, 2023 6 hours ago, HectorMB said: Hello there! I did a little search but unproductive, so i leave the question here: is possible communication between hubs (with Pybricks firmware) and ps4 controller? If not, there's any plan to add this feature in the future? Thanks!!! It's possible with this LMS-ESP32 board connected to the Spike. You can then even add more servo's/LED's to your model, or even a touchscreen. https://antonsmindstorms.com/2022/03/22/python-ps4-gamepad-connection-robot-inventor-and-spike-prime-hub/ Quote
HectorMB Posted May 17, 2023 Posted May 17, 2023 Thanks, it looks que interesting indeed. Nevertheless, i guess the main limitation, which makes the LMS-ESP32 necessary, it's because of the technic hubs. Nevertheless, given that the TLG MINDSTORMS app already allows the connection to a ps4 controller, the Mindstorms hubs should be able to connect without any add-on, right? Quote
Mr Jos Posted May 18, 2023 Posted May 18, 2023 10 hours ago, HectorMB said: Thanks, it looks que interesting indeed. Nevertheless, i guess the main limitation, which makes the LMS-ESP32 necessary, it's because of the technic hubs. Nevertheless, given that the TLG MINDSTORMS app already allows the connection to a ps4 controller, the Mindstorms hubs should be able to connect without any add-on, right? It has to do with the difference in Bluetooth, TLG allows the connection in streaming mode, so a PC in between the ps4. Copy pasted from that link above; You might ask: why did LEGO only allow the gamepad via a PC in streaming mode? Doesn’t it have Bluetooth? The problem is that there’s Bluetooth and Bluetooth. More specifically, there is Bluetooth Classic (BTC, BR/EDR) and Bluetooth Low Energy (or BLE). Most gamepads use Bluetooth classic. And the LEGO hub has a chip that can do Bluetooth Classic (BTC). But there’s a catch: the hub runs an implementation of Micropython and has a firmware Bluetooth stack that limits BTC. The stack only runs the RFCOMM protocol – a wireless serial port – and you can only use that protocol to access the Micropython REPL. In all likelihood, LEGO will never change this setup because it is core to the communication with the LEGO apps. The bright side is that the Bluetooth Low Energy (BLE) protocol is accessible for us hackers. In other articles, I have shown how to use that to connect to an Android app or to connect to other LEGO hubs. Alas, most gamepads don’t support BLE. Long story short: the only way to work around this limitation is with some extra hardware. Quote
HectorMB Posted May 18, 2023 Posted May 18, 2023 (edited) Thanks again! I'm not experienced with the language and I might have missed something. What intrigued me in first place was that the Mindstorms app has indeed an option to make a program including control via a ps4 controller, although I didn't try it (Yet). So, it might be that it can be done but going through a PC, tablet or smartphone (which at the end would make the role of the hardware such LMS-ESP32). So, I'm pretty sure that Anton is right and the only way to do this is with an intermediate hardware... Which can be the LMS-ESP32. :). It still intimidates me as I never jumped into something similar, but I guess there's always a first time! :D ps: a LMS-ESP32 is on the way... Edited May 18, 2023 by HectorMB Quote
heyitsdisty Posted May 20, 2023 Posted May 20, 2023 Hey folks, I've been trying to connect two remotes to a single Technic hub (so ports A and B are on one remote and ports C and D are on the other). I'm not a programmer and all my attempts at writing code to connect two remotes has failed. Any solutions? Is it even possible to connect two remotes to a single hub in Pybricks? Quote
vascolp Posted May 20, 2023 Posted May 20, 2023 4 hours ago, heyitsdisty said: Hey folks, I've been trying to connect two remotes to a single Technic hub (so ports A and B are on one remote and ports C and D are on the other). I'm not a programmer and all my attempts at writing code to connect two remotes has failed. Any solutions? Is it even possible to connect two remotes to a single hub in Pybricks? Unfortunately can´t be done in current version. I use the red buttons as shift if I want to command 4 ports or the red buttons as another command if I want to command just 3 things. It includes a lot of other code but you can check an example of this in Remote Bla Bla. Quote
Berthil Posted May 20, 2023 Posted May 20, 2023 6 hours ago, heyitsdisty said: Any solutions? Is it even possible to connect two remotes to a single hub in Pybricks? On the remote I'm using the center button to switch between three modes. My Load Zone MOC on Rebrickable has the Pybricks file as a download, it's easy to see how I programmed the modes. Quote
heyitsdisty Posted May 21, 2023 Posted May 21, 2023 13 hours ago, Berthil said: On the remote I'm using the center button to switch between three modes. My Load Zone MOC on Rebrickable has the Pybricks file as a download, it's easy to see how I programmed the modes. Thanks for this; unfortunately my build really needs all four ports accessible at once, so switching between modes isn't ideal. 15 hours ago, vascolp said: Unfortunately can´t be done in current version. I use the red buttons as shift if I want to command 4 ports or the red buttons as another command if I want to command just 3 things. It includes a lot of other code but you can check an example of this in Remote Bla Bla. Wait, you can use the red buttons? Is that what Button.CENTER is referring to? I always thought it was referring to the green button in the centre of the remote. Is there a way to use the left red and right red buttons independently? (In this case I'm hoping to turn a motor clockwise to a certain position with the left red button, and anticlockwise to another position with the right red button.) Quote
vascolp Posted May 21, 2023 Posted May 21, 2023 3 minutes ago, heyitsdisty said: Wait, you can use the red buttons? Is that what Button.CENTER is referring to? I always thought it was referring to the green button in the centre of the remote. Is there a way to use the left red and right red buttons independently? (In this case I'm hoping to turn a motor clockwise to a certain position with the left red button, and anticlockwise to another position with the right red button.) You can do all that and much more... red buttons are Button.LEFT and Button.RIGHT. Check documentation, it is complete and has a lot of simple examples. Quote
heyitsdisty Posted May 21, 2023 Posted May 21, 2023 1 hour ago, vascolp said: You can do all that and much more... red buttons are Button.LEFT and Button.RIGHT. Check documentation, it is complete and has a lot of simple examples. Sweet, thanks! Button.LEFT and Button.RIGHT are named rather unintuitively to me; I saw them in the documentation earlier but assumed they just meant 'any button (plus or minus) on the left/right'. Nevertheless, very excited to be able to use them! Quote
Lok24 Posted May 21, 2023 Posted May 21, 2023 6 minutes ago, heyitsdisty said: Button.LEFT and Button.RIGHT are named rather unintuitively to me; I saw them in the documentation earlier but assumed they just meant 'any button (plus or minus) on the left/right'. Nevertheless, very excited to be able to use them! Yes, I never found an explanation for that, should be here: https://docs.pybricks.com/en/stable/parameters/button.html but is not. Quote
AVCampos Posted May 21, 2023 Posted May 21, 2023 You can even use the power button in the hub itself for your programs. In that case, however, you'll have to include some way in your program to end it. Quote
Pybricks Posted May 22, 2023 Author Posted May 22, 2023 Quote I never found an explanation for that When you see an issue like this, how about opening an issue at https://github.com/pybricks/support? That puts it on our roadmap for things to fix. :) Quote
PsychoWard666 Posted July 19, 2023 Posted July 19, 2023 Is it possible connect one remote to two hubs in the same time? I build big truck and need 4 motors to drive and I want connect two motors to the each hub and I also need another ports for other functions. And I have another question for another MOC, I have car for race and there will be another car controlled by PU train remote controller with Pybricks. Is there something what I need to do in code or it will be my controller connect only to my hub? I don´t have the remote yet, I ordered one this week. Thank you. Quote
HectorMB Posted July 20, 2023 Posted July 20, 2023 On 5/17/2023 at 5:04 PM, Mr Jos said: It's possible with this LMS-ESP32 board connected to the Spike. You can then even add more servo's/LED's to your model, or even a touchscreen. https://antonsmindstorms.com/2022/03/22/python-ps4-gamepad-connection-robot-inventor-and-spike-prime-hub/ So, I got my LMS-ESP32... but I found that, unfortunately, the connection between hubs and a ps4 controller is only possible -by now, at least- using the Lego software, but not PyBricks. So, I'll be patient if that changes with time... ;) 12 hours ago, PsychoWard666 said: Is it possible connect one remote to two hubs in the same time? I build big truck and need 4 motors to drive and I want connect two motors to the each hub and I also need another ports for other functions. And I have another question for another MOC, I have car for race and there will be another car controlled by PU train remote controller with Pybricks. Is there something what I need to do in code or it will be my controller connect only to my hub? I don´t have the remote yet, I ordered one this week. Thank you. You can control several hubs at the same time, indeed. Just use different tabs, controlling one hub with each one. Quote
Mr Jos Posted July 20, 2023 Posted July 20, 2023 (edited) 5 minutes ago, HectorMB said: So, I got my LMS-ESP32... but I found that, unfortunately, the connection between hubs and a ps4 controller is only possible -by now, at least- using the Lego software, but not PyBricks. So, I'll be patient if that changes with time... ;) From what I read from Anton's website, the PS4 should be connected to the ESP32, and using the BluePad32 library. That should capture the data, then with the UART data communication cable to SPIKE hub it should be able to transfer these inputs. It's all explained in the steps following the above link. Edited July 20, 2023 by Mr Jos Typo Quote
HectorMB Posted July 20, 2023 Posted July 20, 2023 I'm not quite familiar with all this stuff. This is indeed my first attempt off expiring programming in python. I started with Pybricks , but I have still a huge amount of info to understand! ;) Yes, I went through the article and also contacted Anton. Apparently the communication is possible at this moment through the Lego app, but not yet possible using Pybricks. Quote
The_Cook Posted July 23, 2023 Posted July 23, 2023 Does anyone know if it's possible to replicate the LED colour matching that happens when a standard Lego Remote and City Hub pair together? I can't see anything obvious in the documentation that describes how to get the color from the Remote so that I could set the LED on the Hub accordingly. Python isn't my coding language of choice, so apologies if I'm missing something inherent in the language such as "remote.light" simply being the accessor to get at the color information. Reason being is that I've rebuilt the Green Loco from 60198 to contain 2 motors and I therefore need PyBricks to invert Port B so that all the wheels turn in the right direction. I want it to behave as close to the standard Lego mechanisms as possible for the benefit of my 7year old son. He looks to the LEDs on the remote and the hub to see which are pair together hence wanting the colors to match. Quote
Lok24 Posted July 23, 2023 Posted July 23, 2023 This is completely different with Pybricks You have to start the Hub and then connect a remote within 10 seconds (or try it more often) . The colors can bet as you like. Of course with the LEGO process, if you have different remotes and hubs they all can be "blue", not showing which are connected with each other. Quote
The_Cook Posted July 23, 2023 Posted July 23, 2023 (edited) I get that bit. There will always be the "double click" to start the hub and then start the python program to then pair with the remote. On a default Lego firmware once the pairing has occured the Hub and Remote both show the same color of LED. Pybricks defaults to Blue initially, Green once running, but the LED is changeable so if I can get the colour that the remote has chosen then I can set the LED on the hub to that colour but I don't know if it's possible to interrogate the remote to find out which colour it's chosen and displaying. Edited July 23, 2023 by The_Cook Spelling corrections Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.