Giter Club home page Giter Club logo

node-bacstack's Introduction

Node BACstack

A BACnet protocol stack written in pure JavaScript. BACnet is a protocol to interact with building automation devices defined by ASHRAE.

Usage

Add Node BACstack to your project by using:

npm install --save bacstack

The API documentation is available under fh1ch.github.io/node-bacstack.

Features

The BACnet standard defines a wide variety of services as part of it's specification. While Node BACstack tries to be as complete as possible, following services are already supported at this point in time:

Service Execute Handle
Who Is yes yes
I Am yes¹ yes
Who Has yes¹ yes¹
I Have yes¹ yes¹
Time Sync yes yes
UTC Time Sync yes yes
Read Property yes yes¹
Read Property Multiple yes yes¹
Read Range yes yes¹
Write Property yes yes¹
Write Property Multiple yes yes¹
Add List Element yes¹ yes¹
Remove List Element yes¹ yes¹
Create Object yes¹ yes¹
Delete Object yes yes¹
Subscribe COV yes yes¹
Subscribe Property yes yes¹
Atomic Read File yes yes¹
Atomic Write File yes yes¹
Reinitialize Device yes yes¹
Device Communication Control yes yes¹
Get Alarm Summary² yes yes¹
Get Event Information yes yes¹
Get Enrollment Summary² yes yes¹
Acknowledge Alarm yes¹ yes¹
Confirmed Event Notification yes¹ yes¹
Unconfirmed Event Notification yes¹ yes¹
Unconfirmed Private Transfer yes yes¹
Confirmed Private Transfer yes yes¹

¹ Support implemented as Beta (untested, undocumented, breaking interface) ² Deprecated BACnet function, available for backwards compatibility

Example

const bacnet = require('bacstack');

// Initialize BACStack
const client = new bacnet({apduTimeout: 6000});

// 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);
});
client.whoIs();

// Read Device Object
const requestArray = [{
  objectId: {type: 8, instance: 4194303},
  properties: [{id: 8}]
}];
client.readPropertyMultiple('192.168.1.43', requestArray, (err, value) => {
  console.log('value: ', value);
});

Contributing

Implementing and maintaining a protocol stack is a lot of work, therefore any help is appreciated, from creating issues, to contributing documentation, fixing issues and adding new features.

Please follow the Contribution Guide when submitting any changes.

License

The MIT License

Copyright (c) 2017-2021 Fabio Huser [email protected]

Note: This is not an official product of the BACnet Advocacy Group. BACnet® is a registered trademark of American Society of Heating, Refrigerating and Air-Conditioning Engineers (ASHRAE).

node-bacstack's People

Contributors

dopry avatar fh1ch avatar kfenner avatar klemensas avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

node-bacstack's Issues

Expose server.close

Currently there is no clean way to close the UDP connection. lib/bacnet-transport.js does not expose the server instance (to close the connection it directly) nor does it expose a close method.

RangeError [ERR_OUT_OF_RANGE]: The value of "byteLength" is out of range. It must be >= 1 and <= 6. Received 0

Hello,
I try to use writePropertyMultiple and I get this error .

internal/buffer.js:53
 throw new ERR_OUT_OF_RANGE(type || 'offset',   
 ^

RangeError[ERR_OUT_OF_RANGE]: The value of "byteLength" is out of range. It must be >= 1 and <= 6. Received 0
at boundsError (internal/buffer.js:53:9)     
at Uint8Array.readUIntBE (internal/buffer.js:160:3)     
at module.exports.decodeUnsigned (C:\Users\home\node-bacstack\node_modules\bacstack\lib\asn1.js:87:19)     
at Object.module.exports.decodeEnumerated (C:\Users\home\node-bacstack\node_modules\bacstack\lib\asn1.js:92:10)     
at Object.module.exports.decodeError (C:\Users\home\node-bacstack\node_modules\bacstack\lib\services.js:964:27)     
at processError (C:\Users\home\node-bacstack\node_modules\bacstack\lib\client.js:93:29)     
at handlePdu (C:\Users\home\node-bacstack\node_modules\bacstack\lib\client.js:308:9)     
at handleNpdu (C:\Users\home\node-bacstack\node_modules\bacstack\lib\client.js:342:5)     
at self.receiveData (C:\Users\home\node-bacstack\node_modules\bacstack\lib\client.js:353:7)     
at Socket.<anonymous> (C:\Users\home\node-bacstack\node_modules\bacstack\lib\transport.js:13:25)

Any idea what happens? Thanks in advance.

Node Version: v10.15.0
Node BACstack Version: 0.0.1-beta.13

Priority missing from write request

Since the below change on EncodeWriteProperty all writes seem to fail

if (priority === baAsn1.BACNET_NO_PRIORITY) {
    baAsn1.encodeContextUnsigned(buffer, 4, priority);
}

surely on most occasions this will be falsy and never apply the priority on the write request?

Reading Trend Log - Log Buffers ( Read Access Denied )

Node Version: 9.8.0

Node BACstack Version: Beta 13

  • Bug Report
  • Feature Request
  • Question

Note: Make sure you have read the FAQs
before logging this issue.

Feature Request / Question

Recieving a "Error: BacnetError - Class:2 - Code:27 Class:PROPERTY Code:READ_ACCESS_DENIED" while trying to read the log_buffer property of a trend log instance. I've talked to the controller vendor's support just to ensure that there are no read permissions wrapped around the specific controller, and they have assured me there are not.

Have you had any success reading TL objects?

Structuring objects for readPropertyResponse

Node Version: 8.10.0

Node BACstack Version: 6.11.3

  • Bug Report
  • Feature Request
  • Question

Feature Request / Question

I have been putzing around with this library for a little bit and I have whoIs and iAm working in my node project and YABE. I am, however, struggling to respond to readProperty requests. I have tried creating an object locally and I have tried replying directly using:

client.readPropertyResponse(request.address, request.invokeId, request.request.objectId, request.request.property, []);

I have tried putting data into the [ ] but no matter what I try i get various crashes such as:

TypeError: Cannot read property 'bitsUsed' of undefined

My question is, how do I structure an object to send in these replies? Is there a pre-made function or class I can use, or do I have to do something else? The documentation does not detail this. (I understand that work and life take priority!)

Thank you for any guidance and I will provide any missing info to help you help me!

Write not working

Node Version: v8.11.0

Node BACstack Version: 0.0.1-beta.13

I am trying to work with BACnet properties,
Who Is / I Am is working perfectly fine.
Read is also working using the following code snippet

const requestArray = [
{ objectId: { type: 21, instance: 6 }, properties: [{ id: 8 }] }
];
client.readPropertyMultiple('10.1.1.255', requestArray, (err, value) => {
console.log('value: ', JSON.stringify(value));
console.log('Error:',err);
});

But write is not working its having timeout error.
const values = [
{
objectId: { type: 21, instance: 6 }, values: [
{ property: { id: 75, index: 4294967295,}, value: [{ type: bacnet.enum.ApplicationTags.BACNET_APPLICATION_TAG_BOOLEAN, value: 100 }], priority: 8 }
]
}
];
client.writePropertyMultiple('10.1.1.228', values, (err, value) => {
console.log('value: ', value);
console.log(err);
});

Any help will be much appreciated.

No way to address specific deviceId

First, great work.

Currently read and write functions do addressing by IP, but there is a case when one IP address is a gateway to many deviceIds.

Sample whoIs output:
address: 10.10.10.100 - deviceId: 1603003 - maxAdpu: 1476 - segmentation: 3 - vendorId: 16
address: 10.10.10.100 - deviceId: 1603017 - maxAdpu: 1476 - segmentation: 3 - vendorId: 16
address: 10.10.10.100 - deviceId: 1603006 - maxAdpu: 1476 - segmentation: 3 - vendorId: 16
address: 10.10.10.100 - deviceId: 1603004 - maxAdpu: 1476 - segmentation: 3 - vendorId: 16
address: 10.10.10.100 - deviceId: 1603005 - maxAdpu: 1476 - segmentation: 3 - vendorId: 16
address: 10.10.10.100 - deviceId: 1603010 - maxAdpu: 1476 - segmentation: 3 - vendorId: 16
address: 10.10.10.100 - deviceId: 1603007 - maxAdpu: 1476 - segmentation: 3 - vendorId: 16

In this case there is no way to address specific deviceId for read/write operation.

Is there solution for this case?

vbr,

processing bacnet device on port 0xBAC1

I have a device that uses port 0xBAC1(47809).
I want to working with it, but error is occured.

these code has errors:
client.whoIs(60000, 65000, "192.168.0.90:47809");
client.readProperty("192.168.0.90:47809", bacnet.enum.BacnetObjectTypes.OBJECT_DEVICE, 60512, bacnet.enum.BacnetPropertyIds.PROP_OBJECT_LIST, null, function(err, data) {
console.log(data);
});

Error Message:
Error: getaddrinfo ENOTFOUND 192.168.0.90:47809
at errnoException (dns.js:28:10)
at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:76:26)

RPM Returns back object

First: Great work on this stack! Looking forward to using this more!

On the RPM call I receive an object back. Code samples with a Read Prop and RPM setup the same way

var bacnet = require('bacstack');

// Initialize BACStack
var client = bacnet({adpuTimeout: 6000});

// Read property

client.readProperty('192.168.7.72', 8, 240001, 77, null, function(err, value) {
  console.log(value);
});


// Read Property Multiple
// Setup array of reads here
var requestArray = [{objectIdentifier: {type: 8, instance: 240001}, propertyReferences: [{propertyIdentifier: 77}]}];

// Invoke RPM on BACnet Link
client.readPropertyMultiple('192.168.7.72', requestArray, function(err, value) {
  console.log(value);
  client.close();
});

Log Output:

{ len: 34,
  objectId: { type: 8, instance: 240001 },
  property: { propertyIdentifier: 77, propertyArrayIndex: 4294967295 },
  valueList: [ { len: 25, type: 7, value: 'Removed sensitive information' } ] }
undefined

Any input if you need more to work from I can toss your way! Codebase is more stable hopefully I can contribute as well

encode_application_enumerated is not defined in bacnet-asn1.js

encode_application_enumerated is referenced in bacapp_encode_application_data:

case baEnum.BacnetApplicationTags.BACNET_APPLICATION_TAG_ENUMERATED:
  encode_application_enumerated(buffer, value.Value);
  break;

but not defined as a function. Here is my version to make it work:

var encode_application_enumerated = module.exports.encode_application_enumerated = function(buffer, value) {
var len;
if (value < 0x100) {
len = 1;
} else if (value < 0x10000) {
len = 2;
} else if (value < 0x1000000) {
len = 3;
} else {
len = 4;
}
encodeTag(buffer, baEnum.BacnetApplicationTags.BACNET_APPLICATION_TAG_ENUMERATED, false, len);
encodeBacnetEnumerated(buffer, value);
};

Thank you!

Bacnet device object and properties are not able to access but able to discover the devices

I am using Yabe bacnet simulator which has both device simulator and explorer. But if I use the bacstack library , I am not able to use the device objects and proeprties. It is discovering the device but not able to load object and properties for usage.

Simulator which I used https://sourceforge.net/projects/yetanotherbacnetexplorer.

But in Yabe device explorer it is working.
image

Simulator snap:
image

The error which I am getting:

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)

The nodejs code which I have used:

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);
});

In the below image it is displaying that it is discovering the devices but it is not able to find objects.
98a2e5579a291af57edf750e1b8f9a52d52d427f

CqnnB

Can readProperty but can't writeProperty

Node Version: 8.1.3

Node BACstack Version :0.0.1-beta.13

Thanks for the great work
I can read but cannot write, this is similar to issue #58

Code
const bacnet = require('bacstack');
const client = new bacnet();

client.writeProperty('192.168.1.135', {type: 4, instance: 0}, 85, [
{type: bacnet.enum.ApplicationTags.BACNET_APPLICATION_TAG_REAL, value: 1}
], (err, value) => {
console.log('value: ', value);
});

Error

C:\Users\User\WebstormProjects\untitled3\write.js:5
{type: bacnet.enum.ApplicationTags.BACNET_APPLICATION_TAG_REAL, value: 1}
^

TypeError: Cannot read property 'ApplicationTags' of undefined
at Object. (C:\Users\User\WebstormProjects\untitled3\write.js:5:23)
at Module._compile (module.js:569:30)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:503:32)
at tryModuleLoad (module.js:466:12)
at Function.Module._load (module.js:458:3)
at Function.Module.runMain (module.js:605:10)
at startup (bootstrap_node.js:158:16)
at bootstrap_node.js:575:3

Process finished with exit code 1

Need help on how to read properties and value (and write them)

Node Version: 12.x

Node BACstack Version: current GitHub Master branch

  • Bug Report
  • Feature Request
  • Question

Question

I'm currently trying to get familiar with Bacnet because I want to implement this into the open source smart home platform ioBroker.

I currently use the compliance docker image with the "official" test device from the original backsack c library.

I managed to read the object details using the example provided at https://fh1ch.github.io/node-bacstack/bacstack.html#.readPropertyMultiple . The result is

{"len":651,"values":[{"objectId":{"type":8,"instance":1234},"values":[{"id":75,"index":4294967295,"value":[{"value":{"type":8,"instance":1234},"type":12}]},{"id":77,"index":4294967295,"value":[{"value":"SimpleServer","type":7,"encoding":0}]},{"id":79,"index":4294967295,"value":[{"value":8,"type":9}]},{"id":112,"index":4294967295,"value":[{"value":0,"type":9}]},{"id":121,"index":4294967295,"value":[{"value":"BACnet Stack at SourceForge","type":7,"encoding":0}]},{"id":120,"index":4294967295,"value":[{"value":260,"type":2}]},{"id":70,"index":4294967295,"value":[{"value":"GNU","type":7,"encoding":0}]},{"id":44,"index":4294967295,"value":[{"value":"0.8.5","type":7,"encoding":0}]},{"id":12,"index":4294967295,"value":[{"value":"1.0","type":7,"encoding":0}]},{"id":98,"index":4294967295,"value":[{"value":1,"type":2}]},{"id":139,"index":4294967295,"value":[{"value":12,"type":2}]},{"id":97,"index":4294967295,"value":[{"value":{"value":[233,208,19,84,159],"bitsUsed":40},"type":8}]},{"id":96,"index":4294967295,"value":[{"value":{"value":[63,229,58,16,0,128,1],"bitsUsed":51},"type":8}]},{"id":76,"index":4294967295,"value":[{"value":{"type":8,"instance":1234},"type":12},{"value":{"type":0,"instance":0},"type":12},{"value":{"type":0,"instance":1},"type":12},{"value":{"type":0,"instance":2},"type":12},{"value":{"type":0,"instance":3},"type":12},{"value":{"type":1,"instance":0},"type":12},{"value":{"type":1,"instance":1},"type":12},{"value":{"type":1,"instance":2},"type":12},{"value":{"type":1,"instance":3},"type":12},{"value":{"type":2,"instance":0},"type":12},{"value":{"type":2,"instance":1},"type":12},{"value":{"type":2,"instance":2},"type":12},{"value":{"type":2,"instance":3},"type":12},{"value":{"type":3,"instance":0},"type":12},{"value":{"type":3,"instance":1},"type":12},{"value":{"type":3,"instance":2},"type":12},{"value":{"type":3,"instance":3},"type":12},{"value":{"type":3,"instance":4},"type":12},{"value":{"type":4,"instance":0},"type":12},{"value":{"type":4,"instance":1},"type":12},{"value":{"type":4,"instance":2},"type":12},{"value":{"type":4,"instance":3},"type":12},{"value":{"type":5,"instance":0},"type":12},{"value":{"type":5,"instance":1},"type":12},{"value":{"type":5,"instance":2},"type":12},{"value":{"type":5,"instance":3},"type":12},{"value":{"type":5,"instance":4},"type":12},{"value":{"type":5,"instance":5},"type":12},{"value":{"type":5,"instance":6},"type":12},{"value":{"type":5,"instance":7},"type":12},{"value":{"type":5,"instance":8},"type":12},{"value":{"type":5,"instance":9},"type":12},{"value":{"type":15,"instance":0},"type":12},{"value":{"type":15,"instance":1},"type":12},{"value":{"type":21,"instance":0},"type":12},{"value":{"type":21,"instance":1},"type":12},{"value":{"type":21,"instance":2},"type":12},{"value":{"type":21,"instance":3},"type":12},{"value":{"type":21,"instance":4},"type":12},{"value":{"type":21,"instance":5},"type":12},{"value":{"type":21,"instance":6},"type":12},{"value":{"type":28,"instance":0},"type":12},{"value":{"type":28,"instance":1},"type":12},{"value":{"type":28,"instance":2},"type":12},{"value":{"type":28,"instance":3},"type":12},{"value":{"type":13,"instance":0},"type":12},{"value":{"type":13,"instance":1},"type":12},{"value":{"type":13,"instance":2},"type":12},{"value":{"type":13,"instance":3},"type":12},{"value":{"type":14,"instance":0},"type":12},{"value":{"type":14,"instance":1},"type":12},{"value":{"type":14,"instance":2},"type":12},{"value":{"type":14,"instance":3},"type":12},{"value":{"type":19,"instance":0},"type":12},{"value":{"type":19,"instance":1},"type":12},{"value":{"type":19,"instance":2},"type":12},{"value":{"type":19,"instance":3},"type":12},{"value":{"type":20,"instance":0},"type":12},{"value":{"type":20,"instance":1},"type":12},{"value":{"type":20,"instance":2},"type":12},{"value":{"type":20,"instance":3},"type":12},{"value":{"type":20,"instance":4},"type":12},{"value":{"type":20,"instance":5},"type":12},{"value":{"type":20,"instance":6},"type":12},{"value":{"type":20,"instance":7},"type":12},{"value":{"type":10,"instance":0},"type":12},{"value":{"type":10,"instance":1},"type":12},{"value":{"type":10,"instance":2},"type":12},{"value":{"type":47,"instance":0},"type":12},{"value":{"type":47,"instance":1},"type":12},{"value":{"type":47,"instance":2},"type":12},{"value":{"type":47,"instance":3},"type":12},{"value":{"type":48,"instance":0},"type":12},{"value":{"type":48,"instance":1},"type":12},{"value":{"type":48,"instance":2},"type":12},{"value":{"type":48,"instance":3},"type":12},{"value":{"type":17,"instance":0},"type":12},{"value":{"type":17,"instance":1},"type":12},{"value":{"type":17,"instance":2},"type":12},{"value":{"type":17,"instance":3},"type":12}]},{"id":62,"index":4294967295,"value":[{"value":1476,"type":2}]},{"id":107,"index":4294967295,"value":[{"value":3,"type":9}]},{"id":11,"index":4294967295,"value":[{"value":3000,"type":2}]},{"id":73,"index":4294967295,"value":[{"value":3,"type":2}]},{"id":30,"index":4294967295,"value":[]},{"id":155,"index":4294967295,"value":[{"value":1,"type":2}]},{"id":28,"index":4294967295,"value":[{"value":"server","type":7,"encoding":0}]},{"id":57,"index":4294967295,"value":[{"value":"1901-02-01T23:30:40.260Z","type":11}]},{"id":119,"index":4294967295,"value":[{"value":0,"type":3}]},{"id":56,"index":4294967295,"value":[{"value":"2020-06-16T00:00:00.000Z","type":10}]},{"id":24,"index":4294967295,"value":[{"value":false,"type":1}]},{"id":58,"index":4294967295,"value":[{"value":"USA","type":7,"encoding":0}]},{"id":152,"index":4294967295,"value":[]}]}]}

So de details for all properties of obnject list (76) look like

{"value":{"type":0,"instance":2},"type":12}

So I understand that the "Type" means that there is analog input with instance id 2 ... but how do I get the details for that?
When reading via "bacepics" then they show data like

{
object-identifier: (analog-input, 2)
object-name: "ANALOG INPUT 2"
object-type: analog-input
present-value: 0.000000
status-flags: {false,false,false,false}
event-state: normal
out-of-service: FALSE
units: percent
},

So how can I query those using the lib? Everything I tried did not gave me meaningful results ...

Same goes with writeing one f these values ...

Basically it works for "top level" objects ...like type 121 and such, I can read them, but in fact they are not writable.

But how do I do withthe other properties?

Any help or ideas or advice would be awesome.

Ingo

Read Segmentation Robustness

Node BACstack Version: xxx.13 / PR131

Issue: Segmentation handling could use some TLC

How it currently works: There is 1 segmentation array per instance of this library. If a segment is missed, _lastSequenceNumber can get stuck at a non-zero value and subsequent segment ACKs will NACK due to a mis-match in state. Also, if multiple segments are being received at the same time, the library can get confused

Minor fix: Reset _lastSequenceNumber based upon APDU timeout expiring on the last received segment. This avoids the library getting stuck in a bad state

Proper fix: Each segmented/fragmented response should be stored in a temporary array indexed on the following :

  • per device address (ideally w/ routing support)
    • per device invoke id / sequence number

Array should be cleaned up either on successful reassembly or APDU timeout of the first request and/or of the last valid segment

Create initial implementation

BACNET layer implementation

  • Service (15% done 40% done 100% done)
  • ASN1 (80% done 90% done 100% done)
  • APDU
  • NPDU
  • BVLC

BACNET functionaility implementation

  • WhoIs
  • ReadProperty
  • WriteProperty
  • ReadPropertyMultiple
  • WritePropertyMultiple
  • Segmentation
  • Time Sync

Project Setup

  • Fix linting issues
  • Implement unit tests
  • Implement integration tests
  • Implement abort, error and global error-handling (implement, test)
  • Adapt internal function and variable naming
  • Fix Codeclimate issues
  • Rework interface / API

Postponed

  • ES6 rework
  • Add compliance tests and extend to all official functions
  • Rework project structure (e.g. split BACNET layers into separate smaller files - Services & ASN1)
  • Rework decoding architecture to reduce redundant code
  • Tidy up enum according to latest standard
  • Fix compliance test findings
  • Add missing function usage documentation
  • Improve debug loggs
  • Add ASHRE disclaimer
  • Add FAQ file
  • Drop experimental notice
  • Add notice to report issues with decoding
  • Add exception handling

Types greater than 512 fail. Falls short of ASN1_MAX_OBJECT

Node Version: 9.1

Node BACstack Version: 0.0.1-beta.10 (though I believe this to be in the present as well)

  • Bug Report

Current Behavior (Bug Report)

Bacnet types that are greater than 512 cause an exception. ASN1_MAX_OBJECT is defined as 0x3FF / 1023.
baAsn1.encodeContextObjectId(buffer, 0, objectType, objectInstance); returns an exception for these values when it shouldn't be since they are less than 0x3FF.

The issue is the following lines of code:
asn1.js

const encodeBacnetObjectId = module.exports.encodeBacnetObjectId = (buffer, objectType, instance) => {
  const value = ((objectType & baEnum.ASN1_MAX_OBJECT) << baEnum.ASN1_INSTANCE_BITS) | (instance & baEnum.ASN1_MAX_INSTANCE);
  encodeUnsigned(buffer, value, 4);
};

value isn't intrinsically an unsigned int. It is an int. Hence it propagates a negative value which eventually throws an error when put into an unsigned buffer. A solution is as follows:

const encodeBacnetObjectId = module.exports.encodeBacnetObjectId = (buffer, objectType, instance) => {
  const value = (((objectType & baEnum.ASN1_MAX_OBJECT) << baEnum.ASN1_INSTANCE_BITS) | (instance & baEnum.ASN1_MAX_INSTANCE))>>>0;
  encodeUnsigned(buffer, value, 4);
};

Another example:
(512 & 0x3FF) << 22 | (1 & 0x3FFFFF ) = -2147483647
((512 & 0x3FF) << 22 | (1 & 0x3FFFFF )) >>> 0 = 2147483649

readPropertyMultiple errorCode:31

I am trying to read the data of an analogInput device, but I always get an errorCode: 31

request

const requestArray = [{
objectId: {
type: 0,
instance: 0
},
properties: [{
id: 85
}]
}];
client.readPropertyMultiple('192.168.86.61', requestArray, (err, value) => {
console.log('value: ', JSON.stringify(value));
console.log('Error:', err);
});

response

value: {"len":15,"values":[{"objectId":{"type":0,"instance":0},"values":[{"id":85,"index":4294967295,"value":[{"type":105,"value":{"errorClass":1,"errorCode":31}}]}]}]}
Error: null

thanks

Reading and writing Scheduler object's Weekly_Schedule property

Node Version: 8.11.3

Node BACstack Version: 0.0.1-beta.13

  • Bug Report
  • Feature Request
  • Question

Feature Request / Question

Hello, I wanted to ask if is it possible to implement a way to write a inside Scheduler object's Weekly_Schedule property, at the moment it doesn't seem an implemented feature (Unkown type error for bacnet.enum.ApplicationTags.WEEKLY_SCHEDULE on writeProperty),
I've noticed that readProperty is already capable to representing a Weekly_Schedule content, but it isn't easy distinguish to which day of the week belongs to specific time range.

Thanks for your great work!

New Feature: Allow bacstack client to communicate with bacnet server on same device

I don't know if this is useful for everyone or is a special case for me, but I have a bacnet client I'm writing that needs to communicate with an existing bacnet server. In most cases, this new client and the existing server will be on the same device/at the same IP.

I need a way to bind the client to on UDP port and communicate with the server on the UDP port it is already bound to. If I don't do this, the client can't bind to the UDP port in use by the server and they cannont communicate with each other.

I got this working by doing two things:

  1. Adding a new option to the client called "server_port". It defaults to the value of "port" so it is purely optional and doesn't change behavior if not defined.
  2. Changing bacnet-transport.send to use the "settings.server_port" instead of "settings.port".

I'm not a bacnet expert and am not sure if there is more that needs to be done to make complete this feature, but this change completely solves my issues.

Does anyone else need this feature?

If so, should I submit a pull request?

Is there a better name for the option I added? It makes sense for my use case, but I don't think "server_port" is the right name.

Write Property error in beta13

Node Version: X.Y.Z
0.0.1-beta.12
Node BACstack Version: X.Y.Z

  • Bug Report
  • Feature Request
  • Question

Feature Request / Question

Write Property callback not getting the success / failed message

Current Behaviour (Bug Report)

client.writeProperty('192.168.1.43', {type: 8, instance: 44301}, 28, [
{type: bacnet.enum.ApplicationTags.BACNET_APPLICATION_TAG_REAL, value: 100}
], function(err, value) {
console.log('value: ', value);
});
the value /err is null always.

Expected Behaviour (Bug Report)

Succes / failure information should be posted.

Steps to reproduce Issue (Bug Report)

Listen to network

Node Version: X.Y.Z

Node BACstack Version: X.Y.Z

  • Bug Report
  • Feature Request
  • [ x ] Question

Hello! Not an issue here, but I was wondering if there is a way on listening to a bacstack device datapoints. Like iAm message, but with datapoints.

If owners can help.. I would be very grateful.
Thanks

Device instance, AI/DI reading issues

Hi @fh1ch

Computer 1: I'm running node-bacstack as a client
Computer 2: I'm using Bacnet Device Simulator as a server

  1. I can receive I-Am message from Computer 2 when I send Who-is message from Computer 1
  2. In Computer 2, my device is 1, instance 1. But when I try to run your example, I cannot run with instance = 1, it just works with instance = 4194303 as below (while my device is 1)
var requestArray = [{
  objectIdentifier: {type: 8, instance: 4194303},
  propertyReferences: [{propertyIdentifier: 8}]
}];

And I cannot read the object-list of my device, when I change instance to 1, and propertyIdentifier to 76, computer 2 responds something but not provide the object-list
...

  1. I cannot read the properties of Analog Input, Computer 2 responds an error message when I try to read Analog Input
var requestArray = [{
  objectIdentifier: {type: 0, instance: 0},
  propertyReferences: [{propertyIdentifier: 8}] //or present value --> 85
}];

How can I read the present value of Analog/Binary Input?

There are many things else but please help me to clear those points first.

Many thanks.

COV functionality

Hi, thank you for your library and effort.

What's the state of COV implementation?
I see you've listed it as having some support but I'm not able to get it working.

Though I might be interpreting the functionality wrong as I'm finding it hard to simulate and test out BACnet devices in general.
https://github.com/fh1ch/node-bacstack/blob/master/lib/bacnet-client.js#L178
Here you seem to be calling baServices.decodeCOVNotifyUnconfirmed which doesn't exist and throws an error. Isn't this part supposed to be related to confirmed notifications?

Ability to unbind iAm listeners

First of all,
great work on this!

Is there a way to unbind any iAm listeners that may be dead. I'm currently opening a ws connection from a client which calls whoIs and listens for responses. However once this is closed the iAm stays open, and eventually hits nodes MaxListenersExceededWarning.

Thanks much!

app.ws('/api/whois', (ws, req) => {
  ws.on('message', msg => {
    const data = JSON.parse(msg);
    if (data.action && data.action === 'get') {
      // defines event listener
      bacstack.client.on('iAm', device =>
        ws.send(JSON.stringify(device), err => {
          return ErrorHandler(err);
        })
      );
      // fire BACnet whoIs
      bacstack.client.whoIs();
    }
  });

  // clean up after yourself?
  ws.on('close', function() {
    console.log('Client disconnected.');
    bacstack.client.removeListener('iAm', () => {
      // removeListener is NOT firing
    });
  });

  // TODO: better errorhandling
  ws.on('error', ErrorHandler);
});

Support for UTF16BE encoded strings

If i'm not mistaken, a decent amount of bacnet devices out there encode strings via UTF16BE where as node only supports UTF16LE(little endian). Parser craps itself where as YABE & VTS handle such devices just fine.
The string encoding switch in bacnet-asn1.js @ ~800 multiCharsetCharacterstringDecode doesn't detect the UTF16BE case , then just returns a null string. Once it hits the result.len this generates an unhanded exception and crashes.

Edit: NPM pulled down version 1-beta.9 , will try 10.

writeProperty increase counter twice - causing callback to fail

in bacnet-client.js - writePropery function:
invokeCounter - being increased twice:

Once in line:
baAdpu.encodeConfirmedServiceRequest(buffer, baEnum.BacnetPduTypes.PDU_TYPE_CONFIRMED_SERVICE_REQUEST, baEnum.BacnetConfirmedServices.SERV
ICE_CONFIRMED_WRITE_PROPERTY, maxSegments, baEnum.BacnetMaxAdpu.MAX_APDU1476, invokeCounter++, 0, 0);

Then:
addCallback(invokeCounter++, function(err, data) {

This causes callback to always timeout.

Error: ERR_TIMEOUT

Hi,

I'm new in bacnet and i'm trying to do a integration where I can pull all the values from the device.. Whenever I used readPropertyMultiple I always get value: undefined and Error: ERR_TIMEOUT. Here's my code:

'use strict'
const bacnet = require('bacstack')
let connectionString = '172.29.240.1'
// Initialize BACStack
const client = new bacnet({adpuTimeout: 10000})
// 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)
})
client.whoIs()

// Read Device Object
const requestArray = [{
objectId: { type: 8, instance: 409719 },
properties: [{ id: 8 }]
}]

client.readPropertyMultiple(connectionString, requestArray, (err, value) => {
console.log('value', value)

if (err) {
    console.log(err)
}
client.close()

})

REFERENCE ERROR: require is not defined

Node Version: 6.14.10

Node BACstack Version: 0.0.1-beta.13

Im new in BACnet protocol

Im doing the first bacnet protocol in android. IM using cordova as a tool.
Make the step as this repository sais.

1.- npm install --save bacstack (it was installed in /node_modules/bacstack folder)
2.- I added this code beloow to my index.html page.
3.- Run the app and press my button ".bacnetButton" and get the error -> require is not defined

`

> <body>
> 
> </body>
> 
> <script type="text/javascript">
>        app.initialize();
> 
> $( document ).ready(function() {
> 	$( ".bacnetButton" ).on( "click", function() {
> 	     bac();
> 	});
> });
> 
> function bac(){
> try{
>             const bacnet = require('bacstack');
>             
>             // Initialize BACStack
>             const client = new bacnet({apduTimeout: 6000});
>             
>             // 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);
>             });
>             client.whoIs();
>             
>             // Read Device Object
>             const requestArray = [{
>               objectId: {type: 8, instance: 4194303},
>               properties: [{id: 8}]
>             }];
>             client.readPropertyMultiple('192.168.1.43', requestArray, (err, value) => {
>               console.log('value: ', value);
>             });
> }catch(e){
>    console.log('error: BAC ' + e);
> }   	
> }		
> </script>

`

WriteProperty error

Node Version: 8.16.0

Node BACstack Version: 0.0.1-beta.13

Here is my current code

client.writeProperty('192.168.0.28', 13,10308, 85, [
      {tag: bacnet.enum.ApplicationTags.BACNET_APPLICATION_TAG_BOOLEAN, value: 66}], function(err, value) {
  console.log('value: ', value);
  console.log('err: ', err);
});.

client.writeProperty('192.168.0.28', {type: 2, instance: 10210}, 85, [
      {type: bacnet.enum.ApplicationTags.BACNET_APPLICATION_TAG_BOOLEAN, value: 4}], (err, value) => {
      console.log('value: ', value);
      console.log('err: ', err);
    });

I am passing all the value as per documentation but not able to write property.

Output:

value:  { len: 14,
  objectId: { type: 2, instance: 10210 },
  property: { id: 85, index: 4294967295 },
  values: [ { type: 4, value: 66 } ] }
value:  undefined
err:  Error: BacnetAbort - Reason:0
    at processAbort (/home/pardypanda02/Harsh_Patel/thermostat/node_modules/bacstack/lib/client.js:99:30)
    at handlePdu (/home/pardypanda02/Harsh_Patel/thermostat/node_modules/bacstack/lib/client.js:313:9)
    at handleNpdu (/home/pardypanda02/Harsh_Patel/thermostat/node_modules/bacstack/lib/client.js:342:5)
    at self.receiveData (/home/pardypanda02/Harsh_Patel/thermostat/node_modules/bacstack/lib/client.js:353:7)
    at Socket.<anonymous> (/home/pardypanda02/Harsh_Patel/thermostat/node_modules/bacstack/lib/transport.js:13:25)
    at emitTwo (events.js:126:13)
    at Socket.emit (events.js:214:7)
    at UDP.onMessage [as onmessage] (dgram.js:659:8)
address:  192.168.0.28
deviceId:  1
maxAdpu:  undefined
segmentation:  3
vendorId:  0
address:  192.168.0.28
deviceId:  1
maxAdpu:  undefined
segmentation:  3
vendorId:  0

Default priority to 16 for commands.

Node Version: N/A
Node BACstack Version: master, 4777725

  • Feature Request

Feature Request / Question

  • When writing commandable properties, priority should default to 16.

Current Behaviour

when writing a commandable proper if a priority is not provided, a parameter-out-of-range error is received from some devices.

Expected Behaviour

It would be nice if the priority defaulted to 16 as it does in the web services specification. This might not be exact to spec. Other devices might throw errors if we pass priority to non-commandable properties through APDU instead of WebServices. It looks like if an Object is commandable, then Priority Array and Relinquish Default are required. Maybe the library could check for those properties.

Steps to reproduce Issue

  • WritePropert to the Present Value of some commandable object...
const objectId = { type: Bacstack.enum.ObjectTypes.OBJECT_BINARY_VALUE, instance: 2};
function command(deviceIp, value, priority) {
    return new Promise((resolve, reject) => {
        client.writeProperty(deviceIp, objectId, 
           Bacstack.enum.PropertyIds.PROP_PRESENT_VALUE,
            // set binary-value present-values with enumerated BACnetBinaryPV(0=inactive, 1=active)
            [ { type: Bacstack.enum.ApplicationTags.BACNET_APPLICATION_TAG_ENUMERATED, value } ],
            // must set priority when commanding, otherwise you will get an out of range exception.
            // { priority },
            (err, response) => (err) ? reject(err) : resolve(response)
        );
    });
};

command('192.168.1.81', 0, 8).then((response) => {
   console.log('then', JSON.stringify(response));
})
.catch((err) => {
   console.log('err', JSON.stringify(err));
});

you can uncomment the options line in the client.writeProperty method to see a working case.. 

EADDRNOTAVAIL Add error event listener to server

Creatomg the server instance in lib/bacnet-transport.js and event error listener should be added.
Otherwise if the provided address does not exist you get an you get an ** EADDRNOTAVAIL** error:

Error: bind EADDRNOTAVAIL 192.168.1.23:47808

It should be added to

server.on('error', function(err) {
  console.log(`server error:\n${err.stack}`);
  server.close();
});

// Initialisation
server.bind(settings.port, settings.interface, function() {
    server.setBroadcast(true);
  });

You should figure out how you want to handle the error, I would suggest to bubble it up so the developer can decide to do the right thing.

How to handle events coming from a notification object?

As the title says, if I setup a bacnet server and set the notification object in my controller to forward the messages to my server, how do I handle those events?

I searched but couldnt see anything in the docs or code. Is it possible?

Only one value appearing in "value" of Status Flags

Node Version: 12.18.1

Node BACstack Version: 0.0.6

Question
The Status flag is supposed to be an array of length 4 ( like [0,1,1,0] ), but I only get one 0 ( {"value":[0], "bitsUsed":4} ) when I run the readPropertyMultiple() function on an Analog Value Object. Which flag is it referring to among IN_ALARM, FAULT, OVERRIDDEN and OUT_OF_SERVICE ?

I am trying to make use of the FAULT bit in the Status Flags, how can I achieve this?

statusJson

statusFlag

client.close() not working

Node Version: 8.9.1

Node BACstack Version: Latest version

My code snippet is as follow :
var reqArr2 = [
{objectIdentifier: {type: 8, instance: 4194303}, propertyReferences: [{propertyIdentifier: 77}]}
];
client.readPropertyMultiple(config.ControllerIPAddress.trim(), reqArr2, function(err, value) {
console.log('device :',JSON.stringify(value))
var d = value.values[0].values[0].value[0].value
console.log('>>>>>> device name '+d);
deviceName = "Device_"+d;
client.close();
});

I am getting this error saying close() is not supported.

TypeError: client.close is not a function
at /Users/suresh/Bacnet/facilioagent/fetchdata.js:32:12
at /Users/suresh/Bacnet/facilioagent/node_modules/bacstack/lib/bacnet-client.js:314:7
at invokeStore.(anonymous function) (/Users/suresh/Bacnet/facilioagent/node_modules/bacstack/lib/bacnet-client.js:56:7)
at invokeCallback (/Users/suresh/Bacnet/facilioagent/node_modules/bacstack/lib/bacnet-client.js:44:26)
at handlePdu (/Users/suresh/Bacnet/facilioagent/node_modules/bacstack/lib/bacnet-client.js:189:11)
at handleNpdu (/Users/suresh/Bacnet/facilioagent/node_modules/bacstack/lib/bacnet-client.js:235:5)
at self.receiveData (/Users/suresh/Bacnet/facilioagent/node_modules/bacstack/lib/bacnet-client.js:246:7)
at Socket. (/Users/suresh/Bacnet/facilioagent/node_modules/bacstack/lib/bacnet-transport.js:11:24)
at emitTwo (events.js:126:13)
at Socket.emit (events.js:214:7)

invokeID being sent higher than 255

Firstly let me say, loving the work so far! Really useful library!

However we have hit a problem, the invokeCounter exceeds 255 and never gets reset. I have simply added a reset on the invokeCounter after 255 as that works fine for our use case (one device polling not so often), however it seems a bit 'hacky' as you could, quite legitimately (albeit unlikely), get a response from an earlier request with invokeID 0 after sending a request with an ID of 255, especially if you are talking to many devices.

Perhaps once the service is more complete and all responses are decoded the library can maintain an IP linked invokeID pool or similar?

Many thanks

TypeError: next is not a function

Node Version: 12.16.1

Hey,

I received the Error "TypeError: next is not a function" at

/home/demo/thingweb.node-wot/node_modules/bacstack/lib/client.js:486
      if (err) return next(err);

So the code snippet is following:

self.readProperty = function(address, objectId, propertyId, options, next) {
    next = next || options;
    var settings = {
      maxSegments: options.maxSegments || baEnum.MaxSegments.MAX_SEG65,
      maxAdpu: options.maxAdpu || baEnum.MaxAdpu.MAX_APDU1476,
      invokeId: options.invokeId || getInvokeId(),
      arrayIndex: options.arrayIndex || baAsn1.BACNET_ARRAY_ALL
    };
    var buffer = getBuffer();
    baNpdu.encode(buffer, baEnum.NpduControls.PRIORITY_NORMAL_MESSAGE | baEnum.NpduControls.EXPECTING_REPLY, address, null, DEFAULT_HOP_COUNT, baEnum.NetworkMessageTypes.NETWORK_MESSAGE_WHO_IS_ROUTER_TO_NETWORK, 0);
    var type = baEnum.PduTypes.PDU_TYPE_CONFIRMED_SERVICE_REQUEST | (settings.maxSegments !== baEnum.MaxSegments.MAX_SEG0 ? baEnum.PduTypes.SEGMENTED_RESPONSE_ACCEPTED : 0);
    baAdpu.encodeConfirmedServiceRequest(buffer, type, baEnum.ConfirmedServices.SERVICE_CONFIRMED_READ_PROPERTY, settings.maxSegments, settings.maxAdpu, settings.invokeId, 0, 0);
    baServices.encodeReadProperty(buffer, objectId.type, objectId.instance, propertyId, settings.arrayIndex);
    baBvlc.encode(buffer.buffer, baEnum.BvlcFunctions.BVLC_ORIGINAL_UNICAST_NPDU, buffer.offset);
    transport.send(buffer.buffer, buffer.offset, address);
    addCallback(settings.invokeId, function(err, data) {
      if (err) return next(err);
      var result = baServices.decodeReadPropertyAcknowledge(data.buffer, data.offset, data.length);
      if (!result) return next(new Error('INVALID_DECODING'));
      next(null, result);
    });
  };

I was able to fix it with changing the sequence of "options" and "next" in the functions parameter.

May this is helpful for someone

writeProperty throws Exception when writing null to presentValue

tried to use

writeProperty (address, 4, objectInstance, 85, 12, [{ type: 9, value: null }], (err, val) => {}

in order to reset entry in priority Array and got an Exception 'buffer.Add is not a function'
(yes I know that the type of BACNET_APPLICATION_TAG_NULL is 0, but this doesn't matter here)

this is at line 431 of master/lib/bacnet-asn1.js:
snip >>>>

var bacappEncodeApplicationData = module.exports.bacappEncodeApplicationData = function(buffer, value) {
  if (value.value === null) {
    buffer.Add(baEnum.BacnetApplicationTags.BACNET_APPLICATION_TAG_NULL);
    return;
  }

<<<< snip

Binary Output writing issue: Error: BacnetError - Class:1 - Code:31

Node Version: 10.5.0

Node BACstack Version: 0.0.1-beta.12

I Can read Binary Output. Response:

  objectId: { type: 4, instance: 3000412 },
  property: { propertyIdentifier: 85, propertyArrayIndex: 4294967295 },
  valueList: [ { len: 2, type: 9, value: 1 } ] }

My Code to write this point:

const bacnet = require('bacstack');
const client = new bacnet();

const valueToSave = 1;
client.writeProperty(
    '192.168.1.207',
    4, //4 = Binary Output
    '3000412',
    85,
    16,
    [
        {
            type: bacnet.enum.BacnetApplicationTags.BACNET_APPLICATION_TAG_ENUMERATED,
            value: valueToSave,
        },
    ],
    (err, value) => {
        if (err) {
            console.log('writePropertyError: ', err);
        } else {
            console.log('writeProperty: ', value);
        }
    },
);

Response:

Error: BacnetError - Class:1 - Code:31
    at processError (C:\WEBSTORM\BACnetServerV2\node_modules\bacstack\lib\bacnet-client.js:95:30)
    at handlePdu (C:\WEBSTORM\BACnetServerV2\node_modules\bacstack\lib\bacnet-client.js:309:9)
    at handleNpdu (C:\WEBSTORM\BACnetServerV2\node_modules\bacstack\lib\bacnet-client.js:343:5)
    at self.receiveData (C:\WEBSTORM\BACnetServerV2\node_modules\bacstack\lib\bacnet-client.js:354:7)
    at Socket.<anonymous> (C:\WEBSTORM\BACnetServerV2\node_modules\bacstack\lib\bacnet-transport.js:13:25)
    at Socket.emit (events.js:182:13)
    at UDP.onMessage [as onmessage] (dgram.js:670:8)
    ```
Any suggestions?
Where I can see what it means ' Class:1 - Code:31' ?

Thank you in advance!

PS. I have no problem with Binary Value type to read & write. AI/AO/BI/AV also OK.

how to subscribeProperty

i'm researching BACnet protocol with this library. Now i need to subscribeProperty, but i don't know how to use.
Pls help me, can you share me a example to use ?
many thanks,

SPDX and reuse.software

https://reuse.software/dev/ describes approaches to generate a SPDX file and how to apply license headers. Today this is not combinded with the efforts from the todogroup and it's repolinter but I think it would be worth to use those approaches to simplify license compliance for bacstack.

Still Active?

Is this still being actively developed or will beta be the furthest it ever gets?

Can readProperty but can't writeProperty

Read function works fine:
Code:
client.readProperty('192.168.0.127', 2, 3000052, 85, null, function(err, value) {
console.log('readPropertyAV: ', value);
});
Console:
readPropertyAV: { len: 14,
objectId: { type: 2, instance: 3000052 },
property: { propertyIdentifier: 85, propertyArrayIndex: 4294967295 },
valueList: [ { len: 5, type: 4, value: 12.6 } ] }

But I can't write the same point:

Code:
client.writeProperty('192.168.0.127', 2, 3000052, 85, 12, [
{type: bacnet.enum.BacnetApplicationTags.BACNET_APPLICATION_TAG_REAL, value: 77}
], function(err, value) {
console.log('writeProperty: ', value);
console.log('writePropertyError: ', err);
});
Console:
D:\PANIBRAT\WEB-2\NodeJS\BACnet\test\node_modules\bacstack\lib\bacnet-asn1.js:496
throw 'Unknown type';
^
Unknown type

What wrong?
Any suggestions?

Segmentation for Outgoing Messages

Node Version: 10.15.3

Node BACstack Version: 0.0.1-beta13 (actually using clone of master, but same in current npm release)

  • Bug Report
  • Feature Request
  • Question

Note: Make sure you have read the FAQs
before logging this issue.

Feature Request / Question

I could be wrong here but I don't think segmentation in responses works, or perhaps we have to implement in our own logic.

Would it be possible to implement segmentation in responses, in particular readMultiple response or a writeMultiple request.

Unfortunately I don't know enough about the bacnet protocol myself to implement (i.e. segmented packet structure), however if you point me to somewhere that clearly lays out the packet structure I could potentially submit a pull request.

using Yabe and BACstack to read object information

Node Version: 10.15.0

Node BACstack Version: 0.0.1-beta.13

  • Bug Report
  • Feature Request
  • Question

Question

  • I am using the Bacnet.Room.Simulator from the Yabe installation for a device simulator.
  • I know your FAQs mentions that this backstack module cannot connect with a simulator, however I am able to pull back device information [maybe because Yabe is running on a secondary IP (110.0.75.x versus 192.168.200.y)?].
  • I am not able to pull back object information (readProperty or readPropertyMultiple).
  • My code is shown below with the output (also have the Analog Input information shown) - can you help me understand why I cannot read my Analog Input data? (For properties, I have tried 0, 1, 8, and 85 and I get the same error shown below each time).
  • I can see the who-Is (50 Unconfirmed-REQ who-Is) and then immediately following the I-Am device (67 Unconfirmed-REQ I-Am device,2130025) in Wireshark but I do not see anything for the read property.
  • When testing this, I close the Yabe explorer and only run the bacnet.room.simulator and the backstack module.

image

Using with MSTP Router

Node Version: 8

Node BACstack Version: "0.0.1-beta.13"

  • Bug Report
  • Feature Request
  • Question

Note: Make sure you have read the FAQs
before logging this issue.

Feature Request / Question

I have a bacnet router that is connecting MSTP to IP.
Is it possible to read the data from the devices under it? I am able to read the properties of the router, but not the devices under it.

I am able to read the data from YABE

image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.