Jump to content

Recommended Posts

Posted

Now, as far as I see: fine.

But color detection is strange?

RED is detected according to Log, triggered at "Partial 6", whatever that means ;-)

BLACK is detected, but never reaches more than Partial 1 -and therefore is never triggered?

And the colors in the log aren't reflected in GetColor, only obove Partial 6 (Recommended)

 

 

 

 

 

Posted

Well now you understand why I never exposed them before.

The color detector constantly 'think' he has found a color but often he is just plain wrong. The 'partial' value correspond to how close you are from the detector. I trigger only if a color is triggered close enough to the detector so that we are 100% certain it is in fact this color.

I could probably let you adjust the 'partial' level if you want to. But right now it is set to 5 minimum (1/5 of an inch).

Posted (edited)

This is also why I moved away from color detection to do sensor detection. It is a little more expensive as you need more sensors, but they are 100% reliable where sometime color detection is not when trains are going to fast.

Edited by Cosmik42
Posted
Just now, Cosmik42 said:

where sometime color detection is not when trains are going to fast.

but you can influence that with the coolDownTime now, right?

Posted (edited)
23 minutes ago, mawe said:

but you can influence that with the coolDownTime now, right?

Actually not. The cool down is here to avoid too many repeated positive detection. In the case of a train going fast and the color on the track being short, the train might miss entirely the color. So no color detected, no cool down.

Edited by Cosmik42
Posted

I've already tested several Bluetooth adapters and can't connect more than five HUBs. Even if "up to seven devices at the same time" is written on the packaging. When I switch on the sixth HUB, I get the error: "Error opening communication:Unreachable".
How many HUBs can you connect and which adapter do you use?

It is possible to control the trains via Laptop 1 and barriers via Laptop 2. But also this is very limited with five HUBs each.

What other possibilities can you imagine to avoid this limitation?
Is it possible to make the "MyGlobalFunction" accessible for several laptops?
Or to use one laptop per section (maybe soon Android devices) as controller? Then the HUBs of the trains would have to automatically connect to the respective controllers for each section.

Posted
Just now, Cosmik42 said:

Bought this dongle and can connect up to 14 hubs with it

unfortunately currently not available

Posted
1 hour ago, mawe said:

I've already tested several Bluetooth adapters and can't connect more than five HUBs. Even if "up to seven devices at the same time" is written on the packaging. When I switch on the sixth HUB, I get the error: "Error opening communication:Unreachable".
How many HUBs can you connect and which adapter do you use?

Dear All,

I was wondering myself. Posts here and elsewhere seem to suggest that the maximum number is adapter-specific. Which in turn suggests that all the memory consuming things in BLE communication (remembering all discovered services along with all data as UUIDs etc., all subscriptions to services etc. etc.) are actually stored/handled "on" the adapter. I have no idea whether or not this is even coming close.

Here is a link you guys may have found long ago, just in case not. Answer #3 seems to go along that line: Link

I am using the BL adapter built into my laptop (up-to-date Win10/64bit) and a BLE software stack (ActiveX control) from /n-software for VB6/32bit. I can tell my program to load 50 instances of the Client - it thinks a second about that - but it does so (creates all controls etc. pp). I have no idea though, whether or not all these clients would then communicate successfully: So far I have one hub and one remote:tongue:. They are there though; even when telling client #50 to initiate the connection.

Maybe this means anything to @Cosmik42?

All the best,
Thorsten

Posted

Thanks Cosmik42 for v0.9, this project has come a long way in a very short time!

A few questions:

Is there a function exposed to get/set the remote/hub colour?

Is the list of functions/properties in the code editor window complete? Perhaps at one point we should start a Wiki for them.

Any chance of supporting EV3 via Bluetooth? I have several of these and would love to be able to use sensors / motors - 4 of each is possible on each of these bricks!

Posted
5 hours ago, mawe said:

How many HUBs can you connect and which adapter do you use?

On my MacBook Pro I've connected to 3x Boost Move Hubs, 5x Powered UP Hubs, 2x WeDo 2.0 Smart Hubs, 1x Duplo Train Base, and 4x Powered UP Remotes, all at the same time, and run some color cycling code to sequence the LED's in sync. That's 15 hubs.

Unfortunately I can't help on what adapter it is, as it's the one built into the MacBook Pro. It's a 15 inch late 2013 model.

Posted
13 hours ago, Cosmik42 said:

The color detector constantly 'think' he has found a color but often he is just plain wrong. The 'partial' value correspond to how close you are from the detector. I trigger only if a color is triggered close enough to the detector so that we are 100% certain it is in fact this color.

I could probably let you adjust the 'partial' level if you want to. But right now it is set to 5 minimum (1/5 of an inch).

Yes, sure. But applications are different.

Its a wild flickering of colors., as you say, but I'm absolutely not interested in that and ignore them all, no events for that.

Only one single event: BLACK! And this is shown in the log very clear, and even if close to the sensor (2-3mm) and everything is fixed, so nothing moving, it's still"Partial 2" max and doesn't trigger.

 

 

 

 

12 hours ago, Cosmik42 said:

This is also why I moved away from color detection to do sensor detection. It is a little more expensive as you need more sensors, but they are 100% reliable where sometime color detection is not when trains are going to fast.

Yes, and my approch is the complete opposite ;-) Which is not better than yours, but - different

Bt this shows the flexibility of your project. Hope I get a small video till wednesday, in the monemt I'm struggeling with the RED/BLACK issue.

 

Posted

@Toastie, great link! Taken from it, I think this is the best answer matching both your experience and the one of @Mr Hobbles :

"[The number of BLE device you can connect to] depends on the amount of RAM you have available on the master device.
 For a stand-alone Bluetooth dongle where the stack runs on the dongle itself, this is anywhere from 6 - 8. A lot of dongles I have seen support 7.

That said, if the dongle is using the Bluetooth stack that’s built into the operating system (or if you use the built-in Bluetooth adapter on the phone/tablet), then you are not RAM-limited (you have gigabytes available rather than a few hundred kilobytes), so the limit is a lot higher."

Posted
2 hours ago, Lok24 said:

in the monemt I'm struggeling with the RED/BLACK issue.

Given you want to double down on the color route, let me know if you want me to expose this 'partial' trigger?

9 hours ago, Jade124 said:

Is there a function exposed to get/set the remote/hub colour?

Yes! Forgot to add it to the helper list.
It is SetLEDColor(Colors color) where Colors is an enum with the following options:

public enum Colors
{
	BLACK = 0,
	PINK = 1,
	PURPLE = 2,
	BLUE = 3,
	LBLUE = 4,
	CYAN = 5,
	GREEN = 6,
	YELLOW = 7,
	ORANGE = 8,
	RED = 9,
	WHITE = 10
}
9 hours ago, Jade124 said:

Is the list of functions/properties in the code editor window complete? Perhaps at one point we should start a Wiki for them.

Mostly yes. There's a lot more but most of it is internal stuff.

Quote

Any chance of supporting EV3 via Bluetooth? I have several of these and would love to be able to use sensors / motors - 4 of each is possible on each of these bricks!

I had no idea EV3 was Bluetooth enabled! I just found a great open-source library to connect to it.
Sounds like an amazing idea! I will definitely explore this!

 

Posted (edited)
11 minutes ago, Cosmik42 said:

I had no idea EV3 was Bluetooth enabled! I just found a great open-source library to connect to it.
Sounds like an amazing idea! I will definitely explore this!

 

I've two bricks here, it is definitely BT but not BLE

You should find infos in the mindstorms communication developer kit.

11 minutes ago, Cosmik42 said:

Given you want to double down on the color route, let me know if you want me to expose this 'partial' trigger?

 

The "problem" is, that your log shows "BLACK", but is never(!) triggered.
Thats all ;-)

I just liked to do something when "BLACK", all others colours or values I don't care.

 

 

Edited by Lok24
Posted
6 hours ago, Lok24 said:

The "problem" is, that your log shows "BLACK", but is never(!) triggered.
Thats all ;-)

I just liked to do something when "BLACK", all others colours or values I don't care.

I think Black is the most confusing color for the detector. Because it is hard to estimate distance when the surface is black.

If it never triggers its because it never believe it is close to the color itself.

6 hours ago, Lok24 said:

I've two bricks here, it is definitely BT but not BLE

You should find infos in the mindstorms communication developer kit.

I had a more in-depth look and I believe I can support EV3 in a just a couple days of coding.

Posted
2 minutes ago, Cosmik42 said:

I think Black is the most confusing color for the detector. Because it is hard to estimate distance when the surface is black.

If it never triggers its because it never believe it is close to the color itself.

 

the log ist showing "NONE" or "BLACK", so the color is recognized properly within your program, have a look:

HUB NO.4 - Distance: 15 Color: 0(BLACK) -> Partial: 1
HUB NO.4 - Distance: 13,5 Color: 0(BLACK) -> Partial: 2
HUB NO.4 - Distance: 15 Color: 0(BLACK) -> Partial: 1
HUB NO.4 - Distance: 13,5 Color: 0(BLACK) -> Partial: 1
HUB NO.4 - Distance: 10,5 Color: 0(BLACK) -> Partial: 1
HUB NO.4 - Distance: 6 Color: 0(BLACK) -> Partial: 1
HUB NO.4 - Distance: 7,5 Color: 0(BLACK) -> Partial: 1
HUB NO.4 - Distance: 15 Color: 255(NONE) -> Partial: 0
HUB NO.4 - Distance: 13,5 Color: 255(NONE) -> Partial: 0
HUB NO.4 - Distance: 7,5 Color: 255(NONE) -> Partial: 0
HUB NO.4 - Distance: 6 Color: 0(BLACK) -> Partial: 0
HUB NO.4 - Distance: 4,5 Color: 0(BLACK) -> Partial: 1
HUB NO.4 - Distance: 3 Color: 0(BLACK) -> Partial: 1
HUB NO.4 - Distance: 1,5 Color: 0(BLACK) -> Partial: 1
HUB NO.4 - Distance: 1,5 Color: 0(BLACK) -> Partial: 2
HUB NO.4 - Distance: 0 Color: 0(BLACK) -> Partial: 3
 

 

Posted (edited)

Yes, but you see this partial 0, 1, 2 or 3? It means that the program thinks this black is way further  away than it probably is.
It's why I offer you that you can change the current hard-coded value of a Partial 5 to trigger a color, to the partial of your liking.

Edited by Cosmik42
Posted

yes, I see, but if it's not importtant for others I will stay with "red", which works fine, as you recommended.

As the distance between sensor and object in my case ist always constant that "Partial" might be more important to users.

My programm is runnning, so I'll send same pictures maybe tomorrow.

Many thanks for your support.

Posted
35 minutes ago, Cosmik42 said:

I think Black is the most confusing color for the detector.

Well, black is even no color at all, so it is OK when the detector is confused :tongue:.

Don't take me seriously though …

Best wishes
Thorsten 

Posted

It's not really confused, only the combination of distance and color is tricky :sweet:

(BTW: white isn't a color too, but works brilliant, due to reflecting)

 

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.
×
×
  • Create New...