Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug in querying scene levels using Hasseb interface #98

Open
TobsA13 opened this issue Jan 27, 2022 · 9 comments
Open

Bug in querying scene levels using Hasseb interface #98

TobsA13 opened this issue Jan 27, 2022 · 9 comments

Comments

@TobsA13
Copy link

TobsA13 commented Jan 27, 2022

Hi, I get a 0 as response when I querying a scene with has the value 255.

dali_driver = SyncHassebDALIUSBDriver()
a = address.Short(1)
b = gear.QuerySceneLevel(a, 8)
c = dali_driver.send(b)
d = c.value
print(d)

=> 0

This is a log from a Lunatone interface.
image

I tried to search the bug in the code, but I could not find it.

@sde1000
Copy link
Owner

sde1000 commented Jan 27, 2022

Do you get sensible responses when querying scenes that have values other than MASK?

@TobsA13
Copy link
Author

TobsA13 commented Jan 28, 2022

Yes other values are working correct. It's only the MASK value.

@sde1000
Copy link
Owner

sde1000 commented Jan 28, 2022

Hm. What's the value of c.raw_value.as_integer?

@TobsA13
Copy link
Author

TobsA13 commented Jan 28, 2022

Also 0

@TobsA13

This comment has been minimized.

@TobsA13
Copy link
Author

TobsA13 commented Jan 28, 2022

Ok the issue seems to occur when I have sniffing enabled. As soon I have sniffing disabled I get the right values.

I don't know if this is a bug, or you should not use sniffing and querying commands at the same time.

@sde1000
Copy link
Owner

sde1000 commented Jan 29, 2022

What's your setup? You have a Hasseb device that you are controlling with your script, and a Lunatone DALI-USB also connected to the same bus for sniffing, running their software?

@TobsA13
Copy link
Author

TobsA13 commented Feb 3, 2022

HI sorry for the delay, wasn't home the last days.
Yes correct. The Hasseb device is my main device for the iot integration. The Lunatone device was for setting up some of their DALI hardware.

Do you use the sniffing of the Hasseb device? I also get many errors during the sniffing, so I can't use the output of the sniffing.

('ERROR', bytearray(b'\xaa\x07\x00\x06\x00\x00\x00\x00\x00\x00'))
('ERROR', bytearray(b'\xaa\x07\x01\x06\x01\x00\x00\x00\x00\x00'))
('ERROR', bytearray(b'\xaa\x07\x00\x06\x00\x00\x00\x00\x00\x00'))

Which should be:
grafik
My code for the sniffing, it does not matter if I use the Sync or the Async driver:

from pprint import pprint
from threading import Thread
from dali.driver.hasseb import AsyncHassebDALIUSBDriver

dali_driver = AsyncHassebDALIUSBDriver()
dali_driver.enableSniffing()

def ref(driver):
    while True:
        data = driver.receive()
        if data is not None and len(data) > 0:
            text = ""
            if data[3] == 0x05:
                text += 'SNIFF'
            elif data[3] == 0x06:
                text += 'ERROR'
            else:
                text += 'OTHER'
            pprint((text, data))

thread = Thread(target = ref, args = (dali_driver, ))
thread.start()

@sde1000
Copy link
Owner

sde1000 commented Feb 3, 2022

I don't use the Hasseb device. I think you're going to have to talk to @hasseb directly about this; they wrote the firmware and supplied the driver.

@sde1000 sde1000 changed the title Bug in querying scene levels Bug in querying scene levels using Hasseb interface Feb 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants