BFi53ER0 Battery-Free Bluetooth Gateway -- example code
=======================================================

Three small programs for a first integration, in Python 3 with the standard
library only (no packages to install):

  udp_receive.py      receive every telegram over UDP port 9001, IPv6 and IPv4
  tcp_feed.py         read the TCP feed on port 9000, with catch-up from the
                      gateway's microSD card; reconnects by itself
  modbus_identify.py  a first Modbus TCP read: device identification and the
                      register map and firmware versions

Run them on a computer on the gateway's network:

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

With encrypted output switched on in the settings page (Forwarding ->
Encrypted output, firmware 0.57.105 and later), give the key to the
receivers: python3 udp_receive.py --key HEX, python3 tcp_feed.py GATEWAY
--key HEX. Only this option needs a package: pip install cryptography.

With analog data ticked to go out as JSON (System -> History on the microSD
card -> Analog data, firmware 0.57.117 and later), lines with "io" instead
of "src" arrive as well; both receivers print them. A program of your own
that reads "src" from every line must skip or handle them.

bfi53er0-xxxx is the name printed on the gateway's label; an IP address works
too. Modbus TCP is off until it is turned on in the settings page
(Forwarding -> Modbus TCP).

Documents: the Quick Start, the Hardware Specification and the setup / user
manual download from the website, each also as a Markdown (.md) file that AI
tools can read directly. The System Integration Guide (the JSON payload
decoding and the complete Modbus register map) is provided on request, as PDF
and Markdown.

(c) 2026 BANFi Semiconductor Co., Ltd. and FL Semiconductor LLC. You may use,
copy and modify these examples to integrate with BFi53ER0 products.
