websockify-msp-js: Remote Access to Betaflight Flight Controllers over WebSocket

websockify-msp-js: Remote Access to Betaflight Flight Controllers over WebSocket

An introduction to websockify-msp-js, a lightweight MSP proxy that bridges Betaflight MSP to WebSocket, enabling Betaflight Configurator, Node.js, Python, and ROS 2 applications to communicate with flight controllers over the network.

websockify-msp-js: Remote Access to Betaflight Flight Controllers over WebSocket

In most cases, Betaflight Configurator communicates with a flight controller through a USB serial connection. However, when the flight controller is deployed inside a Raspberry Pi companion computer, a robotics platform, or any environment where direct USB access is inconvenient, remote configuration and debugging become much more challenging.

To solve this problem, we developed websockify-msp-js, a lightweight MSP proxy that bridges Betaflight’s MultiWii Serial Protocol (MSP) to WebSocket. This allows both Betaflight Configurator and any WebSocket-capable application to communicate with a flight controller over the network.


Why an MSP Proxy?

MSP is one of the core communication protocols used by Betaflight for exchanging data between the flight controller and host applications. Traditionally, MSP is transported over USB or UART, which means most existing tools assume the flight controller is connected locally.

The Betaflight community previously explored bridging MSP over WebSocket using websockify, and a Node.js implementation called websockify-js was also available. However, these projects have seen little maintenance in recent years. We therefore implemented a dedicated MSP proxy designed specifically for modern Node.js applications while remaining easy to integrate and maintain.

Design Goals

  • Full compatibility with Betaflight Configurator
  • Support for both MSP v1 and MSP v2
  • Native deployment on Raspberry Pi
  • Support for both UART and USB serial devices
  • MSP packet filtering
  • Built-in Web UI for real-time debugging

Architecture

[Betaflight Configurator] <-> [WebSocket] <-> [MSP Proxy on Raspberry Pi] <-> [UART/USB] <-> [TFC1]

The MSP proxy simply bridges two transport layers without modifying any MSP packets. From the perspective of Betaflight Configurator, it behaves just like a standard serial connection.

GitHub Repository:

https://github.com/t2t-io/websockify-msp-js

Getting Started

Installation

$ git clone https://github.com/t2t-io/websockify-msp-js.git
$ cd websockify-msp-js
$ npm install

Launching the Proxy

$ node index.js -s /dev/ttyAMA0 -c msp
$ node index.js -s "/dev/ttyUSB0?baudrate=230400" -c msp

Connect Betaflight Configurator to:

ws://<RPi_IP>:6761

Configuring Betaflight Configurator

Step 1 Enable Manual Connection Mode.

Figure 1. Enable Manual Connection Mode from the Options page.

Step 2 Select Manual Selection, then enter the Raspberry Pi IP address and port 6761.

Figure 2. Connecting to the MSP Proxy through WebSocket.

Once connected, Betaflight Configurator behaves almost exactly the same as when connected through a local USB serial port.

Figure 3. The MSP Proxy console showing filtered MSP traffic in real time.


MSP Packet Filtering and Debugging

# Inclusion Filter
$ node index.js -s /dev/ttyAMA0 -c msp -f "MSP_STATUS,MSP_ATTITUDE,MSP_ANALOG"

# Exclusion Filter
$ node index.js -s /dev/ttyAMA0 -c msp -f "@MSP_ATTITUDE,@MSP_RAW_IMU"

Enable the built-in Web UI:

$ node index.js -s /dev/ttyAMA0 -c msp -w

Figure 4. Inspect MSP traffic and adjust packet filters dynamically through the built-in Web UI.


Typical Use Cases

Besides Betaflight Configurator, websockify-msp-js is also well suited for:

  • Raspberry Pi companion computers
  • Headless Betaflight configuration
  • Node.js and Python automation
  • ROS 2 mission planning
  • Remote ground stations
  • Web-based dashboards

Conclusion

websockify-msp-js extends MSP beyond traditional serial transports by exposing it through a standard WebSocket interface.

Existing MSP tools can communicate with flight controllers without modification, while new applications can leverage any WebSocket library to build remote management, autonomous flight, ROS 2 integration, cloud connectivity, or automated testing solutions.

Questions? Requests? Suggestions?

We are looking forward to hearing from you!

Are you looking for
Consulting Services,
Support Plans or
Training & Workshops?