← How-Tos
flipper-zero 2 days ago ◑ 4 views ◯ 5 min read

Flipper Zero as a Passive RS-485/Modbus Bus Sniffer: GPIO UART Wiring and Protocol Logging

flipper zerors-485modbusmodbus rtugpiouartindustrial protocolmax485ufbt

The Flipper Zero's GPIO header exposes a UART that's already a familiar tool for hardware hacking — reading debug consoles, talking to modules, dumping flash over a serial bootloader. Less obvious is that the same UART, paired with a cheap RS-485 transceiver module, turns the Flipper into a portable passive sniffer for industrial RS-485 and Modbus RTU buses: the kind of wiring that runs between a VFD and its controller, a PLC and its I/O modules, or any of the industrial sensors covered elsewhere on this site. Being able to clip onto an existing RS-485 pair and see the actual Modbus traffic flowing across it, without needing a laptop and a USB-to-RS485 adapter, is a genuinely useful field tool when you're trying to understand what a piece of secondhand industrial gear is actually saying to its controller.

What This Does and Doesn't Do

This build makes the Flipper a passive listener on an RS-485 bus: it reads the differential signal, decodes UART framing, and logs raw bytes (and, with the app extension covered below, parses Modbus RTU frame structure) to the Flipper's screen and storage. It does not transmit onto the bus, and getting that part right matters — RS-485 is a multi-drop differential bus, and an improperly configured transceiver driving its output pins onto a live bus can collide with a legitimate device's transmission and disrupt the very system you're trying to observe. Keep the transceiver's driver-enable pin permanently disabled (tied to receive-only) for this application.

Hardware: Wiring an RS-485 Transceiver to Flipper GPIO

An RS-485 transceiver module (built around a chip like the MAX485 or SN65HVD75) converts the bus's differential A/B signal pair into a single-ended UART-level signal the Flipper's GPIO UART can read directly.

Transceiver pinFlipper GPIO pinNotes
RO (receiver output)RX (GPIO 14 / pin 13 on the Flipper header, check your firmware's pin map)This is the UART data the Flipper reads
DE / RE (driver/receiver enable)Tie RE low (always enabled) and DE low (always disabled)Keeps the transceiver permanently in listen-only mode — this is what makes the tap passive
VCC3V3 or 5V per module specConfirm your transceiver module's logic level matches the Flipper's 3.3V GPIO before connecting RO directly
GNDGNDCommon ground with the Flipper; do not assume the bus's ground is at the same potential as your test setup without checking
A / BBus terminalsClip onto the existing RS-485 pair; polarity matters, and swapping A/B typically just inverts logic but some transceivers behave oddly — verify with a known-good signal first

Capturing Raw UART Data

Out of the box, the Flipper's built-in GPIO/UART tools (and the general-purpose "USB-UART Bridge" or GPIO apps depending on firmware) can pass the received serial stream through to a connected computer over USB, effectively turning the Flipper plus transceiver into a USB-to-RS485 read-only adapter you can feed into any serial terminal or Modbus analysis tool on a laptop. This alone is useful: no laptop-side RS-485 adapter needed, just the Flipper and a cheap transceiver board in your pocket.

Decoding Modbus RTU Framing On-Device

Modbus RTU frames follow a defined structure — a slave address byte, a function code, a data payload, and a 16-bit CRC — separated by a minimum silent interval (3.5 character times) that marks frame boundaries. A custom Flipper application (built with ufbt, the unofficial Flipper build tool, against the firmware's GPIO/UART APIs) can:

  1. Buffer incoming bytes from the UART peripheral.
  2. Detect frame boundaries using the inter-byte silence timing rather than a fixed delimiter, since Modbus RTU has no start/stop byte.
  3. Validate the CRC-16 (Modbus uses a specific polynomial, 0xA001 reversed) to confirm a captured frame is actually a valid Modbus frame and not a mid-transmission garbage capture.
  4. Parse the slave address and function code to show a human-readable summary on the Flipper's screen — read holding registers, write single coil, and so on are the most common function codes you'll see on a typical industrial bus.
  5. Log parsed frames to the SD card for later review, which is often more useful in the field than trying to read fast-scrolling traffic on the small screen in real time.

This is a genuinely approachable first custom Flipper app if you've wanted to get into firmware development for the device: the logic is straightforward serial parsing rather than anything exotic, and you get an immediately useful tool out of it.

Practical Uses

Safety and Practical Notes

Paired with the CAN bus and general GPIO hardware-hacking capability the Flipper already has, a passive RS-485/Modbus tap rounds out the device as a genuinely useful portable tool for understanding the industrial protocols that show up constantly in secondhand CNC, machine-control, and automation gear.