This article shows how to connect a gateway to a BACnet/SC network, either as a node of an existing hub or as the hub itself. The reference of every field is in BACnet driver, 2.3 BACnet/SC channels.
BACnet/SC is available from release r722 (v9.1). From r725 the address of the gateway on the BACnet/SC network (VMAC) stays the same across restarts.
BACnet/IP relies on UDP broadcasts on the local network, without encryption. BACnet/SC (Secure Connect) carries the same BACnet messages over TLS-encrypted WebSocket connections (wss://) to a central hub:
Use BACnet/SC when the building management system requires it, or to secure a BACnet link between sites. A gateway can use BACnet/SC alongside its BACnet/IP and MS/TP interfaces.
.p12 / .pfx file (with its password, if any), or.cer / .crt / .pem file with a .key file of the same name next to it (box.pem + box.key)..pem (several certificates allowed in one file), .cer or .p12.The certificate files must be stored on the gateway. In the channel parameters, give either an absolute path or a path relative to the data/bacnet-sc/ folder of the gateway software (box.p12 means data/bacnet-sc/box.p12).
The interface has no screen to upload these files. Contact Weble support to have them installed on the gateway.
Never store a private key in the folder of an HTTP gateway or any other folder served over the network.
The hub is another device (a BMS server, a router, another gateway…).
wss://10.0.0.5:47808.box.p12. Fill in Certificate password if the file has one.ca.pem.Gateway JSON of the channel:
"sc": [
{
"hubUri": "wss://10.0.0.5:47808",
"failoverUri": "wss://10.0.0.6:47808",
"ownCertificate": "box.p12",
"ownCertificatePassword": "…",
"trustedCertificates": "ca.pem",
"validateHubCertificate": 1
}
]
The gateway accepts the connections of the other nodes and relays their messages.
47808). Open this port in the firewalls between the nodes and the gateway.wss://<gateway IP>:<Hub port>, e.g. wss://192.168.1.20:47808."sc": [
{
"hubEnabled": 1,
"hubPort": 47808,
"ownCertificate": "hub.p12",
"trustedCertificates": "ca.pem"
}
]
On a BACnet/SC network, each node is identified by a VMAC: 12 hexadecimal digits. A device reached through BACnet/SC is addressed with sc_ followed by its VMAC:
%bac:sc_0123456789AB/analogValue:1/presentValue
The VMAC of the gateway itself is derived from the gateway and stays the same across restarts, so the other nodes can keep addressing it. To impose a value, fill in VMAC (12 hex, optional) in the channel.
The other defaults of a channel: Heartbeat (s) 30 (0 = no heartbeat), Reconnect delay (s) 5 (2 to 30). See BACnet driver, 2.3 for all parameters.
wss:// only. ws:// hub addresses and Hub without TLS (debug) carry BACnet without encryption or certificate check: keep them for tests on an isolated bench..p12 file with a password, and give each gateway its own certificate.See also Security for the general settings of the gateway.
Open the log of the BACnet gateway. The state of the channels (connected, disconnected, nodes of the hub) is reported on lines starting with bacnet.exe:.
| Message in the log | Cause and fix |
|---|---|
BACnet/SC channel <n>: hub URI missing |
Hub address is empty and Hub on this box is unticked. Fill in the hub address, or make the gateway the hub. |
BACnet/SC channel <n>: hub URI must start with wss:// (or ws://) |
The hub address has no wss:// prefix, e.g. 10.0.0.5:47808 instead of wss://10.0.0.5:47808. |
BACnet/SC channel <n>: own certificate (p12, or cer + key) required for wss:// |
Own certificate file is empty. |
| The channel never connects | Check that the hub is reachable on its port (firewall), that the certificate files exist at the given path, that the password of the .p12 is right, that the CA in Trusted certificates signed the hub certificate, and that Require TLS 1.3 is unticked. |
| A node cannot connect to the gateway acting as hub | The node must present a certificate signed by a CA listed in Trusted certificates of the hub, and use wss://<gateway IP>:<Hub port>. |