Modbus RTU to MQTT gateway on Tibbo
The gateway polls devices on an RS-485 line over Modbus RTU and publishes their values to an MQTT broker. Energy meters, thermostats, drives and other Modbus devices show up in SCADA, Home Assistant, Node-RED or a cloud service without a PC on site. Setpoints can be written back over MQTT.
Everything here comes from recipe 01: a TIDE project and an AppBlocks variant under the MIT license, tested on Scancode's hardware.
In short
- Hardware: Tibbo TPP2(G2) board in a TPB2 enclosure, four Tibbit modules (RS-485 port, terminal block, power supply, power connector), a 12 V adapter.
- Interfaces: RS-485 as Modbus RTU master, Ethernet with MQTT 3.1.1.
- Firmware: Tibbo BASIC in TIDE; site settings live in two files. Or the AppBlocks variant with settings in a web console.
- No PCB design: modules plug into sockets, the enclosure is built around them.
Bill of materials and layout

The layout and power budget were checked by the tps_check script from the Tibbo skills for AI agents: about 205 mA on the 5 V line against 700 mA available from the power supply module, 29% load. Four M sockets stay free for inputs, relays or more RS-485 ports.
In the Scancode catalog (Russia) the Tibbo items cost $308.45 including VAT as of 5 December 2026; the 12 V adapter and the DMK1000 DIN-rail kit are extra. Outside Russia and the CIS, check prices with Tibbo or a local distributor.
- 1 × TPP2(G2) board
- 1 × TPB2 enclosure
- 1 × Tibbit #05, RS-485 port, socket S1
- 1 × Tibbit #21, 4-terminal block for the RS-485 line, socket S2
- 1 × Tibbit #09, 5 V supply from 9-18 V, socket S11
- 1 × Tibbit #18, power jack and 2 terminals, socket S12
- 1 × 12 V DC adapter, 0.5 A or more
Why TPP2(G2)
It is the cheapest board that does the job. CPU and memory are the same as on TPP3(G2); it just has fewer sockets. TPP3(G2) with the TPB3 enclosure costs more and only makes sense if the gateway needs more modules than TPP2 can hold.
Setting up the poll list
Everything site-specific sits in two files. config.tbh holds the network (DHCP or static), broker address and login, topic root, RS-485 speed and parity, and poll period. config.tbs holds the list of points, one line per value: device address, Modbus function, register, data type, divider, point name, and whether MQTT may write to it.
Function 3 reads holding registers, function 4 input registers. Registers are numbered from zero, so 40001 in a device manual becomes 0. Types: U16 and S16 take one register, U32, S32 and F32 take two, high word first. A divider of 10 turns 235 into 23.5. Writing from MQTT works for U16 and S16 with function 3.
MQTT topics
The controller ID in topics is its MAC address in hex, for example 002477517F17.
- tibbo/<id>/<point name>: controller to broker, the value, for example 23.5
- tibbo/<id>/<point name>/set: broker to controller, a new value to write (function 6)
- tibbo/<id>/status: controller to broker, for example online ok=6 err=0 after every poll cycle
Loading the firmware
Install TIDE from tibbo.com, open the project, edit config.tbh and config.tbs and build it. Pick the controller in Device Explorer and run: the firmware loads and starts in debug mode, and the Output window shows the IP address, the broker connection and poll errors. For production, switch the build to Release and load it again.
Troubleshooting
- Every point fails with error 255: A and B swapped, wrong baud rate or parity, or a wrong device address. Device makers label A and B differently.
- Error 254: noise on the line. Use shielded twisted pair and terminate both ends. Tibbit #05 revision B already has a 120 Ω terminator.
- Error 2 or 3: the device does not know that register or function. Check its register map.
- The green LED keeps blinking: no broker. Check the address, port 1883, login and password.
- Odd F32 values: the device sends the low word first. Try the neighbouring register or add a type with reversed word order.
The AppBlocks variant
The recipe also ships the official Tibbo ModbusMQTTGateway example moved to TiOS and the same TPP2(G2) kit. Devices and registers are set in the device web console. It reads one 16-bit register per point, publishes only (no writes from MQTT), polls every 5 s and publishes every 30 s by default. For float values, 32-bit counters and setpoint writes, use the TIDE variant.
Questions
Can I do the same without programming?
How many devices can it poll?
Can it use TLS to the broker?
What is the license?
Where to buy Tibbo
In Russia and the CIS - Scancode, the official Tibbo distributor (iot@scancode.ru, prices on tibbo.ru). In other countries - Tibbo Technology and its local distributors.
See also
An AI-built device on Tibbo
The same gateway from the task to firmware, with every AI step checked by Tibbo tools.
Open →ComparisonSerial to Ethernet: Tibbo DS110x or Moxa NPort
When a programmable converter is enough.
Open →CodeRecipe 01 on GitHub
TIDE project, AppBlocks variant, BOM and layout. MIT license.
Open →DocsTibbit #05: RS-485 port
Terminals, terminator and control lines.
Open →