-
Notifications
You must be signed in to change notification settings - Fork 104
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... |
I'd like to pick this back up, as I've been unsuccessful at getting anything to work after updating (3 months ago). I've tried everything I can think of, reinstalling BAC0, different python versions, but I can't get anything to work. One interesting thing i saw is that the reported version is "2024.09.10", but I have "2024.9.20" installed. Not sure if it's a bug in reporting the version?
|
Hello. We stoped reporting it as we got it running with my initial script. I was working with a mac m1 and could not get it working as we are connecting to the network with a TAP openvpn that is not supoorted. My collegue wirh a linux system achieved to run it as the connection was done correctly. i dont know if this can give you anny insigth on your problem! Best regards |
The new flavour of bacpypes3 is really more sensitive to network configuration. The problem you have actually is that BAC0 tries to do a whois on the device in another subnet. A whois is a broadcast message typically, so if there is no BBMD between both networks, the message will never get an answer... hence the I may have an idea... I'll need a little time to investigate |
I made some tests on my side (using the develop branch, maybe you can give it a try). |
Thank you for taking the time. |
Yes, it is still ahead of what you find on pypi. Also, launch Wireshark and see what is going on. |
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: