question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ReadProperty.py on the same device using IP2VLANRouter.py

See original GitHub issue

Hello @JoelBender, @ChristianTremblay. Hope you are doing well. I have two devices A & B. DEVICE A is running IP2VLANRouter.py with 5 and I have run ReadProperty.py and ReadWriteProperty.py samples on DEVICE B. I can detect the devices from ReadProperty.py pr ReadWriteProperty.py on DEVICE B using:

>> python samples/ReadProperty.py --ini BAC0.ini
> read 20:2 analogValue:2 presentValue
15.0233

My question is; - How can I detect them on DEVICE A?

Thanks in Anticipation.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
JoelBendercommented, Dec 25, 2020

BACnet is a protocol for device-to-device communications, there is no concept of “send this request to myself”. You can run two different applications on the same machine, like both IP2VLANRouter.py and ReadWriteProperty.py, provided they use different UDP ports. In this case, you have two different devices with two different BACnet addresses on two different BACnet networks.

Before getting too deep into BACnet routing, here is a simple way to get two applications on the same machine to talk to each other:

  1. create an INI file called BAC0.ini and put 192.168.0.118/24:47808 in the address field and give it device instance number 1234.
  2. in a terminal window, run python ReadWriteProperty.py --ini BAC0.ini
  3. create a second INI file called BAC1.ini and put 192.168.0.118/24:47809 in the address field and give it device instance number 5678.
  4. in a second terminal window, run python ReadWriteProperty.py --ini BAC1.ini

You now have two applications with two different UDP ports on the same machine and they can talk to each other.

  1. in the second window, enter read 192.168.0.118:47808 device:1234 objectName and it will return the device name (which is a common shortcut of saying “the object name of the device object in the device”).
  2. in the first window, enter read 192.168.0.118:47809 device:5678 objectName and it will return the other device name.

In both of those cases the application in one window is talking to the application in the other window using BACnet. What is different about BACnet than what you might be expecting is that the two applications are peers and can exchange content between them in both directions at the same time.

0reactions
anas-r-devcommented, Dec 28, 2020

It’s working now. Thank you @JoelBender

Read more comments on GitHub >

github_iconTop Results From Across the Web

JoelBender/bacpypes - Gitter
Im trying to make a VLAN with 2 devices...already did that with IP2VLANRouter.py, created a BBMD...I can discover devices on the 20 network....
Read more >
BAC0 Documentation - Read the Docs
This library brings out simple commands to browse a BACnet network, read properties from BACnet devices or write to them. Python is a...
Read more >
bacpypes - Bountysource
i want to read Data from bacnet device using python code instead of ... response from device. where as lib works for the...
Read more >
How to use the bacpypes.pdu.Address function in bacpypes | Snyk
nse.i_am_router_to_network) # make a vlan device object this_device = \ LocalDeviceObject( objectName=args.ini.objectname, objectIdentifier=("device", int(args.
Read more >
Re: [BACpypes-developers] Problem with readProperty and ...
python samples/ReadProperty.py --ini BACpypes.ini This is the wrong sample code when your application needs to behave as a foreign device, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found