ws数据推送
连接地址:
/scada/device/data/ws/:id, id中包含组态设备sn信息,注意ws、wss的配置
连接示例:
var randId = Math.random().toString(36).substr(2)
//创建WebSocket连接
var ws = new WebSocket(`ws://127.0.0.1:30001/scada/device/data/ws/${randId}-0638633006916920,1637735787015487488`);
响应示例:
{"0638633006916920":[{"key":"humidity","label":"humidity","type":"","unit":"","value":31},{"key":"temprature","label":"temprature","type":"","unit":"","value":23.2},{"key":"runtime","label":"runtime","type":"","unit":"","value":{"cpu":30,"mem":"333"}}]}
修改于 1 年前