fh1ch / node-bacstack

A BACnet protocol stack written in pure JavaScript
MIT License
174 stars 98 forks source link

readPropertyMultiple errorCode:31 #144

Closed stefano055415 closed 4 years ago

stefano055415 commented 4 years ago

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

Craigzyc commented 4 years ago

I'm getting this identical response on both readPropertyMultiple and readProperty. My code is similar. @stefano055415 Did you get anywhere with this?

fh1ch commented 4 years ago

Please see https://github.com/fh1ch/node-bacstack/blob/master/FAQ.md#i-receive-the-error-bacneterror---class-x---code-y-what-does-this-mean. The error {"errorClass": 1,"errorCode": 31} means: OBJECT - UNKNOWN_OBJECT.

You try to read instance 0 of object o, which is not a valid BACNET object. Try something like {objectId: {type: 8, instance: 4194303}, properties: [{id: 8}]}, which returns all properties from the device object.

The fact that you receive an error also indicates, that the device is reachable and acts according to specs.