Jump to content
THIS IS THE TEST SITE OF EUROBRICKS! ×
THIS IS THE TEST SITE OF EUROBRICKS!

Recommended Posts

Posted

I'm not a regular visitor of the train section here on Eurobricks but I think this might be interesting for you :) The Powered Up 3.0 app allows now to have multiple hubs connected, but it does not offer a convenient interface to control the connected trains the same time. I created two code variations in the Powered Up app with the following abilities using the slider control interface:

Simple interface

  • Control 2 trains with the 2 sliders
  • Control the lights of the 2 trains separately with 2 buttons
  • Stop button to stop all trains
  • Code can be customized to control more trains/motors with one slider, e.g. coupled trains

Advanced interface

  • Control 4 trains with the left slider
  • Switch between the trains with the right button (speed and light status of the trains is stored in the app)
  • Left number shows the speed of the current train, right number shows the train selected
  • Left button toggles the light of the currently selected train
  • Middle button stops the currently selected train

The code can be tweaked to control trains with multiple motors and it can be also used to control trains equipped with other type of Powered Up motors as well, or trains using the 4 port hub. 

Here's a video demonstration:

The pdf guide can be downloaded here.

Posted (edited)

This is my approach as well, where each loco may have different profiles to be configured.

You could offer a zip file with the programm as download.

 

Edited by Lok24
Posted
On 2/23/2020 at 10:12 AM, Lok24 said:

This is my approach as well, where each loco may have different profiles to be configured.

You could offer a zip file with the programm as download.

I usually create the Powered Up programs on my iPad as it is easier to navigate compared to my Android phone. I'd need to recreate the apps on the phone to share the files, and not many people are comfortable to tinker with app files on their devices. I think the pdf version for now is pretty straightforward to use and to recreate on any device. Hopefully LEGO will add a sharing function in the future to the app.

Posted
9 hours ago, kbalage said:

 I think the pdf version for now is pretty straightforward to use and to recreate on any device.

I copuld not download because there are strange windows asking for eMail-Adress and buying something.

Each "program" is just some json-fiiles in one folder .

9 hours ago, kbalage said:

 Hopefully LEGO will add a sharing function in the future to the app.

Sharing is possible via LEGO LIFE.

 

Posted
Just now, Lok24 said:

I copuld not download because there are strange windows asking for eMail-Adress and buying something.

Each "program" is just some json-fiiles in one folder .

Sharing is possible via LEGO LIFE.

 

That strange window is required as the download link is e-mailed to you, you don't need to buy anything. Unfortunately LEGO life sharing does not work yet in the Powered Up app, it is only available in the Boost app.

Posted
Just now, kbalage said:

That strange window is required as the download link is e-mailed to you, you don't need to buy anything. Unfortunately LEGO life sharing does not work yet in the Powered Up app, it is only available in the Boost app.

That's why it is much easier to zip the folder ;-)

Posted
Just now, Lok24 said:

That's why it is much easier to zip the folder ;-)

And you will have it blocked by a lot of systems (e.g. Gmail, some virus scanners) because it contains json files.. 

Posted

The program in this form relies on active connections, since the app can connect to 4 hubs simultaneously. When you switch between the hubs it stores the speed value in a variable and reads the value stored for the next one, same goes for the light status. 

 

Posted

Thanks.

On exhibitions it is quite normal that you lose connetion to the engines because you are to far away.

That is why I use some python solutions there which automatically reconnect.

But I'm looking for a solution with my App-Prog, which is obviously very similar to yours, driving 1to 4 locos with multiple profiles each.  

Posted

At the moment unfortunately there's no in-app solution to control the connections automatically. I just did a quick test, if one hub disconnects because it goes too far then you need to push the button on the hub and tap on the hub's name on the connection screen as well. The good news is that it does not affect the order of the hubs, so if number 1 disconnects then number 2-3-etc stays in the same slot. Once you reconnect number 1 it can pick up the speed stored for it previously.

Posted

I think this is only because the option "connect automatically" ist buggy, especially if you have more than one hub.

Having only one sometimes it connects when turning on, in most cases yot have to tap on "connect" in the BT dialog , sometimes you only have to invke the BT dialog without tapping on "connect"

Posted
1 hour ago, izx said:

Gmail isn't blocking json files (which are a plain text database) ... perhaps you're thinking of js (JavaScript) files?

BTW, thanks for including the pages with the popup explanations in the file, Balasz! Very very helpful!

I'm not sure what is exactly blocked and what not, but when I tried to zip the folder on one Android device and e-mail it to the other one it did not work. That's the reason why I choose the pdf file with the comments, I think it is easier to use than trying to troubleshoot the file-copy paste on different Android devices and everyone can recreate the program on iOS devices as well. 

Posted
2 hours ago, kbalage said:

I'm not sure what is exactly blocked and what not, but when I tried to zip the folder on one Android device and e-mail it to the other one it did not work. That's the reason why I choose the pdf file with the comments, I think it is easier to use than trying to troubleshoot the file-copy paste on different Android devices and everyone can recreate the program on iOS devices as well. 

Oh, of course! The PDF is the main thing. Hopefully LEGO introduces easier cross-platform sharing in a future update.

  • 9 months later...
Posted
On 2/25/2020 at 9:32 AM, kbalage said:

At the moment unfortunately there's no in-app solution to control the connections automatically. I just did a quick test, if one hub disconnects because it goes too far then you need to push the button on the hub and tap on the hub's name on the connection screen as well. The good news is that it does not affect the order of the hubs, so if number 1 disconnects then number 2-3-etc stays in the same slot. Once you reconnect number 1 it can pick up the speed stored for it previously.

Hi, i was trying to decipher your guide but i seem to be missing some of the Options in the App (The custom Controllers like sliders etc,) was there any change between the versions ? All manuals i find Refer to a lot of Custom Controllers and i am at a loss if i it wrong ?

Posted
Just now, Jasseji said:

Hi, i was trying to decipher your guide but i seem to be missing some of the Options in the App (The custom Controllers like sliders etc,) was there any change between the versions ? All manuals i find Refer to a lot of Custom Controllers and i am at a loss if i it wrong ?

I created that guide before the custom controllers were introduced, it is using the stock 2-slider interface. With the customization it is much easier to create controls for multiple trains. I don't have the possibility to update the guide at the moment but I will do it when I'll have a chance.

Posted
2 hours ago, kbalage said:

I created that guide before the custom controllers were introduced, it is using the stock 2-slider interface. With the customization it is much easier to create controls for multiple trains. I don't have the possibility to update the guide at the moment but I will do it when I'll have a chance.

i am sorry, it is my fault, i chose the "program" option when creating the project and there those blocks are not visible - my fault

Posted
22 hours ago, kbalage said:

I created that guide before the custom controllers were introduced, it is using the stock 2-slider interface. With the customization it is much easier to create controls for multiple trains. I don't have the possibility to update the guide at the moment but I will do it when I'll have a chance.

i go the program to work correctly, i am trying to figure out now how to add the PU Controller, so i can control the trains via App AND controller at the same time - did you try this ever ? The dosumentation is not very clear from Lego side unfortunately...

Posted

@Jasseji I don't think it is a wise choice to assign multiple controllers to the same motors the same time, what shall be the expected output if both are used? You can make a code to switch between them, although that one is not that simple either. A solution like this requires more knowledge about coding in general, it's not really specific to LEGO's implementation.

Posted

The motor speed is in a variable.

You can change the value of that variable either via poweredUpApp  Controller  or via remote control.
I know some who use this or asked for.

 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...