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

Using with MSTP Router #140

Open
2 of 3 tasks
dushyantbangal opened this issue Aug 10, 2019 · 14 comments
Open
2 of 3 tasks

Using with MSTP Router #140

dushyantbangal opened this issue Aug 10, 2019 · 14 comments

Comments

@dushyantbangal
Copy link

dushyantbangal commented Aug 10, 2019

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

@dushyantbangal dushyantbangal changed the title Using with Using with MSTP Router Aug 10, 2019
@NateZimmer
Copy link

See #48 , I have a fork that does this but its not well tested nor fully complete. Needs proper tests & vetting of all the services before its up to spec with the rest of this repo for a PR.

@dushyantbangal
Copy link
Author

dushyantbangal commented Aug 12, 2019

@NateZimmer I had a look at your fork, even tried using it before posting this issue. But I think I was doing something wrong with the net and adr. I didnt fully understand it, as I'm new to bacnet. I was just about to post the issue there, I think you've disabled posting issues.

@dushyantbangal
Copy link
Author

@NateZimmer this is my bacnet router's configuration:
image

What should be my settings? I see the devices do have unique instance ids across the network, but the properties inside the devices have unique instance ids only under that device, and not across the whole network.

So far I have been able to read only the properties on the router device.

@NateZimmer
Copy link

Hey @dushyantbangal, first you should use that fork and perform a who-is on the same subnet as that router.

If you have MSTP devices on that router & the router is functioning properly, you should get a response back from the router with those devices.

 client.whoIs({'address':{'net':0xFFFF,'ip':'xxx.xxx.xxx.255'}});

Device iAM responses from the router should have a net and adr.

You can then read objects from those devices like so:

client.readProperty( {'ip':'192.168.1.166','net':2000,'adr':[9]} , {type: 8, instance: 532663}, 85, (err, value) => {
  console.log('value: ', value);
});

@dushyantbangal
Copy link
Author

dushyantbangal commented Aug 13, 2019

Device iAM responses from the router should have a net and adr.

Great!

But for some weird reason, on Ubuntu Virtual Box inside Windows, I was not getting any response on who-is. I was getting response to readProperty, on the router properties and other direct BACnet IP devices.

While on Windows, I was just getting responses for who-is and nothing on readProperty.
Are you aware of anything like this?

I'll have to try it again once I get access to the network.

@RyeBot33
Copy link

In this a little late. I am able to get the read request working through the router, but am unable to get the write properties to work. I am defining it exactly as in the read requests, but no luck. I can write to the values in the router just fine, just not the controller on the other side. Any ideas?

@NateZimmer
Copy link

NateZimmer commented Feb 15, 2020

@RBrothersBSI use wireshark to capture the who-is responses from the router as well as the write property request being sent to the router. Wireshark can help verify if the packet is being formatted correctly as well as a clue as to what might be going wrong.

@RyeBot33
Copy link

Bingo. Using wireshark I was able to see what the issue was.
priorityZero
By default it was attempting to write at priority zero and I wasn't providing it any options. In the write property method in client.js I added || 16 to settings.priority to give it a fallback if not provided. Thank you, sir!

@Apollon77
Copy link

These changes should also be incorporated int https://github.com/BiancoRoyal/node-bacstack, please try this package and open issues at https://github.com/BiancoRoyal/node-bacstack/issues if it does not work as expected

@mwitt1337
Copy link

client.whoIs({'address':{'net':0xFFFF,'ip':'xxx.xxx.xxx.255'}});

Nate I tried this with your fork and it throws a RTE

dgram.js:396
throw new ERR_INVALID_ARG_TYPE('address', ['string', 'falsy'], address);
^

TypeError [ERR_INVALID_ARG_TYPE]: The "address" argument must be one of type string or falsy. Received type object
at Socket.send (dgram.js:396:11)
at module.exports.self.send (C:\zimmer-bacstack\node-bacstack\node_modules\bacstack\lib\transport.js:38:12)
at EventEmitter.self.whoIs (C:\zimmer-bacstack\node-bacstack\node_modules\bacstack\lib\client.js:403:15)
at Object. (C:\zimmer-bacstack\node-bacstack\index.js:38:8)
at Module._compile (internal/modules/cjs/loader.js:689:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
at Function.Module._load (internal/modules/cjs/loader.js:530:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:742:12)

I am trying to read the properties of an MS/TP device and so far I've had no luck with multiple forks.

YABE gives me an error when trying to read the child objects.
image

@Apollon77
Copy link

@mwitt1337 Can you please try the fork https://github.com/BiancoRoyal/node-bacstack !?

@mwitt1337
Copy link

mwitt1337 commented Jul 21, 2020

I did get the WHOIS to work.

image

Device 156 is the MS/TP to IP router I am trying to get through. I'm not seeing the "NET" and "ADR". The readproperties of 156 did work but there isn't much there. Here is the JSON visualized

image

I'm just stuck at how do I get the NET and ADR info so that I can access the devices beyond the MS/TP router? Is there something I'm not seeing in this information?

This is from a BACNET explorer. It shows "NET 1" and a long MAC Address is this the info I need? What ADR would I use?
image

@Apollon77
Copy link

Can you please show your code? (And when you use a fork then maybe better continuing in an issue there)

@mwitt1337
Copy link

I will open an issues under the fork https://github.com/BiancoRoyal/node-bacstack

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

No branches or pull requests

5 participants