After upgrading to Dia 1.2.19 over the weekend, I’ve uncovered a bug in the XBeeSensor driver and behavior from the actual sensor that I believe is new.
Immediately after starting Dia and once the XBee sensor is seen on the network and configured, I start seeing the following exception logged, approximately 60 times:
XBeeDeviceManager(xbee_device_manager):
Exception during rx callback for addr = ('[00:13:a2:00:40:55:9b:a5]!', 232, 49413, 146, 1, 0)
Traceback (most recent call last):
File "src/devices/xbee/xbee_device_manager/xbee_device_manager.py", line 328, in __select_rx_cbs_for
File "src/devices/xbee/xbee_devices/xbee_sensor.py", line 405, in sample_indication
File "src/devices/xbee/xbee_devices/xbee_sensor.py", line 406, in
KeyError: 'AD1'
I’ve modified the sample_indication method so that this exception is properly handled; what’s happening is that the io_sample dict doesn’t contain values for AD1, AD2, or AD3 keys; DIO11 (low battery) seems to be there reliably, however.
After implementing this fix, however, the inrush of packets is causing a bottleneck. My logging shows that the sample_indication method is processing 2-3 packets per second for 30 seconds, which effectively stops any other packets from being processed in a timely fashion (although they don’t seem to get dropped). I’ll accept that my additional logging may now be contributing to this overhead, but the stack traces that were being logged before took a non-trivial amount of time…
After the initial startup of Dia, I see this burst of packets happening at an irregular frequency: 8 times between noon and 1pm today, only once between 11 and noon, 7 times between 10 and 11, 5 times between 9 and 10, and only twice between 7 and 9.
I don’t know for sure that this is brand new behavior introduced by Dia 1.2.19, but I suspect it is.
Any thoughts on what might be causing this? What else can I provide to help diagnose the problem?