Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

properties: [{id: 8}] results in Error: ERR_TIMEOUT #32

Open
aniston opened this issue Dec 29, 2020 · 14 comments
Open

properties: [{id: 8}] results in Error: ERR_TIMEOUT #32

aniston opened this issue Dec 29, 2020 · 14 comments
Labels

Comments

@aniston
Copy link

aniston commented Dec 29, 2020

Node Version: v12.19.0
Node BACstack Version: [email protected]

  • [x ] Bug Report

Expected Behaviour (Bug Report)

  • using the readPropertyMultiple command with the properties: [{id: 8}] results in Error: ERR_TIMEOUT, although it should support 8 for all properties

  • tried increasing the adpuTimeout: 9000 but still got the same result Error: ERR_TIMEOUT

  • the code does work if called with singular properties like properties: [{id: 77},{id: 28},{id: 85},{id: 111}]

  • in the last working version from the original library node-bacstack the results are as expected ie: with properties: [{id: 8}] we get the correct value object.

  • my sample code

//setup the BACnet comms
const bacnet = require('node-bacnet');
const client = new bacnet({
  port: 47808,                          // Use BAC0 as communication port
  interface: '192.168.222.84',          // Listen on a specific interface
  broadcastAddress: '192.168.222.255',  // Use the subnet broadcast address
  adpuTimeout: 6000                     // Wait twice as long for response
});


// get what we want to read/write
const requestArray = [
  {objectId: {type: 8, instance: 1010220}, properties: [{id: 8}]}    //this results in ERR_TIMEOUT
  //{objectId: {type: 8, instance: 1010220}, properties: [{id: 77},{id: 28},{id: 85},{id: 111}]} //this works
];

// now send the request
client.readPropertyMultiple('192.168.222.222', requestArray, (err, object) => {
  console.log('Returned obj. = ', JSON.stringify(object,null,2));
  console.log('ERRORS if any or NULL :: ', err);
  // IMP close the open listening socket
  client.close();
});
@Apollon77
Copy link
Collaborator

Could you please attach a debug log from both libraries (the "old" one and this one)?

@aniston
Copy link
Author

aniston commented Dec 29, 2020

@Apollon77 I have never done a debug log before :(

  • any advice how to get one done ?

or do you mean this text from the console ?

Returned obj. =  undefined
ERRORS if any or NULL ::  Error: ERR_TIMEOUT
    at Timeout._onTimeout (D:\node-bacstack\node_modules\node-bacnet\lib\client.js:158:16)
    at listOnTimeout (internal/timers.js:554:17)
    at processTimers (internal/timers.js:497:7)

@Apollon77
Copy link
Collaborator

call your script like

DEBUG=* node myscript.js

Should works for both libs

@aniston
Copy link
Author

aniston commented Dec 29, 2020

@Apollon77 , am on windoze , going thru the debug docs and found that I had to use that DEBUG=* method differently , namely set DEBUG=* & node app.js

  • here is output from the node-bacnet lib
 bacnet:transport:debug Send packet to 192.168.222.222: 810a001301040275000e0c020f6a2c1e09081f +0ms
  bacnet:transport:debug server listening on 192.168.222.84:47808 +3ms
  bacnet:transport:debug server got message from 192.168.222.222:47808: 810a05c001043c0000100e0c020f6a2c1e290a4e2207d04f290b4e220bb84f290c4e750500322e31384f29184e104f291c4e7523004444432053746174696f6e20444f492032343720484c4b20476562c3a475646520334f291e4e4f292c4e750b0056332e312e35623839304f29384ea4460101044f29394eb40c21142b4f293a4e750c004949495f314f475f3130334f293e4e2205c44f29464e750d0045592d4153353235463030314f29494e21054f294b4ec4020f6a2c4f294c4ec4020f6a2cc4028000ccc40280012cc40280012dc4028003e8c4028003e9c4028003eac4028003ebc4028003ecc460000000c460000001c460000002c460000003c460000004c460000005c460000006c460000007c460000008c404000001c401800000c404400000c404400002c404400001c403c00191c403c0012fc403c000cac403c0012ec403c00192c403c000c9c403c00190c403c0012cc403c000cbc403c000c8c403c002bbc403c0012dc403c00193c403c00064c405000009c40500000bc40500000ac405000006c405000001c40500000cc405000008c405000005c405000003c405000007c405000000c40500000dc405000004c405000002c40080002dc40080002ec40080002fc400400000c401400006c401400004c401400005c404c00000c400800006c400800005c400800002c400800000c400800003c400800001c400800004c400800008c40080004bc403000000c40080000ac401000000c40000001bc400800030c400800036c400800034c400800035c40140000bc401400011c40140000ec401400010c40140000cc401400017c40140000dc401400018c40140000fc40140001bc40140001cc401400016c401400012c40140001ac401400015c401400019c401400013c401400014c404c00001c400800010c40080000fc400800014c400800015c40080000ec40080001dc403000002c40080001ec403000001c401000002c401000003c400400001c400400002c400400003c401000006c401000007c401000008c403800000c403800001c400000014c400000015c40000000ec400000013c400000012c400000011c400000016c40000000fc400000010c40000001ac400000017c400000004c400000019c400000005c400000000c400000018c400000003c400000002c400000001c40000000dc400000006c40000000bc40000000cc400000009c40000000ac400000007c400000008c40080004ec40080004ac401400002c400800049c401400031c40080004cc40080004fc40080004dc400800050c400800061c400800051c400800054c400800052c400800055c400800053c400800078c400800060c401400007c401400009c401400008c40140001fc40140002ac401400024c401400025c40140002ec40140002dc401400020c401400021c401400026c401400027c401400022c401400028c401400023c401400029c40080006dc40080006fc40080006ec400800070c400800077c400800071c400800074c400800072c400800075c400800073c40140003cc40140003ec40140003dc40140003fc401400044c401400040c401400041c40140002bc400800062c400800066c400800063c400800069c400800064c400800065c400800067c40140002fc400800068c404c00002c404c00003c401400030c40080006ac40080007cc40080006bc40080007dc40080006cc40080007ec400800076c40080007fc40080007bc400800080c400800084c400800085c400800086c400800087c401400033c401400034c401400035c401400036c401400037c401400038c401400043c401400039c401400047c40140003ac401400048c40140003bc401400049c401400042c400800056c400800058c400800057c400800059c40080005ac40080005bc40080005cc40080005dc40080005ec40080005fc400800079c40080007ac400800082c400800083c400800081c40140004bc40140004cc401400051c40140002cc40140005cc40140005ec40140005dc401400061c40140 +209ms
  bacnet:client:trace handlePdu Header:  {
  func: 10,
  sender: { address: '192.168.222.222', forwardedFrom: null },
  apduType: 60,
  expectingReply: true
} +0ms
  bacnet:transport:debug Send packet to 192.168.222.255: 810b000a010041000010 +12ms
  bacnet:transport:debug server IGNORE message from 192.168.222.84:47808 (13833360053100): 810b000a010041000010 +0ms
  bacnet:transport:debug server got message from 192.168.222.222:47808: 810a05c001043c0000100e0c020f6a2c1e290a4e2207d04f290b4e220bb84f290c4e750500322e31384f29184e104f291c4e7523004444432053746174696f6e20444f492032343720484c4b20476562c3a475646520334f291e4e4f292c4e750b0056332e312e35623839304f29384ea4460101044f29394eb40c21142b4f293a4e750c004949495f314f475f3130334f293e4e2205c44f29464e750d0045592d4153353235463030314f29494e21054f294b4ec4020f6a2c4f294c4ec4020f6a2cc4028000ccc40280012cc40280012dc4028003e8c4028003e9c4028003eac4028003ebc4028003ecc460000000c460000001c460000002c460000003c460000004c460000005c460000006c460000007c460000008c404000001c401800000c404400000c404400002c404400001c403c00191c403c0012fc403c000cac403c0012ec403c00192c403c000c9c403c00190c403c0012cc403c000cbc403c000c8c403c002bbc403c0012dc403c00193c403c00064c405000009c40500000bc40500000ac405000006c405000001c40500000cc405000008c405000005c405000003c405000007c405000000c40500000dc405000004c405000002c40080002dc40080002ec40080002fc400400000c401400006c401400004c401400005c404c00000c400800006c400800005c400800002c400800000c400800003c400800001c400800004c400800008c40080004bc403000000c40080000ac401000000c40000001bc400800030c400800036c400800034c400800035c40140000bc401400011c40140000ec401400010c40140000cc401400017c40140000dc401400018c40140000fc40140001bc40140001cc401400016c401400012c40140001ac401400015c401400019c401400013c401400014c404c00001c400800010c40080000fc400800014c400800015c40080000ec40080001dc403000002c40080001ec403000001c401000002c401000003c400400001c400400002c400400003c401000006c401000007c401000008c403800000c403800001c400000014c400000015c40000000ec400000013c400000012c400000011c400000016c40000000fc400000010c40000001ac400000017c400000004c400000019c400000005c400000000c400000018c400000003c400000002c400000001c40000000dc400000006c40000000bc40000000cc400000009c40000000ac400000007c400000008c40080004ec40080004ac401400002c400800049c401400031c40080004cc40080004fc40080004dc400800050c400800061c400800051c400800054c400800052c400800055c400800053c400800078c400800060c401400007c401400009c401400008c40140001fc40140002ac401400024c401400025c40140002ec40140002dc401400020c401400021c401400026c401400027c401400022c401400028c401400023c401400029c40080006dc40080006fc40080006ec400800070c400800077c400800071c400800074c400800072c400800075c400800073c40140003cc40140003ec40140003dc40140003fc401400044c401400040c401400041c40140002bc400800062c400800066c400800063c400800069c400800064c400800065c400800067c40140002fc400800068c404c00002c404c00003c401400030c40080006ac40080007cc40080006bc40080007dc40080006cc40080007ec400800076c40080007fc40080007bc400800080c400800084c400800085c400800086c400800087c401400033c401400034c401400035c401400036c401400037c401400038c401400043c401400039c401400047c40140003ac401400048c40140003bc401400049c401400042c400800056c400800058c400800057c400800059c40080005ac40080005bc40080005cc40080005dc40080005ec40080005fc400800079c40080007ac400800082c400800083c400800081c40140004bc40140004cc401400051c40140002cc40140005cc40140005ec40140005dc401400061c40140 +2s
  bacnet:client:trace handlePdu Header:  {
  func: 10,
  sender: { address: '192.168.222.222', forwardedFrom: null },
  apduType: 60,
  expectingReply: true
} +2s
  bacnet:transport:debug Send packet to 192.168.222.255: 810b000a010041000010 +11ms
  bacnet:transport:debug server IGNORE message from 192.168.222.84:47808 (13833360053100): 810b000a010041000010 +2ms
Returned obj. =  undefined
ERRORS if any or NULL ::  Error: ERR_TIMEOUT
    at Timeout._onTimeout (D:\node-bacstack\node_modules\node-bacnet\lib\client.js:158:16)
    at listOnTimeout (internal/timers.js:554:17)
    at processTimers (internal/timers.js:497:7)
  bacnet:transport:debug transport closed +765ms
  • for the "old" lib i do not get any DEBUG output ! only the correct JSON Object.

@Apollon77
Copy link
Collaborator

Interestingly also the old one shpuld work with debug ... https://github.com/fh1ch/node-bacstack/blob/master/FAQ.md#what-is-the-easiest-way-to-debug-failing-operations

@aniston
Copy link
Author

aniston commented Dec 29, 2020

hmmn, strange it does not work on the old one, tried both as per example fromt he FAQ link and the * method too.
set DEBUG=bacstack & node rpm_8_1010220.js
set DEBUG=* & node rpm_8_1010220.js
but no DEBUG messages , just the clean JSON object.

@Apollon77
Copy link
Collaborator

hm ... would be very intersting to see the "old" library on which messages are sent and such :-)

@aniston
Copy link
Author

aniston commented Dec 30, 2020

some more info:
I set up a Linux Debian 10 VM and installed both libs , still no DEBUG info from the old lib, tried combinations of the export env like
export DEBUG=bacstack and then DEBUG=* node app.js or node app.js
export DEBUG=* and then DEBUG=* node app.js or node app.js

I still do not get any debug output , just the correct resulting object, npm module debug look installed correctly given that i get DEBUG info on the current node-bacnet lib.

PS: the OP problem persists under Linux as well.

@Apollon77
Copy link
Collaborator

how you installed the old one? Directly from github? or how?

@aniston
Copy link
Author

aniston commented Dec 30, 2020

I installed the old one via npm with npm install --save bacstack
The installed versions are :

npm ls --depth=0
/root
├── [email protected]
└── [email protected]

@aniston
Copy link
Author

aniston commented Dec 30, 2020

I'm wondering if no one has found this problem before ? are you able to do a correct read PROP_ALL with properties: [{id: 8}] on a DEVICE object , while generally that is where it would be used.

@Apollon77
Copy link
Collaborator

It could be that the latest npm version of the old lib never had debug and only the github version has. Maybe install from github?

@aniston
Copy link
Author

aniston commented Dec 30, 2020

ok installed from GitHub, but still no DEBUG messages.

So after removing the default npm bacstack lib I did this to install directly from GitHub npm install fh1ch/node-bacstack.git
Sadly still no DEBUG messages !

and..

npm ls --depth=0
/root
├── [email protected] (github:fh1ch/node-bacstack#6bbae54977f75b261405e9993141d45bed5846b1)
└── [email protected]

I am attaching the wireshark capture files of the BACnet protocol , they are captured as per the respective library names.
node-bacnet.txt
node-bacstack.txt
you will need to rename the extension with .pcapng else i could not attach them here.

@PJBCoetzer
Copy link

Hi @aniston, were you able to resolve this issue? I'm also facing the problem getting a ERR_TIMEOUT but unable to get the framework to run/get data from the BacNet network. I'm running on a edge micro pc running Debian 9 with Node 14 running. Can ping the host, but not getting any data though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants