Skip to content

LittleDrogon/COM-SERIAL_MONITOR

 
 

Repository files navigation

Direct Mode Bridge Mode

Repository: https://github.com/BH4ME/COM-SERIAL_MONITOR.git Version: v1.0.0

SerialMonitor

SerialMonitor is a modern Qt-based serial port debugging and monitoring tool for Windows. It supports both direct and bridge (com0com) modes, bilingual UI (English/Chinese), auto-reconnect, data export, and virtual port management. Ideal for embedded development, protocol analysis, and advanced serial communication tasks.


🚩 Key Features

  • 🎛️ Direct Mode: Communicate directly with a physical serial port for standard debugging.
  • 🔗 Bridge Monitor Mode: Use com0com virtual port pairs to transparently bridge and monitor data between host (upper computer), SerialMonitor, and device (lower computer).
  • 🔍 Real-time Monitoring: View, filter, and export serial data in HEX/ASCII with timestamps.
  • 🌏 Bilingual UI: One-click switch between English and Chinese.
  • 🔄 Auto port detection & reconnect: Hot-plug support and robust error recovery.
  • 📦 Virtual port management: One-click cleanup of virtual port cache.
  • 🖥️ Modern Qt GUI: High-DPI support, user-friendly interface.

🖼️ Serial Port Topology: Direct vs Bridge (com0com) Mode

Direct Mode

Host PC communicates directly with the device (lower computer) via a physical serial port

flowchart LR
    PC["💻 Host PC\n(Upper Computer Software)"]
    COM6["🔌 COM6\n(Physical Serial Port)"]
    Device["🖲️ Device\n(Lower Computer/Target Device)"]
    PC <--> COM6 <--> Device
    classDef node fill:#f9f,stroke:#333,stroke-width:1px;
    class PC,COM6,Device node;
Loading

Bridge Monitor Mode

Host PC connects to a virtual serial port, SerialMonitor bridges the physical and virtual ports, and the device connects to the physical port, enabling three-way monitoring

flowchart LR
    PC["💻 Host PC\n(Upper Computer Software)"]
    VCOM["🌀 COM14\n(Virtual Serial Port)"]
    SerialMonitor["🟦 SerialMonitor\n(This Program)"]
    PCOM["🔌 COM6\n(Physical Serial Port)"]
    Device["🖲️ Device\n(Lower Computer/Target Device)"]
    PC <--> VCOM
    VCOM <--> SerialMonitor
    SerialMonitor <--> PCOM
    PCOM <--> Device
    classDef node fill:#f9f,stroke:#333,stroke-width:1px;
    class PC,VCOM,SerialMonitor,PCOM,Device node;
Loading
  • Host PC: Upper computer software (e.g., serial debugging assistant, protocol analysis tool, etc.)
  • SerialMonitor: This program, bridges/monitors data flow
  • Device: Lower computer/target device (e.g., MCU, embedded board, etc.)
  • COM6: Physical serial port
  • COM14: Virtual serial port (created by com0com)

Installation & Usage

1. Download & Install

Windows Users

  1. Download the Release Installer
    Go to the Releases page and download the latest SerialMonitor_Setup.exe.
  2. Install com0com driver (required for Bridge Monitor mode)
  3. Run SerialMonitor
    • After installation, launch from the desktop shortcut or run SerialMonitor.exe.

Linux/macOS Users

  • Currently only Windows is supported. More platforms coming soon.

2. How to Use

Direct Mode

  1. Select a physical serial port (e.g., COM6), set parameters, and click "Open Port".
  2. Choose "Direct Mode" to communicate directly with your device.

Bridge Monitor Mode

  1. Install and configure a com0com virtual port pair (e.g., COM14 <-> COM15).
  2. Select the physical port (e.g., COM6), click "Open Port", and choose "Bridge Monitor Mode".
  3. Host software must connect to the virtual port (e.g., COM14), device connects to the physical port (e.g., COM6).
  4. This program will transparently forward and monitor all data, ideal for protocol analysis and sniffing.

Other Features

  • Switch language: Use the Language/语言 menu to select English or 中文.
  • Data export: Click "Export TXT" or "Export MD".
  • Clean virtual ports: Click "Clean Virtual Ports".
  • Auto-reconnect: The program will try to reconnect automatically after disconnection.

Build from Source

Dependencies

  • Qt 6.x (6.5+ recommended; Qt5 supported with manual adaptation)
  • CMake 3.14+
  • Ninja or Make
  • com0com driver (for Bridge Monitor mode, Windows only)

Build Steps

  1. Clone the repository
    git clone https://github.com/BH4ME/COM-SERIAL_MONITOR.git
    cd SerialMonitor
  2. Configure and build
    mkdir build
    cd build
    cmake -G Ninja ..
    ninja
  3. Run
    ./SerialMonitor

Main Source Structure

  • src/mainwindow.cpp / mainwindow.h: Main UI and core logic
  • src/utils.cpp / utils.h: Virtual port management, com0com integration
  • src/translations/: Translation files
  • setup_com_monitor.iss: Inno Setup installer script
  • com0com/: com0com driver and related tools

FAQ

Q: Bridge Monitor mode doesn't work?
A: Make sure com0com is installed and run this program as administrator. Host software must connect to the virtual port (e.g., COM14), device connects to the physical port (e.g., COM6). Q: Language switch doesn't work?
A: Ensure zh_CN.qm and en_US.qm exist in the translations directory and rebuild the project. Q: How to create custom virtual port pairs?
A: Use the com0com setup tool to create new virtual port pairs, then select the corresponding ports in this program.


Contributing & License

Pull requests, issues, and suggestions are welcome!
This project is licensed under the MIT License. See LICENSE for details.


Acknowledgements


串口监听助手(SerialMonitor)

SerialMonitor 是一个基于 Qt 的现代串口调试与监听工具,支持 Windows 平台。支持直连和桥接(com0com)两种模式,中英文界面,自动重连,数据导出,虚拟串口管理等。

主要功能

  • 直连模式:直接与物理串口通信,适合常规串口调试。
  • 桥接监听模式:通过 com0com 虚拟串口对,实现“上位机-监听-设备”三方透明桥接,支持数据监控与转发。
  • 自动识别串口,支持热插拔、断线重连。
  • 中英文界面切换
  • 数据导出:支持 TXT/Markdown 格式导出通信数据。
  • 虚拟串口自动管理
  • 美观易用的 Qt 界面

串口关系示意图(直连与桥接监听)

直连模式

flowchart LR
    Host[上位机软件]
    COM6[COM6(物理串口)]
    Device[设备]
    Host <--> COM6 <--> Device
Loading

桥接监听模式

flowchart LR
    Host[上位机软件]
    VPort[COM14(虚拟串口)]
    SerialMonitor[SerialMonitor]
    PPort[COM6(物理串口)]
    Device[设备]
    Host <--> VPort <--> SerialMonitor <--> PPort <--> Device
Loading

安装与使用

1. 下载与安装

Windows 用户

  1. 前往 Releases 页面,下载最新的 SerialMonitor_Setup.exe
  2. 安装包会自动检测并提示安装 com0com。你也可以手动安装:com0com 官方下载
  3. 安装完成后,直接运行桌面快捷方式或 SerialMonitor.exe

Linux/macOS 用户

  • 目前仅支持 Windows,后续将支持更多平台。

2. 使用方法

直连模式

  1. 选择物理串口(如 COM6),设置参数,点击“打开串口”。
  2. 选择“直连模式”,即可直接与设备通信。

桥接监听模式

  1. 安装并配置好 com0com 虚拟串口对(如 COM14 <-> COM15)。
  2. 选择物理串口(如 COM6),点击“打开串口”,选择“桥接监听模式”。
  3. 上位机软件请连接虚拟串口(如 COM14),设备连接物理串口(如 COM6)。
  4. 本程序会自动转发并监听所有数据流,适合协议分析、抓包等场景。

其它功能

  • 切换语言:菜单栏 Language/语言,选择 English 或 中文。
  • 数据导出:点击“Export TXT”或“Export MD”。
  • 清理虚拟串口:点击“Clean Virtual Ports”。
  • 自动重连:断线后自动尝试重连。

开发与源码编译

依赖环境

  • Qt 6.x(推荐 6.5 及以上,支持 Qt5 但需手动适配)
  • CMake 3.14+
  • Ninja 或 Make
  • Windows 平台需安装 com0com 驱动(桥接监听模式)

编译步骤

  1. 克隆仓库
    git clone https://github.com/BH4ME/COM-SERIAL_MONITOR.git
    cd SerialMonitor
  2. 配置并编译
    mkdir build
    cd build
    cmake -G Ninja ..
    ninja
  3. 运行
    ./SerialMonitor

主要源码结构

  • src/mainwindow.cpp / mainwindow.h:主界面与核心逻辑
  • src/utils.cpp / utils.h:虚拟串口管理、com0com集成
  • src/translations/:多语言翻译文件
  • setup_com_monitor.iss:Inno Setup 安装脚本
  • com0com/:com0com 驱动及相关工具

常见问题 FAQ

Q: 桥接监听模式无法使用?
A: 请确保已正确安装 com0com,并以管理员身份运行本程序。上位机软件必须连接虚拟串口(如 COM14),设备连接物理串口(如 COM6)。 Q: 切换语言无效?
A: 请确保 translations 目录下有 zh_CN.qmen_US.qm,并重新构建项目。 Q: 如何自定义虚拟串口对?
A: 使用 com0com 的 setup 工具创建新的虚拟串口对,并在本程序中选择对应端口。


贡献与许可

欢迎提交 Issue、PR 或建议!
本项目采用 MIT License,详见 LICENSE


致谢

About

Serial port monitor for Windows. Supports direct and bridge (com0com) modes, bilingual UI, auto-reconnect, data export, and virtual port management. Solves debugging and protocol analysis pain points for embedded/serial development.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • C++ 87.4%
  • CMake 6.9%
  • Makefile 4.4%
  • C 1.1%
  • Qt Script 0.1%
  • Inno Setup 0.1%