thegridelectric / gw-scada-spaceheat-python

GridWorks SCADA for space heating
MIT License
5 stars 2 forks source link

Understand (and fix?) I2C delay for flow meter #202

Open jessicamillar opened 1 year ago

jessicamillar commented 1 year ago

Right now, the flow meters are set to read every 60 seconds. About 2% of the reported flow meter readings are delayed beyond 65 seconds, with an average time of about 3 minutes and ranging between 90 seconds and 5 minutes.

What are the odds that a single i2c thread would change this behavior significantly?

Both pipe temp sensors (which are different i2c devices and different actors) report their delayed readings at the same time (see below, dist_flow_long and glycol_flow_long).

Interestingly, the i2c analog temp sensor has a delay of comparable length, reported exactly 3 seconds before the above. In addition, the i2c analog temp sensor has many more shorter delays (between 65 and 75 seconds) - in fact, 11% of the analog temp sensor readings are longer than 65 seconds.

dist_flow_long =[['2023-03-28 00:33:50', 1679963630, 236], ['2023-03-28 01:02:03', 1679965323, 124], ['2023-03-28 01:09:36', 1679965776, 333], ['2023-03-28 01:50:00', 1679968200, 302], ['2023-03-28 04:22:04', 1679977324, 185], ['2023-03-28 06:04:58', 1679983498, 315], ['2023-03-28 06:13:21', 1679984001, 202], ['2023-03-28 06:29:24', 1679984964, 297], ['2023-03-28 07:47:58', 1679989678, 183], ['2023-03-28 08:32:11', 1679992331, 180], ['2023-03-28 10:51:45', 1680000705, 152], ['2023-03-28 11:06:19', 1680001579, 86], ['2023-03-28 13:18:53', 1680009533, 285]]

glycol_flow_long = [['2023-03-28 00:33:50', 1679963630, 290], ['2023-03-28 01:02:03', 1679965323, 179], ['2023-03-28 01:09:36', 1679965776, 333], ['2023-03-28 01:50:00', 1679968200, 302], ['2023-03-28 04:22:04', 1679977324, 168], ['2023-03-28 06:04:58', 1679983498, 307], ['2023-03-28 06:13:21', 1679984001, 262], ['2023-03-28 06:29:24', 1679984964, 297], ['2023-03-28 07:47:58', 1679989678, 233], ['2023-03-28 08:32:11', 1679992331, 178], ['2023-03-28 10:51:45', 1680000705, 164], ['2023-03-28 11:06:19', 1680001579, 89], ['2023-03-28 13:18:53', 1680009533, 280]]

dist_swt_above_65 = [['2023-03-28 00:33:47', 1679963627, 282], ['2023-03-28 01:02:00', 1679965320, 124], ['2023-03-28 01:09:33', 1679965773, 333], ['2023-03-28 01:49:57', 1679968197, 318], ['2023-03-28 04:22:01', 1679977321, 123], ['2023-03-28 06:04:55', 1679983495, 335], ['2023-03-28 06:13:18', 1679983998, 253], ['2023-03-28 06:29:21', 1679984961, 275], ['2023-03-28 07:47:55', 1679989675, 200], ['2023-03-28 08:32:08', 1679992328, 177], ['2023-03-28 10:51:42', 1680000702, 113], ['2023-03-28 11:06:16', 1680001576, 78], ['2023-03-28 13:18:50', 1680009530, 273]]