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

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


Recommended Posts

Posted
On 6/27/2020 at 11:58 PM, Cosmik42 said:

Hi everyone,

I have finally release the source code of this project. My life choices simply prevent me to engage further in this project, and it would be stupid not have the community take over and make it even better!
You can download the full source code here: https://github.com/Cosmik42/BAP

Feel free to upload some pull-request and help improve this software!

Here an example to set different speeds for every train for each section in the code editor of the PAB software.  Many thanks to Cosmik42 who was so nice to release the source code.

 

BAP train speed in section

 

  • Replies 745
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

Posted
On 6/27/2020 at 11:58 PM, Cosmik42 said:

I have finally release the source code of this project.

@Cosmik42

I totally missed this - no idea why.

But your move is so incredibly reassuring: We remain to be a real community here on EB - which is entirely not the case in so many other "places" in life.

Thank you very very much for doing this.

For me it makes the whole difference.

All the very best wishes and hopes for your endeavors!

Sincerely,
Thorsten

Posted
On 10/3/2020 at 11:32 PM, Toastie said:

But your move is so incredibly reassuring: We remain to be a real community here on EB - which is entirely not the case in so many other "places" in life.

Thank you very very much for doing this.

For me it makes the whole difference.

All the very best wishes and hopes for your endeavors!

Thank you kindly sir! 
Your energy and passion in this forum was a great source of inspiration to continue working on this project.

  • 2 months later...
Posted (edited)

I posted on the repo, does anyone have instructions to compile the msft c++ app on a machine without visual studio?  I only have visual code and ms build to compile this.  But if someone tells me how to do it I will provide my experience here.

 

Also, if anyone can clearly demonstrate to me that they can compile cross-system for OSX, I will ship you a Mac Mini to test dev builds.

 

Thanks to everyone working on this cool project!

Edited by ixodie
Posted

Could it somehow be possible to do a communication to an old RCX via the infrared tower ? - Or communicate to powerfunktions motors and sensors via the WEDO Hub ?

I have about 25 old school RCX and a whole bunch of 9v motors to it, that I want to use controling my trains instead of buying new Sbricks/powered up.

Posted
1 hour ago, Stoffer70 said:

I have about 25 old school RCX and a whole bunch of 9v motors to it, that I want to use controling my trains

Wow, lucky you!!!

Now, do you want the RCX' on the trains? Or have them controlling power to (sections) of track?

Best,
Thorsten

Posted
22 minutes ago, Toastie said:

Wow, lucky you!!!

Now, do you want the RCX' on the trains? Or have them controlling power to (sections) of track?

Best,
Thorsten

Thanks.

No not on the trains. I use them to control sektions of 9v tracks and to control change track. And also I use them to shift light in signal posts.  

I have made several home made sensors to the RCX with Reed sensors that can detect a driving train. 

But after reading this very interesting post about the Brick automation projekt,I thought that maybe it could be possible to control everything incl my new trains in this program?

Posted

Well, I am afraid that won't work. At least not in a straight forward approach.

You would need to convert the (IR) serial protocol of the RCX/tower into Bluetooth LE communication. As far as I understood, this is what @Cosmik42's software does: BLE bidirectional communication. Now, one thing would be to lift the RCX com to BL (but not BLE) com via a NXT brick equipped with a HiTechnic IR sensor. Guess they are sold out though. I have two and they work perfectly well in terms of NXT to RCX com. Problem is: Range, as the HiTechnic sensor is rather limited. I solved that issue by making my own IR <-> RF converters (bluntly copying any 38kHz IR signal to RF). Next thing to do would be to hook-up the NXT to @Cosmik42's program. Don't know if that works. But if, you would have access. 

With regard to the WeDo Hub: I am out. Provided this is a hub using BLE as well: No. As far as I know there is no channel from RCX/serial to BLE via @Cosmik42's software.

But then others may know better.

What I did, was to get hold of a BLE client for Windows, and then use my own program to talk to a) the RCX'es on my layout via serial IR -> RF RF-> IR -> RCX and to PF via serial IR -> RF RF -> HiTechnik sensor -> NXT then NXT -> HiTechnic sensor IR -> RF -> RF -> IR -> PF. And b) the BLE PU hubs are accessed via the nSoftware BLE client for Windows directly. All runs on VB6/32 bit from 1998 on a Win10/64bit machine with USB to serial converters.

Let me know if you want to know more. I have about 10 RCX doing work on my layout.

Best
Thorsten

 

     

  • 3 years later...
Posted (edited)

Well, I finally found the perfect solution to my train problems, the BAP.
Sadly, it does not work. It gave me this error
FATAL ERROR: We could not initialize the bluetooth watcher
Exception: Zařízení není připraveno k použití. (Výjimka na základě hodnoty HRESULT: 0x800710DF)          <- Sorry, my default language wasn't english, and I restarted PC several times and it didn't help

 

See the end of this message for details on invoking 
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************


System.Exception: Zařízení není připraveno k použití. (Exception from HRESULT: 0x800710DF)
   at Windows.Devices.Bluetooth.Advertisement.BluetoothLEAdvertisementWatcher.Start()
   at LegoTrainProject.MainBoard.toolStripButtonEnableScanning_Click(Object sender, EventArgs e) in C:\Users\Cosmik\Dropbox (Lucky Duck Games)\Private\LuckyDuck\The Lego Project\Source\LTP.Desktop\Main UI\MainBoard.cs:line 1570
   at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
   at System.Windows.Forms.ToolStripButton.OnClick(EventArgs e)
   at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
   at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
   at System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met)
   at System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met)
   at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
   at System.Windows.Forms.ToolStrip.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** Loaded Assemblies **************
mscorlib
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.9261.0 built by: NET481REL1LAST_C
    CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll
----------------------------------------
LegoTrainProject
    Assembly Version: 1.0.0.0
    Win32 Version: 1.0.0.0
    CodeBase: file:///C:/Users/jenik/Downloads/Release%20V1.5/LegoTrainProject.exe
----------------------------------------
System.Windows.Forms
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.9251.0 built by: NET481REL1LAST_C
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.9261.0 built by: NET481REL1LAST_C
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Drawing
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.9037.0 built by: NET481REL1
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
Windows.Devices
    Assembly Version: 255.255.255.255
    Win32 Version: 10.0.10011.16384
    CodeBase: file:///C:/Windows/SysNative/WinMetadata/Windows.Devices.winmd
----------------------------------------
System.Runtime
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.9037.0
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Runtime/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Runtime.dll
----------------------------------------
Windows.Foundation
    Assembly Version: 255.255.255.255
    Win32 Version: 10.0.10011.16384
    CodeBase: file:///C:/Windows/SysNative/WinMetadata/Windows.Foundation.winmd
----------------------------------------
System.Runtime.InteropServices.WindowsRuntime
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.9037.0
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Runtime.InteropServices.WindowsRuntime/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Runtime.InteropServices.WindowsRuntime.dll
----------------------------------------
System.Configuration
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.9037.0 built by: NET481REL1
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Core
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.9261.0 built by: NET481REL1LAST_C
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll
----------------------------------------
System.Xml
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.9037.0 built by: NET481REL1
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
Accessibility
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.9037.0 built by: NET481REL1
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Accessibility/v4.0_4.0.0.0__b03f5f7f11d50a3a/Accessibility.dll
----------------------------------------

************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuration>
    <system.windows.forms jitDebugging="true" />
</configuration>

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.


I still can't figure out what is wrong, any ideas?

Edited by Polja22
Posted
On 8/29/2024 at 10:23 AM, Polja22 said:

Well, I finally found the perfect solution to my train problems, the BAP.
Sadly, it does not work. It gave me this error
FATAL ERROR: We could not initialize the bluetooth watcher
Exception: Zařízení není připraveno k použití. (Výjimka na základě hodnoty HRESULT: 0x800710DF)          <- Sorry, my default language wasn't english, and I restarted PC several times and it didn't help

 

See the end of this message for details on invoking 
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************

 

...


I still can't figure out what is wrong, any ideas?

Well, silly me, I had my bluetooth off :P

 

Posted
On 8/29/2024 at 12:46 PM, Polja22 said:

Well, silly me, I had my bluetooth off :P

Glad you fixed it! Was about to come reply to try just that :)

  • 1 month later...
Posted
On 8/29/2024 at 12:46 PM, Polja22 said:

Well, silly me, I had my bluetooth off :P

There should be a graceful handling in case bluetooth is off, this is just sloppy programming :(

Posted
1 hour ago, JopieK said:

There should be a graceful handling in case bluetooth is off, this is just sloppy programming :(

It's an open source project that was only meant for me. Feel free to contribute state of the art programming! 😘

Posted
1 hour ago, JopieK said:

this is just sloppy programming :(

Hmmm. On professional for pay software - yeah.

On a project like this one [which I found and find simply mind-blowing, particularly when looking back (in this thread) at the light speed pace, this was developed by @Cosmik42], all the "could be", "would be", "what could possibly go wrong", etc. issues are certainly not in forefront programming focus.

Now, foreseeing that a potential user has BT radio off when using BLE devices also needs some "imagination" ... believe me - I am no. 1 in line for such failures, but when I find out, I usually slap my head (hard) to get my brain into the clear. It's like calling Comcast, and they ask you: "Well, did you double-check that you turned your device on?" Or even better: "Is it plugged in?" :pir-laugh:

I guess it is more like: If you don't know what you are doing, do it anyway, but don't blame others if it does not work (rather than sloppy programming) ... :pir-huzzah2:

Here is to SP (sloppy programming) - I am in!

All the best, and keep it rolling,

Thorsten

Posted

Totally agree, I was there when  it was being developed and it was amazing too see someone do daily updates and requests when dealing with a FT job and family. I use this app every day and the only BT issue I have is after a Windows Update and remembering to do a reboot as MS never resets the BT properly after an update. 

Posted
On 10/11/2024 at 9:20 PM, Cosmik42 said:

It's an open source project that was only meant for me. Feel free to contribute state of the art programming! 😘

Well maybe indeed I'm too much used to give feedback on software of others (as an undergraduate embedded systems teacher). Even though I encourage my students to also give me feedback on my code, next periode we will actively be doing that via GitHub.

But still, it should be not that difficult to add it, making graceful handling of unexpected events wouldn't hurt.

Apart from that, of course it is a lot of work and effort. Also really great that you open sourced it.

Probably after my (part-time) PhD I will use your ideas and create an automated LEGO train layout myself. My 'LEGO'-cellar was done over the summer, but they still need to build the upper floor, after that we need to move the pallets from storage (at my brother in law's cheese warehouse) back (looking forward to it as I miss the LEGO building, did some smaller projects but nothing substantial for myself). B.t.w. probably I would go for C++, C# is not too bad I think, but I mostly use macOS, probably a Pi 5 would be the base for controlling everything.

Posted
15 hours ago, JopieK said:

after that we need to move the pallets from storage (at my brother in law's cheese warehouse) back (looking forward to it as I miss the LEGO building,

Now that's a real cheese brick!

Posted
2 hours ago, zephyr1934 said:

Now that's a real cheese brick!

Hope all my bricks haven't turned into 1 x 1 cheese slopes indeed :) We'll have to see!

Posted
On 10/11/2024 at 9:20 PM, Cosmik42 said:

It's an open source project that was only meant for me. Feel free to contribute state of the art programming! 😘

Just to inform you, the Brick Automation Project version 1.6 has been released on lgauge.com with some new features.

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.

Announcements

  • THIS IS THE TEST SITE OF EUROBRICKS!

×
×
  • Create New...