node.js - 从 bacnet 模拟器读取数据时出错:错误:ERR_TIMEOUT 使用 bacstack lib(nodejs)
问题描述
我正在尝试从 bacnet 模拟器中读取数据。但我收到错误
err: Error: ERR_TIMEOUT
at Timeout._onTimeout (C:\Users\EpsilonPrime\node_modules\bacstack\lib\client.js:75:16)
at ontimeout (timers.js:436:11)
at tryOnTimeout (timers.js:300:5)
at listOnTimeout (timers.js:263:5)
at Timer.processTimers (timers.js:223:10)
下面是使用 bacstack 库编写的 nodejs 代码。
const bacnet = require('bacstack');
// Initialize BACStack
const client = new bacnet({apduTimeout: 3000});
console.log(client);
//console.log(client.EventEmitter)
// Discover Devices
client.on('iAm', (device) => {
console.log('address----------> ', device.address);
console.log('deviceId----------> ', device.deviceId);
console.log('maxApdu----------> ', device.maxApdu);
console.log('segmentation----------> ', device.segmentation);
console.log('vendorId----------> ', device.vendorId);
console.log('object type----------> ', device.vendorId);
console.log('vendorId----------> ', device.vendorId);
});
client.whoIs();
// Read Device Object
client.readProperty('192.168.14.87', {type: 8, instance: 2195695}, 28, (err, value) => {
console.log('value: ', value);
console.log('err: ', err);
});
解决方案
我想知道是否 - 首先,如果您应该切换到这个后续项目(?):
https://www.npmjs.com/package/node-bacnet
推荐阅读
- laravel - php artisan 在 Azure 上迁移(在 BitBucket 管道中)
- python - Python subprocess ignores backslash in convert command
- c++ - 如何根据精度轻松模板化数学函数?
- python - 如何在python中分离混合词(波斯语和英语)
- javascript - Threejs / EffectComposer - 交互式遮罩 UnrealBloomPass
- c++ - 我需要帮助用 C++ 编写几何系列
- c# - 如何在 RestSharp 中使用 ExecuteAsync 返回变量
- html - 使用 NGINX 从链接中删除 .html
- c# - 单击时如何删除按钮图像并将图像更改为其他图像
- mysql - Mysql从纪元中减去