Open andyparkers opened 11 months ago
Yes, init.py commands are reverse-engineered. I used the official tool to capture usb packets with Wireshark.
If you can read your device measures with my tool but not with your tool... you probably sent a wrong command.
Suggestion: try to log your commands and my commands to compare them.
Perhaps you must initialize struct Keys
, I'm not sure.
I provided you with a part of the whole code only, it was initialized beforehand according to init.py. I am wondering how I can log what I get in response, can I just print(hexa)
? If I do this, I get:
b'z\xff\x80\x16\x00(\x00\x00\x00&\x80\x00\x08\x00\x00\x0c\x00\x00\x00\x0b\x00\x00\x00\xcdr\x01\x00\x0f\x00\x00\x00 \x0c\x85'
for 0.11 µSv/h, so the actual index of hexa[20]
is [12]
(because B in hex is 11 in decimal), it is like shifted right by 8 elements and I won't get full answer log message. I might assume that this happens due to partial data request since you take 42 bytes only in this line:
elif self.com == 'ONEv1':
return self.serial.read(12 + 21 + 2 + 2 + 2 + 2 + 1)
but anyway this is weird for me. What about my case: recently I have found out that I can't get any response from MCU and can only send data and it is the same as yours in hid_set_report
(successfully anyway, callback function on the end of transfer is called), now I am trying to read the response. If you have any thoughts how to do this, please help me out. In documentation there is a send-only example, so I can send data using usb_host_transfer_submit()
, but have no idea how to obtain the response.
Yes, print(hexa)
or print(hexa[20])
are beautify ways.
For the Radex One (ONEv1), if I remember correctly, to get a measure:
read(12 + 21 + 2 + 2 + 2 + 2 + 1)
)If usb_host_transfer_submit
is the equivalent of hid_set_report
, you need an equivalent of hid_get_report
.
In the documentation, I don't understand anything, perhaps it's that: the peripherals/usb/host/hid example demonstrates the possibility to receive reports from a USB HID device with several interfaces.
Is it correct to send data to Radex ONE this way and try to parse measure?
Form and send a new packet:
Parsing in callback function by the end of the transfer function:
Result: