Open samuaz opened 3 years ago
Hi @samuaz ,
It will probably take me long time to make you a formal answer because I lack of time, but in the mean time it may help you to know, you can visualize the data sent by akbl.
For doing that, just turn on the debug mode on akbl:
akbl/setup
:
DEBUG='True' # Python boolean
A. to monitor the daemon:
3.1: stop the systemctl service: systemctl stop akbl
3.2: start the daemon in the current terminal: akbl --start-daemon
. Execute the command as root, and you must only have 1 process.
example of the debug info:
_DEBUG from `/usr/lib/python3.9/AKBL/Engine/Driver.py` on method `write_constructor`:
packet=2:8:1:0:0:0:0:0:0 legend=__save_block, block=1
packet=2:14:0:1:0:0:0:0:0 legend=set_speed, speed=1
packet=2:8:1:0:0:0:0:0:0 legend=__save_block, block=1
packet=2:3:1:0:0:128:0:240:0 legend=add_light_zone: left_color=#0000FF, hex_id=128
packet=2:8:1:0:0:0:0:0:0 legend=__save_block, block=1
packet=2:4:0:0:0:0:0:0:0 legend=end_colors_line
B: Use the block testing window:
execute as root the command akbl --block-testing
, and all the info will be logged in the terminal, example:
_DEBUG from `/usr/lib/python3.9/AKBL/Engine/Driver.py` on method `write_constructor`:
command output=9
_DEBUG from `/usr/lib/python3.9/AKBL/Engine/Driver.py` on method `read_device`:
msg=array('B', [16, 0, 0, 0, 0, 0, 0, 0])
_DEBUG from `/usr/lib/python3.9/AKBL/Engine/Driver.py` on method `write_constructor`:
packet=2:14:0:100:0:0:0:0:0 legend=set_speed, speed=100
packet=2:3:1:0:0:1:36:128:0 legend=add_light_zone: left_color=#204a87, hex_id=1
packet=2:4:0:0:0:0:0:0:0 legend=end_colors_line
packet=2:5:0:0:0:0:0:0:0 legend=end_block_line
HI me again xD,
And thanks again for this project.
I'm trying to read your code to try to write an implementation to debug and support my M15R3 per key lights. I'm not python developer, I'm c/c++/java developer.
Maybe you could help me clear up some doubts
I just start writing a small function that write to the device. (Previously I write the function that search by vendor and save founded device in a pointer)
so my write functions looks like this
where
I found this ^ in a very old documentation, so I'm not sure if are correct.
Then first question how is composed the data array that you send to the libusb_control_transfer?
How do you found the correct values here for a machine? Specially [0]START_BYTE, [1]command, [2]HEX_ID?
Thanks so much!!