JnyJny/busylight

[BUG] Luxafor flag - cannot use blink and would there be other modes?

Closed this issue · 4 comments

Software Versions:

  • Operating System: macOS 11.6 on Apple M1
  • Python version: 3.8.2
  • BusyLight version: 0.13.1

General Type of Problem

  • Installation
  • Command-line
  • Integrating into another project
  • Web API
  • other

Describe the Problem
Connected a Luxafor flag to the MacBook Pro, gets recognized just fine, busylight on and off work fine as well, but busylight blink does nothing and switches the light off. Have the debug output in the attached file but could not see the problem with it. Is blink not supported for the flag?

Also tried fade, strobe, wave and others but was not sure, if they are really supported, as they are not a command. So I guess they would only serve in my own python application as described on the code examples?

Maybe it is just me and I use the command wrong or did sth else incorrectly. I also assumed that I do not have to touch any udev rules on MacOS as it was suggested for Linux?!

Thank you for your help and this great tool in general 😄

Expected Behavior
Flag to blink.

Error Output
No error, just new command line with cursor. Debugger output attached in file
Debug output luxafor flag.pdf

Edit: included text from the PDF file here.

ID: Device Name
 0: Luxafor Flag
     0: path: b'IOService:/AppleARMPE/arm-
io@10F00000/AppleT810xIO/usb-
drd0@82280000/AppleT8103USBXHCI@00000000/usb-drd0-port-
hs@00100000/LUXAFOR
FLAG@00100000/IOUSBHostInterface@0/AppleUserUSBHostHIDDevice'
     0: vendor_id: 0x4d8
     0: product_id: 0xf372
     0: serial_number:
     0: release_number: 0x100
     0: manufacturer_string: Microchip Technology Inc.
     0: product_string: LUXAFOR FLAG
     0: usage_page: 0xff00
     0: usage: 0x01
     0: interface_number: 0x00
./busylight --debug --light-id 0 on 0x4512e0
2021-11-07 19:39:21.037 | INFO | busylight.manager:update:172 - Manager has 0 lights 2021-11-07 19:39:21.037 | DEBUG | busylight.lights.usblight:all_lights:158 - USBLight querying subclass lights...
2021-11-07 19:39:21.037 | DEBUG | busylight.lights.usblight:all_lights:148 - Searching for lights belonging to: BlinkStick
2021-11-07 19:39:21.037 | DEBUG | busylight.lights.usblight:first_light:93 - BlinkStick looking for first unclaimed light...
2021-11-07 19:39:21.041 | DEBUG | busylight.lights.usblight:first_light:108 - BlinkStick found no unclaimed lights.
2021-11-07 19:39:21.041 | DEBUG | busylight.lights.usblight:all_lights:155 - BlinkStick found 0 lights
2021-11-07 19:39:21.041 | DEBUG | busylight.lights.usblight:all_lights:148 - Searching for lights belonging to: Blynclight
2021-11-07 19:39:21.041 | DEBUG | busylight.lights.usblight:first_light:93 - Blynclight looking for first unclaimed light...
2021-11-07 19:39:21.044 | DEBUG | busylight.lights.usblight:first_light:108 - Blynclight found no unclaimed lights.
2021-11-07 19:39:21.044 | DEBUG | busylight.lights.usblight:all_lights:155 - Blynclight found 0 lights
 
2021-11-07 19:39:21.044 | DEBUG | busylight.lights.usblight:all_lights:148 - Searching for lights belonging to: Busylight
2021-11-07 19:39:21.044 | DEBUG | busylight.lights.usblight:first_light:93 - Busylight looking for first unclaimed light...
2021-11-07 19:39:21.045 | DEBUG | busylight.lights.usblight:first_light:108 - Busylight found no unclaimed lights.
2021-11-07 19:39:21.045 | DEBUG | busylight.lights.usblight:all_lights:155 - Busylight found 0 lights
2021-11-07 19:39:21.045 | DEBUG | busylight.lights.usblight:all_lights:148 - Searching for lights belonging to: Flag
2021-11-07 19:39:21.045 | DEBUG | busylight.lights.usblight:first_light:93 - Flag looking for first unclaimed light...
2021-11-07 19:39:21.047 | DEBUG | busylight.lights.usblight:first_light:96 - Flag entry found for 1240
2021-11-07 19:39:21.047 | DEBUG | busylight.lights.usblight:first_light:98 - entry: {'path': b'IOService:/AppleARMPE/arm-io@10F00000/AppleT810xIO/usb- drd0@82280000/AppleT8103USBXHCI@00000000/usb-drd0-port- hs@00100000/LUXAFOR FLAG@00100000/IOUSBHostInterface@0/AppleUserUSBHostHIDDevice', 'vendor_id': 1240, 'product_id': 62322, 'serial_number': '', 'release_number': 256, 'manufacturer_string': 'Microchip Technology Inc.', 'product_string': 'LUXAFOR FLAG', 'usage_page': 65280, 'usage': 1, 'interface_number': 0} 2021-11-07 19:39:21.047 | DEBUG | busylight.lights.usblight:__init__:216 - Flag init 4d8 f372 b'IOService:/AppleARMPE/arm-io@10F00000/AppleT810xIO/usb- drd0@82280000/AppleT8103USBXHCI@00000000/usb-drd0-port- hs@00100000/LUXAFOR FLAG@00100000/IOUSBHostInterface@0/AppleUserUSBHostHIDDevice' False
2021-11-07 19:39:21.047 | DEBUG | busylight.lights.usblight:acquire:429 - Flag.acquire(reset=False)
2021-11-07 19:39:21.047 | DEBUG | busylight.lights.usblight:acquire:431 - lock acquired 2021-11-07 19:39:21.048 | SUCCESS | busylight.lights.usblight:acquire:447 - Flag hid.open_path(b'IOService:/AppleARMPE/arm- io@10F00000/AppleT810xIO/usb- drd0@82280000/AppleT8103USBXHCI@00000000/usb-drd0-port- hs@00100000/LUXAFOR

FLAG@00100000/IOUSBHostInterface@0/AppleUserUSBHostHIDDevice') was a success None
2021-11-07 19:39:21.049 | DEBUG | busylight.lights.usblight:all_lights:152 - Flag added a light LUXAFOR FLAG: 0x04d8:0xf372
2021-11-07 19:39:21.049 | DEBUG | busylight.lights.usblight:first_light:93 - Flag looking for first unclaimed light...
2021-11-07 19:39:21.051 | DEBUG | busylight.lights.usblight:first_light:96 - Flag entry found for 1240
2021-11-07 19:39:21.051 | DEBUG | busylight.lights.usblight:first_light:98 - entry: {'path': b'IOService:/AppleARMPE/arm-io@10F00000/AppleT810xIO/usb- drd0@82280000/AppleT8103USBXHCI@00000000/usb-drd0-port- hs@00100000/LUXAFOR FLAG@00100000/IOUSBHostInterface@0/AppleUserUSBHostHIDDevice', 'vendor_id': 1240, 'product_id': 62322, 'serial_number': '', 'release_number': 256, 'manufacturer_string': 'Microchip Technology Inc.', 'product_string': 'LUXAFOR FLAG', 'usage_page': 65280, 'usage': 1, 'interface_number': 0} 2021-11-07 19:39:21.051 | DEBUG | busylight.lights.usblight:__init__:216 - Flag init 4d8 f372 b'IOService:/AppleARMPE/arm-io@10F00000/AppleT810xIO/usb- drd0@82280000/AppleT8103USBXHCI@00000000/usb-drd0-port- hs@00100000/LUXAFOR FLAG@00100000/IOUSBHostInterface@0/AppleUserUSBHostHIDDevice' False
2021-11-07 19:39:21.051 | DEBUG | busylight.lights.usblight:acquire:429 - Flag.acquire(reset=False)
2021-11-07 19:39:21.051 | DEBUG | busylight.lights.usblight:acquire:431 - lock acquired 2021-11-07 19:39:21.052 | ERROR | busylight.lights.usblight:acquire:435 - hid_open open failed for open_path(b'IOService:/AppleARMPE/arm- io@10F00000/AppleT810xIO/usb- drd0@82280000/AppleT8103USBXHCI@00000000/usb-drd0-port- hs@00100000/LUXAFOR FLAG@00100000/IOUSBHostInterface@0/AppleUserUSBHostHIDDevice') 2021-11-07 19:39:21.052 | ERROR | busylight.lights.usblight:first_light:105 - Flag (1240, 62322, b'IOService:/AppleARMPE/arm-io@10F00000/AppleT810xIO/usb- drd0@82280000/AppleT8103USBXHCI@00000000/usb-drd0-port- hs@00100000/LUXAFOR FLAG@00100000/IOUSBHostInterface@0/AppleUserUSBHostHIDDevice') for 1240

2021-11-07 19:39:21.052 | DEBUG | busylight.lights.usblight:first_light:108 - Flag found no unclaimed lights.
2021-11-07 19:39:21.052 | DEBUG | busylight.lights.usblight:all_lights:155 - Flag found 1 lights 2021-11-07 19:39:21.052 | DEBUG | busylight.lights.usblight:all_lights:148 - Searching for lights belonging to: Status_Indicator
2021-11-07 19:39:21.052 | DEBUG | busylight.lights.usblight:first_light:93 - Status_Indicator looking for first unclaimed light...
2021-11-07 19:39:21.053 | DEBUG | busylight.lights.usblight:first_light:108 - Status_Indicator found no unclaimed lights.
2021-11-07 19:39:21.053 | DEBUG | busylight.lights.usblight:all_lights:155 - Status_Indicator found 0 lights
2021-11-07 19:39:21.053 | DEBUG | busylight.lights.usblight:all_lights:148 - Searching for lights belonging to: Blink1
2021-11-07 19:39:21.053 | DEBUG | busylight.lights.usblight:first_light:93 - Blink1 looking for first unclaimed light...
2021-11-07 19:39:21.055 | DEBUG | busylight.lights.usblight:first_light:108 - Blink1 found no unclaimed lights.
2021-11-07 19:39:21.055 | DEBUG | busylight.lights.usblight:all_lights:155 - Blink1 found 0 lights
2021-11-07 19:39:21.055 | DEBUG | busylight.lights.usblight:all_lights:161 - USBLight found 1 in total.
2021-11-07 19:39:21.055 | INFO | busylight.manager:update:175 - After all_lights, Manager has 1 lights
2021-11-07 19:39:21.056 | INFO | busylight.manager:update:182 - Manager has 1 lights after update
2021-11-07 19:39:21.056 | DEBUG | busylight.lights.usblight:update:510 - Flag update for b'\x01\xff\x00\x00\x00\x00\x00\x00'
2021-11-07 19:39:21.057 | DEBUG | busylight.lights.usblight:update:510 - Flag update for b'\x01\xffE\x12\xe0\x00\x00\x00'
./busylight --debug --light-id 0 blink 0x4512e0
 
2021-11-07 19:40:13.967 | INFO | busylight.manager:update:172 - Manager has 0 lights 2021-11-07 19:40:13.968 | DEBUG | busylight.lights.usblight:all_lights:158 - USBLight querying subclass lights...
2021-11-07 19:40:13.968 | DEBUG | busylight.lights.usblight:all_lights:148 - Searching for lights belonging to: BlinkStick
2021-11-07 19:40:13.968 | DEBUG | busylight.lights.usblight:first_light:93 - BlinkStick looking for first unclaimed light...
2021-11-07 19:40:13.972 | DEBUG | busylight.lights.usblight:first_light:108 - BlinkStick found no unclaimed lights.
2021-11-07 19:40:13.972 | DEBUG | busylight.lights.usblight:all_lights:155 - BlinkStick found 0 lights
2021-11-07 19:40:13.972 | DEBUG | busylight.lights.usblight:all_lights:148 - Searching for lights belonging to: Blynclight
2021-11-07 19:40:13.972 | DEBUG | busylight.lights.usblight:first_light:93 - Blynclight looking for first unclaimed light...
2021-11-07 19:40:13.975 | DEBUG | busylight.lights.usblight:first_light:108 - Blynclight found no unclaimed lights.
2021-11-07 19:40:13.975 | DEBUG | busylight.lights.usblight:all_lights:155 - Blynclight found 0 lights
2021-11-07 19:40:13.975 | DEBUG | busylight.lights.usblight:all_lights:148 - Searching for lights belonging to: Busylight
2021-11-07 19:40:13.975 | DEBUG | busylight.lights.usblight:first_light:93 - Busylight looking for first unclaimed light...
2021-11-07 19:40:13.977 | DEBUG | busylight.lights.usblight:first_light:108 - Busylight found no unclaimed lights.
2021-11-07 19:40:13.977 | DEBUG | busylight.lights.usblight:all_lights:155 - Busylight found 0 lights
2021-11-07 19:40:13.977 | DEBUG | busylight.lights.usblight:all_lights:148 - Searching for lights belonging to: Flag
2021-11-07 19:40:13.977 | DEBUG | busylight.lights.usblight:first_light:93 - Flag looking for first unclaimed light...

2021-11-07 19:40:13.978 | DEBUG | busylight.lights.usblight:first_light:96 - Flag entry found for 1240
2021-11-07 19:40:13.978 | DEBUG | busylight.lights.usblight:first_light:98 - entry: {'path': b'IOService:/AppleARMPE/arm-io@10F00000/AppleT810xIO/usb- drd0@82280000/AppleT8103USBXHCI@00000000/usb-drd0-port- hs@00100000/LUXAFOR FLAG@00100000/IOUSBHostInterface@0/AppleUserUSBHostHIDDevice', 'vendor_id': 1240, 'product_id': 62322, 'serial_number': '', 'release_number': 256, 'manufacturer_string': 'Microchip Technology Inc.', 'product_string': 'LUXAFOR FLAG', 'usage_page': 65280, 'usage': 1, 'interface_number': 0} 2021-11-07 19:40:13.978 | DEBUG | busylight.lights.usblight:__init__:216 - Flag init 4d8 f372 b'IOService:/AppleARMPE/arm-io@10F00000/AppleT810xIO/usb- drd0@82280000/AppleT8103USBXHCI@00000000/usb-drd0-port- hs@00100000/LUXAFOR FLAG@00100000/IOUSBHostInterface@0/AppleUserUSBHostHIDDevice' False
2021-11-07 19:40:13.978 | DEBUG | busylight.lights.usblight:acquire:429 - Flag.acquire(reset=False)
2021-11-07 19:40:13.978 | DEBUG | busylight.lights.usblight:acquire:431 - lock acquired 2021-11-07 19:40:13.979 | SUCCESS | busylight.lights.usblight:acquire:447 - Flag hid.open_path(b'IOService:/AppleARMPE/arm- io@10F00000/AppleT810xIO/usb- drd0@82280000/AppleT8103USBXHCI@00000000/usb-drd0-port- hs@00100000/LUXAFOR FLAG@00100000/IOUSBHostInterface@0/AppleUserUSBHostHIDDevice') was a success None
2021-11-07 19:40:13.981 | DEBUG | busylight.lights.usblight:all_lights:152 - Flag added a light LUXAFOR FLAG: 0x04d8:0xf372
2021-11-07 19:40:13.981 | DEBUG | busylight.lights.usblight:first_light:93 - Flag looking for first unclaimed light...
2021-11-07 19:40:13.983 | DEBUG | busylight.lights.usblight:first_light:96 - Flag entry found for 1240
2021-11-07 19:40:13.983 | DEBUG | busylight.lights.usblight:first_light:98 - entry: {'path': b'IOService:/AppleARMPE/arm-io@10F00000/AppleT810xIO/usb- drd0@82280000/AppleT8103USBXHCI@00000000/usb-drd0-port- hs@00100000/LUXAFOR FLAG@00100000/IOUSBHostInterface@0/AppleUserUSBHostHIDDevice', 'vendor_id': 1240, 'product_id': 62322, 'serial_number': '',

'release_number': 256, 'manufacturer_string': 'Microchip Technology Inc.', 'product_string': 'LUXAFOR FLAG', 'usage_page': 65280, 'usage': 1, 'interface_number': 0} 2021-11-07 19:40:13.983 | DEBUG | busylight.lights.usblight:__init__:216 - Flag init 4d8 f372 b'IOService:/AppleARMPE/arm-io@10F00000/AppleT810xIO/usb- drd0@82280000/AppleT8103USBXHCI@00000000/usb-drd0-port- hs@00100000/LUXAFOR FLAG@00100000/IOUSBHostInterface@0/AppleUserUSBHostHIDDevice' False
2021-11-07 19:40:13.983 | DEBUG | busylight.lights.usblight:acquire:429 - Flag.acquire(reset=False)
2021-11-07 19:40:13.983 | DEBUG | busylight.lights.usblight:acquire:431 - lock acquired 2021-11-07 19:40:13.983 | ERROR | busylight.lights.usblight:acquire:435 - hid_open open failed for open_path(b'IOService:/AppleARMPE/arm- io@10F00000/AppleT810xIO/usb- drd0@82280000/AppleT8103USBXHCI@00000000/usb-drd0-port- hs@00100000/LUXAFOR FLAG@00100000/IOUSBHostInterface@0/AppleUserUSBHostHIDDevice') 2021-11-07 19:40:13.983 | ERROR | busylight.lights.usblight:first_light:105 - Flag (1240, 62322, b'IOService:/AppleARMPE/arm-io@10F00000/AppleT810xIO/usb- drd0@82280000/AppleT8103USBXHCI@00000000/usb-drd0-port- hs@00100000/LUXAFOR FLAG@00100000/IOUSBHostInterface@0/AppleUserUSBHostHIDDevice') for 1240
2021-11-07 19:40:13.983 | DEBUG | busylight.lights.usblight:first_light:108 - Flag found no unclaimed lights.
2021-11-07 19:40:13.983 | DEBUG | busylight.lights.usblight:all_lights:155 - Flag found 1 lights 2021-11-07 19:40:13.983 | DEBUG | busylight.lights.usblight:all_lights:148 - Searching for lights belonging to: Status_Indicator
2021-11-07 19:40:13.983 | DEBUG | busylight.lights.usblight:first_light:93 - Status_Indicator looking for first unclaimed light...
2021-11-07 19:40:13.985 | DEBUG | busylight.lights.usblight:first_light:108 - Status_Indicator found no unclaimed lights.
2021-11-07 19:40:13.985 | DEBUG | busylight.lights.usblight:all_lights:155 - Status_Indicator found 0 lights
2021-11-07 19:40:13.985 | DEBUG | busylight.lights.usblight:all_lights:148 - Searching for lights belonging to: Blink1

2021-11-07 19:40:13.985 | DEBUG | busylight.lights.usblight:first_light:93 - Blink1 looking for first unclaimed light...
2021-11-07 19:40:13.986 | DEBUG | busylight.lights.usblight:first_light:108 - Blink1 found no unclaimed lights.
2021-11-07 19:40:13.986 | DEBUG | busylight.lights.usblight:all_lights:155 - Blink1 found 0 lights
2021-11-07 19:40:13.986 | DEBUG | busylight.lights.usblight:all_lights:161 - USBLight found 1 in total.
2021-11-07 19:40:13.986 | INFO | busylight.manager:update:175 - After all_lights, Manager has 1 lights
2021-11-07 19:40:13.987 | INFO | busylight.manager:update:182 - Manager has 1 lights after update
2021-11-07 19:40:13.988 | DEBUG | busylight.lights.usblight:update:510 - Flag update for b'\x01\xff\x00\x00\x00\x00\x00\x00'
2021-11-07 19:40:13.989 | DEBUG | busylight.lights.usblight:update:510 - Flag update for b'\x01\xff\x00\x00\x00\x00\x00\x00'
2021-11-07 19:40:13.990 | DEBUG | busylight.lights.usblight:update:510 - Flag update for b'\x03\xff\x00\x00\x00\x0e\x00\x00'

Yup, that's a real bug. Seeing the same behavior with my Luxafor Flag. Doesn't look like the state of the light isn't being updated correctly, it will take some time to dig into this.

Looks like I broke or forgot to completely implement the Luxafor Flag commands. The FlagStrobeCommand and FlagWaveCommand classes were missing an implementation of the color property. I probably should have a FlagBaseCommand class that implements the color property, but I'll do that later. This fix is 168161f and is tagged as version 0.13.2.

The busylight command only exposes capability that is common across all supported lights; on, off and blink. If you want to access other capabilities you'll need to write a little bit of code.

Please let me know if blink works now for you with your Luxafor Flag.

Hello, thank you for this quick response. Yes, blink works, now. Thank you. For the rest, I will try to find the time and write some code :) Looking forward to learn sth new.

I just have a question concerning the blinking speed. Besides that it is a bit hard to see the difference between slow, medium, and fast, I also think that the different colors blink with different speeds even when the same level is set. Could this be or is this just my eyes, playing a trick on me?

Thank you!

Glad to hear that blink is working again for you.

WRT to blink speeds; I just set the bits and what the hardware decides to do with those bits is out of my hands. That said, I did not do much tuning to the mapping from "slow", "medium", and "fast" to the 8-bit speed field for the Flag. I'll be happy to accept pull requests that address that mapping. The code in question is in busylight.lights.luxafor.flag.blink().