Merge pull request #796 from 0x4net/master

Update Bacnet manual 47808-udp-bacnet.md
This commit is contained in:
Carlos Polop 2024-02-14 11:04:35 +01:00 committed by GitHub
commit c41af08731
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -32,13 +32,24 @@ PORT STATE SERVICE
```bash
pip3 install BAC0
pip3 install netifaces
import BAC0
bbmdIP = '<IP>:47808'
bbmdTTL = 900
bacnet = BAC0.connect(bbmdAddress=bbmdIP, bbmdTTL=bbmdTTL) #Connect
bacnet.vendorName.strValue
#I couldn't find how to obtain the same data as nmap with this library or any other
#talk me if you know how please
import time
myIP = '<Your IP>/<MASK>' #You need to be on the same subnet as the bacnet device. Example: '192.168.1.4/24'
bacnet = BAC0.connect(ip=myIP)
bacnet.whois() #Broadcast request of bacnet devices
time.sleep(5) #Wait for devices to respond
for i, (deviceId, companyId, devIp, numDeviceId) in enumerate(bacnet.devices):
print(f"-------- Device #{numDeviceId} --------")
print(f"Device: {deviceId}")
print(f"IP: {devIp}")
print(f"Company: {companyId}")
readDevice = bacnet.readMultiple(f"{devIp} device {numDeviceId} all")
print(f"Model Name: {readDevice[11]}")
print(f"Version: {readDevice[2]}")
# print(readDevice) #List all available info about the device
```
## Automatic