-
Notifications
You must be signed in to change notification settings - Fork 101
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
Can't read device with new version while it works with 23.7.3 #495
Comments
I suspect bacpypes doesn't know which route to take to reach the device. Can you try a discover before the read ? |
Tank you for the fast response! I tried the discover and in both versions, the new and the old one. Both versions does not find any devices. however the old can read the values if I explicitly specify the deviceIP. I also noticed that both libraries trow an exception when I close the connection. code BAC0-2024.9.20import asyncio
import BAC0
async def bac():
bacnet_dev = {'deviceIp': '10.10.10.15', 'device_uri': '***', 'type': 'analogInput', 'objectId': '27'}
print(BAC0.infos.__version__)
async with BAC0.start('10.187.24.210/16', bbmdAddress='10.187.104.102:47808', bbmdTTL=900) as bacnet:
await bacnet._discover()
print(await bacnet.devices)
try:
value = await bacnet.read(
f"{bacnet_dev['deviceIp']} {bacnet_dev['type']} {bacnet_dev['objectId']} presentValue")
except Exception:
print("ERROR: CANT READ DEVICE")
asyncio.run(bac()) output
Code BACO-23.7.3import BAC0
def bac():
bacnet_dev = {'deviceIp': '10.10.10.15', 'device_uri': '***', 'type': 'analogInput', 'objectId': '27'}
print(BAC0.infos.__version__)
bacnet = BAC0.lite('10.187.24.210/16', bbmdAddress='10.187.104.102:47808', bbmdTTL=900)
bacnet.discover()
print(bacnet.devices)
try:
value = bacnet.read(
f"{bacnet_dev['deviceIp']} {bacnet_dev['type']} {bacnet_dev['objectId']} presentValue")
print(value)
except Exception as e:
print("ERROR: CANT READ DEVICE")
bacnet.disconnect()
bac() Output
|
Following, I'm having a similar problem (to my knowledge). |
I have discovered that using the old version we can get the discover after running a whois. Buit this still does not work with the new version: BAC0-2024.9.20
Output
BAC0-23.7.3
Output
|
BACpypes3 is tied more closely to the BACnet standard by default so "weird routes" and devices not reachable via normal BACnet mechanism are harder to reach with default options. First thing I see (that I missed when looking at the code on the phone) is that your network interface IP address is in the same range than the BBMD. You should not need to register to a BBMD on the same subnet than you. The BBMD will handle your messages and send them where they should go. Normally. Can you confirm that the BBMD device If so, please try without registering to the BBMD. import asyncio
import BAC0
async def bac():
bacnet_dev = {'deviceIp': '10.10.10.15', 'type': 'analogInput', 'objectId': '27'}
print(BAC0.infos.__version__) # 2024.9.20
async with BAC0.start(ip='10.187.176.185/16') as bacnet:
# there is a routing to the external IP to the internal one
try:
value = await bacnet.read(f"{bacnet_dev['deviceIp']} {bacnet_dev['type']} {bacnet_dev['objectId']} presentValue")
except Exception as e:
print(f"can't read {attempt}/5: {e}")
asyncio.run(bac()) Let start with this... |
We are using the Library to read from a few buildings and it does not work with the new version.
Here are the snippets we are using
OUTPUT:
while with the old version:
OUTPUT
Are we doing something wrong?
The text was updated successfully, but these errors were encountered: