Reading value from Real BACnet Device on using BAC0

613 views Asked by At

I was trying to use BAC0 package in python 3 to get value from BACnet device available in BACnet network.

import BAC0 bacnet = BAC0.lite(ip='192.168.5.10/24' ,port=47809)

value = bacnet.read("192.168.5.13:47808 analogInput 1 presentValue")

Where 192.168.5.10 is my local PC Host address and 192.168.5.13 is the ip address of BACnet Device

Getting error :

BAC0.core.io.IOExceptions.NoResponseFromController: APDU Abort Reason : Timeout

1

There are 1 answers

0
DennisVM-D2i On

First off - for the benefit of others, you're missing a new-line after the 'import BAC0' statement.

I've just tested with a slight variant (- not that I'm a Python developer), but it seemed to work; I've masked the exact IP addresses that I tested with):

import BAC0

BAC0.log_level('info')

bacnet = BAC0.lite(ip = '192.168.n.h/24', port = 47809)

value = bacnet.read("195.n.n.h:47808 analogInput 1 presentValue")

print(value)

Are you sure you've got the correct (IP address and) port #?

Has the default gateway been set upon the 'server'/serving/target device (- at least in the case whereby the BACnet client & server are sitting within different subnets)?

Are you sure that this target/'server' device does not also have a DNET & DADR pair of values associated with it - i.e. also require them to be specified?

Is there a F/W blocking communication?

Is the device currently (marked as) 'out-of-service' (or encountering an issue)?

Has it got a valid BACnet license and/or BACnet configuration applied?

You might need to diagnose further with Wireshark, to see what response octets/bytes are been sent back (if any - and maybe even what 'service' request octets/bytes are been sent); or maybe even 'VTS' (Visual Test Shell) instead/too.