ChristianTremblay / BAC0

BAC0 - Library depending on BACpypes3 (Python 3) to build automation script for BACnet applications
GNU Lesser General Public License v3.0
174 stars 99 forks source link

Test device doesn't show with discover or whois #294

Closed vakker closed 3 years ago

vakker commented 3 years ago

If I create a test device (similarly to how it's done in conftest.py:

import BAC0

bacnet = BAC0.lite()

device_app = BAC0.lite(port=47809, deviceId=101)

ip = device_app.localIPAddr.addrTuple[0]
boid = device_app.Boid

test_device = BAC0.device(f"{ip}:47809", boid, bacnet, poll=10)

print(bacnet.discover(networks='known'))
print(bacnet.whois())

Then it prints the physical devices that I have connected to the network, but not the virtual one. Is this intended?

ChristianTremblay commented 3 years ago

Yes. Because whois use broadcast on port 47808 by default. And the other device is on port 47809 (because there would be a port clash...) If you want to test whois, you could use two interfaces orc configure 2 IP in your NIC.

vakker commented 3 years ago

@ChristianTremblay great, thanks!