Closed Vrumfondel closed 3 years ago
Perhaps.
I think this is around: return self.dev.read(12)
Other possibility is the configuration of the device: serial.Serial(port = device.device, baudrate = 115200, timeout = 0.5)
I don't know, I searching some google tips.
I'll change whatever you want me to change, having this code public would be great.
It'll open up a lot more use for this device so it's worth my time.
The device was still working but the menus stopped working, I'm unsure when this occurred, I had to restart the RADEX ONE for the menus to work again, I assume the python code caused it.
Nope, the menus appear to in-general not work when plugged in, but when unplugged it starts working again, this wasn't the case earlier, weird.
I tried to reproduce the results but it's working normal now
This is one of our commands that temporary break the device. For my device, a full restart of the device fix all problems.
Can you try some settings:
baudrate = 9600
timeout = 1
timeout = 2
Changing the baudrate worked, there's data being printed now! Making progress!
C:\Windows\system32>cmd.py readall
b'z\xff\x00\x80\x00\x00\x02\x00\x00\x00\x82\x80'
b'z\xff \x80\x1e\x00\x03\x00\x00\x00C\x80'
b'\x01\x00\x00\x00\x14\x00\x00\x00\x11\xa4\x00\x00'
b'\xde\r\x00\x00\x12\x00\x03\x1e\x01\x08H\x03'
b'\x08\x00\x00\x00\x95$'
Traceback (most recent call last):
File "C:\platform-tools\cmd.py", line 114, in <module>
measures = reader.read(False)
File "C:\platform-tools\radexreader\__init__.py", line 170, in read
measure = (hexa[6] + hexa[7] * 256 + hexa[8] * 256 * 256) / 100
IndexError: index out of range
Good.
I found that in same time in your video file: 16 10/04/2021 08:46:55 IRP_MJ_DEVICE_CONTROL (IOCTL_SERIAL_SET_BAUD_RATE) DOWN 80 25 00 00 €%.. 4 COM4
Can you capture again packets when you start the python program to check if you found the same IOCTL_SERIAL_SET_BAUD_RATE
.
cmd.py readall COM4 Monitoring Session 3.txt
I found two IOCTL_SERIAL_SET_BAUD_RATE packets in the packets recorded, a upload and a download.
26 10/04/2021 11:48:09 IRP_MJ_DEVICE_CONTROL (IOCTL_SERIAL_SET_BAUD_RATE) DOWN 80 25 00 00 €%.. 4 COM4
27 10/04/2021 11:48:09 IRP_MJ_DEVICE_CONTROL (IOCTL_SERIAL_SET_BAUD_RATE) UP STATUS_SUCCESS COM4
Just incase I also included the console output below as well.
C:\Windows\system32>cmd.py readall
b'z\xff\x00\x80\x00\x00\x02\x00\x00\x00\x82\x80'
b'z\xff \x80\x1e\x00\x03\x00\x00\x00C\x80'
b'\x01\x00\x00\x00\x14\x00\x00\x00\x11\xa4\x00\x00'
b'\xde\r\x00\x00\x12\x00\x03\x1e\x01\x08H\x03'
b'\x08\x00\x00\x00\x95$'
Traceback (most recent call last):
File "C:\platform-tools\cmd.py", line 114, in <module>
measures = reader.read(False)
File "C:\platform-tools\radexreader\__init__.py", line 170, in read
measure = (hexa[6] + hexa[7] * 256 + hexa[8] * 256 * 256) / 100
IndexError: index out of range
Just incase I also included the console output above as well.
So we are ok.
I read some description of Radex One, and there are no memory with the device, it's only real time, is correct? Based on your video, we can probably get from Radex One the following values: date / time / ambient dose / accumulated / cpm.
Can you try again only these lines:
# 7b ff 20 00 06 00 01 00 00 00 5d 00 01 00 0c 00 f2 ff
self.hid_set_report((0x7b, 0xff, 0x20, 0, 0x06, 0, 0x01, 0, 0, 0, 0x5d, 0, 0x01, 0, 0x0c, 0, 0xf2, 0xff))
print(self.hid_get_report())
I read some description of Radex One, and there are no memory with the device, it's only real time, is correct?
Yes, this is why I want this code, after getting it to work on windows I want to modify it to run it on my phone so I can have a more portable way of storing radiation data, without having to write it down, I'll try out this code you've provided now.
b'z\xff\x00\x80\x00\x00\x02\x00\x00\x00\x82\x80'
b'z\xff \x80\x1e\x00\x01\x00\x00\x00E\x80'
b'\x01\x00\x00\x00\x14\x00\x00\x00\x11\xa4\x00\x00'
b'\xde\r\x00\x00\x12\x00\x03\x1e\x01\x08H\x03'
b'\x08\x00\x00\x00\x95$'
Ok, remove all added line in def read
, and modify:
for key in keys:
#self.hid_set_report((0x12, 0x12, 0x01, 0x02, key, 0, 0, 0, 0, 0, 0, 0, 0x3c, 0x84))
key = 0x01
self.hid_set_report((0x7b, 0xff, 0x20, 0, 0x06, 0, key, 0, 0, 0, 0x5d, 0, 0x01, 0, 0x0c, 0, 0xf2, 0xff))
hexa = self.hid_get_report()
print(hexa)
Then run cmd.py tail
.
C:\Windows\system32>cmd.py tail
b'z\xff \x80\x1e\x00\x01\x00\x00\x00E\x80'
1970-01-24 03:14:40 0.01 µSv/h ±99% (0.00 ≤ 0.01 ≤ 0.07)
b'\x01\x00\x00\x00\x14\x00\x00\x00\x11\xa4\x00\x00'
1970-01-16 04:05:20 11141.12 µSv/h ±15% (9469.89 ≤ 11141.12 ≤ 12812.35)
b'\xde\r\x00\x00\x12\x00\x03\x1e\x01\x08H\x03'
1970-01-14 15:40:48 732.19 µSv/h ±15% (622.30 ≤ 732.19 ≤ 842.08)
11141.12 µSv/h
I guess I'll die.
b'z\xff \x80\x1e\x00\x01\x00\x00\x00E\x80'
1970-01-24 03:14:40 0.01 µSv/h ±99% (0.00 ≤ 0.01 ≤ 0.07)
b'\x01\x00\x00\x00\x14\x00\x00\x00\x11\xa4\x00\x00'
1970-01-16 04:05:20 11141.12 µSv/h ±15% (9469.89 ≤ 11141.12 ≤ 12812.35)
b'\xde\r\x00\x00\x12\x00\x03\x1e\x01\x08H\x03'
1970-01-14 15:40:48 732.19 µSv/h ±15% (622.30 ≤ 732.19 ≤ 842.08)
b'\x08\x00\x00\x00\x95$z\xff \x80\x1e\x00'
1989-06-13 12:37:20 21625.54 µSv/h ±15% (18381.65 ≤ 21625.54 ≤ 24869.43)
b'\x01\x00\x00\x00E\x80\x01\x00\x00\x00\x14\x00'
2038-03-12 11:20:32 0.01 µSv/h ±99% (0.00 ≤ 0.01 ≤ 0.07)
b'\x00\x00\x11\xa4\x00\x00\xde\r\x00\x00\x12\x00'
b'\x03\x1e\x01\x08H\x03\x08\x00\x00\x00\x95$'
1971-09-30 04:18:09 0.08 µSv/h ±90% (0.01 ≤ 0.08 ≤ 0.15)
b'z\xff \x80\x1e\x00\x01\x00\x00\x00E\x80'
1970-01-24 03:14:40 0.01 µSv/h ±99% (0.00 ≤ 0.01 ≤ 0.07)
b'\x01\x00\x00\x00\x14\x00\x00\x00\x11\xa4\x00\x00'
1970-01-16 04:05:20 11141.12 µSv/h ±15% (9469.89 ≤ 11141.12 ≤ 12812.35)
b'\xde\r\x00\x00\x12\x00\x03\x1e\x01\x08H\x03'
1970-01-14 15:40:48 732.19 µSv/h ±15% (622.30 ≤ 732.19 ≤ 842.08)
b'\x08\x00\x00\x00\x95$z\xff \x80\x1e\x00'
1989-06-13 12:37:20 21625.54 µSv/h ±15% (18381.65 ≤ 21625.54 ≤ 24869.43)
b'\x01\x00\x00\x00E\x80\x01\x00\x00\x00\x14\x00'
2038-03-12 11:20:32 0.01 µSv/h ±99% (0.00 ≤ 0.01 ≤ 0.07)
b'\x00\x00\x11\xa4\x00\x00\xde\r\x00\x00\x12\x00'
b'\x03\x1e\x01\x08H\x03\x08\x00\x00\x00\x95$'
1971-09-30 04:18:09 0.08 µSv/h ±90% (0.01 ≤ 0.08 ≤ 0.15)
b'z\xff \x80\x1e\x00\x01\x00\x00\x00E\x80'
1970-01-24 03:14:40 0.01 µSv/h ±99% (0.00 ≤ 0.01 ≤ 0.07)
b'\x01\x00\x00\x00\x14\x00\x00\x00\x11\xa4\x00\x00'
1970-01-16 04:05:20 11141.12 µSv/h ±15% (9469.89 ≤ 11141.12 ≤ 12812.35)
b'\xde\r\x00\x00\x12\x00\x03\x1e\x01\x08H\x03'
1970-01-14 15:40:48 732.19 µSv/h ±15% (622.30 ≤ 732.19 ≤ 842.08)
b'\x08\x00\x00\x00\x95$z\xff \x80\x1e\x00'
1989-06-13 12:37:20 21625.54 µSv/h ±15% (18381.65 ≤ 21625.54 ≤ 24869.43)
b'\x01\x00\x00\x00E\x80\x01\x00\x00\x00\x14\x00'
2038-03-12 11:20:32 0.01 µSv/h ±99% (0.00 ≤ 0.01 ≤ 0.07)
b'\x00\x00\x11\xa4\x00\x00\xde\r\x00\x00\x12\x00'
b'\x03\x1e\x01\x08H\x03\x08\x00\x00\x00\x95$'
1971-09-30 04:18:09 0.08 µSv/h ±90% (0.01 ≤ 0.08 ≤ 0.15)
b'z\xff \x80\x1e\x00\x01\x00\x00\x00E\x80'
1970-01-24 03:14:40 0.01 µSv/h ±99% (0.00 ≤ 0.01 ≤ 0.07)
b'\x01\x00\x00\x00\x14\x00\x00\x00\x11\xa4\x00\x00'
1970-01-16 04:05:20 11141.12 µSv/h ±15% (9469.89 ≤ 11141.12 ≤ 12812.35)
b'\xde\r\x00\x00\x12\x00\x03\x1e\x01\x08H\x03'
1970-01-14 15:40:48 732.19 µSv/h ±15% (622.30 ≤ 732.19 ≤ 842.08)
b'\x08\x00\x00\x00\x95$z\xff \x80\x1e\x00'
1989-06-13 12:37:20 21625.54 µSv/h ±15% (18381.65 ≤ 21625.54 ≤ 24869.43)
b'\x01\x00\x00\x00E\x80\x01\x00\x00\x00\x14\x00'
2038-03-12 11:20:32 0.01 µSv/h ±99% (0.00 ≤ 0.01 ≤ 0.07)
b'\x00\x00\x11\xa4\x00\x00\xde\r\x00\x00\x12\x00'
b'\x03\x1e\x01\x08H\x03\x08\x00\x00\x00\x95$'
1971-09-30 04:18:09 0.08 µSv/h ±90% (0.01 ≤ 0.08 ≤ 0.15)
b'z\xff \x80\x1e\x00\x01\x00\x00\x00E\x80'
1970-01-24 03:14:40 0.01 µSv/h ±99% (0.00 ≤ 0.01 ≤ 0.07)
b'\x01\x00\x00\x00\x14\x00\x00\x00\x11\xa4\x00\x00'
1970-01-16 04:05:20 11141.12 µSv/h ±15% (9469.89 ≤ 11141.12 ≤ 12812.35)
b'\xde\r\x00\x00\x12\x00\x03\x1e\x01\x08H\x03'
1970-01-14 15:40:48 732.19 µSv/h ±15% (622.30 ≤ 732.19 ≤ 842.08)
b'\x08\x00\x00\x00\x95$z\xff \x80\x1e\x00'
1989-06-13 12:37:20 21625.54 µSv/h ±15% (18381.65 ≤ 21625.54 ≤ 24869.43)
Here's the data it's generated so far, hope it helps.
It is bullshit, but we are reading things.
Now we will try to find the time, I will assume that it is the same encoding as on the Radex RD1212. What is the minimum and the maximum date that you can configure on your device? For the Radex RD1212, it's 01/01/2016 - 31/12/2036.
EDIT: Can you run cmd.py readlast
with the following changes (I think we have not all data):
for key in keys:
#self.hid_set_report((0x12, 0x12, 0x01, 0x02, key, 0, 0, 0, 0, 0, 0, 0, 0x3c, 0x84))
key = 0x01
self.hid_set_report((0x7b, 0xff, 0x20, 0, 0x06, 0, key, 0, 0, 0, 0x5d, 0, 0x01, 0, 0x0c, 0, 0xf2, 0xff))
hexa = self.dev.read(12)
print(hexa)
hexa = self.dev.read(21)
print(hexa)
hexa = self.dev.read(2)
print(hexa)
hexa = self.dev.read(2)
print(hexa)
hexa = self.dev.read(2)
print(hexa)
hexa = self.dev.read(2)
print(hexa)
hexa = self.dev.read(1)
print(hexa)
Reference:
454 10/04/2021 08:47:01 IRP_MJ_WRITE DOWN 7b ff 20 00 06 00 01 00 00 00 5d 00 {ÿ .......]. 12 12 COM4
455 10/04/2021 08:47:01 IRP_MJ_WRITE UP STATUS_SUCCESS 7b ff 20 00 06 00 01 00 00 00 5d 00 {ÿ .......]. 12 COM4
456 10/04/2021 08:47:01 IRP_MJ_DEVICE_CONTROL (IOCTL_SERIAL_GET_COMMSTATUS) DOWN COM4
457 10/04/2021 08:47:01 IRP_MJ_DEVICE_CONTROL (IOCTL_SERIAL_GET_COMMSTATUS) UP STATUS_SUCCESS 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 .................... 20 COM4
458 10/04/2021 08:47:01 IRP_MJ_DEVICE_CONTROL (IOCTL_SERIAL_GET_COMMSTATUS) DOWN COM4
459 10/04/2021 08:47:01 IRP_MJ_DEVICE_CONTROL (IOCTL_SERIAL_GET_COMMSTATUS) UP STATUS_SUCCESS 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 .................... 20 COM4
460 10/04/2021 08:47:01 IRP_MJ_WRITE DOWN 01 00 0c 00 .... 4 4 COM4
461 10/04/2021 08:47:01 IRP_MJ_WRITE UP STATUS_SUCCESS 01 00 0c 00 .... 4 COM4
462 10/04/2021 08:47:01 IRP_MJ_DEVICE_CONTROL (IOCTL_SERIAL_GET_COMMSTATUS) DOWN COM4
463 10/04/2021 08:47:01 IRP_MJ_DEVICE_CONTROL (IOCTL_SERIAL_GET_COMMSTATUS) UP STATUS_SUCCESS 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 .................... 20 COM4
464 10/04/2021 08:47:01 IRP_MJ_DEVICE_CONTROL (IOCTL_SERIAL_GET_COMMSTATUS) DOWN COM4
465 10/04/2021 08:47:01 IRP_MJ_DEVICE_CONTROL (IOCTL_SERIAL_GET_COMMSTATUS) UP STATUS_SUCCESS 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 .................... 20 COM4
466 10/04/2021 08:47:01 IRP_MJ_WRITE DOWN f2 ff òÿ 2 2 COM4
467 10/04/2021 08:47:01 IRP_MJ_WRITE UP STATUS_SUCCESS f2 ff òÿ 2 COM4
468 10/04/2021 08:47:01 IRP_MJ_DEVICE_CONTROL (IOCTL_SERIAL_GET_COMMSTATUS) DOWN COM4
469 10/04/2021 08:47:01 IRP_MJ_DEVICE_CONTROL (IOCTL_SERIAL_GET_COMMSTATUS) UP STATUS_SUCCESS 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 .................... 20 COM4
470 10/04/2021 08:47:01 IRP_MJ_DEVICE_CONTROL (IOCTL_SERIAL_GET_COMMSTATUS) DOWN COM4
471 10/04/2021 08:47:01 IRP_MJ_DEVICE_CONTROL (IOCTL_SERIAL_GET_COMMSTATUS) UP STATUS_SUCCESS 00 00 00 00 00 00 00 00 21 00 00 00 00 00 00 00 00 00 00 00 ........!........... 20 COM4
472 10/04/2021 08:47:01 IRP_MJ_DEVICE_CONTROL (IOCTL_SERIAL_GET_COMMSTATUS) DOWN COM4
473 10/04/2021 08:47:01 IRP_MJ_DEVICE_CONTROL (IOCTL_SERIAL_GET_COMMSTATUS) UP STATUS_SUCCESS 00 00 00 00 00 00 00 00 21 00 00 00 00 00 00 00 00 00 00 00 ........!........... 20 COM4
474 10/04/2021 08:47:01 IRP_MJ_READ DOWN 12 COM4
475 10/04/2021 08:47:01 IRP_MJ_READ UP STATUS_SUCCESS 7a ff 20 80 1e 00 01 00 00 00 45 80 zÿ €......E€ 12 COM4
476 10/04/2021 08:47:01 IRP_MJ_DEVICE_CONTROL (IOCTL_SERIAL_GET_COMMSTATUS) DOWN COM4
477 10/04/2021 08:47:01 IRP_MJ_DEVICE_CONTROL (IOCTL_SERIAL_GET_COMMSTATUS) UP STATUS_SUCCESS 00 00 00 00 00 00 00 00 15 00 00 00 00 00 00 00 00 00 00 00 .................... 20 COM4
478 10/04/2021 08:47:01 IRP_MJ_DEVICE_CONTROL (IOCTL_SERIAL_GET_COMMSTATUS) DOWN COM4
479 10/04/2021 08:47:01 IRP_MJ_DEVICE_CONTROL (IOCTL_SERIAL_GET_COMMSTATUS) UP STATUS_SUCCESS 00 00 00 00 00 00 00 00 15 00 00 00 00 00 00 00 00 00 00 00 .................... 20 COM4
480 10/04/2021 08:47:01 IRP_MJ_READ DOWN 21 COM4
481 10/04/2021 08:47:01 IRP_MJ_READ UP STATUS_SUCCESS 01 00 00 00 14 00 00 00 11 a4 00 00 de 0d 00 00 12 00 03 1e 01 .........¤..Þ........ 21 COM4
482 10/04/2021 08:47:01 IRP_MJ_DEVICE_CONTROL (IOCTL_SERIAL_GET_COMMSTATUS) DOWN COM4
483 10/04/2021 08:47:01 IRP_MJ_DEVICE_CONTROL (IOCTL_SERIAL_GET_COMMSTATUS) UP STATUS_SUCCESS 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 .................... 20 COM4
484 10/04/2021 08:47:01 IRP_MJ_DEVICE_CONTROL (IOCTL_SERIAL_GET_COMMSTATUS) DOWN COM4
485 10/04/2021 08:47:01 IRP_MJ_DEVICE_CONTROL (IOCTL_SERIAL_GET_COMMSTATUS) UP STATUS_SUCCESS 00 00 00 00 00 00 00 00 02 00 00 00 00 00 00 00 00 00 00 00 .................... 20 COM4
486 10/04/2021 08:47:01 IRP_MJ_READ DOWN 2 COM4
487 10/04/2021 08:47:01 IRP_MJ_READ UP STATUS_SUCCESS 08 48 .H 2 COM4
488 10/04/2021 08:47:01 IRP_MJ_DEVICE_CONTROL (IOCTL_SERIAL_GET_COMMSTATUS) DOWN COM4
489 10/04/2021 08:47:01 IRP_MJ_DEVICE_CONTROL (IOCTL_SERIAL_GET_COMMSTATUS) UP STATUS_SUCCESS 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 .................... 20 COM4
490 10/04/2021 08:47:01 IRP_MJ_DEVICE_CONTROL (IOCTL_SERIAL_GET_COMMSTATUS) DOWN COM4
491 10/04/2021 08:47:01 IRP_MJ_DEVICE_CONTROL (IOCTL_SERIAL_GET_COMMSTATUS) UP STATUS_SUCCESS 00 00 00 00 00 00 00 00 02 00 00 00 00 00 00 00 00 00 00 00 .................... 20 COM4
492 10/04/2021 08:47:01 IRP_MJ_READ DOWN 2 COM4
493 10/04/2021 08:47:01 IRP_MJ_READ UP STATUS_SUCCESS 03 08 .. 2 COM4
494 10/04/2021 08:47:01 IRP_MJ_DEVICE_CONTROL (IOCTL_SERIAL_GET_COMMSTATUS) DOWN COM4
495 10/04/2021 08:47:01 IRP_MJ_DEVICE_CONTROL (IOCTL_SERIAL_GET_COMMSTATUS) UP STATUS_SUCCESS 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 .................... 20 COM4
496 10/04/2021 08:47:01 IRP_MJ_DEVICE_CONTROL (IOCTL_SERIAL_GET_COMMSTATUS) DOWN COM4
497 10/04/2021 08:47:01 IRP_MJ_DEVICE_CONTROL (IOCTL_SERIAL_GET_COMMSTATUS) UP STATUS_SUCCESS 00 00 00 00 00 00 00 00 02 00 00 00 00 00 00 00 00 00 00 00 .................... 20 COM4
498 10/04/2021 08:47:01 IRP_MJ_READ DOWN 2 COM4
499 10/04/2021 08:47:01 IRP_MJ_READ UP STATUS_SUCCESS 00 00 .. 2 COM4
500 10/04/2021 08:47:01 IRP_MJ_DEVICE_CONTROL (IOCTL_SERIAL_GET_COMMSTATUS) DOWN COM4
501 10/04/2021 08:47:01 IRP_MJ_DEVICE_CONTROL (IOCTL_SERIAL_GET_COMMSTATUS) UP STATUS_SUCCESS 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 .................... 20 COM4
502 10/04/2021 08:47:01 IRP_MJ_DEVICE_CONTROL (IOCTL_SERIAL_GET_COMMSTATUS) DOWN COM4
503 10/04/2021 08:47:01 IRP_MJ_DEVICE_CONTROL (IOCTL_SERIAL_GET_COMMSTATUS) UP STATUS_SUCCESS 00 00 00 00 00 00 00 00 02 00 00 00 00 00 00 00 00 00 00 00 .................... 20 COM4
504 10/04/2021 08:47:01 IRP_MJ_READ DOWN 2 COM4
505 10/04/2021 08:47:01 IRP_MJ_READ UP STATUS_SUCCESS 00 95 .• 2 COM4
506 10/04/2021 08:47:01 IRP_MJ_DEVICE_CONTROL (IOCTL_SERIAL_GET_COMMSTATUS) DOWN COM4
507 10/04/2021 08:47:01 IRP_MJ_DEVICE_CONTROL (IOCTL_SERIAL_GET_COMMSTATUS) UP STATUS_SUCCESS 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 .................... 20 COM4
508 10/04/2021 08:47:01 IRP_MJ_DEVICE_CONTROL (IOCTL_SERIAL_GET_COMMSTATUS) DOWN COM4
509 10/04/2021 08:47:01 IRP_MJ_DEVICE_CONTROL (IOCTL_SERIAL_GET_COMMSTATUS) UP STATUS_SUCCESS 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 .................... 20 COM4
510 10/04/2021 08:47:01 IRP_MJ_READ DOWN 1 COM4
511 10/04/2021 08:47:01 IRP_MJ_READ UP STATUS_SUCCESS 24 $ 1 COM4
512 10/04/2021 08:47:01 IRP_MJ_DEVICE_CONTROL (IOCTL_SERIAL_PURGE) DOWN 0f 00 00 00 .... 4 COM4
513 10/04/2021 08:47:01 IRP_MJ_DEVICE_CONTROL (IOCTL_SERIAL_PURGE) UP STATUS_SUCCESS COM4
514 10/04/2021 08:47:01 IRP_MJ_DEVICE_CONTROL (IOCTL_SERIAL_GET_COMMSTATUS) DOWN COM4
515 10/04/2021 08:47:01 IRP_MJ_DEVICE_CONTROL (IOCTL_SERIAL_GET_COMMSTATUS) UP STATUS_SUCCESS 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 .................... 20 COM4
516 10/04/2021 08:47:01 IRP_MJ_DEVICE_CONTROL (IOCTL_SERIAL_GET_COMMSTATUS) DOWN COM4
517 10/04/2021 08:47:01 IRP_MJ_DEVICE_CONTROL (IOCTL_SERIAL_GET_COMMSTATUS) UP STATUS_SUCCESS 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 .................... 20 COM4
[10/04/2021 08:20:42] Written data (COM4)
7b ff 20 00 06 00 01 00 00 00 5d 00 01 00 0c 00 {ÿ .......].....
f2 ff òÿ
[10/04/2021 08:20:42] Read data (COM4)
7a ff 20 80 1e 00 01 00 00 00 45 80 01 00 00 00 zÿ €......E€....
14 00 00 00 11 a4 00 00 de 0d 00 00 12 00 03 1e .....¤..Þ.......
01 08 48 03 08 00 00 00 95 24 ..H.....•$
C:\Windows\system32>cmd.py readlast
b'z\xff \x80\x1e\x00\x01\x00\x00\x00E\x80'
b'\x01\x00\x00\x00\x14\x00\x00\x00\x11\xa4\x00\x00'
b'\xde\r\x00\x00\x12\x00\x03\x1e\x01\x08H\x03'
b'\x08\x00\x00\x00\x95$'
Traceback (most recent call last):
File "C:\platform-tools\cmd.py", line 91, in <module>
measures = reader.read(True)
File "C:\platform-tools\radexreader\__init__.py", line 170, in read
measure = (hexa[6] + hexa[7] * 256 + hexa[8] * 256 * 256) / 100
IndexError: index out of range
I see you edited the code, I'll run that as well.
Ok, I updated the code, please try again :). Yes, I see many IRP_MJ_READ DOWN, we will do same.
C:\Windows\system32>cmd.py readlast
b'z\xff \x80\x1e\x00\x01\x00\x00\x00E\x80'
b'\x01\x00\x00\x00\x14\x00\x00\x00\x11\xa4\x00\x00\xde\r\x00\x00\x12\x00\x03\x1e\x01'
b'\x08H'
b'\x03\x08'
b'\x00\x00'
b'\x00\x95'
b'$'
Traceback (most recent call last):
File "C:\platform-tools\cmd.py", line 91, in <module>
measures = reader.read(True)
File "C:\platform-tools\radexreader\__init__.py", line 174, in read
timestamp = (hexa[2] + hexa[3] * 256 + hexa[4] * 256 * 256 + hexa[5] * 256 * 256 * 256)
IndexError: index out of range
Good. Can you check date on your device?
How do I do that? The Radex one doesn't have a date setting option in the settings, the date on my computer is 4/10/2021 at 12:30 PM
Okay. So if you change your computer date, and run the official tool to read data, the date displayed is your computer date, right? So, date is not transferred.
So we can supposed, that the previous results contains expected but encoded measures:
b'z\xff \x80\x1e\x00\x01\x00\x00\x00E\x80'
b'\x01\x00\x00\x00\x14\x00\x00\x00\x11\xa4\x00\x00\xde\r\x00\x00\x12\x00\x03\x1e\x01'
b'\x08H'
b'\x03\x08'
b'\x00\x00'
b'\x00\x95'
b'$'
(I will suppose a stop mark)Okay. So if you change your computer date, and run the official tool to read data, the date displayed is your computer date, right? So, date is not transferred.
Yep, date is not transferred.
So we are searching three values. We need more data.
I'm not sure, but we can try the cmd.py tail
with the following read
function:
def read(self, last=False):
print("go")
values = {}
#if last:
# keys = [0x01]
#else:
keys = list(range(0x01, 0x09)) # from 0x01 to 0x08
for key in keys:
self.hid_set_report((0x7b, 0xff, 0x20, 0, 0x06, 0, key, 0, 0, 0, 0x5d, 0, 0x01, 0, 0x0c, 0, 0xf2, 0xff))
print("=== " + str(key) + " ===")
hexa = self.dev.read(12)
print(hexa)
hexa = self.dev.read(21)
print(hexa)
hexa = self.dev.read(2)
print(hexa)
hexa = self.dev.read(2)
print(hexa)
hexa = self.dev.read(2)
print(hexa)
hexa = self.dev.read(2)
print(hexa)
hexa = self.dev.read(1)
print(hexa)
time.sleep(2)
return dict(sorted(values.items(), key=operator.itemgetter(0)))
go
=== 1 ===
b'z\xff \x80\x1e\x00\x01\x00\x00\x00E\x80'
b'\x01\x00\x00\x00\x14\x00\x00\x00\x11\xa4\x00\x00\xde\r\x00\x00\x12\x00\x03\x1e\x01'
b'\x08H'
b'\x03\x08'
b'\x00\x00'
b'\x00\x95'
b'$'
=== 2 ===
b''
b''
b''
b''
b''
b''
b''
=== 3 ===
b''
b''
b''
b''
b''
b''
b''
=== 4 ===
b''
b''
b''
b''
b''
b''
b''
=== 5 ===
b''
b''
b''
b''
b''
b''
b''
=== 6 ===
b''
b''
b''
b''
b''
b''
b''
=== 7 ===
b''
b''
b''
b''
b''
b''
b''
=== 8 ===
b''
b''
b''
b''
b''
b''
b''
Ok, is there data for 2 / 3 / 4 / 5 / 6 / 7 / 8 after some seconds/minute?
The only one with a result is 1, the rest are always empty.
KeyLoopResult.txt It's the same thing repeated, nothing is changing.
Ok, I know why, a story of addresses, perhaps... Try again with this:
def read(self, last=False):
print("go")
values = {}
keys = {
(0x7b, 0xff, 0x20, 0, 0x06, 0, 0x01, 0, 0, 0, 0x5d, 0, 0x01, 0, 0x0c, 0, 0xf2, 0xff),
(0x7b, 0xff, 0x20, 0, 0x06, 0, 0x02, 0, 0, 0, 0x5c, 0, 0x01, 0x08, 0x0c, 0, 0xf2, 0xf7),
(0x7b, 0xff, 0x20, 0, 0x06, 0, 0x03, 0, 0, 0, 0x5b, 0, 0x01, 0, 0x0c, 0, 0xf2, 0xff),
(0x7b, 0xff, 0x20, 0, 0x06, 0, 0x04, 0, 0, 0, 0x5a, 0, 0, 0x08, 0x0c, 0, 0xf2, 0xf7),
(0x7b, 0xff, 0x20, 0, 0x06, 0, 0x05, 0, 0, 0, 0x59, 0, 0x01, 0, 0x0c, 0, 0xf2, 0xff),
(0x7b, 0xff, 0x20, 0, 0x06, 0, 0x06, 0, 0, 0, 0x58, 0, 0, 0x08, 0x0c, 0, 0xf2, 0xf7),
(0x7b, 0xff, 0x20, 0, 0x06, 0, 0x07, 0, 0, 0, 0x57, 0, 0x01, 0, 0x0c, 0, 0xf2, 0xff),
(0x7b, 0xff, 0x20, 0, 0x06, 0, 0x08, 0, 0, 0, 0x56, 0, 0, 0x08, 0x0c, 0, 0xf2, 0xf7)
}
for key in keys:
self.hid_set_report(key)
print("=== " + str(key[6]) + " ===")
hexa = self.dev.read(12)
print(hexa)
hexa = self.dev.read(21)
print(hexa)
hexa = self.dev.read(2)
print(hexa)
hexa = self.dev.read(2)
print(hexa)
hexa = self.dev.read(2)
print(hexa)
hexa = self.dev.read(2)
print(hexa)
hexa = self.dev.read(1)
print(hexa)
time.sleep(2)
return dict(sorted(values.items(), key=operator.itemgetter(0)))
KeyLoopResult 1.txt I see a lot of repetition.
Can you capture packets again with the official program like your first text file format?
Then open all files.
Search in files: 7b ff 20 00 06 00 01
Do you see:
in all files?
I did some cleanup in previous comments.
Can you try this new version with cmd.py tail
for 1 minute?
In this version we are sending same written data
as MinuteofData4.txt.
I did a few more of these readlast tests, and the only thing that has changed is the time, I've kept an eye on the geiger counter and it's shifting around (0.09 ~ 0.14µSv/h).
RADEX ONE results, same code ran another time.
Yes, I think that the data previously displayed is a ack. I changed data displayed. On the latest result this is better. I will think about it.
Gist updated again. Just to check, but results will be wrong.
Microsoft Windows [Version 10.0.18363.1440]
(c) 2019 Microsoft Corporation. All rights reserved.
C:\Windows\System32>cmd.py readlast
Information python3-radexreader 1.2.0 with python 3.9.1 + pyusb 1.1.1 + pyserial 3.5
ComPort COM4
[info] Measuring range: 0.05 - 999 µSv/h
[info] Uncertainty of the result: ±(15+6/D)%
[info] D is the value after a complete cycle of 100? seconds
[warn] The values displayed are only an approximation.
[warn] The actual value can only be measured with suitable professional device.
[warn] For now, not tested with measured values greater than 0.25 µSv/h.
=== block1 ===
11/04/2021 10:08:00
read
b'z\xff\x00\x80\x00\x00\x05\x00\x00\x00\x7f\x80'
b''
b''
b''
Traceback (most recent call last):
File "C:\platform-tools\cmd.py", line 91, in <module>
measures = reader.read(True)
File "C:\platform-tools\radexreader\__init__.py", line 245, in read
self.testread()
File "C:\platform-tools\radexreader\__init__.py", line 225, in testread
print("= " + str(hexa[1] + hexa[2]))
IndexError: index out of range
C:\Windows\System32>
Gist updated again. Run it multiple times to check if results are same or not.
Okay. So, gist updated again. Run it multiple times to check if results are same or not. This time I displayed all reads.
I'm using https://www.diffchecker.com/diff to compare the tests, there are differences in the two results. Test 1 w/ ALL READS Test 2 w/ ALL READS
Good. Perhaps measures are here, or we are wrong. I updated the gist to display only them.
I updated the gist to extract them. Not sure. Try to change value for line 222/223/224.
Change them to what?
print("value:" + str(hexa[16]))
is 100% printing the CPM, I stared at the display while looking at that number and it got it right three times in a row.
=== block6 ===
11/04/2021 10:47:45
read
b'\x00\x08\x00\x00\x0c\x00\x00\x00\x0c\x00\x00\x00\x14\x02\x00\x00\x0f\x00\x00\x00\xc4'
value:12
value:15
value:196
b'\xf5'
=== block7 ===
11/04/2021 10:47:58
read
b''
Traceback (most recent call last):
File "C:\platform-tools\cmd.py", line 91, in <module>
measures = reader.read(True)
File "C:\platform-tools\radexreader\__init__.py", line 329, in read
self.testread()
File "C:\platform-tools\radexreader\__init__.py", line 222, in testread
print("value:" + str(hexa[8]))
IndexError: index out of range
print("value:" + str(hexa[8]))
appears to be printing the µSv/h, 14 means 0.14 µSv/h and 9 means 0.09 µSv/h, etc.
Appearently this lib only works for RD-1212BT, not for RD-1212 (without BT).
This should be mentioned in the documentation.