Lowa

Advanced Powered Up Control

Recommended Posts

We've been working on adding support to control LEGO Powered Up hubs directly from our train automation software.  One of the goals is to be able to support more advanced ways to control your PU hubs in LEGO trains:

  • Control multiple trains from one device.  If you save the project as a web interface, you can control all the trains from a phone or tablets.  If you have PF trains, you can use our WiFi controllers to control those from the same device as your PU trains.
  • Link two (or more) hubs so you can create trains with multiple powered locomotives.  
  • Control locomotives that have two motors.  Both motors will automatically spin at the same speed but in the opposite direction (because that's how you have to mount them in the train). 

The video below illustrates what we're able to do at this point.  I used a little demo setup so it's easier to see what we're doing. 

Let us know if there is a potential application that we missed.

 

Share this post


Link to post
Share on other sites

I really like this! Any chance you can support SBrick and PFx brick as well? 

I know there is another project out there that can do it all but it is windows 10 only so I was looking for something I can use on my mac and win 7 PC's 

Also would it be possible to use the computer as a hub of sorts where it takes control inputs from the PUp remote and then relays that to a specific train? This would be more inviting for play but you could also setup the buttons on the remote to do other stuff like throw switches for operations. 

I know you have a lot in the works but I really like where this is all headed!

Share this post


Link to post
Share on other sites

@Lowa

I am really deeply impressed. You guys have so many brilliant ideas (just take the curved switches alone).

What I like so much about your software is the "cleanliness". It is very intuitive - and at the same time very powerful. I mean, you can run your own python scripts, operate BLE and 4DBrix WiFi devices … and all that is tile oriented and highly modular. And: It is a track designer on the side … Wow.

This is so well thought out!

Plus: Help from your side comes fast and efficient. Really nice.

Best regards,
Thorsten  

Share this post


Link to post
Share on other sites
On 6/12/2019 at 3:12 PM, Roadmonkeytj said:

Im really liking the work your doing!

 

Thank you!

Share this post


Link to post
Share on other sites
On 6/12/2019 at 3:21 PM, supertruper1988 said:

I really like this! Any chance you can support SBrick and PFx brick as well? 

That's the plan.  The user interface is there, it's just a matter of communicating with those controllers.  I don't have any experience controlling those from Python so we first need to figure that one.  If there's anyone that has SBrick sample code, please let me know...  The SBrick website has an example using gatttool but that only works on Linux.

On 6/12/2019 at 3:21 PM, supertruper1988 said:

I know there is another project out there that can do it all but it is windows 10 only so I was looking for something I can use on my mac and win 7 PC's 

Our system is supported on Windows, macOS, Linux and Raspberry Pi.  I haven't tried it on Windows 7 but in theory it should work.  It does require a BLE112 dongle.  For the Raspberry Pi fans: we experimented with Bluetooth communication using the on board controller.  It did work on the RPi model B running on Jessie, however, it did not work on the RPi model B+ running on Scratch.  We could make the connection, send a command to start the motor and then the RPi lost the Bluetooth connection.  We didn't manage to fix that, an online search seems to indicate the model B+ has stability issue with WiFi and Bluetooth connections.  Our tests confirmed that...  It does work fine on both the model B and B+ with the BLE112 dongle so at that works on all platform that's what we standardize the software code on.

Note that you can connect your phone or tablet over WiFi to the system running nControl.  If you save your project as a web interface, you can control all your trains from that phone/tablet.  That works with Android, iOS and Fire devices, even the old ones.  You just need a browser that support javascript and html 5.

On 6/12/2019 at 3:21 PM, supertruper1988 said:

Also would it be possible to use the computer as a hub of sorts where it takes control inputs from the PUp remote and then relays that to a specific train? This would be more inviting for play but you could also setup the buttons on the remote to do other stuff like throw switches for operations. 

In theory it should be possible to receive inputs from the PU remote, I just haven't tried it.  Once that's done, you could decided how your computer should respond to the instructions of the remote.  In theory you could use one of the controls on the remote as a 'device selector' and the other one to control it.  The main issue that I see is how to you know what device you have selected ?  We could show that on a mobile device, but then you might as well take that device to control the layout...

Share this post


Link to post
Share on other sites
4 hours ago, Lowa said:

... The main issue that I see is how to you know what device you have selected ?  We could show that on a mobile device, but then you might as well take that device to control the layout...

If on the users’ computer, they can define which color channels correspond to which functions, would it be possible to set up a... “super channel” of sorts? I don’t quite know how to explain this, so hopefully this crudely typed diagram will help:

Channel RED =

=> RED A 

——> red A1

——> red A2

——> red A3

——> red A4

=> RED B

——> red B1

——> red B2

——> red B3

——> red B4

 

What I’m more or less trying to ask is if it would be possible to create a set of sub-channels per each of the five currently available channels?  In my head, each of the sub channels could be identified by a flash of the main color followed by a white flash in the number of which sub channel has been selected...? 

Even with such an implementation however, it is still *wholly* up to the user to define & remember which witch is which...

 

Did any of this make sense to anyone...?

Share this post


Link to post
Share on other sites
On 6/12/2019 at 4:17 PM, Toastie said:

@Lowa

I am really deeply impressed. You guys have so many brilliant ideas (just take the curved switches alone).

What I like so much about your software is the "cleanliness". It is very intuitive - and at the same time very powerful. I mean, you can run your own python scripts, operate BLE and 4DBrix WiFi devices … and all that is tile oriented and highly modular. And: It is a track designer on the side … Wow.

This is so well thought out!

Plus: Help from your side comes fast and efficient. Really nice.

Best regards,
Thorsten  

Thank you for appreciating what we've done so far and sharing this with the community!

 

13 hours ago, M_slug357 said:

What I’m more or less trying to ask is if it would be possible to create a set of sub-channels per each of the five currently available channels?  In my head, each of the sub channels could be identified by a flash of the main color followed by a white flash in the number of which sub channel has been selected...? 

Even with such an implementation however, it is still *wholly* up to the user to define & remember which witch is which...

That's an interesting idea!  The PU hub is indeed able to change the LED color of the remote, so it should be possible to change the LED color from the control software.  I'm just not sure if the remote broadcasts a push of the green button.  If that's the case, that could be the selector button.  If that's not the case, you would have to use one of the buttons of the two controls limiting the functionality of that one.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.