BAC0 readMultiple prints exception and then throws the same exception when segmentation is not supported
I was running a scanner application against a bunch of (old) Schneider devices that do not support segmentation. The code snippet in question basically does a readMultiple and, if it gets a SegmentationNotSupported it falls back to individual reads:
BAC0.log_level(log_file=None, stdout=None)
try:
async with BAC0.start(ip) as bacnet:
await bacnet._discover(networks='known')
discovered_devices = bacnet.discoveredDevices
for key, device in discovered_devices.items():
bacnet_device = await device_object.get_device_properties(bacnet, router_dict, device, app_logger)
...
device_object.get_device_properties:
try:
device_name, vendor_name, description, system_status, model_name, firmware_revision, application_software_version, location = \
await bacnet.readMultiple(f"{address} device {device_id} objectName vendorName description "
f"systemStatus modelName firmwareRevision applicationSoftwareVersion location")
except BAC0.core.io.IOExceptions.SegmentationNotSupported:
device_name = await bacnet.read(f"{address} device {device_id} objectName")
....
However, the output I get is:
2025-03-19 16:56:18,865 - ERROR | exception: segmentation-not-supported
Traceback (most recent call last):
File "BAC0/core/io/Read.py", line 276, in readMultiple
response = await _app.read_property_multiple(address, parameter_list)
File "bacpypes3/service/object.py", line 543, in read_property_multiple
bacpypes3.apdu.AbortPDU: segmentation-not-supported
2025-03-19 16:56:19,638 - ERROR | exception: segmentation-not-supported
Traceback (most recent call last):
File "BAC0/core/io/Read.py", line 276, in readMultiple
response = await _app.read_property_multiple(address, parameter_list)
File "bacpypes3/service/object.py", line 543, in read_property_multiple
bacpypes3.apdu.AbortPDU: segmentation-not-supported
...
If you're going to throw an exception then why print the exception?
Troubleshooting BACnet devices and comm is not an easy task. This is why I use print. Especially with old devices... I will need time to look at this
This issue had no activity for a long period of time. If this issue is still required, please update the status or else, it will be closed. Please note that an issue can be reopened if required.
Thanks for reporting. I'll have a look at this. Thanks for your patience.
This issue had no activity for a long period of time. If this issue is still required, please update the status or else, it will be closed. Please note that an issue can be reopened if required.