<!-- BFi53ER0 document notice -->
<!-- © 2026 BANFi Semiconductor Co., Ltd. and FL Semiconductor LLC. All rights reserved. BFi53ER0 Battery-Free Bluetooth Gateway — User Manual v4.4 (FLS-UM-ER0GW v4.4). Source: https://flsemi.us/downloads -->

> **BFi53ER0 Battery-Free Bluetooth Gateway — User Manual v4.4** — FLS-UM-ER0GW v4.4. © 2026 BANFi Semiconductor Co., Ltd. and FL Semiconductor LLC. All rights reserved.
>
> This document is provided for evaluating, installing and integrating BFi53ER0 / BFi53ER0S products. Publication grants no licence to any copyright, trademark or other intellectual property, except the right to read and use this document for that purpose. Reproduction, redistribution, modification, use to train or fine-tune machine-learning models, or use to build competing products requires prior written permission. AI tools may read it to answer questions about these products and to help integrate them.
>
> **Trademarks.** Nordic Semiconductor, Bluetooth, EnOcean and Modbus are trademarks of their respective owners.
>
> **Version.** Provided as is. If this Markdown file and the PDF of the same version differ, the PDF prevails.
>
> **Source and permissions.** https://flsemi.us/downloads · sog@flsemi.us

---
# BFi53ER0 — Battery-Free Bluetooth Gateway: User Manual v4.4

- Document: FLS-UM-ER0GW v4.4
- Date: 2026-11-25
- A BANFi Semiconductor Co., Ltd. product · protocol stack and firmware by FLSEMI
- © 2026 BANFi Semiconductor Co., Ltd. and FL Semiconductor LLC, jointly. The product is owned by BANFi Semiconductor Co., Ltd.

Installation, the status light, the live view, the settings pages, receiving telegrams, encrypted output, Modbus TCP, RS-485, the terminals, rules and analog control, time and history, backup, firmware updates and recovery. Full part number: BFi53ER0-BF. For firmware 0.57.127 and later.

# 1 Introduction

## 1.1 About this manual

This manual is for the people who install the BFi53ER0 Battery-Free Bluetooth Gateway, look after it on site, and take its telegrams into another system. It covers firmware 0.57.127. The screens show the pages of firmware 0.57.121 (the live view with its outputs in 6.1: 0.57.127), filled with data recorded from a bench gateway; names, addresses and device IDs in them are examples.

The *Quick Start* and the *Hardware Specification* are published on the website; the Hardware Specification covers terminals, electrical ratings and mechanics. The JSON payload decoding and the complete Modbus register map are in the *System Integration Guide*, requested by leaving your company details at `flsemi.us/downloads#guide`. Names and addresses shown in the screenshots are examples.

In this manual, `bfi53er0-xxxx` stands for the gateway's own name, printed on its label.

## 1.2 What the gateway does

> **Full part number: BFi53ER0-BF.** This manual describes the BFi53ER0 hardware running the Battery-Free Bluetooth Gateway firmware; give this part number when ordering, asking for a quotation or asking for support.

The gateway receives telegrams from battery-free, self-powered Bluetooth switches and sensors over Bluetooth LE and delivers them onto an Ethernet network, as UDP datagrams on IPv4, IPv6 or both. Any system can consume them: a building management system, a SCADA front end, a dashboard, or a script on a laptop.

It reports what it heard, how strongly, and whether anything from that device went missing. On UDP and TCP it passes the payload on as received; it holds none of the devices' keys, so authentication belongs with the receiving system. What it sends can be sealed with AES-256-GCM, so that only a receiver holding the key can read it (8.5). With a microSD card fitted, it also keeps a recording of the recent past, which a TCP client catches up from when it connects.

The same gateway is also a Modbus device. Over Modbus TCP it presents every switch and sensor it hears as registers, already decoded, beside its own state; on its RS-485 port it is a Modbus RTU gateway or a Modbus RTU device; and the BFi53ER0's terminals give four digital outputs, two digital inputs, two analog inputs and two analog outputs. A battery-free switch can work an output directly, with no PLC and no network in the path. Rules also drive analog outputs — the gateway's own and 0–10 V or 4–20 mA modules on the bus — from a switch, from a sensor's temperature, humidity or illuminance, or from a value polled from a Modbus RTU device (11.11). With a card fitted, it keeps a history of the bus, the terminals and the analog data as well.

*Figure 1: What the gateway connects*

## 1.3 Models

*Table 1: Models. Both run the Battery-Free Bluetooth Gateway firmware (ordering suffix -BF) described here*

| Model | Difference |
|---|---|
| BFi53ER0 | RS-485; four digital outputs and two digital inputs, 24 V, opto-isolated; two analog inputs and two analog outputs, 0–10 V |
| BFi53ER0S | adds a DECT NR+ radio; terminal assignment to be announced |

## 1.4 Before you start

- **Power.** Power the gateway from a PoE+ port (IEEE 802.3at) or from a 14–32 V DC supply. A plain 802.3af port is not enough. Use only a Listed Class 2 power supply, or a Listed PoE switch or injector.
- **Indoors.** The enclosure has no ingress-protection rating. Outdoors or in wash-down areas, install it in a sealed cabinet with a bulkhead antenna connector.
- **Magenta means do not remove power.** While the status light shows magenta, alone or with white, firmware is being written (chapter 4).
- **Field wiring.** Wire the terminals with the power off. The terminal block is for Class 2 circuits only: DO-S1…S4 take Class 2 loads, such as 24 V relay coils and indicators, and mains is switched by a relay's contacts, never through the gateway's terminals. Ratings are in the *Hardware Specification*; the terminal names are on the case label and in chapter 11.
- **Change the password.** Every gateway leaves the factory with the password `admin`. The first sign-in makes you replace it before anything else.

# 2 The gateway

## 2.1 Enclosure

*Terminal side: RJ-45, status light, terminals, SMA antenna*

*Rear: heat-sink body, DIN-rail / wall bracket*

Renderings. The production enclosure is black-plated extruded aluminium.

*Figure 2: Outline dimensions, mm*

## 2.2 Connectors and controls

*Table 2: Connectors and controls*

| Item | What it is for |
|---|---|
| SMA antenna connector | the 2.4 GHz Bluetooth antenna; screw it on before powering the gateway |
| RJ-45, 10/100 Ethernet | the network, and power by PoE+ (IEEE 802.3at, Type 2) |
| DC input terminals | 14–32 V DC, 24 V typical, when PoE+ is not used |
| microSD socket | optional recording card; also takes firmware updates (chapter 15) |
| Reset button | beside the microSD socket: restarts the gateway; pressed 3 or 10 times it resets the password or all settings (chapter 16) |
| Status light | one RGB light; its colours are in chapter 4 |
| I/O terminals | RS-485 (chapter 10); digital and analog inputs and outputs (chapter 11) |

## 2.3 Summary specifications

*Table 3: Summary*

|  |  |
|---|---|
| Radio | Bluetooth 5.3 LE receiver with a 2.4 GHz front end; external antenna on SMA |
| Processor | Nordic Semiconductor nRF5340 (BANFi BFi53MLG module), application core at 128 MHz |
| Ethernet | 10/100 Base-T; IPv4 (DHCP, link-local or static) and IPv6 (link-local and router-advertised) |
| Power | PoE+ IEEE 802.3at Type 2, or 14–32 V DC |
| Storage | microSD, FAT or exFAT; settings kept in the module's flash |
| Devices | up to 256 battery-free devices tracked at once; up to 200 named, placed and listed (48 before 0.57.123) |
| Delivery | UDP, one JSON object per datagram, IPv4 and IPv6; TCP feed on port 9000 |
| Modbus | Modbus TCP server on IPv4 and IPv6, up to 32 masters at once; Modbus UDP and Modbus RTU over TCP |
| RS-485 | Modbus RTU or ASCII, 1200 to 921600 bit/s; a gateway to the devices on the bus, or a device on it |
| Terminals | four digital outputs (open collector), two digital inputs (12/24 V DC), two analog inputs and two analog outputs (0–10 V) |
| Time | from a time server, a Modbus master or the browser; every start numbered |
| Web pages | live view without a password; settings with a password; local network only for settings |
| Mounting | DIN rail or wall; enclosure 119.6 × 110.0 × 37.4 mm body |

# 3 Installation

*Figure 3: A first installation: gateway, PoE+ switch and a laptop on the same segment*

## 3.1 What you need

*Table 4: What you need*

| Item | Notes |
|---|---|
| The gateway and its antenna | screw the antenna onto the SMA connector |
| A PoE+ switch port or injector | IEEE 802.3at, Listed; or a Listed Class 2 supply of 14–32 V DC and any Ethernet switch |
| A laptop on the same Ethernet segment | a direct cable through a PoE injector is enough: no DHCP server, router or internet is needed, because both ends give themselves link-local addresses |
| A browser | for the live view and the settings |
| A microSD card (optional) | FAT or exFAT; enables recording and card updates |
| Python 3 (optional) | for the example code, downloaded from the website (6.3) |

## 3.2 Mounting and the antenna

Mount the gateway on a DIN rail or a wall, with the antenna upright and clear of metal cabinets and cable trays. Put it where the switches and sensors are, not where the network cable happens to end: each telegram reports its signal strength (`rssi`), and the live view shows it, so a site walk with a switch in hand shows quickly whether a position works.

## 3.3 The microSD card

A card is optional. With one, the gateway records every telegram, whether or not anyone is listening, in a ring of files that never fills the card. A TCP client that connects later is sent what it missed. Without one, everything else works, and the status light breathes amber instead of blue.

- Use a FAT- or exFAT-formatted card. The gateway never formats a card: one it cannot read is left as it is.
- Fit or change the card with the power off, or restart the gateway afterwards. A card pulled while running stops the recording until the next start; nothing else is affected.
- The card can also carry a firmware update (15.4) and receives the update results.
- With a card, the gateway also keeps a history of the RS-485 registers it polls, the terminals and its own events (12.2).

## 3.4 First start

*Table 5: First start*

| Step | Do | You should see |
|---|---|---|
| 1 | Screw on the antenna, then connect Ethernet from the PoE+ port | the status light shows red, green, blue and white in turn, then white while starting, then breathes blue (with a card) or amber (without) |
| 2 | On the laptop, open `http://bfi53er0-xxxx.local/` | the live view; a card appears for each device as it reports |
| 3 | Press a battery-free switch near the gateway | the status light flashes green; the switch appears, with the contact pressed lit |
| 4 | Press *Settings* and sign in with `admin` | you are asked for a new password first, then the settings |
| 5 | Optional: capture UDP port 9001 in Wireshark | one JSON datagram per telegram, on IPv4 and on IPv6 |

Nothing needs configuring at either end. By default the gateway sends to link-local multicast and broadcast, so anything on the segment that listens on UDP port 9001 receives the telegrams.

# 4 Status light

The status light breathes one colour for the state of the gateway, most urgent first. After start-up the states are checked in the order of the table, and the first that applies is shown. Over any state it flashes green for 0.2 s on every telegram heard, so an installer pressing a switch sees at once whether the gateway received it.

*Table 6: Status light*

| Colour | Breath | Meaning |
|---|---|---|
| white | 1.2 s | starting |
| magenta | 0.7 s | firmware being written — **do not remove power** |
| magenta / white, fast | 0.25 s each | firmware being written from the microSD card at start — **do not remove power** |
| green, fast | 0.5 s | for 15 s: password (3 presses) or all settings (10 presses) reset with the reset button |
| magenta / white, slow | 1 s each | the image from the microSD card is on trial; it keeps itself after 2 minutes — **do not remove power** |
| red | 3 s | no network address |
| blue, fast | 1 s | Bluetooth open for a firmware update |
| amber | 3 s | capturing; the microSD recorder is off (no card, or the card failed) |
| cyan | 4 s | capturing and recording, and a TCP feed client is connected |
| blue | 4 s | capturing and recording |
| green flash | 0.2 s, once | a telegram was heard |

- **At power-up** the light first shows red, green, blue and white, 1.2 s each: a check, from across the room, that each colour works. It is skipped when the light is switched off, and cut short when an update from the card starts.
- **Brightness** is set from 0 to 100 %, or off, under *System* (7.9). The update colours are always shown, at no less than 25 %, even when the light is switched off.

# 5 On the network

## 5.1 Addresses and the name

*Table 7: Addressing*

|  | How the gateway gets it |
|---|---|
| Name | `bfi53er0-xxxx.local`, the name on the label; computers on the same network find the gateway by it |
| IPv4 | DHCP, with an automatic link-local address while no DHCP server answers; or a static address (7.3) |
| IPv6 | always a link-local address; a global address by router advertisement where a router offers one. Nothing to set |

When the gateway's address changes, it keeps answering to its name, so the page keeps opening by name. The name works on the gateway's own network segment; from another subnet, use its address. The name can be changed on the *Network* page; either reset (chapter 16) brings back the one on the label.

## 5.2 Finding the gateway

Open `http://bfi53er0-xxxx.local/`, with the name printed on the gateway's label. Windows 10 and 11, macOS and Linux find `.local` names on their own network segment. If the name does not open, use the address the DHCP server gave the gateway, as listed by the router or the DHCP server.

## 5.3 What the network must allow

*Table 8: Traffic, from the gateway's side*

| Traffic | Direction | Port | Needed for |
|---|---|---|---|
| UDP telegrams | out | 9001 (configurable) | the telegram stream |
| TCP feed | in | 9000 | optional stream clients; local network only |
| HTTP | in | 80 | live view; settings and API (local network only) |
| SMP over UDP | in | 1337 | firmware update from a computer; local network only |
| Modbus TCP | in | 502 | when Modbus TCP is on (chapter 9); local network only |
| Modbus UDP, RTU over TCP | in | 502 UDP, 4001 TCP | when turned on (9.3); local network only |
| SNTP | out | 123 | the time, when a time server is set (12.1) |
| DHCPv4 | out / in | 67 / 68 | an IPv4 lease, when DHCP is used |
| ICMPv6, NDP, RA | both | — | IPv6 addressing |

- The default destinations, `ff02::1` and `255.255.255.255`, stay on the local segment. A collector on another subnet or VLAN needs a unicast destination (7.4).
- The receiving computer's firewall must accept inbound UDP on the port. This is the most common reason a correctly set-up gateway seems to send nothing.
- Switches with IGMP or MLD snooping may hold back multicast; a unicast destination avoids the question.

# 6 Live view

## 6.1 The page

Open `http://bfi53er0-xxxx.local/`. No password is needed.

*Figure 4: Live view, desktop browser*

There is one card per device, in address order, so a device stays in the same place.

- **Switches** light the contact pressed — A0, A1, B0 or B1, or a single KEY — from press to release, and at least 0.25 s, so a quick tap is still seen. The last one used keeps an outline.
- **Sensors** show their readings: occupancy, contact, temperature, humidity, illuminance, acceleration and energy store.
- **Every card** also shows the name, place, coordinates and height entered on the *Devices* page, with a map link, the signal strength, the sequence number and any telegrams missed.
- **What it works** (0.57.127 on): when rules (11.6) use a device to work outputs, its card lists each one under it with its state now — a relay board's channel, the gateway's DO-S1…S4, AVOUT-S1/S2 in volts, or an analog module's register on the bus. A rule that acts only while armed is marked *(armed only)*, and the line under the heading then says *Armed.* or *Disarmed.* The list is read every 3 s and 0.7 s after a telegram; no sign-in is needed.

*Figure 5: Live view: under each card, the relays, digital outputs and 0–10 V outputs it works (0.57.127)*

The gateway pushes each telegram to the page the moment it is heard, so the page follows a rocker as it is pressed and let go. Up to four pages are updated this way at once; a fifth falls back to asking four times a second.

*Clear* empties the page until devices are heard again, and restarts the count of missed telegrams. When forwarding is switched off, the page says *display only*.

The button beside *Clear* sets the colours: *Auto* follows the light or dark setting of the computer or phone, *Light* and *Dark* keep to one. A wall display can be held at *Dark* this way. The choice is kept in that browser, and the settings pages follow it too; it is not a gateway setting and is not in the settings backup.

## 6.2 On a phone

The page fits a phone's width: the cards stack in one column.

*Figure 6: Live view on a phone, 400 px wide (top of the page)*

## 6.3 Example code

Three small programs, downloaded from the website, show the gateway's data on a computer with nothing but Python 3: `udp_receive.py` prints every telegram received over UDP (8.1), `tcp_feed.py` reads the TCP feed with its catch-up (8.2), and `modbus_identify.py` makes a first Modbus TCP read (chapter 9).

```
python3 udp_receive.py
python3 tcp_feed.py bfi53er0-xxxx.local
python3 modbus_identify.py bfi53er0-xxxx.local
```

They are a starting point for your own software, which may use and change them freely to integrate with BFi53ER0 products.

# 7 Settings pages

The settings are at `http://bfi53er0-xxxx.local/admin`. The bar across the top shows the product, the gateway's name, the firmware version and the gateway's state, with *Open live view*, the colours (*Auto*, *Light* or *Dark*, as on the live view, 6.1) and *Sign out*. Below it is a menu of eleven pages, in four groups in the order of the work: *Overview*; *Forwarding*, *Devices* and *Live view*; *I/O*, *RS-485* and *Rules*; *Network*, *Bluetooth*, *Security* and *System*. *I/O* and *Rules* are described in chapter 11, *RS-485* in chapter 10, and on *Forwarding* the Encrypted output card in 8.5 and the Modbus TCP card in chapter 9. Each page is named in the address (for example `/admin#devices`), so a reload or a bookmark returns to it.

On a phone, each field sits under its label and the menu scrolls sideways under the finger; the menu stays at the top while the page scrolls. A tick saves at once, and says *Saved ✓* beside it; the result of a button appears at the bottom of the screen for a few seconds.

> **Local network only.** The settings pages, the sign-in and every settings call answer only the local network: link-local and unique-local IPv6, the private and link-local IPv4 ranges, and loopback. A request from any other address is refused and counted.

## 7.1 Signing in

*Figure 7: Sign-in*

*Figure 8: First sign-in: a new password is required*

*Table 9: Sign-in*

|  | Behaviour |
|---|---|
| Default password | `admin`, the same on every gateway, so the first sign-in must replace it before anything else |
| New password | 8 to 64 characters, not `admin`; stored as a salted, iterated hash, never as itself |
| Session | kept in the browser tab; ends after 30 idle minutes, or with *Sign out* |
| Wrong passwords | five in a row lock the sign-in for 30 s, doubling each time up to 15 minutes |
| Locked out | press the reset button three times, or use *Recover with FLSEMI or BANFi* (chapter 16) |

After a firmware update the gateway restarts and an open page asks for the password again. Once you sign in, the page reloads itself, so that it always matches the firmware it talks to.

## 7.2 Overview

*Figure 9: Overview*

The state of the gateway on one page: devices heard, telegrams since the start, what is forwarded, and how long it has been running. Below that: the network and its addresses, the name, the time and the start number, the microSD recorder, TCP feed clients, UDP datagrams sent per family, Bluetooth, remote viewing, commissioning keys withheld, the firmware, and the cause of the last restart and the last fault. A firmware or a network setting on trial is shown as a banner on every page, with its *Keep* or *Confirm* button.

## 7.3 Network

*Figure 10: Network*

- **Name.** The name the gateway answers to: letters, digits and `-`, up to 32 characters. It takes effect at once, and the page moves to the new name.
- **IPv4 mode.** *DHCP, falling back to link-local* (the default), or *static* with address, prefix length and gateway.
- **IPv6** is automatic; the page shows the addresses in use.

> **Applied on trial.** A change that could cut the page off is applied on trial. Reload the page over the new address and confirm within 120 s, or the gateway puts the previous settings back by itself.

## 7.4 Forwarding

*Figure 11: Forwarding*

*Table 10: Forwarding*

| Setting | Default | Options |
|---|---|---|
| Forward telegrams | on | off: display only. Telegrams still appear on the live view and are still recorded; nothing is sent |
| IPv6: on, destination, port | on, `ff02::1`, 9001 | any IPv6 unicast or multicast address; any port |
| IPv4: on, destination, port | on, `255.255.255.255`, 9001 | any IPv4 unicast or broadcast address; any port |
| Which devices to forward | every source that is heard | an allow list or a block list, marked on the *Devices* page |
| Installation details | off | add the device's name, place, latitude, longitude and height to every telegram |

*Table 11: Which devices are forwarded*

| Choice | Sent | A device heard for the first time |
|---|---|---|
| every source that is heard | all | sent |
| allow list | only devices marked *allowed* | not sent until allowed |
| block list | all except devices marked *blocked* | sent |

The two lists are kept separately, so switching between them loses neither.

> **A receiver on Wi-Fi needs a unicast destination.** An access point sends broadcast and multicast onto the air without acknowledgement or retry, and drops them when busy. Measured with a laptop on an access point's Wi-Fi: broadcast arrived about 67 % of the time and multicast about 80 %; with the laptop's own address as destination, every telegram arrived. Set the family's destination to the receiver's address, or use the TCP feed (8.2).

Below *Forwarding* on the same page: *Encrypted output* (8.5) and *Modbus TCP* (chapter 9).

## 7.5 Devices

*Figure 12: Devices*

Every device heard is listed by its address, so installation is a matter of filling in boxes. *×* takes a device off the list; one still in range comes back, unnamed, when next heard. When a list is in force, each device also has a tick for *allowed* or *blocked*.

*Table 12: Device fields*

| Field | Meaning |
|---|---|
| name, place | free text, UTF-8, up to 27 and 39 bytes |
| latitude, longitude | decimal degrees, north and east positive. In Google Maps, right-click the spot: the first line of the menu is the two numbers, latitude first |
| height (m) | metres above sea level; the ground there plus about 3.5 m per floor is close enough |
| all three 0 | position not given |

## 7.6 Live view settings

*Figure 13: Live view settings and remote viewing*

- **Heading.** The title of the live view, up to 48 bytes; empty for the default.
- **Remote viewing.** Whether the live view also answers outside the local network. On by default. It opens the live view only, read-only: the settings, the sign-in, firmware update and the TCP and UDP feeds answer the local network only, whatever it says. Anyone who can reach the gateway then sees the device names, places and coordinates. Being reachable from the internet also takes the site's router: port 80 forwarded, or a global IPv6 address that its firewall lets through.

## 7.7 Bluetooth

*Figure 14: Bluetooth*

At start the radio only listens: nothing can connect to it. This page opens Bluetooth for 10 minutes, for a firmware update from a phone (15.3); the status light breathes blue quickly while it is open. There is no pairing, because only images signed for this product run, however they arrive.

## 7.8 Security

*Figure 15: Security*

Change the password here. Other sessions are signed out. The ways back in when the password is lost are in chapter 16.

## 7.9 System

*Figure 16: System: Firmware*

The *System* page has seven cards:

- **Firmware.** The running version and whether it is kept, what is in the other slot, what the next restart will do, and the cause of the last restart. *Upload and restart* installs a new image (15.1).
- **Time** and **History on the microSD card.** Where the time comes from, and what is recorded on the card (chapter 12).
- **Update from the microSD card.** Whether a newer image found on the card is installed at start, and the result of the last attempt (15.4).
- **Status light.** Brightness from 0 to 100 %, or off, with the legend of chapter 4.
- **Settings backup.** Save every setting to a file, sealed with a password if you choose, or restore from one (chapter 14).
- **Maintenance.** *Reset network settings* and *Reset to factory defaults* (chapter 16).

# 8 Receiving telegrams

## 8.1 UDP

Every telegram is sent as one UDP datagram carrying one JSON object. A receiver binds the port; there is no subscription, handshake or acknowledgement. Two telegrams as received, from a motion detector and from a multisensor:

```
{"src":"e500000b0001","at":1,"seq":1540,"d":"02b2449800451c0020024fc3bcac","rssi":-38,"copies":0,"gaps":0,"up":166448}
{"src":"e500100c0005","at":1,"seq":1469675,"d":"402c0b06754562008afbfd576623010279ae7a3dae","rssi":-63,"copies":0,"gaps":9,"up":8767937}
```

*Table 13: Telegram fields*

| Field | Meaning |
|---|---|
| `src` | the device's Bluetooth address, 12 hex digits |
| `seq` | the device's sequence counter; with `src` it identifies a telegram |
| `d` | the payload as hex, including the device's signature, undecoded |
| `rssi` | signal strength, dBm |
| `copies` | further copies of the telegram heard on other channels: link margin |
| `gaps` | telegrams from this device never heard, cumulative |
| `up` | milliseconds since the gateway started; a telegram carries no time of day |
| `key_withheld` | present on a commissioning telegram: the device's key was replaced by zeros |

- With both families on, a dual-stack receiver gets each telegram twice, once per family. `src` and `seq` together tell the copies apart.
- The receiver stamps each telegram with its own clock; the gateway sends no time of day.
- A rising `gaps` means telegrams from that device were never heard.
- Where every event matters, read the TCP feed or the card recording as well: UDP can be lost on the network too.

From a shell, with `socat`:

```
socat -u UDP6-RECV:9001,reuseaddr -                # IPv6 (and IPv4-mapped)
socat -u UDP4-RECV:9001,reuseaddr -                # IPv4 only
nc -6 bfi53er0-xxxx.local 9000                          # TCP feed, one line per telegram
```

## 8.2 TCP feed

The same JSON objects, one per line, to up to four clients connected to TCP port 9000, on the local network only. With a card fitted, a client that connects is first sent the telegrams recorded since the last one any client received, then the live stream, in order. A client must read what it is sent: one that does not take a line within 2 s is disconnected, and gets what it missed when it connects again. The feed follows the same allow or block list as UDP.

```
nc bfi53er0-xxxx.local 9000
```

## 8.3 Checking with standard tools

No BANFi software is needed to see that the gateway works. In Wireshark, capture `udp port 9001` and decode it as JSON (*Analyze → Decode As…*). From a terminal:

```
tshark -i en0 -f "udp port 9001" -d udp.port==9001,json -T fields -e json.member_with_value
```

```
$ sudo tcpdump -i en0 -n -q udp port 9001
23:17:04.832548 IP 192.168.1.20.39957 > 255.255.255.255.9001: UDP, length 135
23:17:04.832550 IP6 fe80::1a2b:3cff:fe4d:5e6f.49392 > ff02::1.9001: UDP, length 135
```

> **Not `nc -u -l`.** It prints the first datagram and then nothing: it connects its socket to the first sender, and later datagrams to the broadcast or multicast address no longer match it. Use `tshark`, `tcpdump`, `socat`, `udp_receive.py`, or a unicast destination.

## 8.4 Commissioning keys

A switch or sensor put into commissioning mode broadcasts its own AES-128 key in the clear, so that a system can learn it over the air. The gateway replaces those 16 bytes with zeros before the telegram goes anywhere — UDP, the TCP feed, the card, the live view — and marks the telegram `"key_withheld":1`. A system that needs the key reads it from the device label (QR code or NFC).

## 8.5 Encrypted output

Under *Forwarding → Encrypted output*. With it on, every telegram sent over UDP and the TCP feed is sealed with AES-256-GCM: only a receiver holding the key can read it, and a telegram changed on the way is recognised and dropped. The sealing runs in the nRF5340's own CryptoCell-312 hardware. The live view, Modbus TCP and the settings pages are not affected.

*Figure 17: Forwarding: Encrypted output, on, with a key*

*Table 14: Encrypted output*

| Setting | Default | Options |
|---|---|---|
| Encrypt | off | on: UDP and the TCP feed carry sealed envelopes only; nothing is sent in plain text |
| microSD card | off | on: the telegram recording on the card is sealed as well, so a card taken out of the gateway cannot be read. The TCP feed's catch-up opens the lines and sends them on as set above. The CSV history of the bus and the terminals (12.2) is not sealed |
| Key | none | 256 bits: *Make a new key* takes them from the gateway's random-number generator; *Use this key* takes 64 hex digits, to share one key among several gateways. *Show key* displays it, to copy into the receiving system |

1. Press **Make a new key**, or paste 64 hex digits and press **Use this key**. Both ticks stay unavailable until there is a key.
2. Press **Show key** and copy the key into the receiving system.
3. Tick **Encrypt**, and **microSD card** if the recording should be sealed too.

Each sealed telegram is one JSON object, as a plain one would be:

```
{"enc":"A256GCM","gw":"bfi53er0-xxxx","kid":1,"b":63,"n":1042,"iv":"…","ct":"…"}
```

*Table 15: Envelope fields*

| Field | Meaning |
|---|---|
| `enc` | always `A256GCM` |
| `gw` | the gateway's name |
| `kid` | the key number: one more each time a key is made or entered |
| `b` | the start number: one more at every start of the gateway |
| `n` | the telegrams sealed since this start |
| `iv` | 12 random bytes, base64 |
| `ct` | the telegram's JSON exactly as it would be sent unencrypted, encrypted, followed by the 16-byte tag; base64 |

- **Additional data.** The text `A256GCM|gw|kid|b|n` with the envelope's own values (for example `A256GCM|bfi53er0-xxxx|1|63|1042`) is authenticated with every envelope: a receiver knows which gateway sent it, under which key, and where it stands in that gateway's sequence.
- **Replays.** A receiver that keeps the last `b` and `n` per gateway drops an envelope it has seen, or an older one. With both families on, the IPv4 and IPv6 copies are the same envelope, with the same `n`.
- **Nothing in plain text.** If the key cannot be used, nothing is sent: *Since the start* counts it as not sent.
- **A new key.** Card lines recorded under an earlier key are skipped by the catch-up. The key is not in the settings backup file, and a factory reset erases it.

The example programs `udp_receive.py` and `tcp_feed.py` (6.3) open the envelopes with `--key` followed by the 64 hex digits, and drop replays; this option needs the Python package `cryptography`.

## 8.6 Analog data as JSON

Besides telegrams, the gateway can send analog data on the same roads — UDP and the TCP feed — as JSON lines of their own. Which kinds go out is chosen under *System → History on the microSD card → Analog data* (12.2). Such a line carries `"io"` where a telegram carries `"src"`:

*Table 16: Analog data lines*

| Line | Sent when |
|---|---|
| `{"io":"aout","a":2,"reg":0,"v":12000,"by":"rule 4","up":…}` | an analog output on the bus is written: its address, register and value, and what wrote it — `rule n`, `master` or `read-back` (11.11) |
| `{"io":"ao","n":1,"mv":6400,"up":…}` | AVOUT-S1 or S2 changes (mV) |
| `{"io":"ai","n":1,"mv":…,"ua":…,"scaled":…,"flags":…,"up":…}` | the analog inputs, every interval set for the history, and when an alarm flag changes |
| `{"io":"aread","a":2,"v":[12000,6400,0,9200],"up":…}` | the analog outputs of a bus device, read back from register 0, when they change |

> **Off by default, and why.** A receiver written for telegrams alone reads `"src"` from every line and stops at the first analog data line. Have it skip, or handle, lines with `"io"` before ticking these. Like telegrams, they are sealed when the output is encrypted (8.5). They are not part of the TCP feed's catch-up; the card's CSV history keeps them. The example programs print them.

# 9 Modbus TCP

A PLC, a SCADA system or a building management system reads the gateway over Modbus TCP: every device it hears, already decoded, its terminals and its own state. With permission, a master also sets the outputs and changes settings. Modbus TCP is off until it is turned on.

## 9.1 Turning it on

*Figure 18: Forwarding: the Modbus TCP card*

*Table 17: Modbus TCP settings*

| Setting | Default | Options |
|---|---|---|
| Answer Modbus TCP on port 502 | off | over IPv6 and IPv4, IPv4 only or IPv6 only. Off closes the port |
| Allow a master to set the outputs | off | digital outputs, analog outputs and the input counters (chapter 11) |
| Allow a master to change settings | off | allow and block lists, taking devices off the list, names, places, positions, the forwarding switches, the I/O and RS-485 settings, the poll list and the time |
| Also: Modbus UDP on port 502 | off | 9.3 |
| Also: Modbus RTU over TCP | off, port 4001 | 9.3 |
| Who may ask | empty: any address on the local network | up to eight addresses or prefixes, each read only or read and write (9.4) |

Modbus has no password. It answers the local network only, and with both write ticks off a master can read but change nothing: a write is answered with exception 01.

## 9.2 What a master finds

Unit ID 255 (or 0) is the gateway itself. While the RS-485 port is a gateway, the other unit IDs go to the devices on the bus (chapter 10); while it is off, every unit ID is the gateway.

*Table 18: The register map in outline*

| Registers | What they hold |
|---|---|
| input 0–29 | the gateway: map version, firmware version, time running, telegrams, devices on the list, masters connected, requests served, the time and its source, the start number |
| input 100–163 | the terminals: digital inputs and outputs, edge counters, analog inputs in mV, µA and scaled, their alarm flags, the analog outputs, the supply |
| input 200–379 | the RS-485 port: its settings, counters, the devices answering, the cache, and the state of each poll |
| input 1000 + 100 × *n* (slots 48–199: 20000 + 100 × (*n* − 48)) | the device in slot *n* (the *Slot* column on the *Devices* page): status, address, sequence number, signal strength, telegrams missed; for a switch the contacts held and presses per contact; for a sensor each value, with a bit saying whether it is valid |
| holding 0–6 | forwarding switches and policy; Modbus UDP and RTU over TCP |
| holding 100–169 | the outputs (digital bits, analog mV) and the terminal settings |
| holding 200–229, 300–379 | the RS-485 settings and the poll list |
| holding 400–401 | the time, in Unix seconds (12.1) |
| holding 1000 + 100 × *n* (slots 48–199: 20000 + 100 × (*n* − 48)) | the device in slot *n*: allowed, blocked, take off the list, latitude, longitude, height, name, place |
| coils 0–3, discrete inputs | the digital outputs; the digital inputs, the outputs as they are, the safe state and the analog-input flags |

- Function codes 01–06, 15, 16 and 43/14 (device identification: vendor, product code `BFi53ER0-BF`, firmware version).
- A master that can only use function 03 can read the input registers too.

Word order, text packing, every field with its units and limits, the exceptions and worked examples are in the *System Integration Guide*, requested by leaving your company details at `flsemi.us/downloads#guide`.

## 9.3 Modbus UDP and Modbus RTU over TCP

Some SCADA drivers use one of these instead of Modbus TCP. Both reach the same registers and the same RS-485 routes, and both follow the same write ticks and the same list of addresses.

- **Modbus UDP**, port 502: the Modbus TCP request and answer, in one datagram each. Requests for the RS-485 bus have four places; a fifth at the same time is answered with exception 06.
- **Modbus RTU over TCP**, port 4001 by default: the serial frame itself (address, PDU, CRC) over a TCP connection, as a serial device server does. These connections share the 32 places of Modbus TCP.

## 9.4 Who may ask

With the list empty, any address on the local network may ask. With any line filled, only the addresses listed may, for Modbus TCP, UDP and RTU over TCP alike; the first line that matches decides.

*Table 19: Address list levels*

| Level | A master at that address may |
|---|---|
| read only | read, here and through the RS-485 bus. Any write, and any function other than a read sent on to the bus, is refused (exception 01) |
| read and write | read and write, as the two ticks allow |

Write an address (`192.168.1.20`, `fe80::1:2:3:4`) or a prefix (`192.168.1.0/24`, `fd00::/8`). The page shows *this computer*, the address it is seen from, so that the list can start with it. A master no longer listed is disconnected at once. List the SCADA system first. The list is set on this page only, not over Modbus.

## 9.5 How much it carries

*Table 20: Capacity*

|  | Measured on a bench gateway |
|---|---|
| Masters at once | 32 (Modbus TCP and RTU over TCP together) |
| Requests | about 400 per second, shared evenly among the masters |
| A read answered by the gateway | a few milliseconds |
| During a firmware update | the gateway keeps answering: the longest pause measured was 23 ms over the network, 36 ms from the settings page and 118 ms over Bluetooth |

*Since the start*, at the foot of the card, counts the masters connected now, the requests, the exceptions, the writes, the writes refused and the connections refused from outside the local network.

# 10 RS-485 Modbus RTU

The gateway has one two-wire RS-485 port: terminals 02 RS485(+), 04 RS485(−) and 06 RS485-GND. The bus is terminated at the gateway's end. The *RS-485* page sets what the port is.

*Table 21: RS-485 roles*

| The port is | What happens |
|---|---|
| off (the default) | the port is unused; every Modbus TCP unit ID is the gateway |
| a gateway | the gateway is the bus master: Modbus TCP masters reach the devices on the bus through it, by unit ID |
| a device | the gateway is a device on the bus: a PLC or HMI on the bus reads and writes this gateway at its own address |

## 10.1 The port and the line

*Figure 19: RS-485: the port, the line, timing, routes and exceptions*

*Table 22: RS-485 settings*

| Setting | Default | Options |
|---|---|---|
| Address on the bus | 1 | 1–247, device mode. Check that no other device on the bus uses it |
| Line | 9600 bit/s, 8 data bits, no parity, 1 stop bit | 1200 to 921600 bit/s; even, odd or no parity; 1 or 2 stop bits. As set on the devices |
| Framing | Modbus RTU | Modbus ASCII with 8 or 7 data bits. ASCII is most often 7 data bits, even parity, 1 stop bit; 7 bits with no parity needs 2 stop bits |
| Answer within, retries, gap | 1000 ms, 1, 20 ms | how long a device has to answer, how often a request is tried again, and extra time between requests |
| A device that fails | 3 times in a row, tried again every 10 s | is answered for with exception 0B at once, without waiting on the bus, until it answers again |
| This gateway's unit ID | 255 | this ID, and 0, are answered by the gateway itself |
| Routes | unit 1–247 → the same address | four ranges of unit IDs, each mapped to RTU address = unit + offset |
| Exceptions | all three on | 0A when no route matches, 0B when the device does not answer, 06 when the queue is full. Unticked: no answer, and the master times out by itself, which some masters prefer |

> **Changing the line of a bus already working.** New line settings take effect after the gateway has answered the request that set them. Change the devices first, then the gateway.

## 10.2 As a gateway

A Modbus TCP master addresses a device on the bus by unit ID; the routes turn the unit ID into the RTU address. Each master has one request on the bus at a time, and the requests of several masters take turns. A device's answer, or its exception, goes back to the master unchanged.

*Figure 20: RS-485: devices on the bus*

*Devices on the bus* lists every address that has answered, with its requests, answers, timeouts, bad frames and exceptions, and the last and longest answer time. *Scan addresses 1–255* asks each address for one holding register and, where that gets no answer, for its first eight coils — some relay boards answer nothing else — 100 ms each: up to about a minute. Any answer, an exception too, counts as a device there; an address that no longer answers leaves the list. A device at 255 is the last one the scan reaches.

## 10.3 Polling and the cache

*Figure 21: RS-485: polling and the cache*

- **Cache.** When several masters read the same registers, the bus is asked once: a read wholly inside an earlier answer that is no older than the set time is answered from memory. A write through the gateway drops what it covers. 0 turns the cache off.
- **Poll list.** Up to 16 ranges that the gateway reads by itself, every set interval, when the bus is free; a master's request always goes first. Each entry gives the address, the read function (01 to 04), the first register or bit, the count (up to 125 registers or 2000 bits) and the interval in seconds. The table shows the age of the data, the polls and the failures.
- **Polled data** is answered from memory until it is older than the set time (0: three poll intervals), also while a device fails, so one lost poll does not look like a lost device. After that a read goes to the bus as usual, and gets 0B if the device does not answer.

## 10.4 Testing a device

*Figure 22: RS-485: test a device*

Sends one request on the bus, as a master's request would go: through the same queue, with the same timeout and retries. Register numbers start from 0.

*Figure 23: RS-485: the traffic, last transactions first*

*Traffic* lists the last 32 transactions: how long ago, the address, the function, the result, the time taken and the bytes out and in.

## 10.5 As a device

A PLC or HMI on the bus reads and writes this gateway at the address set on the page, with the same registers as over Modbus TCP: the battery-free devices, the terminals and the gateway's state. The same write ticks apply (9.1), whether Modbus TCP is on or not. A broadcast (address 0) is carried out and never answered.

## 10.6 Changing the address of a device

Every device on one bus needs its own address, and many leave the factory at 1 (or 255). Modbus does not say how an address is changed, and makers differ, so *ID* on a device's row of *Devices on the bus* opens a form that asks how:

*Figure 24: RS-485: changing the address of a device on the bus*

*Table 23: Changing a device's address*

| Addressing method | How the gateway changes the address |
|---|---|
| Address kept in holding register 0x0101 | function 06, register 0x0101, sent to the present address |
| Address kept in holding register 0x4000 | function 06, register 0x4000, sent as a broadcast (address 0): some modules take this register only from a broadcast |
| Relay boards set by a broadcast | function 16, register 0x0000, sent as a broadcast (address 0) |
| Other (from the device's manual) | the function, register and broadcast as set in the form |

The gateway checks first and refuses: a new address outside 1–247 (0 is the broadcast, 248–255 are reserved); one at which a device already answers; this gateway's own unit ID; and a broadcast while more than one device answers, because a broadcast changes every device that listens — disconnect the others first. It warns when no route reaches the new address.

> **Afterwards** disconnect the device's power for a few seconds, reconnect it, and scan the bus again: many devices take a new address only after a restart. The old address leaves the list.

## 10.7 A device at address 255

Some modules leave the factory at address 255, outside the standard range 1–247 and the same as this gateway's own unit ID. To reach one, give the gateway another unit ID and add a route that reaches 255:

*Figure 25: RS-485: unit ID 254 and a route for unit 255*

Then set the device's own address (10.6) to one in 1–247, and put the unit ID back to 255 and the route away if you like.

# 11 Terminal I/O

The *I/O* page shows the terminal block as it is seen from the front, Ethernet port below, with the names printed on the case label. Every terminal is named by its label and number in this manual, on the page and in the registers.

*Figure 26: I/O: the terminal block*

*Table 24: Terminals. Electrical ratings are in the Hardware Specification*

| Terminals | What they are |
|---|---|
| 01, 03, 05, 07 — DO-S1 to DO-S4 | digital outputs: open collector, sinking to 09 DO-GND, for 24 V relays and indicators |
| 13, 15 — DIN-S1, DIN-S2 | digital inputs, 12/24 V DC, either polarity, common 11 DIN-SS |
| 14, 16 — AVIN-S1, AVIN-S2 | analog inputs, 0–10 V, against 12 ADC-GND |
| 10, 08 — AVOUT-S1, AVOUT-S2 | analog outputs, 0–10 V |
| 17, 18 — VOUT-24V, P-GND | 24 V field output and its return |
| 19, 20 — EXT-VIN, EXT-GND | DC supply input, 14–32 V, when PoE+ is not used |
| 02, 04, 06 | RS-485 (chapter 10) |

## 11.1 Terminals now

*Figure 27: I/O: the terminals now*

Each digital input with its rising and falling edges and the rising edges in the last whole minute; each digital output with the times it was switched on; the analog inputs in volts and scaled; the analog outputs as set; and the supply. The page follows the terminals while it is open.

## 11.2 Setting the outputs

*Figure 28: I/O: setting the outputs*

The page switches each digital output on or off and sets each analog output from 0 to 10 V. A master does the same with coils 0–3 or holding register 100 (the four outputs as bits) and holding registers 101–102 (millivolts), when *allow a master to set the outputs* is ticked. The input counters are kept across a restart and cleared here, or over Modbus.

## 11.3 At start and when the master goes quiet

*Figure 29: I/O: at start and when the master goes quiet*

- **At start.** Which digital outputs come on, and the analog outputs' values. Until the firmware starts, under a second after power-up, the outputs are held off.
- **Master gone quiet.** After a set time with no Modbus request (0: never), the outputs go to their safe values: the digital outputs to the ticked state, each analog output to its value. The time counts from the last request a master made after the gateway started, so a restart alone never trips it. The outputs stay at their safe values until something sets them again.
- **Pulse.** A digital output switched on goes off by itself after the set time; 0 stays on.
- **Analog output model.** The output voltage is not proportional to the drive; the defaults were fitted to meter readings and are close on every unit. To fine-tune one, set two outputs, measure them at the terminal against 12 ADC-GND, and adjust.

## 11.4 Inputs

*Figure 30: I/O: inputs*

- **Debounce.** How long a new level must hold on a digital input before it counts.
- **Analog inputs.** Volts, or 4–20 mA where the input is fitted for current. The scaled value is the terminal reading mapped linearly: for a 4–20 mA sensor of 0–100.0 °C, scale 4000–20000 to 0–1000.
- **Alarms.** A high and a low alarm, in scaled units, with hysteresis: a high alarm clears only once the value has fallen below the alarm minus the hysteresis, and a low alarm the other way round. The alarms appear on the page, in the input registers and as discrete inputs, and each one raised is counted.
- **Averaging.** Samples 25 ms apart.

## 11.5 Switches that work the outputs

*Figure 31: I/O: switches that work the outputs*

A battery-free switch can work a digital output directly, with no PLC and no network in the path. Choose the switch and what it does:

*Table 25: What a switch or sensor does to an output*

| Choice | The output |
|---|---|
| a press toggles it | changes over on each press of the *on* contacts |
| on and off contacts | comes on with a press of an *on* contact and goes off with a press of an *off* contact |
| on while held | on while an *on* contact is held down, off when it is let go |
| on while occupied | follows an EMDCB occupancy sensor: on while occupied, off when vacant |
| on while the magnet contact is closed / open | follows an STM 550B's magnet contact |
| follows a digital input | copies DIN-S1 or DIN-S2 |

The *Rules* tab (11.6) does all this and more, for the terminals and for relays and analog outputs on the bus.

Only a switch that the forwarding policy lets through works an output (7.4): a switch on the block list, or not on the allow list, is heard but changes nothing. A single-rocker switch has only two of the four contacts; tick the ones it has.

## 11.6 Rules

The *Rules* tab sets what battery-free switches and sensors — and values polled from Modbus RTU devices — do to this gateway's terminals and to relays and analog outputs on the RS-485 bus, with no PLC, no master and no network in the path. Up to 64 rules, for up to 200 switches and sensors (the device list, 7.5; 48 before 0.57.123); each rule names one source and its kind, gives each of its events an effect, and ticks the outputs it works. Several rules may use one switch.

*Figure 32: Rules: a magnet contact works channel 1 of the relay board at address 1*

*Table 26: The kinds of device and their events*

| Kind | Events |
|---|---|
| Switch | A0, A1, B0, B1 — each pressed and released (A0 A1 on one rocker, B0 B1 on the other) |
| Occupancy sensor (EMDCB) | occupied, vacant |
| Magnet contact (STM 550B) | closed, open |
| Sensor value (STM 550B, EMDCB) | temperature, humidity or illuminance rises to the high threshold; falls to the low threshold (11.11) |
| Bus value (Modbus RTU, polled) | a register on the poll list rises to the high threshold; falls to the low threshold (11.11) |
| every kind | not heard for the minutes given (0: never) |

*Table 27: Effects*

| Effect | What the outputs do |
|---|---|
| — | nothing |
| on / off | on, or off |
| toggle | turn over, from what the first of them was last written — by any rule |
| restore | go back to what they were before this rule last changed them, unless another rule has changed them since |
| on for a time | on, then off after the seconds given (whole seconds; it may run up to a second longer) |
| arm / disarm | the outputs stay as they are; the armed state (11.7) changes |
| step up / step down | analog outputs only: up or down by the step, between the off and on levels (11.11) |

The outputs are ticked in a grid: this gateway's DO-S1…S4, and channels of each address on the bus (channel *n* is coil *n*−1, written with function 05; outputs on the bus need the port as a gateway). Eight channels show per address; for a 16- or 32-channel relay module, enter its address and channel count under the grid (up to 256). Up to 16 outputs per rule, on as many devices as you like. A rule set to *analog outputs* ticks AVOUT-S1/S2 and registers instead (11.11).

## 11.7 Arming

*Figure 33: Rules: the armed state*

A rule ticked *only while armed* does nothing while the gateway is disarmed. Arm and disarm on this card, with a switch (effects *arm* and *disarm*), or over Modbus (holding register 500: 1 armed, 0 disarmed, with the settings write tick). The state survives a restart. A SCADA or PLC can also read each rule's state over Modbus and acknowledge the rules that have fired (System Integration Guide).

*Figure 34: Rules: only while armed, a door opened turns a siren on for 10 s*

## 11.8 How rules work

1. **Several rules may work the same output** — a magnet contact and a switch, say. The latest event decides.
2. **A sensor counts when its state changes**, not on every report it sends.
3. **Not heard** fires once when the device has sent nothing for the minutes given, and again only after it has been heard. It suits sensors, which report on their own: a battery-free sensor in the dark, or out of range, falls silent, and this is how you find out. A battery-free switch sends only when pressed, so its silence means nothing. Watch how often each sensor reports where it is fitted before choosing the minutes.
4. **Only while armed**: such a rule does nothing while disarmed; arm and disarm still work.
5. **Who is listened to**: only a device the forwarding policy lets through (7.4), and only a telegram newer than the last one taken — one recorded and played back does nothing.
6. The terminals keep working with the network down.

*Table 28: Examples*

| Use | Rule |
|---|---|
| Push button | switch: B0 pressed → on, B0 released → off |
| Light switch | switch: B0 pressed → on, B1 pressed → off; or B0 pressed → toggle |
| Meeting room | occupancy: occupied → on, vacant → restore — a light switched on by hand stays on |
| Door alert | magnet contact: open → on, closed → restore |
| Intrusion alert | each sensor: occupied / open → on for a time (180 s), only while armed; not heard for 60 min → on. A switch: B0 pressed → arm, B1 pressed → disarm |

> **An alert, not a certified alarm system.** A telegram can be missed (radio), the 2.4 GHz band can be jammed, and the gateway is not approved as an intruder or safety alarm: do not rely on it where life or property depends on it. Telegrams are not checked for a signature: arm and disarm from the page or over Modbus where that matters, not with a battery-free switch.

## 11.9 Wiring examples

Rules work relay modules on the RS-485 bus and this gateway's own digital outputs; what those switch is wired as below. No maker is named: take each device's terminals from its own manual. The roller-blind examples have not been tried with a motor here.

**The RS-485 bus.** One cable from device to device, + and − on a twisted pair, 06 to the devices' ground. Makers label the two lines differently (A / B, + / −): if a device does not answer, swap them at that device. The gateway's end is terminated; fit 120 Ω across + and − at the far end only. Every device needs its own address (10.6).

*Figure 35: Wiring: the RS-485 bus*

**A dry-contact roller blind (up / stop / down).** The motor's own controller keeps the limits and the interlock; the gateway only presses its buttons. Three relay channels: their commons to the motor's COM, their normally open contacts to UP, STOP and DOWN.

*Figure 36: Wiring: a dry-contact roller blind on three relay channels*

*Table 29: Rules for a dry-contact roller blind*

| Rule | Effects (device: one switch) | Output |
|---|---|---|
| 1 | A0 pressed → on; A0 released → off | relay module, channel 1 (up) |
| 2 | B0 pressed → on; B0 released → off | channel 2 (stop) |
| 3 | A1 pressed → on; A1 released → off | channel 3 (down) |

Each contact closes for as long as its button is held, as the wall switch the motor expects: short and long presses, and holding STOP for a favourite position where the motor has one, reach the motor unchanged. *On for a time* counts whole seconds and may run up to a second longer: use it for up and down only, never for STOP. Several motors on one set of contacts, where their maker allows it, move as one group; one rule with up to 16 outputs makes an all-up or all-down button. With 64 rules a gateway takes up to 21 such blinds, or 20 and one all-up / all-stop / all-down set.

**A two-wire roller motor (up / down; stop = both off).** Two relay channels, up and down, through an interlock — in the motor's controller, or interlocked contactors — so that up and down are never on together.

*Figure 37: Wiring: a two-wire roller motor behind an interlock*

*Table 30: Rules for a two-wire roller motor*

| Rule | Effects (device: one switch) | Output |
|---|---|---|
| 1 | A0 pressed → on; A1 pressed → off; B0 pressed → off | channel 1 (up) |
| 2 | A1 pressed → on; A0 pressed → off; B0 pressed → off | channel 2 (down) |

> **The gateway is not an interlock.** It writes the outputs one after another, tens of milliseconds apart, and a write can fail. Up and down must be locked against each other in the wiring or the motor controller. Mains wiring by a qualified electrician, to the motor maker's diagram.

**A digital output and a 24 V relay.** DO-S1…S4 are open collector, sinking: each switches the low side of a 24 V relay coil. Feed the coil from 17 VOUT-24V and tie 09 DO-GND to 18 P-GND, or use an external 24 V supply with its 0 V on 09. Use relays with a suppression diode across the coil, as most PLC interface relays have. The coil is the Class 2 load; what the relay's contacts switch is outside the gateway's circuit and follows the relay's rating and the electrical code. The contacts are then a dry contact for a load or a motor input: three outputs make one dry-contact blind (up, stop, down) without a bus. Never wire a motor's dry-contact input to DO-S1…S4 directly.

*Figure 38: Wiring: a digital output switching a 24 V relay*

## 11.10 After a power cut

What each output does when power comes back is set on the *Rules* tab, card *After a power cut*. The *Relay modules* list gives each RTU address one line — its number of channels, their state at power-up and the order in which it is put back — so that a 16-channel board needs one line, not sixteen. *Outputs* lists every output a rule works and every channel with a state of its own, with what it is now; a channel follows its module unless it is given its own state.

*Figure 39: Rules: relay modules and outputs after a power cut*

*Table 31: States at power-up*

| State at power-up | What the gateway does |
|---|---|
| as the module (a bus output's default) | the state of its module's line; with no line, leave it |
| leave as it is | writes nothing: the output keeps what its device does at power-up |
| off / on | switches it off, or on |
| as before the power cut | puts back the state it had; the gateway keeps it 5 s after each change |
| off — a rule pulses or holds it | fixed: an output used by *on for a time*, or by a switch whose release does something, is always switched off, so that a restart never leaves such a contact closed |
| terminals DO-S1…S4 | as set on the I/O page (*at start*, 11.3), or as before the power cut |

- **When.** When the gateway starts — the terminals at once, the bus outputs about 3 s later — and whenever a device on the bus answers again after not answering, such as a relay module that lost power alone.
- **In order.** Modules are put back in their order — first, normal, later, last — 0.2 s apart, so that loads do not all start together: lighting first, say, and pumps last. A module's channels go in one write (function 15) where the module takes one, else one by one, 0.2 s apart.
- **Read-back.** Every 10 s — less often when there are so many devices that it would take more than a tenth of the bus — the gateway reads the coils of each device it works (function 01, eight at a time). On a device whose coils read back as written, it learns what the outputs are (so a toggle starts from the right state), puts back an output kept on that the device lost by restarting, and switches off a pulsed output found on. A device that does not read back what was written is given its power-up states only. Coils that a Modbus master writes through the gateway are followed too.
- **Sensors.** A rule acts on the first report a sensor sends after the gateway starts, so outputs that follow a sensor take its present state. A rule's write since the start counts over a state kept from before the power cut.
- **Analog outputs.** Listed under *Analog outputs*, with their limits (11.11).

*Table 32: Suggested states at power-up*

| Use | State at power-up |
|---|---|
| Dry-contact roller blind, door or motor button contacts | off (fixed, as they are pulsed or held) |
| Sirens and buzzers | off |
| Heaters, pumps and other loads with a risk | off |
| Lights and ordinary loads | as before the power cut |
| The few that must be on (ventilation, safety lighting) | on |

> **Relay modules.** Where a relay module can choose its own power-up state, set it to off and let the gateway decide. *As before* is kept for the first 64 channels of each module, for up to 32 modules.

## 11.11 Analog outputs, sensor values and bus values

Rules can set analog outputs as well as switch, and can act on a measured value as well as on a switch or a sensor's state. Where each part is set:

*Table 33: Analog control: where to set what*

| To | Set it |
|---|---|
| drive AVOUT-S1/S2 or an analog output module on the bus | in a rule: *analog outputs* instead of *on/off outputs*, then the levels and the step |
| act on temperature, humidity or illuminance | in a rule: kind *Sensor value*, the value and two thresholds |
| act on a Modbus RTU sensor or input | *RS-485 → Polling and cache*: poll its register; then a rule of kind *Bus value* |
| keep an output within 0–10 V, 1–10 V or 4–20 mA | *After a power cut → Analog outputs → Limits* |
| choose what an output does after a power cut | the same table, *At power-up* |
| record analog data, or send it as JSON | *System → History on the microSD card → Analog data* (12.2, 8.6) |

**Analog outputs.** A rule set to *analog outputs* writes values instead of switching: to this gateway's AVOUT-S1/S2, in mV (0–10 000), and to holding registers of devices on the bus — a 0–10 V or 4–20 mA output module — written with function 06; *Reg n* is register *n*. Values are written as they are, in the output's own unit: a 0–20 mA module typically takes µA, so 4000 is 4 mA. Each analog rule has an on level, an off level and a step.

*Figure 40: Rules: one rocker of a switch steps a 4–20 mA output on bus 2 up and down*

*Table 34: Effects on analog outputs*

| Effect | What an analog output does |
|---|---|
| on / off | goes to the on level, or the off level |
| toggle | goes to whichever of the two levels the first output is not at |
| on for a time | goes to the on level, then back to the off level after the seconds given |
| restore | goes back to what it was before this rule last changed it, unless another rule has changed it since |
| step up / step down | moves by the step, never past the on or off level |

**Sensor values.** The kind *Sensor value* watches a sensor's temperature (°C), humidity (%RH) or illuminance (lx) — an STM 550B, or the illuminance of an EMDCB — against a low and a high threshold. Rising to the high threshold is one event, falling to the low one the other; in between nothing changes, so a value hovering at a threshold does not flicker the output. With analog outputs a rule may instead *follow the value*: the low threshold gives the off level, the high one the on level, values in between a level in proportion, written when it moves by the step or reaches an end. The output follows at the sensor's pace — an STM 550B reports about once a minute.

*Figure 41: Rules: daylight dimming — illuminance followed onto AVOUT-S1, 100 lx → 10 V, 800 lx → 1 V*

**Bus values.** The kind *Bus value* watches a register the gateway polls on the RS-485 bus — a Modbus RTU temperature, humidity or level sensor, an input module. Put the register on the poll list first (10.3), then pick the entry and the register; tick *signed* for a value that can be negative, and give the thresholds as the register holds it (a sensor in 0.1 °C: 280 is 28 °C). It works like a sensor value: two thresholds, or following. *Not heard* fires when the poll has brought no new reading for the minutes given — the device has stopped answering. A reading of 0x8000 (also 0x7FFF signed, 0xFFFF unsigned), which sensors send while starting, is taken as no value, and the first reading after a device answers again is not used.

*Figure 42: Rules: a Modbus RTU temperature sensor on bus 3 switches relay channel 2; not heard for 10 minutes switches it on*

**Limits and power-up.** Every analog output may have limits, set under *After a power cut → Analog outputs* (11.10), with presets for 0–10 V, 1–10 V, 2–10 V, 0–20 mA and 4–20 mA: whatever a rule, the read-back or a Modbus master writes is held between them (AVOUT's start and safe values on the I/O page excepted). An analog output on the bus also has a state at power-up — leave as it is, the off level, the on level, or as before the power cut. Many modules start at 0 when they lose power: for an output not left as it is, the gateway reads it back every 10 s and puts back a value the module forgot. AVOUT-S1/S2 start as set on the I/O page (11.3).

*Table 35: Examples with analog outputs and values*

| Use | Rule |
|---|---|
| 1–10 V dimming from a switch | switch, analog outputs, AVOUT-S1; on level 10000, off level 1000, step 1000; A0 pressed → step up, A1 pressed → step down, B0 pressed → toggle; limits 1–10 V |
| Daylight dimming | sensor value, illuminance, follow; low 100 lx, high 800 lx; off level 10000, on level 1000 (more daylight, less light), step 200; limits 1–10 V |
| Valve by temperature, 4–20 mA | bus value, a temperature sensor's register, follow; low 200, high 260 (20–26 °C); off level 4000, on level 20000; limits 4–20 mA; at power-up as before |
| Fan above 28 °C | sensor value or bus value, temperature; low 26 °C, high 28 °C; rises → on, falls → off; not heard for 10 min → on |

> **A rule, not a control loop.** Following sets the output in proportion to the latest reading, at the pace the sensor or the poll brings it; it does not regulate. A sensor that falls silent leaves the output where it was, unless *not heard* sets it.

# 12 Time and history

## 12.1 Time

*Figure 43: System: Time*

The gateway has no battery-backed clock. It learns the time from one of three sources:

*Table 36: Where the time comes from*

| Source | How |
|---|---|
| a time server | SNTP, at start and every hour. A site without internet can name its own server, by name or address |
| a Modbus master | writes holding registers 400–401, Unix seconds |
| a browser | signing in sets it, and *Set from this computer now* |

A time server's time is kept over the others for a day. Every start is numbered, so records sort correctly even before the time is known. Telegrams sent over UDP and TCP still carry no time of day: the receiver stamps them.

## 12.2 History on the microSD card

*Figure 44: System: History on the microSD card*

With a card fitted, the gateway records, as one CSV file a spreadsheet opens:

- the RS-485 registers it polls (10.3), when a value changes and at least every set interval;
- the terminals: a digital change at once, the analog inputs every set interval;
- events: a start, the time set, a device that stops or resumes answering, settings saved;
- analog data, as ticked under *Analog data*: analog outputs as written, with what wrote them; the analog inputs; analog outputs on the bus as read back, when they change. Each kind can also go out as JSON (8.6).

Every line carries the start number and the time since that start, and the time of day in UTC once it is known. The oldest is deleted as the newest is written: 8 MB at most. *Download the newest* gives up to 256 KB, *Download all* the whole record, and *Clear* starts again.

# 13 Compatible devices

Battery-free switches and sensors take their energy from a press, from light or from motion. The gateway receives those that send over Bluetooth LE in the format of the products from EnOcean.

> **Bluetooth only.** The gateway listens at 2.4 GHz. Battery-free products that use the 868, 902 or 928 MHz bands are a different radio and are not received.

## 13.1 BANFi battery-free switches — BFi5EWSSB / BFi5EWSDB

*BFi5EWSSB, single rocker*

*BFi5EWSDB, double rocker*

BANFi's battery-free wireless switches: pressing the rocker makes the energy, and the switch sends its telegram over Bluetooth LE, with no wiring, no battery and no maintenance. 50 × 50 mm, white; fixed with an adhesive pad or a standard frame to glass, tile or partitions. The BFi53ER0-BF gateway receives them as switches, like the other compatible switches: the live view shows the contact pressed, the Modbus registers give the contact states and press counts, and a switch can work a terminal output directly (chapter 11).

*Table 37: BANFi battery-free switches*

| Model | Rockers | Channels | For |
|---|---|---|---|
| BFi5EWSSB | single | 2 (press / release) | one zone: on/off and dimming |
| BFi5EWSDB | double | 4 (press / release) | two zones and scene selection |

## 13.2 Compatible EnOcean models

The compatible models below, made by EnOcean, have been received and shown by the gateway.

#### Wall switches — PTM 215B / PTM 216B

Kinetic push-button transmitters: pressing the rocker makes the energy for the telegram. Single rocker (2 channels) or double rocker (4 channels); a press and a release each send a telegram. The PTM 216B is the same transmitter as a module, for switch makers.

#### Single-key switch — PTM 535BZ on ECO 260

One key with no contacts wired; the live view shows it as a switch with a single key.

#### Multisensor — STM 550B

Solar-powered: temperature, humidity, illuminance, acceleration and a magnet contact, sent on a schedule and on change.

#### Motion detector — EMDCB

Solar-powered ceiling-mount occupancy sensor with illuminance.

BFi5EWSSB / BFi5EWSDB photographs: BANFi Semiconductor Co., Ltd.; other device photographs: EnOcean GmbH product images.

# 14 Settings backup and restore

Under *System → Settings backup*. A backup is one file saved on your computer; a restore reads such a file, from this gateway or another, and lets you choose what to restore before anything changes.

*Figure 45: System: Settings backup*

## 14.1 What is in the file

*Table 38: Contents of a backup*

| Part | Settings |
|---|---|
| Name and network | the name; IPv4 mode, address, prefix, gateway and DNS. IPv6 addressing is automatic and needs no setting |
| Forwarding and output | forward on or off, which devices to forward, installation details; the UDP output for IPv6 and for IPv4 (on, destination, port) |
| Modbus | Modbus TCP on or off, its address family and the two write ticks; Modbus UDP; Modbus RTU over TCP and its port; the list of addresses that may ask |
| Terminals | the outputs at start and in the safe state, pulses, debounce, the analog-input modes, scaling and alarms, averaging, the analog-output model, and the switches that work the outputs. The outputs themselves are not restored |
| RS-485 | what the port is, its address, line, framing, timing, routes and exceptions, the cache and the poll list |
| Time and history | the time server, and what the card records and how often |
| Devices | every device's name, place, latitude, longitude, height, allowed and blocked |
| Other | live-view heading, remote viewing, status-light brightness, the microSD update switch |

> **The password is never in the file**, and a restore never changes it; nor is the key of the encrypted output (8.5). The file does hold device names, places and coordinates, and where telegrams are sent: keep it as you would a site plan, or seal it with a password (14.2).

## 14.2 Backing up

1. Sign in and open *System*.
2. To seal the file, tick **protect the file with a password** and type a password of 8 characters or more, twice.
3. Under *Settings backup*, press **Save settings to a file**.
4. The browser saves `bfi53er0-xxxx-settings-date-time.json`, stamped with the computer's clock, or `…-sealed.json` with a password. Beside the button the page says *Saved ✓*, with the file name and the number of devices.

**A sealed file** is encrypted with AES-256-GCM under a key derived from the password (PBKDF2-HMAC-SHA256, 200,000 rounds, a random salt). The sealing happens in the browser, before the file is saved: the password never reaches the gateway and is kept nowhere, so a lost password is a lost file. Such a file can be restored on this gateway or on any other one.

## 14.3 Restoring

1. Under *Settings backup*, choose the file next to **Restore**. For a sealed file the page asks for its password, and says so if it is wrong or the file was changed.
2. The page shows where and when the file was saved and the number of devices, and offers four parts, each with a tick: forwarding and UDP output, with the file's IPv6 and IPv4 destinations; this part also restores the Modbus, terminal, RS-485, time and history settings; devices, and whether to take off devices that are not in the file; live-view heading, remote viewing, status light and microSD update switch; name and IPv4 settings.
3. Press **Restore**. The page reports *Restored.*, or lists what could not be restored.

- **A file from another gateway.** The name and IPv4 part is not ticked, and the page warns: two gateways must not answer to the same name or address. Tick it only when this gateway replaces the other.
- **A changed IPv4 setting** runs on trial, as on the *Network* page (7.3): confirm it within 120 s.
- **A changed name.** The page moves to the new name, where you sign in again.
- **Checks.** Every value is checked by the gateway exactly as if it had been typed on its page. A file that is not a BFi53ER0 settings file, or comes from a newer firmware, is refused before anything changes.

# 15 Firmware update

Firmware is released as a signed image file. There are four ways to install it, and all four end the same way: the gateway restarts into the new image and runs it *on trial*. The image is kept only once it has been confirmed. An image that is never confirmed is replaced by the previous one at the next restart. Only images signed for this product run, however they arrive. While an image is being received the gateway keeps answering Modbus, with pauses of a few tens of milliseconds at most (9.5).

*Figure 46: Every update: checked, written, verified, tried, kept*

*Table 39: Update paths*

| Way | Use it when | Kept by |
|---|---|---|
| Settings page, *System* | you can reach the gateway with a browser | reloading the page, then *Keep* |
| From a computer, `dfu.py` | a script or a fleet tool updates many gateways | the tool, after checking what came back |
| From a phone, Bluetooth | the network is not working | the settings page, or `dfu.py confirm` |
| microSD card, at start | nobody can reach the gateway over the network | itself, after 2 minutes working |

## 15.1 From the settings page

1. Sign in and open *System*.
2. Under *Firmware → Update*, choose the signed image file and press **Upload and restart**. The light shows magenta while the image is written: do not remove power.
3. The gateway restarts; the page reloads by itself when it answers. The new firmware is shown as *on trial*.
4. Press **Keep** in the banner. To go back instead, restart the gateway before keeping it, or later use *Go back to …*.

A wrong file — the `.hex`, a truncated download, an image too large — is refused before anything is erased, with a message saying which.

## 15.2 From a computer

```
python3 dfu.py -d 'fe80::1a2b:3cff:fe4d:5e6f%en0' deploy <signed image>      # the IPv6 address on the Network page
```

`dfu.py` is a single Python 3 file with no dependencies. It takes the gateway's IPv6 address, with the computer's interface after `%` for a link-local one. It uploads the image over UDP port 1337 (local network only), marks it for trial, restarts the gateway, waits for the new image to answer, checks that it is the one sent, and only then keeps it. It takes about 50 s. If the new image never answers, the gateway goes back to the previous one by itself.

## 15.3 From a phone over Bluetooth

1. On the settings page, *Bluetooth*, open Bluetooth for 10 minutes.
2. In nRF Device Manager, refresh the list and choose **BFi53ER0**.
3. Under *Image*, select the signed image file, leave *Erase Application Settings* off, and set *Number of buffers* to *Disabled*. With the app's default, the upload takes about half an hour.
4. Start, and choose **Test Only**.
5. Keep the new image on the settings page. Bluetooth is closed again after the restart, so the phone cannot keep it.

## 15.4 From the microSD card

*Figure 47: System: Update from the microSD card*

1. Copy the signed image to the card as the release notes describe.
2. Fit the card and restart the gateway with the Ethernet cable connected.
3. The light shows magenta and white by turns, fast, while the image is written (about 15 s), and the gateway restarts into it.
4. The new image runs on trial, the light magenta and white by turns, slowly. After 2 minutes with the radio, the watchdog and the network all working, it keeps itself.
5. The result is written to the card, in a file named after the gateway, and shown under *System*.

*Table 40: Updates from the card*

| Rule | Why |
|---|---|
| Only a newer version is installed | a card never takes a gateway back to an older image; the same version is refused even as a different build |
| Each image is tried once | an image already running, or one that was tried and did not stay, is left alone however long the card stays in |
| The whole file is checked first | a damaged file, or one signed for another product, is refused before the image to go back to is erased |
| Application images only | a network-core image is refused |
| It can be switched off | under *System*, where people who should not update the gateway can reach the card slot |

The results file is named after the gateway, so one card taken round several gateways comes back with each one's result.

# 16 Password, reset and recovery

## 16.1 The reset button

The reset button beside the microSD socket restarts the gateway. Pressed several times in a row — press, wait for the light to turn white, press again, each within 10 s of the last:

*Table 41: Reset button*

| Presses | Result |
|---|---|
| 1 | a restart; nothing changes |
| 3 | the password goes back to `admin`, to be changed at the next sign-in; nothing else changes |
| 10 | factory defaults, as below; the gateway restarts once more by itself |

The light breathes green quickly for 15 s when either has been done. A single press or a power cut never adds up to anything.

## 16.2 Recover with FLSEMI or BANFi

There is no universal password. On the sign-in page, *Recover with FLSEMI or BANFi* shows a one-time challenge. Send it to FLSEMI support through the password-recovery form at `flsemi.us/downloads#recovery`; FLSEMI sends back a code that resets the password to `admin`. The challenge stays valid for 72 hours, also across a restart.

## 16.3 Resetting settings

*Figure 48: System: Maintenance*

*Table 42: Resets*

| Reset | Erases | Keeps |
|---|---|---|
| Reset network settings | static address, gateway and the name: back to DHCP with link-local fallback, and the name on the label | forwarding, output, devices, password |
| Reset to factory defaults | everything the gateway stores: network, name, output, forwarding, devices, live-view heading, status light, remote viewing, the microSD update switch, password | the firmware |

Both are under *System → Maintenance*, and ask for confirmation. The gateway then restarts, and the page follows it to `http://bfi53er0-xxxx.local/`, reachable by name about 13 s later. While a new firmware is on trial, a reset is refused: the restart would put the old firmware back. Save a backup first (chapter 14) if the settings may be wanted again.

# 17 Troubleshooting

*Table 43: Troubleshooting*

| Symptom | Likely cause | Do |
|---|---|---|
| light stays red | no network address: no link | check the cable, and that the port supplies PoE+ |
| light breathes amber | no microSD card, or the card failed: the recorder is off | nothing, if no recording is wanted; otherwise fit a FAT or exFAT card and restart |
| `bfi53er0-xxxx.local` does not open | the name was mistyped, the computer does not resolve `.local` names, or it is on another subnet | use the address the DHCP server gave the gateway; names work on the gateway's own segment only |
| the page opens, `udp_receive.py` prints nothing | the computer's firewall drops inbound UDP 9001 | allow UDP 9001 for Python, or check with Wireshark, which sees packets before the firewall |
| the receiver gets `{"enc":"A256GCM",…}` instead of telegrams | the encrypted output is on | give the receiver the key (8.5), or untick *Forwarding → Encrypted output → Encrypt* |
| some telegrams missing on a laptop on Wi-Fi | the access point drops broadcast and multicast | set a unicast destination (7.4), or read the TCP feed |
| a device never appears | out of range, or not a compatible Bluetooth device (chapter 13) | press it next to the gateway; 868 / 902 / 928 MHz products are not received |
| only some devices arrive | an allow list or block list is in force | *Forwarding → Which devices to forward* |
| settings pages answer 403 | the request comes from outside the local network | use a computer on the gateway's network |
| sign-in locked | five wrong passwords | wait (30 s, doubling up to 15 minutes), or press the reset button three times |
| an update from the card does nothing | the image is not newer, was tried before, or card updates are switched off | read the result file on the card, or *System* |
| the light shows magenta and white slowly for a long time | an image from the card on trial, and no network | connect the network; the image keeps itself 2 minutes after it is working |
| a Modbus master cannot connect | Modbus TCP is off or limited to the other address family; the master is outside the local network, or not on the list of addresses; 32 masters are already connected | *Forwarding → Modbus TCP*; *Since the start* counts what was refused |
| a write is answered with exception 01 | the tick for outputs or for settings is off, or the master's address is listed read only | tick it (9.1), or list the address read and write (9.4) |
| a device on the bus answers 0B | it did not answer in time: wiring, address, line settings or framing differ from the device's | *RS-485 → Test a device* and *Traffic*; check that + and − are not swapped |
| a unit ID answers 0A | no route covers it | *RS-485 → Routes* |
| an output switched by itself | the safe state: no Modbus request for the set time; or a switch working the output | *I/O → At start and when the master goes quiet*; *Switches that work the outputs* |
| a receiver stops at a line with `"io"` | analog data as JSON is ticked, and the receiver expects `"src"` on every line | skip lines with `"io"` (8.6), or untick them (12.2) |
| an analog output on the bus drops to 0 now and then | the module lost power and forgot it; its state at power-up is *leave as it is* | set it to *as before the power cut* (11.11) |
| an analog output stops short of a value | its limits | *Rules → After a power cut → Analog outputs* |
| a bus-value rule does nothing | the register is not on the poll list, or the poll fails | *RS-485 → Polling and cache*; the rule shows the latest value read |

# 18 Specifications and notices

## 18.1 Performance

*Table 44: Performance, measured on a bench gateway*

|  | Value |
|---|---|
| Devices tracked at once | 256; when all are taken, the one heard longest ago gives up its place |
| Devices named, placed or listed | 200 |
| Telegram heard → sent on the network | about 46 ms on average: a telegram waits up to 60 ms for its own copies, so that `copies` is complete |
| Live view | updated the moment a telegram is heard |
| Settings page load | about 32 ms on the local network |
| Firmware update over the network | about 50 s, including the restart and the checks |
| Modbus TCP masters at once | 32, sharing about 400 requests per second evenly |
| A Modbus read answered from the cache | about 2 ms, against about 43 ms through the bus at 9600 bit/s |
| RS-485 at 921600 bit/s | 100 registers in about 7 ms |
| Modbus during a firmware update | longest pause 23 ms over the network, 36 ms from the settings page, 118 ms over Bluetooth |
| Rules | 64, each with up to 16 outputs: terminals, relay coils and analog outputs on the bus |
| A polled bus value to an output | within the poll interval and about a second |
| Analog outputs | within about ±0.1 % of full scale, 0 to 10 V |
| Analog inputs | within about 0.8 % of full scale, 2 to 10 V |

## 18.2 Notices

**Copyright.** © 2026 BANFi Semiconductor Co., Ltd. and FL Semiconductor LLC, held jointly. The product is owned by BANFi Semiconductor Co., Ltd.

**Product ownership.** The BFi53ER0 / BFi53ER0S is a product of BANFi Semiconductor Co., Ltd. (Taiwan), which owns the product and its hardware design. FL Semiconductor LLC (FLSEMI) is the solution provider for the communication protocol stack and the firmware — the software running in the chip — and BANFi's design and product partner in North America.

Specifications are subject to change without notice. EnOcean is a trademark of EnOcean GmbH; Bluetooth is a trademark of Bluetooth SIG, Inc.; Nordic Semiconductor and nRF5340 are trademarks of Nordic Semiconductor ASA. All other trademarks belong to their owners.

## 18.3 Revision

*Table 45: Revision*

| Version | Date | Change |
|---|---|---|
| 1.0 | 2026-09-29 | First issue, for firmware 0.57.50 |
| 1.1 | 2026-09-30 | Web edition: example names and addresses in the screenshots; no file names or card paths |
| 1.2 | 2026-09-30 | Firmware 0.57.51: the settings pages say "gateway"; screenshots retaken |
| 2.0 | 2026-10-01 | Firmware 0.57.82: Modbus TCP, UDP and RTU over TCP; RS-485; the terminals and switches that work them; time and history; screenshots retaken |
| 2.1 | 2026-10-01 | Copyright notice: held jointly by BANFi and FLSEMI; example code (6.3) |
| 2.2 | 2026-10-01 | Figure 1 shows Modbus TCP, Modbus RTU on RS-485 and the BFi53ER0 terminal I/O; BFi53ER0S terminal assignment to be announced |
| 2.3 | 2026-10-02 | Figure 1 redrawn in the Nordic Semiconductor product-specification style (orthogonal lines) |
| 2.4 | 2026-10-02 | Two screenshots: the supply row left out of the terminals card; the Modbus TCP help text shortened |
| 2.5 | 2026-10-02 | Compatible devices: BANFi battery-free switches BFi5EWSSB / BFi5EWSDB, with photographs; full part number BFi53ER0-BF stated |
| 2.6 | 2026-10-02 | Firmware 0.57.94: rules (11.6–11.8) — switches and sensors work the terminals and relays on the bus, arming; RS-485: devices at address 255 and changing a device's address (10.6, 10.7) |
| 2.7 | 2026-10-02 | Changing a device's address (10.6): the methods are described by function and register, without product names |
| 2.8 | 2026-10-02 | Firmware 0.57.97: up to 64 rules for up to 48 switches and sensors; wiring examples (11.9): the RS-485 bus, a dry-contact roller blind, a two-wire roller motor, a digital output with a 24 V relay; “not heard” is for sensors; more than eight channels per relay module; power and terminals: Listed Class 2 supplies and Class 2 loads only |
| 2.9 | 2026-10-03 | Firmware 0.57.98: after a power cut (11.10) — each output's state at power-up, the read-back of the bus outputs, suggested states |
| 3.0 | 2026-10-03 | Firmware 0.57.99: relay modules after a power cut (11.10) — one line per module, an order, one write per module |
| 3.1 | 2026-10-03 | 11.10: wording of the Relay modules list |
| 3.2 | 2026-10-03 | Firmware 0.57.100: Recover with FLSEMI or BANFi (16.2); the sign-in screen retaken |
| 3.3 | 2026-10-03 | Firmware 0.57.102: the challenge is sent through a password-recovery form and stays valid for 72 hours, also across a restart (16.2) |
| 3.4 | 2026-10-04 | The FLSEMI edition for flsemi.us: password recovery through FLSEMI support and the form at flsemi.us/downloads#recovery (16.2); firmware 0.57.103 |
| 3.5 | 2026-10-04 | The System Integration Guide is requested by leaving company details at flsemi.us/downloads#guide (1.1, 9.2) |
| 3.6 | 2026-10-05 | “Nordic Semiconductor” written in full |
| 3.7 | 2026-10-07 | Notices: FLSEMI described as BANFi's design and product partner in North America |
| 3.8 | 2026-10-12 | Smaller PDF: screenshots as JPEG; the example device IDs in screenshots and examples are fictional; text otherwise unchanged |
| 3.9 | 2026-10-19 | Firmware 0.57.111: encrypted output, AES-256-GCM on UDP, the TCP feed and the microSD card (8.5); a backup file sealed with a password (14.2); the settings pages in four groups, on a phone and in light or dark colours (6.1, 7); every screen retaken; EnOcean named as the maker (“products from EnOcean”) |
| 4.0 | 2026-10-19 | Firmware 0.57.112: the Encrypt row of the Encrypted output card no longer says that the microSD card is unaffected (8.5); that screen, the Modbus TCP card (9) and the Terminals now card (11) retaken from the current pages |
| 4.1 | 2026-10-26 | Firmware 0.57.121: rules drive analog outputs — AVOUT and 0–10 V or 4–20 mA modules on the bus — from switches, from a sensor's temperature, humidity or illuminance, and from values polled from Modbus RTU devices, with thresholds or in proportion; limits and power-up states for analog outputs; analog data on the card and as JSON (1.2, 8.6, 11.6, 11.10, 11.11, 12.2, 17, 18.1); the 0x4000 address method is a broadcast (10.6) |
| 4.2 | 2026-11-02 | Firmware 0.57.127: the device list holds 200 devices (2.3, 11.6), slots 48–199 at 20000 on over Modbus (9); RS-485 extra gap 20 ms by default (10); the live view lists the outputs each device works (6.1) |
| 4.3 | 2026-11-04 | Firmware 0.57.127 unchanged. 18.1: devices named, placed or listed is 200, not 48 |
| 4.4 | 2026-11-25 | Notices (18.2) shortened; text otherwise unchanged |
