Cosmik42

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

Recommended Posts

39 minutes ago, ElectroDiva said:

Brick Automation Project

I like this one a lot! BTW - PFx *just* replied and are sending me some samples :D 

But I believe your hardware will arrive first so I'll make sure to jump on it as soon as it arrives.

Share this post


Link to post
Share on other sites

Do you allow me a different opinion about the name of the project?

I do not understand the discussion, The TLG fair play rules allow the naming. In the case we are wrong TLG will tell us. Without any lawsuit or charges, an (in)famous event in germany demontrated last month.

Share this post


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

I like this one a lot! BTW - PFx *just* replied and are sending me some samples :D 

But I believe your hardware will arrive first so I'll make sure to jump on it as soon as it arrives.

Great news - really looking forward to seeing what you come up with!

Maybe you can try out some more complicated scenarios once their additional stuff arrives.

Share this post


Link to post
Share on other sites
58 minutes ago, Giottist said:

In the case we are wrong TLG will tell us.

Yes, like "Held der Steine" learned it a few weeks ago. He is one of the key influencers in Germany, doing a lot of interesting set reviews on YT, and with a 6-digit followership.

Until LEGO "told" him. With a hard-handed letter from the legal department. Turned into a serious PR disaster here, he now produces reviews of clone sets on his channel now - with an audience of hundreds of thousands AFOLs.

The LEGO legal department is not known for subtlety and quite often, not a hoard of common sense.

Share this post


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

Yes, like "Held der Steine" learned it a few weeks ago. He is one of the key influencers in Germany, doing a lot of interesting set reviews on YT, and with a 6-digit followership.

 

Sorry, I do not like to transfer this matter in to an international forum. The true facts are different as claimed: The mentioned youtuber applied for a trade mark (or similar, I'm not an expert) and the rules are that the TLG may disagree. TLG did it, perhaps somewhat clumsy by a letter from a lawyer, but definetly without any threat or penalty charge or something like that. This mentioned youtuber did tell us that deciding fact after a request from other more relaxed indipendent AFOLs. BTW, this mentioned youtuber claimed immediately the TLG changed the PU port plugs just to squeeze only more money out of us obviously without checking the PU concept in advance. Source (in german language): https://www.youtube.com/watch?v=zsCftQIy-pI&t=3s.

I think, Cosmik42 (and you!) demonstrate the opposite by the best way imaginable.

I have a humble request: Can we stop to discuss about this case? I bet, the TLG has nothing against the name of Cosmik42s marvelous work according to their fairness site.

Share this post


Link to post
Share on other sites

It's settled. The Brick Automation Project will release with its V1.0 version tomorrow!

Thanks everyone!

Share this post


Link to post
Share on other sites

As the project is getting more and more popular (rebrickable) you should consider releasing version 0.10 instead of 1.0. Or at least leave a note somewhere that you can't be held responsible for any damage.

It's a shame it has to be, but just think about it for a second.

 

Share this post


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

As the project is getting more and more popular (rebrickable) you should consider releasing version 0.10 instead of 1.0. Or at least leave a note somewhere that you can't be held responsible for any damage.

It's a shame it has to be, but just think about it for a second.

 

Indeed! I will add a proper term of service.

Share this post


Link to post
Share on other sites
V1.0 is officially released!
----------------------------
- New Name: The Brick Automation Project
- EV3 Support!
- Fix of SBrick port (port B and C were inverted)
- Add 'Released' event for PUP Remotes
- Fix Battery Level Not Showing up for PUP Hubs
- Introduce official terms of service
 

Share this post


Link to post
Share on other sites

Hi Vincent,

Does what it should do!

New project, done in 10 minutes:
Press + on Handheld, motor accelerates, release button: train continues with last speed
I should spend some more time to make this more usable.

Idea:

Handheld A+ accelerate
Handheld A- brake
Handheld Astop Stop

Same with B, another train

Handheld  Power: toggle to level 2, having six buttons for switches, signals, crossing ...

Many thanks for sharing your work!

Edited by Lok24

Share this post


Link to post
Share on other sites
Note to self: don't introduce an improvement when doing a hot fix 😅
I added a bug when adding auto-size of Hub name to ensure visibility of hub's battery level. Fix has been uploaded to the same folder 😅

Share this post


Link to post
Share on other sites
So I progressed really well with the PFx integration. But I have a question for people who actually own one of these little marvel. How do you use it? Do you pre-set it and just turn on everything? What would you want to 'control' from BAP.
 
So far I have the obvious 2 motors control, and I can individually turn on and off lights from 1 of the 8 light channels. But I am trying to understand what is the best intergration use case. Thanks!

Share this post


Link to post
Share on other sites
1 hour ago, Cosmik42 said:
So I progressed really well with the PFx integration. But I have a question for people who actually own one of these little marvel. How do you use it? Do you pre-set it and just turn on everything? What would you want to 'control' from BAP.
 
So far I have the obvious 2 motors control, and I can individually turn on and off lights from 1 of the 8 light channels. But I am trying to understand what is the best intergration use case. Thanks!

I would like to be able to have a sensor from another device play a certain sound track when arriving at a station is one example. Also have buttons on the Pup remote activate prescribed sound sequences. 

Share this post


Link to post
Share on other sites
1 minute ago, supertruper1988 said:

I would like to be able to have a sensor from another device play a certain sound track when arriving at a station is one example. Also have buttons on the Pup remote activate prescribed sound sequences. 

Loud and clear. Should be easy to do :)
What about lights, do you do some fancy light effects?

Edited by Cosmik42

Share this post


Link to post
Share on other sites
On 2/8/2019 at 9:21 PM, Lok24 said:

Hub[0].SetLEDColor(Colors.BLUE);

Compiling failed.
Error (CS1502): The best match for the overloaded 'LegoTrainProject.Hub.SetLEDColor (LegoTrainProject.Port.Colors)' method has some invalid arguments.
Error (CS1503): Argument '1': Unable to convert 'LegoTrainProject.DynamicCode.Colors' into 'LegoTrainProject.Port.Colors'.

Hi, I had to do:

Hub[0].SetLEDColor(Port.Colors.BLUE);

LegoTrainProject.Port.Colors makes me think that the context for the Colors is port - this is where it is used for reading a port color. I'm very very new to C#, trying to learn...

Share this post


Link to post
Share on other sites
7 hours ago, Cosmik42 said:
So I progressed really well with the PFx integration. But I have a question for people who actually own one of these little marvel. How do you use it? Do you pre-set it and just turn on everything? What would you want to 'control' from BAP.
 
So far I have the obvious 2 motors control, and I can individually turn on and off lights from 1 of the 8 light channels. But I am trying to understand what is the best intergration use case. Thanks!

Hey Cosmik - really good to hear you’ve received my package and that you’re already starting to get results with the hardware!

Not sure if you’ve seen this - but the system is actually really well documented on the Fx bricks website here (including usage guides, a full BLE interface guide, some APIs with source code and even a sound effects library : )

 

In terms of functionality for your software and the PFx kit - here’s what I’d like to be able to do:

1- On the 2 standard power functions outputs, i’d like to have the same controls as you have implemented for the SBrick - i.e. basic power functions motor and light control (perhaps with the addition of motor speed gradient control if that isn’t already available). I’d also like to be able to trigger these outputs based on an event associated with another device in the network (e.g. a sensor connected to a PUP hub or EV3 brick)

2- On the speaker output, i’d like to be able to trigger one of the stored sound effects based on an event associated with the PFx brick or one of the other devices in the network.

3- On the lighting dock output, I’d like to be able to trigger one of the PFx brick’s preset lighting effects (documented in the brick interface control document) or individual lighting pin outputs based on an event associated with the PFx brick or one of the other devices in the network.

 

To bring the above functionality together with some real world examples - here’s a couple of use cases:

A- Automating a Level Crossing. Train passes a section of track, triggering an onboard or trackside sensor connected to a PUP hub. That sends an event to a PFx brick controlling a level crossing. The PFx brick’s 2 power functions outputs are used to lower the barriers. The PFx brick’s lighting dock output is used to start flashing warning lights. The PFx brick’s sound output is used to sound a warning alarm. The train passes another section of track, triggering another sensor and a second event is sent to the PFx brick allowing the barriers to be raised again and lights to be switched off.

 

B- Automating a Steam Train.

Steam loco with a PFx brick sets off on a preset journey (ideally at a set time). As it pulls away from the station - the lights turn on, steam buildup sounds are triggered, a horn/whistle sound is triggered, and the motor gradually ramps up to a preset speed.

As the train passes another section of track near the next station, an onboard or trackside sensor connected to a PUP hub is triggered, sending an event to the PFx brick to gradually ramp down the motor, trigger a horn/whistle sound, trigger steam release sounds and turn off the lights.

Share this post


Link to post
Share on other sites

Consider it done ;)

1 hour ago, Jade124 said:

Hi, I had to do:


Hub[0].SetLEDColor(Port.Colors.BLUE);

LegoTrainProject.Port.Colors makes me think that the context for the Colors is port - this is where it is used for reading a port color. I'm very very new to C#, trying to learn

Glad you got it to work!

Share this post


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

Hi, I had to do:


Hub[0].SetLEDColor(Port.Colors.BLUE);

LegoTrainProject.Port.Colors makes me think that the context for the Colors is port - this is where it is used for reading a port color. I'm very very new to C#, trying to learn...

Ahhh! Thanks, I'l give it a try.

Share this post


Link to post
Share on other sites
45 minutes ago, ElectroDiva said:

To bring the above functionality together with some real world examples - here’s a couple of use cases:

A- Automating a Level Crossing. Train passes a section of track, triggering an onboard or trackside sensor connected to a PUP hub. That sends an event to a PFx brick controlling a level crossing. The PFx brick’s 2 power functions outputs are used to lower the barriers. The PFx brick’s lighting dock output is used to start flashing warning lights. The PFx brick’s sound output is used to sound a warning alarm. The train passes another section of track, triggering another sensor and a second event is sent to the PFx brick allowing the barriers to be raised again and lights to be switched off.

 

B- Automating a Steam Train.

Steam loco with a PFx brick sets off on a preset journey (ideally at a set time). As it pulls away from the station - the lights turn on, steam buildup sounds are triggered, a horn/whistle sound is triggered, and the motor gradually ramps up to a preset speed.

As the train passes another section of track near the next station, an onboard or trackside sensor connected to a PUP hub is triggered, sending an event to the PFx brick to gradually ramp down the motor, trigger a horn/whistle sound, trigger steam release sounds and turn off the lights.

Amazing ideas. This project is indeed something else!!!

Share this post


Link to post
Share on other sites

Productive weekend! PFx first implementation is done. Just some clean up left.

Hope to release this tonight!

 

Share this post


Link to post
Share on other sites

Looks awesome Cosmik - really good progress!! 

 

Glad to see you’ve managed to crack the different lighting effects. Are the various lighting outputs on the lighting dock expansion also individually controllable? 

Share this post


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

Glad to see you’ve managed to crack the different lighting effects. Are the various lighting outputs on the lighting dock expansion also individually controllable?

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.

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.