Cosmik42

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

Recommended Posts

1 hour ago, Phil B said:

There is an active BAP group on FB, including the author.

Hmmm. As old fart and someone who does not do FB for a good number of reasons (not of relevance here):

It appears as if @Cosmik42 has left this forum. Somewhere in this thread he disappeared. In the beginning he was very responsive. I thought he just had it - when a development reaches a certain stage of stability and functionality, it loses its luster. Well, that is what I thought. But learning that there is this active group with the author contributing makes me wonder what caused his shift of activity from EB to FB.

All the best,
Thorsten

 

Share this post


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

But learning that there is this active group with the author contributing makes me wonder what caused his shift of activity from EB to FB.

Well, that may not strictly be true. It appears @Cosmik42 only recently reappeared on the FB group. The group is public, i.e. no account required to simply read posts/comments. As it's public, I can share what the author posted on FB a week ago (January 6, 2020):

Quote

Hi everyone! I have been away from this group for a while because my day job took over most of my spare time. I am back, setting up a new and improved layout.

Hopefully he will reappear here too shortly!

Share this post


Link to post
Share on other sites
10 hours ago, TuxTown said:

I thought lets try it one more time tonight. However now I didn 't succeed in having all hubs keep a stable connection. For some reason I had the situation back from before the bluetooth driver upgrade that one hub is disconnecting all the time. Swapping a hub moves the problem. Very frustrating that after a few weeks I still didn' t have a ride without issues. Not sure whether the connection problems tonight are due to the specific laptop or due to buggy BAP software. I also didn't hear on this forum from anyone who managed to use the self-driving module without problems with 5 to 10 hubs. Does anybody use it succesfully?

Hi TuxTown! Thanks for trying BAP. What you are experiencing is due to your bluetooth dongle and you are simply seeing the limit of BLE device yours can connect to. 
I found a dongle that can connect up to 14 simultaneous devices.

The original link below shows that it is not available anymore, but maybe you can find it somewhere else?

https://www.amazon.de/dp/B007MKMJGO/ref=pe_3044161_185740101_TE_item?fbclid=IwAR1abc9ElM11bo_vzv6oeAsiEFAxxDdodY9MwihJGgYQrP2meCM_RD5zwbs

The best option is always built-in bluetooth because the only limitation to the number of device you can connect with is linked to RAM consuption of the dongle.

9 hours ago, Toastie said:

It appears as if @Cosmik42 has left this forum. Somewhere in this thread he disappeared. In the beginning he was very responsive. I thought he just had it - when a development reaches a certain stage of stability and functionality, it loses its luster. Well, that is what I thought. But learning that there is this active group with the author contributing makes me wonder what caused his shift of activity from EB to FB.

 

Don't worry guys. I am still here. Just hardly available, but even though I don't comment often here, I do answer most of my PM. 

My company has grown from 6 people to almost 20, and that keeps me busy way beyond the usual 9-5pm. I guess it's a good problem to have, but it's not super compatible with hobby time :)
However I recently kinda find a new pocket of time and I am looking at spending some time again on the software. 
So I will be more active here as well as on the FB group.

Cheers!

Share this post


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

The best option is always built-in bluetooth because the only limitation to the number of device you can connect with is linked to RAM consuption of the dongle.

 

 

Hi Cosmik42, thanks for visiting. I don't have a dongle I'm using the buildin bluetooth on a HP Elitebook laptop with 16Gb RAM.

 

Besides that, can you perhaps comment on the problems I described on page 25 of this thread? ( clearing sector before passing the sensor & no events although debug log shows the sensor detected a train)

 

Thanks a lot and keep up the good work.

 

Edited by TuxTown

Share this post


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

Hi Cosmik42, thanks for visiting. I don't have a dongle I'm using the buildin bluetooth on a HP Elitebook laptop with 16Gb RAM.

Then it is another form of hardware limitation from your built-in bluetooth hub I am affraid. Try with a dongle!

As for your message, the way this works is simplified. Basically as soon as you enter a new section, there is a cool-down set at the configuratuion level of the train to define such value.

image.png.facca0980978bae214577d8cc0e1e959.png

Share this post


Link to post
Share on other sites

Can you please explain in more detail the meaning of the train options 1. Time needed... and 3. Section Speed Coeficient?

Regarding 1. the software should know when the train is leaving a section. Its defined by giving the start and end sensor of all section. So what is the function of this option?

Edited by Didicas

Share this post


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

Can you please explain in more detail the meaning of the options 1. Time neede

Option 1 is made this way because sections can be be freed even if a train has not fully left it. As soon as a train is allowed to move to the next section, a cool down is trigger. Once this cool down is over, the current section is freed and the next train can enter it. This is made in a way to fluidify traffic and also allow to run 2 trains with as little as 3 sections. Without it you would need more sections and traffic would be stopped all the time.

Option 2 detects if the next section is free or not. If not, we can prevently slowdown the train before it stops completely when hitting the end of the current section.

Option 3 is to deal with different battery level. If a battery is getting low, you can punch this coffecient up to achieve the same speed accross by just virtually increasing speed.

Hope it helps.  

Share this post


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

Don't worry guys. I am still here. Just hardly available, but even though I don't comment often here, I do answer most of my PM. 

My company has grown from 6 people to almost 20, and that keeps me busy way beyond the usual 9-5pm. I guess it's a good problem to have, but it's not super compatible with hobby time :)

This is wonderful news. Truly wonderful news!

More importantly though: Congratulations on your success!!! Very nice.

As far as I am concerned, you have created the most powerful software for the new line of LEGO electronics. It would have been totally OK if it just was like that: Done and gone. And people figuring out how it works (which is very close to TLG's approach, at least software wise!). Because it is fun.

It is even more fun and much more reassuring to know that you are around!

You have really changed TLG's PuP world with your ingenious software.

All the very best - for your company and you personally!

Thorsten

Share this post


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

This is wonderful news. Truly wonderful news!

More importantly though: Congratulations on your success!!! Very nice.

As far as I am concerned, you have created the most powerful software for the new line of LEGO electronics. It would have been totally OK if it just was like that: Done and gone. And people figuring out how it works (which is very close to TLG's approach, at least software wise!). Because it is fun.

It is even more fun and much more reassuring to know that you are around!

You have really changed TLG's PuP world with your ingenious software.

All the very best - for your company and you personally!

Thanks for the very kind words Thorsten!

Share this post


Link to post
Share on other sites
On 1/15/2020 at 4:11 PM, Cosmik42 said:

Then it is another form of hardware limitation from your built-in bluetooth hub I am affraid. Try with a dongle!

 

Hi Vince,

Being at home for 1 day, I tried  a 20 euro dongle from the local coolblue. (Trust Bluetooth 4.0 USB Adapter) It seems with this thing you can only connect 5 hubs. Googling around I get the impression that doing bluetooth for trains doesn't scale at all. How about 5 trains and 10 switches? Did anyone succeed in doing this or anything larger?

Being away again. Will see how to proceed in februari.

 

Share this post


Link to post
Share on other sites
32 minutes ago, TuxTown said:

Did anyone succeed in doing this or anything larger?

Yes. I am running a VB6 program (yes, VB6:moar:) on a Win10 64bit, Dell 7530 Precision Laptop with built-in Bluetooth. The BLE stack is from n!software and connects to as many BLE devices as I turn on (10 so far; I don't have more ...). I don't know if this is of importance, but I am using the VB6 n!software BLE Client simply as indexed object. And it just scales as I like. I tried 30 and VB6 created 30 individual indexed objects. 

So - just send me BLE devices and I will try to hook them up ... just kidding.

No idea, why that works.

All the best
Thorsten 

Share this post


Link to post
Share on other sites

I've repeatedly connected 14 PUP hubs to my BAP pc with this ioGear Bluetooth dongle: https://www.newegg.com/iogear-gbu521-usb/p/N82E16833139027?Item=N82E16833139027. If I try to connect one more it crashes the program. I had planned to control all my switches with BAP but with 20+ switches, 14 hubs was not enough for all the switches as well as the locomotives so I'm going a different route for switch control and just using BAP for locomotive control.

Dave

Share this post


Link to post
Share on other sites
8 hours ago, bogieman said:

14 hubs was not enough for all the switches as well as the locomotives

Using 4 ports Technic hubs for the switches might help a bit...

Share this post


Link to post
Share on other sites
11 hours ago, bogieman said:

I've repeatedly connected 14 PUP hubs to my BAP

I confirm that I myself run 12 to 14 devices with BAP at once without issues. 

Share this post


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

Using 4 ports Technic hubs for the switches might help a bit...

Agreed, but I didn't become aware of those until recently, and the ship had already sailed...

Share this post


Link to post
Share on other sites

I just started with the BAP software v1.5 (great job, awesome software!). I bought a few Powered UP XL motors (bb0960c01),  Hubs (bb0892c01), Technic Hubs and Color & Distance Sensor 88007.
I was able to connect up to 16 devices to my internal Bluetooth device (Qualcomm Atheros QCA61x4) of my DELL desktop.

When a PUP XL motor is connected to HUB NO.4 the motor is not running when I move the speed slider ( with technic hub no problem).
Sometimes also an error message pops up during connection of the hub with sensor: "ERROR: Issue with color packet. It was too short!!".

Most of the times the battery level of HUB NO. 4 shows 0%, with Technic Hub it's ok (maybe firmware issue with HUB NO.4?).  

Thanks again for the great software!

ScreenShot398n.thumb.jpg.b12b0ebcd6fbbe8d70a2ba510efc50c1.jpg

Share this post


Link to post
Share on other sites

Tried the self-driving module setup I gave on page 25 again with another laptop. On this one I can connect all hubs. One of the differences seems to be that the HP elitebook 850G3 laptop I have has bluetooth 4.2, whereas the better working Acer Aspire has 5.0.  Reading about the differences 5.0 seems to be a lot better. This seems to make it more probable to connect more devices.  Good to read someone used 16 hubs. Connecting  more than a few things via bluetooth seems to be a niche market. And also 16 devices is ofcourse not a very scalable amount if one wants to use a hand full of trains and say some 20 switches.

About the program;

The thing that when I state the trains starts in section 0 results in leaving section 0 before passing its sensor stays peculiar, but ala. More problematic is that passing some sensors does not result in a trigger, although the distance debug log shows the train is detected when passing. I don' t think it's related to the time or distance since the previous sensor, because driving another round and coming at the same point again shows the same behaviour. Not sure how to troubleshoot this.

Edited by TuxTown

Share this post


Link to post
Share on other sites
20 hours ago, TuxTown said:

The thing that when I state the trains starts in section 0 results in leaving section 0 before passing its sensor stays peculiar, but ala. More problematic is that passing some sensors does not result in a trigger, although the distance debug log shows the train is detected when passing. I don' t think it's related to the time or distance since the previous sensor, because driving another round and coming at the same point again shows the same behaviour. Not sure how to troubleshoot this.

Are you using PUP Sensors or PF Sensors? PF Sensors via SBrick are horribly difficult to use because their sensitivity depends on the battery level of the SBrick host!
I would recommend to stick with PUP sensors.

If you are using PUP sensors, then make sure the distance you use is high enough to trigger when the train passes in front of it.

Share this post


Link to post
Share on other sites

I use PUP sensors, both WeDo 2.0 and Lego 88007 color and distance ones. The issue yesterday was with two WeDo sensors. I have them at a 3 studs distance of the track as can be seen on the photo's. Are you saying I should try a bigger distance? The triggers are not just firing when the measured distance changes?

CsWlITN.jpg

9645haM.jpg

Edited by TuxTown

Share this post


Link to post
Share on other sites

Hi @Cosmik42

I stumbled into a weird problem.
I had to but a new laptop (HP Pavillion) and now I can't connect to technic hubs
Old Lap was a Lenovo

Any other device works flawless, Sbrick, Buwizz, Puphub, Boosthub, no problem.

But when I try a technic hub it won't connect

- Start your BAP software
- Press button on Techhub
- Lamp on Techhub goes steady blue
*- Software tells it found a new device, incl. MAC address and waits for about 20seconds
- But than it tells: Error opening communication:Unreachable
- It starts over at *
- Close BAP software but led on Techhub keeps steady lit, ONLY switching off BT on laptop lets it disconnect.
(any other kind of hub now disconnects like it should but not the techhub)
Tried three different techhubs, all the same problem


Okay
Wife not at home so took het laptop (Lenovo) (without a lot of comments)
Here everything works good.

So narrowing down problem is the HP lap
But I really have no idea where to search

Edited by JaBaCaDaBra

Share this post


Link to post
Share on other sites

Hi @Cosmik42,

I played a little with longer distances, but that didn't work. However, changing the sensor distance from 3 to 2 studs does seem to improve things. All sensors are now firing a trigger.

 

I found another thing. In my setup (page 25) I had a path 0, 1, 4, 0, 2, 3, 1, 4, 3, 1, 4, 0, 2, 2, 3, 1, 4, 0.  In there the program/train gets stuck in forever loops because the two times 2 after one another. After the second 2 the end-section-2 sensor doesn't fire a trigger. So I deleted this extra 2. However, in my setup with a crossing this seemed to be a way to make sure the crossing is not occupied.

Edited by TuxTown

Share this post


Link to post
Share on other sites
On 2/4/2020 at 9:52 PM, TuxTown said:

I played a little with longer distances, but that didn't work. However, changing the sensor distance from 3 to 2 studs does seem to improve things. All sensors are now firing a trigger.

Closer is what I meant.

 

On 2/4/2020 at 9:52 PM, TuxTown said:

I found another thing. In my setup (page 25) I had a path 0, 1, 4, 0, 2, 3, 1, 4, 3, 1, 4, 0, 2, 2, 3, 1, 4, 0.  In there the program/train gets stuck in forever loops because the two times 2 after one another. After the second 2 the end-section-2 sensor doesn't fire a trigger. So I deleted this extra 2. However, in my setup with a crossing this seemed to be a way to make sure the crossing is not occupied.

I am not 100% sure what you are trying to achieve, but you can check the option to allow getting into a section only if the very next is free to. 

Share this post


Link to post
Share on other sites
On 2/4/2020 at 8:31 PM, JaBaCaDaBra said:

- Start your BAP software
- Press button on Techhub
- Lamp on Techhub goes steady blue
*- Software tells it found a new device, incl. MAC address and waits for about 20seconds
- But than it tells: Error opening communication:Unreachable
- It starts over at *
- Close BAP software but led on Techhub keeps steady lit, ONLY switching off BT on laptop lets it disconnect.
(any other kind of hub now disconnects like it should but not the techhub)
Tried three different techhubs, all the same problem

Did you try to reboot your computer? This has solved this kind of issue for me in the past.

Share this post


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

reboot

Yes offcourse, multiple times.

Strangest happ is that after closing BAP the techhub remains connected.
I have to shutdown BT on the laptop to let it disconnect.
This makes you think that the laptop itself was connected to the techhub but that was NOT the case.
ones... in the beginning.... I stepped into this trap :sweet:
But now I know that only the EV3 need to be connected and not any other hub.

HP bug?
In the mean time M$ update KB4532695 refuses to be installed.
No idea if this has something to do with it.

I'm going to buy a BT dongle to bypass this problem.
Q:
BT 4.0 or is 5.0 preffered?

Share this post


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

This makes you think that the laptop itself was connected to the techhub but that was NOT the case.

@JaBaCaDaBra, @Cosmik42

I am really no experienced programmer, just building my own code on a Win10/64bit Dell Precision 7530 laptop with latest Windows updates installed. The Bluetooth stack is native Win10 code with built-in Bluetooth radio hardware. I am programming in VB6 (no joke) using a 2016 n/software BLE ActiveX control.

What I do notice (and I am struggling a bit with) is:

Using the "BLEClient.Connect" method throws the "connected" event, even when any LEGO BLE device is turned off. No other commands trying to access the BLE devices don't work of course. This happens whenever the BLE device is registered and visible in the "devices and printers" section of control panel in Win10; when you click on the corresponding icon, it says "paired" (no hubs turned on).

Same hols true for the Disconnect method: The disconnect event is thrown immediately.

It thus looks like that at least my ActiveX control is connecting and disconnecting to the Win10 stack, maybe because it tells the control, that the device is paired(?)

This makes life of course much easier, as you don't have to pair every time you want to use your BLE devices.

Also, when not exiting my program cleanly, i.e., not disconnecting before shutting down, the hubs remain connected, even with may software not running.

Could that be? All the best,
Thorsten

     

 

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.