sde1000 / python-dali

Library for controlling DALI lighting systems
Other
150 stars 71 forks source link

LUBA USB driver query #120

Open ptorrent opened 1 year ago

ptorrent commented 1 year ago

Hello there,

first at all, thanks for your awesome job !

I would like to know the sequence for removing all short addresses of a dali bus ?

is that the correct sequence ?

            yield DTR0(255)
            yield SetShortAddress(Broadcast())

Thanks for your help !

sde1000 commented 1 year ago

Yes, that should do it. (You can see it as part of the Commissioning sequence.)

ptorrent commented 1 year ago

I did the test but it seems not working as I isolated the code for doing that..

What would be the Brocast() value for that ? 255 ?

sde1000 commented 1 year ago

Could you describe your setup in more detail?

ptorrent commented 1 year ago

I've 2 dali light, everything is working fine with your python scripts. Now I try to clear their short address. So I isolated this code

      yield DTR0(255)
      yield SetShortAddress(Broadcast())

But nothing seems happen, this is the sequence writed on dali bus

1x 0xa3 0xff
2x 0x7f 0x80
sde1000 commented 1 year ago

That should do it. The two sends of 0x7f 0x80 must occur within 100ms of each other, with nothing else being sent in between — are you managing this?

ptorrent commented 1 year ago

I'm using lunaton USB DAlI2 device,

i'm able to see both request:

0091.0001 0xa3 0xff
0091.0061 0x7f 0x80
0091.0076 0x7f 0x80

Only 15ms between 0x7f 0x80 . Is this normal ?

Are the command correct ? After sending thos commands, I'm still able to get ballastStatus if I target the short address

THanks for your help, that's realy appreciate !

sde1000 commented 1 year ago

They look correct, and 15ms between the two repetitions looks normal.

What do you get for QueryControlGearPresent on the short address? And if you broadcast QueryMissingShortAddress do you get a "yes" response?

sde1000 commented 1 year ago

Hang on, I might be being stupid. SetShortAddress(Broadcast()) should be 0xff 0x80 not 0x7f 0x80! 0x7f 0x80 is SetShortAddress(GearShort(63)).

So you should look into how the wrong frame is being sent.

ptorrent commented 1 year ago

Oh yes that was a test..

0xa3 0xff 0xff 0x80 0xff 0x80

But no changes :(

The funny fact is that i've only 2 ballasts and I can ask "ballasts status" on all addresses (means 20.21...40...63). They are all responding... How it's possible ? Do you've to call "Terminate" after ths reset or Initialise before ?

ptorrent commented 1 year ago

Something strange with DTR0, always increasing,

I send the command 0x98 for getting the DTR0 and this is the response:

"value":41,
"binary":"00101001"

I send again

"value":43,
"binary":"00101011"

Every time I ask for DTR0 value, the value is increasing.

this is the request frame : "0x0f 0x98" for short address 07

ptorrent commented 1 year ago

Oh this is the case for all queries x)

Asking if ballast exists:

Request : 0x03 0x91 on short address 1 Answer : 47

Request : 0x03 0x91 Answer : 48

sde1000 commented 1 year ago

It sounds like you might have both units set to the same short address? Or there might be some other hardware issue interfering with communication.

What happens if you disconnect one of the units and only have one on the bus at a time?

ptorrent commented 1 year ago

I got the issue... Seems that you are treating the request id feedback as an answer with Luba USB

It's why it's increasing... any new request a new id + 1

Maybe something wrong with Luba status ?

sde1000 commented 1 year ago

Oh! Probably worth opening a new issue for that and mentioning @sl-wallace — he wrote the LUBA driver. (I don't have one so can't test it.)

sl-wallace commented 1 year ago

Oh! Probably worth opening a new issue for that and mentioning @sl-wallace — he wrote the LUBA driver. (I don't have one so can't test it.)

Interesting, I'll have to take a look into it. I haven't got my LUBA test hardware with me at the moment but I should be able to within the next week or so.

ptorrent commented 1 year ago

Hello !

Did you already test the LUBA USB ? Seems that status are a bit strange

image

image

Is it the same for rs232?