Cosmik42

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

Recommended Posts

Just now, Toastie said:

Instead of scanning for devices I am directly connecting to the unique device address of each BLE server

I think this works well for you, but it is also less user friendly and requires a lot more tech knowledge. 

Share this post


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

 

  • Bug fix: Better handling of faulty device connection

 

Whatever device affected it before, is not anymore :classic:

Capture 2

Thanks again for sharing your hard work!

Unfinished_Projects

Edited by Unfinished_Projects

Share this post


Link to post
Share on other sites

Yes, that is entirely true.

But maybe a text file made with Windows Editor in the format: "Friendly train name: BLEaddress" that your program could parse upon startup or request by user could work. For example:

CargoTrain1: 90:84:2b:01:80:ac (The latter numbers are what the Windows "devices and printer menu" shows you for a know BLE device)

Best
Thorsten

Share this post


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

But maybe a text file made with Windows Editor in the format: "Friendly train name: BLEaddress" that your program could parse upon startup or request by user could work. For example:

CargoTrain1: 90:84:2b:01:80:ac (The latter numbers are what the Windows "devices and printer menu" shows you for a know BLE device)

But what is the usage scenario?

Oh I think I get it. During convention if others are turning on their Hubs and we pick it up?
I think I have an idea on how to manage this elegantly.

Share this post


Link to post
Share on other sites

Does anyone has a PF tilt sensor and SBrick Plus? If so, could you tell me if the sensor works and if the output makes sense?

(I don't own a tilt sensor).

Share this post


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

But what is the usage scenario?

Oh I think I get it. During convention if others are turning on their Hubs and we pick it up?

You are completely right, as it works now it is very user-friedley, but might lead to problems during conventions.

Perhaps reserve a global variable in the global code, i.e. DEVICELIST=""

And in your program : if (DEVICELIST == "") -> behavior like now

If user fills DEVICELIST = (adr1;adr2;adr3....) then filter only these

Therefore it would be useful to display the adress of a connected device somewhere.

Like a "properties" popUp for each device, showing connection, adress, type, firmware, battery-level (in Volt!), connected ports  and so on

Just a suggestion.

Going to try your your new version soon.

Thanks for your work!

 

Share this post


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

Perhaps reserve a global variable in the global code, i.e. DEVICELIST=""

And in your program : if (DEVICELIST == "") -> behavior like now

If user fills DEVICELIST = (adr1;adr2;adr3....) then filter only these

Actually the best approach is the following :

 - Prepare your project at home in a normal way. Save it. This way the program knows your device id.
 - At convention, click a button in settings that says 'Attempt to connect only to devices from this project'.


This way you don't even need to know what a bluetooth address is and the scenario is covered.

Share this post


Link to post
Share on other sites

Sounds good, but at conventions often meet many people to build a huge layout, with many different trains.

And what if someone wants to test my shuttle-project with his own loco?

Sure this is not the "normal" user and needs no prority , but for advaced users it's no problem to enter a list of adresses, we do that with the python/raspberry/SBrick-environment usually.

 

 

Edited by Lok24

Share this post


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

Does anyone has a PF tilt sensor and SBrick Plus? If so, could you tell me if the sensor works and if the output makes sense?

(I don't own a tilt sensor).

I have a tilt sensor, but i have problems to connect to my sBrickPlus (LTP V0.5) SBrick with newest Firmware, 8878 PF Akku for power:

Error opening communication:Unreachable

Discarding Bluetooth ......

 

Share this post


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

Sure this is not the "normal" user and needs no prority , but for advaced users it's no problem to enter a list of adresses, we do that with the python/raspberry/SBrick-environment usually.

Also, I believe that a brief instruction how to find out the MAC address of a LEGO hub (at least on a Win10 machine - I doubt it is much more complicated on others) is not that advanced: -> Control panel -> Devices and printers -> Add device (progress bar appears, turn on hub) and there it shows.

Best,
Thorsten

 

Share this post


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

Error opening communication:Unreachable

Discarding Bluetooth ......

Make sure to unpair the device with windows by removing your SBrick from your paired list.
Let me know if this fixes your problem!

1 hour ago, Lok24 said:

Sure this is not the "normal" user and needs no prority , but for advaced users it's no problem to enter a list of adresses, we do that with the python/raspberry/SBrick-environment usually.

@Toastie, @Lok24, noted. Will prepare something.

Share this post


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

Also, I believe that a brief instruction how to find out the MAC address of a LEGO hub (at least on a Win10 machine - I doubt it is much more complicated on others) is not that advanced: -> Control panel -> Devices and printers -> Add device (progress bar appears, turn on hub) and there it shows.

 

.... no? Shows only Name....

Share this post


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

Make sure to unpair the device with windows by removing your SBrick from your paired list.
Let me know if this fixes your problem!

yup, much better

7 hours ago, Cosmik42 said:

Does anyone has a PF tilt sensor and SBrick Plus? If so, could you tell me if the sensor works and if the output makes sense?

i recognised three Values, 255, 3 and 10 for every other position

255:

DSC_2296.jpg

3:

DSC_2295.jpg

Edited by mawe

Share this post


Link to post
Share on other sites

Hi

V0.5 doent work as expected....

1.) Prog anti-collision-example.ltp is loaded at startup

2.) my prog shuttle-train cannot be loaded

f3.png

 

Share this post


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

V0.5 doent work as expected....

1.) Prog anti-collision-example.ltp is loaded at startup

2.) my prog shuttle-train cannot be loaded

Fixed. Please download from the same link. Thanks!

Share this post


Link to post
Share on other sites

Yes, much better, thanks a lot.

But anti collision is still loaded at startup (but can't work, due to lack of sensors)

and my "own" project is always shown as "Program #1" in the register (what is just a cosmetic issue :classic:)

 

Share this post


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

.... no? Shows only Name.... 

Click on the symbol for the hub/BLE device. Should says something like:

"Hub No.4   Modell: Bluetooth LE Device 90842b0180ac"

The last part is the MAC address in hex (0x90 0x84 0x2B 0x01 0x80 0xAC) which is the one of my hub.

You can also double click on the symbol and go to "Angeschlossenes Gerät" - here you can copy the address (in two different formats)

Best
Thorsten

 

 

 

 

 

Share this post


Link to post
Share on other sites

Hi, no, klicking there doesn't do anything. but I can find the MAC of course in the details of the device, but only with "weitere bluetooth optionen", so no probs with that.

f4.png.921e5504e1c4ca0f1ec8279b68af4e73.png

Edited by Lok24

Share this post


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

i recognised three Values, 255, 3 and 10 for every other position

255:

DSC_2296.jpg

3:

DSC_2295.jpg

Thank you so much for trying. I really need to find this hardware. Though I am not sure the usage for a train scenario.

Share this post


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

Though I am not sure the usage for a train scenario.

Haha,

maybe to stop all engines in case of derailing :)

Share this post


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

Yes, much better, thanks a lot.

But anti collision is still loaded at startup (but can't work, due to lack of sensors)

and my "own" project is always shown as "Program #1" in the register (what is just a cosmetic issue :classic:)

Anti-Collision => Will make it optional.
Your own program => You can rename it if you click on the tab. First field on the left.

Just now, mawe said:

maybe to stop all engines in case of derailing :)

Maybe!

Share this post


Link to post
Share on other sites
On 1/16/2019 at 10:26 AM, Bartosz said:

Off-topic, so don't shoot, but I like the rolling stock. Any close-up photos? :)

@Bartosz

Just now, Lok24 said:

Hi, unfortunatelly I' cant edit the post nor delete it after insterting the user-tag? Strange.

So, here is the only picture I've got:

wagen.jpg

Edited by Lok24

Share this post


Link to post
Share on other sites

Hello,

new parts arrived, testing continues....

LEDs : work brillant and as expected

WEDO Distance: connected, shows values in log, but cannot be triggered by prog (i.e. "Distance is below 3")?

Waht do the values mean?

dist.png.0c4aa55d69e237c7636462e04b693633.png

WEDO Tilt: detected, but not shown in log, cannot be triggered

"Port Connected: A of type WEDO2_TILT"

 

 

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.