Open ninjas28 opened 2 years ago
Yep I get the error too. It's in def decode_VS_DATA_BUF(
I grabbed a screen shot while debugging with Visual Studio Code on Windows 11 Linux subsystem with a shared USB.
def decode_VS_DATA_BUF(
br: BytesBuffer,
base_time: datetime.datetime,
) -> List[Union[RealTimeData, DoseRateDB, RareData, RawData, Event]]:
ret: List[Union[RealTimeData, DoseRateDB, RareData, RawData, Event]] = []
next_seq = None
print(f"decode_VS_Data br={[br._data.hex()]}")
while br.size() > 0:
seq, eid, gid, ts_offset = br.unpack('<BBBi')
dt = base_time + datetime.timedelta(milliseconds=ts_offset)
if next_seq is not None and next_seq != seq:
raise Exception(f'seq jump, expect:{next_seq}, got:{seq}')
Here are the readings as a hex string before alarming the Radiacode 103. Inside the [] brackets [4700000026080092010000003b0000001d0000e5000000496dc540f50d27373c00c2004020001e0101002200000300320000000000c040c28627380000c040e02d103600000040e02d9035]
Here are the readings during alarm.
[7700000026080092010000006b0000002b00002d2700000080f243bb27c33a5900a0004222092c0101e82500000900320000000000fe43bec1cf3a0000e04368919d3a0000ec43c364b23a0000ee43a167eb3a0000f8437cf2c83a0000f24370cea03a00000144b7d1c83a0000e343bf7dbd3a0000e443ba49b43a]
I "think" what is happening is the usb read is not handling multiple blocks of data when this happens. If you just print the message and return ret the next readings read works.
There's a couple of other times this happens, but only when you move the radiation source close and far from the device to trigger alarm values. I find when this happens with other radiation meters it's because the devices take and extra second to perform their internal calculations.
if next_seq is not None and next_seq != seq:
print(f'seq jump, expect:{next_seq}, got:{seq}')
return ret
#raise Exception(f'seq jump, expect:{next_seq}, got:{seq}')
It seems if the dose rate alarms are configured then the device sends additional data that the webserver example is not designed to handle?
I get a couple of different errors when I activate the alarm
or sometimes I get