0

I am using the following code to read from the regular controller having ip address and it works fine but when I provide the address of MS/TP controller in notation net:mac the error thrown

Traceback (most recent call last): File "read.py", line 22, in main() File "read.py", line 13, in main value = bacnet.read(payload) File "/home/nvidia/.local/lib/python3.6/site-packages/BAC0/core/io/Read.py", line 219, in read "APDU Abort Reason : {}".format(reason) BAC0.core.io.IOExceptions.NoResponseFromController: APDU Abort Reason : Timeout

The code is following

import BAC0

bacnet = BAC0.lite(ip="192.168.1.20/24", port=47808)

def main():
    payload = "50:7 analogOutput 1 presentValue" # This is not working
    # payload = "192.168.1.40 analogOutput 1 presentValue" # This works fine
    
    print("Requesting {}".format(payload))
    print("The value is ", bacnet.read(payload))

if __name__ == '__main__':
    main()
Zain Ul Abidin
  • 2,467
  • 1
  • 17
  • 29
  • I don't know this library but I would have thought that you still (possibly) need to prefix the 'net:mac' syntax with the IP address of the (parent/mediating) BACnet router/BACnet gateway - to get you the first leg/half of the journey. – DennisVM-D2i Aug 16 '23 at 09:59
  • but documentation says we can write it that way, BAC0 will automatically use parent IP from routes – Zain Ul Abidin Aug 19 '23 at 08:18
  • 1
    Maybe, but doesn't seem to make sense to me - "routes" for *which* device? How would it know which device you're targeting - especially if you've just jumped on the network for the first time (?). Maybe it does something special that I don't know about, but it does sound suspect. Could the documentation be at fault, or am I wrong, or maybe it's a bit of both (?). Is it assuming that the devices will always tell you who is the 'router' when they are asked; if so, then it's probably a bad assumption. – DennisVM-D2i Aug 19 '23 at 10:46
  • You are right basically, a network discovery mechanism is included in the library which is not well documented i noticed. This discovery mechanism builds the MS/TP routes against the parent BACnet IP address – Zain Ul Abidin Aug 20 '23 at 09:25
  • Yes, but the potential problem is, not all devices will support that mechanism, so it's probably not good to rely upon it - at least if it's the BACnet provision (of asking for the parent BACnet 'router'), i.e. you can't necessarily rely upon it working/working consistently in the real world; but I wouldn't know/be able to say, if they are using their own custom mechanism. – DennisVM-D2i Aug 21 '23 at 07:11

0 Answers0