Cosmik42

Control all your Powered Up & Power Function (SBrick) devices with a single software

Recommended Posts

11 minutes ago, Cosmik42 said:

Yes! The test control activate all of them, but when you set it up on an event you can specify which of the lights are affected. So you can affect different effect to different lights at the same time.

Great - that will allow each brick to be used very efficiently in a layout.

I can imagine using a single PFx brick to control a level crossing in the use case described earlier - with the PF motor, speaker and lighting dock outputs 1-4 used for the crossing itself, and lighting dock outputs 5-8 used for additional signal lights.

Share this post


Link to post
Share on other sites

V1.1 is out -  02/19/19
----------------------------
- New Feature: PFx support!
- Improvement: Better Section Reservation for Self-Driving System.
- Bug Fix: Show proper battery level of remote controls
- Bug Fix: Motor Slider now properly show negative speed.
- Bug Fix: EV3 Motors properly activate on their ports.
- Bug Fix: Train not stopping immediately in Self-Driving module

Download it here: https://www.dropbox.com/sh/w51n3b9ph0zhunj/AAC9OIpjBoqC6CIATQCvk5CGa?dl=1

Share this post


Link to post
Share on other sites

Cheers Cosmik!

I’m away at the moment but will definitely be trying this out at the weekend. Can’t wait :)

Share this post


Link to post
Share on other sites

Thanks so much for developing this software, Cosmik. I'm seriously looking to purchase a 24" touchscreen monitor to incorporate for controlling my layout.

A while ago you mentioned you might add support for 4DBrix. Is that still on you list? Although I don't have any of their products yet, their switch motors seem like a nice solution.

Share this post


Link to post
Share on other sites
Just now, bogieman said:

A while ago you mentioned you might add support for 4DBrix.

I am in touch with them and they are supposed to send me some material.

FYI, I use this model all over my layout using WeDo 2.0 motors plugged to Powered Up hubs.

 

Share this post


Link to post
Share on other sites

I think you can make them even smaller in footprint/minimize parts used - can't tell from the "photograph" (did not watch the video yet): A while ago, I shared this link; it contains a number of similar drives using different motors. There are 4 png graphics files with the mpd's.

The design principle (using 3 technic axles on two 1x4 technic bricks (with 3 holes) to confine the rotation angle) is an ingenious design by Ben Coifman. It was shown in RailBricks issue 9 as Reverse Engineering Challenge and revealed in issue 12.

I just played with the design, reducing the brick count. There are >30 on my layout. Driven by PF, technic varieties, and MicroScout motors.

Best
Thorsten

Share this post


Link to post
Share on other sites
1 hour ago, Cosmik42 said:

I am in touch with them and they are supposed to send me some material.

I assume you've seen the 4DBrix documentation at https://www.4dbrix.com/documentation/arduino/

 

Great project Cosmik, years ago I started on a similar idea (https://github.com/Gumphrie/bcc) with @Asperworking on a Raspberry Pi but didn't get much further than sBrick and Brickster support. The idea was to provide a web interface for controlling the trains that could then work on any wifi networked screen such as an old iPad, then my Raspberry Pi blew up and I didn't get much more time for the project.

Don't know anyone beyond @codefox421 and @legoman666 who actually built the Brickster modules, which are highly compact open source BT receivers. We had lots of fun attempting to fit them into the tiny 3x4 brick case (https://www.shapeways.com/product/RMEMYNGSK/brickster-case?li=search-results-1&optionId=43490793) without severing the contacts, but they can be put in a 4x4 brick.

 

Share this post


Link to post
Share on other sites
9 hours ago, Toastie said:

I just played with the design, reducing the brick count. There are >30 on my layout. Driven by PF, technic varieties, and MicroScout motors.

Sounds like the absolute dream layout! Would love to see pictures!

9 hours ago, bricks n bolts said:

I assume you've seen the 4DBrix documentation at https://www.4dbrix.com/documentation/arduino/

Oh yeah. I am talking with Tom who shared a bit of source code on how to activate his devices.

As a matter of fact the shipping notice from them arrived today!

Share this post


Link to post
Share on other sites
18 hours ago, Cosmik42 said:

V1.1 is out -  02/19/19
----------------------------
-

 

There is one thing I found with Handheld:

Power Button was pressed
FATAL: Something went wrong while reading messages!Der Objektverweis wurde nicht auf eine Objektinstanz festgelegt.

Thanks for your great work!

Share this post


Link to post
Share on other sites
3 hours ago, Lok24 said:

There is one thing I found with Handheld:

Power Button was pressed
FATAL: Something went wrong while reading messages!Der Objektverweis wurde nicht auf eine Objektinstanz festgelegt.

Will test this right now.

A small note about train detection for your layout.

After toying with many solutions, I can confidently say at this point that the only reliable way to detect a train passing by a specific point is with a WeDo 2.0 distance detector coupled with a Powered Up, WeDo 2.0 or Boost Hub.

I have been fighting to get reliable measurement with SBrick+ using WeDo 1.0 distance detectors, and keep failing. The distance at the one things can be detected is 100% dependant on the battery level. Everything is fine with Fresh batteries, but start being unreliable with less than 70% of battery charge (what a waste of batteries!).

Share this post


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

Power Button was pressed
FATAL: Something went wrong while reading messages!

I can't reproduce this.

Share this post


Link to post
Share on other sites

Ok, have a look,

you have to add an event for a specific port for another(!) button, the project here has only this one event

BAP.jpg

Share this post


Link to post
Share on other sites
6 hours ago, Lok24 said:

There is one thing I found with Handheld:

Power Button was pressed
FATAL: Something went wrong while reading messages!

I don't know whether or not this is of any interest in this context: My BLEClient (VB6) crashes when I press the power button on the handheld (only the handheld) when connected. No subscriptions, just a connection.

But this may be just my very own problem. On the other hand, only the handheld's power button does that.

Best,
Thorsten 

Share this post


Link to post
Share on other sites
Just now, Toastie said:

don't know whether or not this is of any interest in this context: My BLEClient (VB6) crashes when I press the power button on the handheld (only the handheld) when connected. No subscriptions, just a connection.

But this may be just my very own problem. On the other hand, only the handheld's power button does that.

Interesting! Unfortunately I am away on a professional trip until Monday and won't be able to test this until then :(

Share this post


Link to post
Share on other sites
1 hour ago, Cosmik42 said:

Interesting! Unfortunately I am away on a professional trip until Monday and won't be able to test this until then :(

Hey, a professional trip maybe fun. At least this is what I always try to pull off.

Was on such a trip the past few days, just to meet a couple of apparently highly engaged people who - for some (to me) unknown reason - can't find a spot in their schedule to bloody talk to each other. I am in this as well - so I suggested that I take the train, travel 500 km towards them,, we meet in a restaurant and talk. And then all of a sudden - it worked. And it was good. And the best part was my - what is it called nowadays: executive time? - around that dinner.

Hope you have some executive time as well!

All the best,
Thorsten

Share this post


Link to post
Share on other sites

@Lok24, I managed to grab my Handled Remote before leaving the office yesterday and managed to track your bug.

It was indeed an edge case! Thanks for finding this one.
The bug is fixed and is available under the same link than 1.1

@Toastie, I am all for more executive time :D Thanks for sharing your own story!

Share this post


Link to post
Share on other sites
46 minutes ago, Cosmik42 said:

@Lok24, It was indeed an edge case! Thanks for finding this one.
The bug is fixed and is available under the same link than 1.1

 

fine, thanks lot.

Did you ever think about to use  all your SBricks with one single Power supply?
 

Share this post


Link to post
Share on other sites
3 minutes ago, Lok24 said:

Did you ever think about to use  all your SBricks with one single Power supply?

I only have 2 of them which use for different purpose. So I never had the usage. But theoretically it should work!

Share this post


Link to post
Share on other sites
18 hours ago, Cosmik42 said:

After toying with many solutions, I can confidently say at this point that the only reliable way to detect a train passing by a specific point is with a WeDo 2.0 distance detector coupled with a Powered Up, WeDo 2.0 or Boost Hub.

 

Very interesting - presumably you mean the WeDo 2.0 motion sensor? (or is there a WeDo 2.0 distance sensor I’ve missed?)

Also - is there a noticeable difference between the WeDo 2.0 sensor and the Boost Color & Distance sensor for distance detection?

Share this post


Link to post
Share on other sites
2 hours ago, ElectroDiva said:

 

Very interesting - presumably you mean the WeDo 2.0 motion sensor? (or is there a WeDo 2.0 distance sensor I’ve missed?)

Also - is there a noticeable difference between the WeDo 2.0 sensor and the Boost Color & Distance sensor for distance detection?

yes it is the motion sensor.

XG BC

Share this post


Link to post
Share on other sites
On 2/19/2019 at 6:28 PM, Toastie said:

I think you can make them even smaller in footprint/minimize parts used - can't tell from the "photograph" (did not watch the video yet): A while ago, I shared this link; it contains a number of similar drives using different motors. There are 4 png graphics files with the mpd's.

The design principle (using 3 technic axles on two 1x4 technic bricks (with 3 holes) to confine the rotation angle) is an ingenious design by Ben Coifman. It was shown in RailBricks issue 9 as Reverse Engineering Challenge and revealed in issue 12.

I just played with the design, reducing the brick count. There are >30 on my layout. Driven by PF, technic varieties, and MicroScout motors.

Best
Thorsten

Thanks for sharing your files Thorsten, I ordered the parts last night to make a couple with the PUP motor.

Dave

Share this post


Link to post
Share on other sites
17 hours ago, ElectroDiva said:

Very interesting - presumably you mean the WeDo 2.0 motion sensor? (or is there a WeDo 2.0 distance sensor I’ve missed?)

Sorry, motion sensor.

As for your question both Boost Color/Distance detector and the motion sensor work well. But the boost one is expensive and harder to find.

Share this post


Link to post
Share on other sites

I'm looking forward to having time to play with this... which might be a few months. Watching some of the videos with the PU controller a thought struck me. Could you use a sequence of button presses on the PU controller to give different programmable commands, similar to how double and triple clicks on a mouse, as well as click and hold differ from a single click? Or is that functionality already built in? I could see it getting really complicated if it could be an arbitrary sequence of presses, e.g., +-++ triggering one event, +-+- triggering a different event

Share this post


Link to post
Share on other sites

Absolutely mind-blowing!
====================

Hi, this is my first post on this forum - have been lurking on Eurobricks for several months now, but decided to finally register after reading this thread. I could get almost no sleep the night I found out about this project, especially after you incorporated the PFx brick support, which, on its own, is a magnificent tool, but has been hard (impossible?) to incorporate in an automated setup. Until now! :)

My life dream is to recreate the whole railway network of my home town in Poland from 30 years ago, maybe as a permanent exhibition where kids (and AFOLs) could play/interact with it in semi-automated modes. To get there in a about 5-20 years, I need to make some smaller steps and the first one is to build one Lego train station that can be operated in an automated mode, just to test the designs and implementations. I was going to use PFx bricks for trains, train and track crossing signaling (picoleds from Brickstuff), motorized switches and boom barriers (PF motors) etc. But I quickly realized that the applications of currently available software are very limiting and would require costly and complicated workarounds or solutions which where not designed for Lego (like Arduino) - and I'd like to stick to original bricks or dedicated products as much as possible. So I kind of ditched it...

But with your software... sky is the limit! And by sky I mean the number of devices the BLUEtooth hardware can handle :) Because of your project, I decided to put my other hobbies on hold, get back to the Lego project and... work longer hours to be able to afford all of the new stuff I need.

Because, as somebody in this thread already pointed out, this project can indeed drive an increased demand for Lego (as well as products of other companies). Take me for example: I put my hobby on hold, stopped buying PF accessories, did not buy the new Lego trains (as I did not want to invest in PUP, as it did not seem to have many advantages over PF). But after testing your software with my PFx bricks a couple of days ago, I already ordered several PUP/WeDo/Boost hubs, remotes, sensors and motors. And as soon as I am able to afford them, I will buy additional PFx bricks (if there are any left) & light boards, Brickstuff lights, 4dbrix yards (maybe some boom barriers as well) and TrixBrix switches. There is an educational benefit as well - this project will give me an incentive to expand my programming skills (so far I know the basics only).

So, @Cosmik42, I can't thank you enough for this marvel. This is truly going to make my life better :) It brought back the hope to be able to make my biggest dream come true one day. But even if I can't, simply because of lack of funds or space, me and my kids are going to have so much fun with the "demo setup", that I'm going to build this year. As @ElectroDiva already said, it is an amazing time to be a train AFOL - so many options on the market already, so many more to come (Bricktracks R104 switches maybe, 4dbrix decouplers?), yet still so many to dream of (double slip switches or power pickup solutions). I know a simple "thank you" is not enough for all the work you put into this and for the decision to share it with us for free, so I'd like to make a "starter" donation - how can I do that?

I promise to give you as much feedback as possible once I have all the parts and a functioning layout. Until then I'm looking forward to further development of BAP and all the implementations the users are sharing. I would also like to thank all the people who have already supported this project by praise (reading input from @Toastie felt like reading my mind), comments, suggestions. This is a great community and I'm glad I finally joined it :)

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.