How can I fix "Network unreachable" error in BACnet temperature sensor setup on Raspberry Pi 4

Hey guys, am creating a building automation system using a Raspberry Pi 4 with Embedded Linux. The system should read data from a BACnet temperature sensor. I have checked the BACnet network configuration and IP address, verified the BACnet device status and settings, ensured the BACnet library is correctly installed and configured.

But am getting the error
Network unreachable

from bacpypes.core import run
from bacpypes.app import BIPSimpleApplication
from bacpypes.object import AnalogInputObject
from bacpypes.service.device import LocalDeviceObject

this_device = LocalDeviceObject(
    objectIdentifier=('device', 1234),
    objectName='BACnetDevice',
    vendorIdentifier=15
)

this_application = BIPSimpleApplication(this_device, '192.168.1.10/24')

temperature_sensor = AnalogInputObject(
    objectIdentifier=('analogInput', 1),
    objectName='TemperatureSensor',
    presentValue=0.0,
)

this_application.add_object(temperature_sensor)

def read_temperature():
    temperature = temperature_sensor.presentValue
    print(f"Temperature: {temperature}")

run()

@Middleware & OS
Solution
Systemctl stop firewalld
Was this page helpful?