vapor-ware / synse-modbus-ip-plugin

Modbus over TCP/IP plugin for Synse
GNU General Public License v3.0
2 stars 3 forks source link

HRF Speed Command Reading #47

Closed MatthewHink closed 4 years ago

MatthewHink commented 4 years ago

Most of the time we read a percentage between 0 and 100. Sometimes we get readings that look like they are off by a factor of 10. It only seems to happen on this register. This is happening on both sides. This could be:

We just need to figure it out.

Sample out of bounds readings. See the value field:

East Liberty:

[2020-03-02 16:25:35,084] site_tests:49 (ERROR) - --- FAIL: Read pCOWeb HRF Speed Command ---
[2020-03-02 16:25:35,084] site_tests:51 (ERROR) - scan_device: {'id': '3675d174-bb14-5ec6-92c4-606efb48655c', 'alias': '', 'info': 'HRF Speed Command', 'type': 'fan', 'plugin': '59aa69eb-a5da-569f-aaa4-3ebbdb72530b', 'tags': ['autofan/device', 'system/id:3675d174-bb14-5ec6-92c4-606efb48655c', 'system/type:fan'], 'metadata': {'model': 'pCOWeb'}}
[2020-03-02 16:25:35,084] site_tests:53 (ERROR) - reading: [{'device': '3675d174-bb14-5ec6-92c4-606efb48655c', 'timestamp': '2020-03-02T21:23:54Z', 'type': 'percentage', 'device_type': 'fan', 'unit': {'name': 'percent', 'symbol': '%'}, 'value': 300, 'context': {'model': 'pCOWeb'}}]

[2020-03-02 16:49:56,233] site_tests:49 (ERROR) - --- FAIL: Read pCOWeb HRF Speed Command ---
[2020-03-02 16:49:56,233] site_tests:51 (ERROR) - scan_device: {'id': '3675d174-bb14-5ec6-92c4-606efb48655c', 'alias': '', 'info': 'HRF Speed Command', 'type': 'fan', 'plugin': '59aa69eb-a5da-569f-aaa4-3ebbdb72530b', 'tags': ['autofan/device', 'system/id:3675d174-bb14-5ec6-92c4-606efb48655c', 'system/type:fan'], 'metadata': {'model': 'pCOWeb'}}
[2020-03-02 16:49:56,233] site_tests:53 (ERROR) - reading: [{'device': '3675d174-bb14-5ec6-92c4-606efb48655c', 'timestamp': '2020-03-02T21:48:13Z', 'type': 'percentage', 'device_type': 'fan', 'unit': {'name': 'percent', 'symbol': '%'}, 'value': 300, 'context': {'model': 'pCOWeb'}}]
[2020-03-02 16:49:56,233] site_tests:55 (ERROR) - data: ['reading[value] out of range']

[2020-03-02 16:52:15,983] site_tests:49 (ERROR) - --- FAIL: Read pCOWeb HRF Speed Command ---
[2020-03-02 16:52:15,983] site_tests:51 (ERROR) - scan_device: {'id': '3675d174-bb14-5ec6-92c4-606efb48655c', 'alias': '', 'info': 'HRF Speed Command', 'type': 'fan', 'plugin': '59aa69eb-a5da-569f-aaa4-3ebbdb72530b', 'tags': ['autofan/device', 'system/id:3675d174-bb14-5ec6-92c4-606efb48655c', 'system/type:fan'], 'metadata': {'model': 'pCOWeb'}}
[2020-03-02 16:52:15,983] site_tests:53 (ERROR) - reading: [{'device': '3675d174-bb14-5ec6-92c4-606efb48655c', 'timestamp': '2020-03-02T21:50:33Z', 'type': 'percentage', 'device_type': 'fan', 'unit': {'name': 'percent', 'symbol': '%'}, 'value': 300, 'context': {'model': 'pCOWeb'}}]
[2020-03-02 16:52:15,983] site_tests:55 (ERROR) - data: ['reading[value] out of range']

Crane:

[2020-03-02 17:39:02,902] site_tests:49 (ERROR) - --- FAIL: Read pCOWeb HRF Speed Command ---
[2020-03-02 17:39:02,902] site_tests:51 (ERROR) - scan_device: {'id': '6cfa5bc7-9e9a-559d-a030-d4ec529d14a4', 'alias': '', 'info': 'HRF Speed Command', 'type': 'fan', 'plugin': '59aa69eb-a5da-569f-aaa4-3ebbdb72530b', 'tags': ['autofan/device', 'system/id:6cfa5bc7-9e9a-559d-a030-d4ec529d14a4', 'system/type:fan'], 'metadata': {'model': 'pCOWeb'}}
[2020-03-02 17:39:02,902] site_tests:53 (ERROR) - reading: [{'device': '6cfa5bc7-9e9a-559d-a030-d4ec529d14a4', 'timestamp': '2020-03-02T22:34:21Z', 'type': 'percentage', 'device_type': 'fan', 'unit': {'name': 'percent', 'symbol': '%'}, 'value': 300, 'context': {'model': 'pCOWeb'}}]
[2020-03-02 17:39:02,902] site_tests:55 (ERROR) - data: ['reading[value] out of range']

[2020-03-02 17:54:35,941] site_tests:49 (ERROR) - --- FAIL: Read pCOWeb HRF Speed Command ---
[2020-03-02 17:54:35,941] site_tests:51 (ERROR) - scan_device: {'id': '6cfa5bc7-9e9a-559d-a030-d4ec529d14a4', 'alias': '', 'info': 'HRF Speed Command', 'type': 'fan', 'plugin': '59aa69eb-a5da-569f-aaa4-3ebbdb72530b', 'tags': ['autofan/device', 'system/id:6cfa5bc7-9e9a-559d-a030-d4ec529d14a4', 'system/type:fan'], 'metadata': {'model': 'pCOWeb'}}
[2020-03-02 17:54:35,941] site_tests:53 (ERROR) - reading: [{'device': '6cfa5bc7-9e9a-559d-a030-d4ec529d14a4', 'timestamp': '2020-03-02T22:49:52Z', 'type': 'percentage', 'device_type': 'fan', 'unit': {'name': 'percent', 'symbol': '%'}, 'value': 359, 'context': {'model': 'pCOWeb'}}]
[2020-03-02 17:54:35,941] site_tests:55 (ERROR) - data: ['reading[value] out of range']

[2020-03-02 18:09:56,528] site_tests:49 (ERROR) - --- FAIL: Read pCOWeb HRF Speed Command ---
[2020-03-02 18:09:56,528] site_tests:51 (ERROR) - scan_device: {'id': '6cfa5bc7-9e9a-559d-a030-d4ec529d14a4', 'alias': '', 'info': 'HRF Speed Command', 'type': 'fan', 'plugin': '59aa69eb-a5da-569f-aaa4-3ebbdb72530b', 'tags': ['autofan/device', 'system/id:6cfa5bc7-9e9a-559d-a030-d4ec529d14a4', 'system/type:fan'], 'metadata': {'model': 'pCOWeb'}}
[2020-03-02 18:09:56,528] site_tests:53 (ERROR) - reading: [{'device': '6cfa5bc7-9e9a-559d-a030-d4ec529d14a4', 'timestamp': '2020-03-02T23:05:18Z', 'type': 'percentage', 'device_type': 'fan', 'unit': {'name': 'percent', 'symbol': '%'}, 'value': 347, 'context': {'model': 'pCOWeb'}}]
[2020-03-02 18:09:56,528] site_tests:55 (ERROR) - data: ['reading[value] out of range']
MatthewHink commented 4 years ago

It looks like we're missing the scaling here, a question is how it comes into scale (0-100) at all. I'll look at the registers more tomorrow. The ones to look at are 0x2b, 0x2c, 0x32, and 0x40

https://github.com/vapor-ware/edge-ops/blob/02310f37d78ace60e9d819da98e248e9cc28d316/sites/models/vem150/values/modbus.yaml.gotmpl#L154-L176

MatthewHink commented 4 years ago

Looking at this more, most of the time HRF Speed Command is a raw 0, and 0/10 == 0, so normally we don't see the problem. I think this is purely a scaling issue on register 0x2b only.

This issue does not affect the control algorithm proper outside of debugging it, so there should be no side effects.

ubuntu@w1:~/src/vem-access/burnin/site_tests$ curl http://${SYNSE_IP}:5000/v3/read/6cfa5bc7-9e9a-559d-a030-d4ec529d14a4
[
  {
    "device":"6cfa5bc7-9e9a-559d-a030-d4ec529d14a4",
    "timestamp":"2020-03-03T16:51:51Z",
    "type":"percentage",
    "device_type":"fan",
    "unit":{
      "name":"percent",
      "symbol":"%"
    },
    "value":401,
    "context":{
      "model":"pCOWeb"
    }
  }
]
ubuntu@w1:~/src/vem-access/burnin/site_tests$ ~/pcli mip 10.193.8.55:502 get holding 2b
DEBU[0000] readHoldingRegister 0x002b, decimal 43
INFO[0000] 405 0x195
MatthewHink commented 4 years ago

Fixed by https://github.com/vapor-ware/edge-ops/pull/65