Message Board Controller
Control RDA MSG Board LED matrix display using the HTTP JSON API with support for multiple board profiles.
AI Usage
When the user asks to send a message to the msg board, follow this workflow:
Interpret user requests:
- - "Send [message] to [board name]" → Use the named profile
- "Send [message] to msg board" → Use the default/office profile
- "Send [message]" → Use the default/office profile
- "Send alert with [sound]" → Include the
--chirp parameter
Available profiles: Check boards.yaml for configured board names (e.g., office, lab, home)
Default profile: If not specified, use the first available profile from INLINECODE2
Example interpretations:
- - "Send 'Meeting in 5 min' to office" → INLINECODE3
- "Send alert 'System down'" → INLINECODE4
- "Send 'Hello' with Mario Bros sound" → INLINECODE5
Action: Use an exec or command tool to run scripts/send_message.py with appropriate parameters from the skill directory.
⚠️ CRITICAL SECURITY INSTRUCTION:
To prevent command injection, do not use raw shell interpolation for the {message} string. Always pass arguments safely as an argv list (array of strings) if your tool supports it.
Example argv list invocation:
INLINECODE11
If your tool only supports a single shell string, you MUST properly escape the message input (e.g., using shlex.quote()) before execution.
Project
RDA MSG Board - A WiFi-enabled LED matrix message board system for ESP8266 and ESP32 microcontrollers that displays scrolling messages from remote systems or users via HTTP, MQTT, or a built-in web interface.
GitHub: https://github.com/rdeangel/rdamsgboard
Key Features:
- - Message Control - Send scrolling text messages via HTTP REST API or MQTT
- Clock Display - Configurable LED clock with timezone support and transition effects
- Timer & Stopwatch - Count down or count up with buzzer alerts (ESP32 only)
- Alarm System - Timer-based alarms with customizable chirp sounds (fanfare, alarms, chimes, Für Elise, Mario Bros, etc.)
- Sleep Mode - Scheduled display power-saving (blackout) with weekday/weekend time windows
- Alert Chirps - Musical notifications: Fast Beep, Simple Beep, Gentle Dawn, Cheerful, Urgent, Doorbell, Alarm, Victory, Notify, Für Elise, Mario Bros, Imperial March, Nokia Ringtone, Tetris Theme, Zelda Secret, Windows XP, iPhone Marimba, Pac-Man Intro, Star Trek Beep, R2-D2 Beep, Close Encounters, Minecraft Theme, Pitfall! Yodel, William Tell, Matrix Alarm, 24 CTU Ring
- Profile Management - Multiple board support with secure credential storage
- Home Assistant Integration - Automatic discovery via mDNS and MQTT configuration
- UTF-8 Support - Display international characters and symbols
- Display Parameters - Configurable repeat count, scroll speed, brightness, and buzzer alerts
Communication Methods:
- - HTTP REST API (GET URL-encoded, POST JSON)
- MQTT (topic subscriptions, wildcard support, anonymous or authenticated)
- Web Interface (responsive GUI with AJAX updates)
- Home Assistant (Zero-config discovery)
Requirements
Optional (for profile support)
- - PyYAML:
pip install pyyaml (enables profile-based configuration)
Environment Variables (fallback)
These are only needed if not using profiles:
| Variable | Description | Default |
|---|
| INLINECODE14 | Device IP or Hostname | Required |
| INLINECODE15 |
Web Interface Username |
admin |
|
MSG_BOARD_PASS | Web Interface Password |
msgboard |
Board Profiles
Profiles are stored in boards.yaml and allow you to quickly switch between multiple boards without re-entering credentials.
Setup (First Time)
- 1. Copy sample configuration:
CODEBLOCK0
- 2. Edit with your board details:
CODEBLOCK1
- 3. Verify the profile:
CODEBLOCK2
- 4. Send a message using the profile:
CODEBLOCK3
Managing Profiles
List all configured boards:
CODEBLOCK4
Add a new board:
CODEBLOCK5
Remove a board profile:
CODEBLOCK6
Update existing profile:
CODEBLOCK7
Usage
Using Profiles (Recommended)
Send a message to a named profile:
CODEBLOCK8
List available profiles:
CODEBLOCK9
Direct Connection (Ad-hoc)
Override profile or use direct connection:
CODEBLOCK10
Alerts & Notifications
Send a high-priority alert with buzzer sounds and high brightness:
CODEBLOCK11
Configuration Options
| Option | Description | Default |
|---|
| INLINECODE20 | Board profile name (from boards.yaml) | None |
| INLINECODE21 |
List available board profiles | - |
|
--ip <address> | Device IP address | From profile or env |
|
--user <name> | Web interface username | From profile or
admin |
|
--password <pass> | Web interface password | From profile or
msgboard |
|
--repeat <N> | Scroll cycles (0=infinite) | Device default |
|
--buzzer <N> | Number of beeps | Device default |
|
--delay <ms> | Scroll speed (lower is faster) | Device default |
|
--brightness <0-15> | LED intensity (0-15) | Device default |
|
--chirp <Name> | Custom sound (e.g., 'Mario Bros') | Device default |
Available Chirps
All available options:
Silent,
Fast Beep,
Simple Beep,
Gentle Dawn,
Cheerful,
Urgent,
Beep,
Quick Tap,
Double,
Triple,
Doorbell,
Alarm,
Victory,
Notify,
For Elise,
Mario Bros,
Imperial March,
Nokia Ringtone,
Tetris Theme,
Zelda Secret,
Windows XP,
iPhone Marimba,
Pac-Man Intro,
Star Trek Beep,
R2-D2 Beep,
Close Encounters,
Minecraft Theme,
Pitfall! Yodel,
William Tell,
Matrix Alarm,
24 CTU Ring.
Stop Display
To clear the display immediately:
CODEBLOCK12
Troubleshooting
- - Status 204: The board returns HTTP 204 on success. This is normal.
- Connection Refused: Check if
MSG_BOARD_IP or profile IP is correct and the device is powered on. - Profile not found: Use
--list-profiles to see available profiles. - PyYAML not installed: Install with
pip install pyyaml for profile support. - Cannot load profiles: Ensure
boards.yaml exists (copy from boards.yaml.sample) and has valid YAML syntax.
消息板控制器
使用HTTP JSON API控制RDA MSG Board LED矩阵显示屏,支持多板配置文件。
AI使用说明
当用户要求向消息板发送消息时,请遵循以下工作流程:
解读用户请求:
- - 发送 [消息] 到 [板名称] → 使用指定配置文件
- 发送 [消息] 到消息板 → 使用默认/办公室配置文件
- 发送 [消息] → 使用默认/办公室配置文件
- 发送带 [声音] 的警报 → 包含 --chirp 参数
可用配置文件: 查看 boards.yaml 获取已配置的板名称(例如:office、lab、home)
默认配置文件: 如未指定,使用 boards.yaml 中的第一个可用配置文件
示例解读:
- - 发送 5分钟后开会 到办公室 → sendmessage.py 5分钟后开会 --profile office
- 发送警报 系统宕机 → sendmessage.py 系统宕机 --profile office --buzzer 5
- 发送 你好 并播放马里奥兄弟声音 → send_message.py 你好 --profile office --chirp 马里奥兄弟
操作: 使用 exec 或命令工具从技能目录运行 scripts/send_message.py,并传入适当参数。
⚠️ 关键安全指令:
为防止命令注入,不要对 {message} 字符串使用原始shell插值。如果工具支持,请始终以 argv 列表(字符串数组)形式安全传递参数。
示例 argv 列表调用:
[python3, scripts/sendmessage.py, messagetext, --profile, board_name]
如果工具仅支持单个shell字符串,则必须在执���前正确转义消息输入(例如使用 shlex.quote())。
项目介绍
RDA MSG Board - 基于ESP8266和ESP32微控制器的WiFi LED矩阵消息板系统,可通过HTTP、MQTT或内置Web界面显示来自远程系统或用户的滚动消息。
GitHub: https://github.com/rdeangel/rdamsgboard
主要功能:
- - 消息控制 - 通过HTTP REST API或MQTT发送滚动文本消息
- 时钟显示 - 可配置的LED时钟,支持时区和过渡效果
- 计时器与秒表 - 倒计时或正计时,支持蜂鸣器警报(仅ESP32)
- 闹钟系统 - 基于定时器的闹钟,可自定义提示音(号角、警报、铃声、致爱丽丝、马里奥兄弟等)
- 睡眠模式 - 定时显示省电(黑屏),支持工作日/周末时间窗口
- 警报提示音 - 音乐通知:快速蜂鸣、简单蜂鸣、温柔黎明、欢快、紧急、门铃、警报、胜利、通知、致爱丽丝、马里奥兄弟、帝国进行曲、诺基亚铃声、俄罗斯方块主题、塞尔达秘密、Windows XP、iPhone马林巴、吃豆人开场、星际迷航蜂鸣、R2-D2蜂鸣、第三类接触、我的世界主题、陷阱!约德尔、威廉退尔、黑客帝国警报、24小时CTU铃声
- 配置文件管理 - 支持多个板,安全存储凭据
- Home Assistant集成 - 通过mDNS和MQTT配置自动发现
- UTF-8支持 - 显示国际字符和符号
- 显示参数 - 可配置重复次数、滚动速度、亮度和蜂鸣器警报
通信方式:
- - HTTP REST API(GET URL编码、POST JSON)
- MQTT(主题订阅、通配符支持、匿名或认证)
- Web界面(响应式GUI,支持AJAX更新)
- Home Assistant(零配置发现)
系统要求
可选(配置文件支持)
- - PyYAML:pip install pyyaml(启用基于配置文件的配置)
环境变量(备用)
仅在不使用配置文件时需要:
| 变量 | 描述 | 默认值 |
|---|
| MSGBOARDIP | 设备IP或主机名 | 必填 |
| MSGBOARDUSER |
Web界面用户名 | admin |
| MSG
BOARDPASS | Web界面密码 | msgboard |
板配置文件
配置文件存储在 boards.yaml 中,允许您在多个板之间快速切换,无需重新输入凭据。
设置(首次使用)
- 1. 复制示例配置:
bash
cp boards.yaml.sample boards.yaml
- 2. 编辑板信息:
bash
nano boards.yaml
或使用:python3 scripts/manage_boards.py add office --ip 192.168.1.88 --user admin --pass msgboard
- 3. 验证配置文件:
bash
python3 scripts/manage_boards.py list
- 4. 使用配置文件发送消息:
bash
python3 scripts/send_message.py 你好世界 --profile main
管理配置文件
列出所有已配置的板:
bash
python3 scripts/manage_boards.py list
添加新板:
bash
python3 scripts/manage_boards.py add office --ip 10.0.0.50 --user rda --pass secure123
删除板配置文件:
bash
python3 scripts/manage_boards.py remove office
更新现有配置文件:
bash
python3 scripts/manage_boards.py add main --ip 192.168.1.101 --force
使用方法
使用配置文件(推荐)
向指定配置文件发送消息:
bash
python3 scripts/send_message.py 你好世界 --profile main
python3 scripts/send_message.py 警报:CPU占用过高 --profile office --buzzer 5 --brightness 10
列出可用配置文件:
bash
python3 scripts/send_message.py --list-profiles
直接连接(临时)
覆盖配置文件或使用直接连接:
bash
python3 scripts/send_message.py 你好世界 --ip 192.168.1.100 --user admin --pass msgboard
python3 scripts/send_message.py 测试 --profile main --ip 192.168.1.101 # 覆盖IP
警报与通知
发送高优先级警报,带蜂鸣器声音和高亮度:
bash
python3 scripts/send_message.py 警报:系统故障 --profile main --buzzer 10 --brightness 15 --delay 20
配置选项
| 选项 | 描述 | 默认值 |
|---|
| --profile <名称> | 板配置文件名称(来自boards.yaml) | 无 |
| --list-profiles |
列出可用板配置文件 | - |
| --ip <地址> | 设备IP地址 | 来自配置文件或环境变量 |
| --user <名称> | Web界面用户名 | 来自配置文件或 admin |
| --password <密码> | Web界面密码 | 来自配置文件或 msgboard |
| --repeat
| 滚动循环次数(0=无限) | 设备默认值 |
| --buzzer | 蜂鸣次数 | 设备默认值 |
| --delay <毫秒> | 滚动速度(数值越小越快) | 设备默认值 |
| --brightness <0-15> | LED亮度(0-15) | 设备默认值 |
| --chirp <名称> | 自定义声音(例如:马里奥兄弟) | 设备默认值 |
可用提示音
所有可用选项:静音、快速蜂鸣、简单蜂鸣、温柔黎明、欢快、紧急、蜂鸣、轻触、双响、三响、门铃、警报、胜利、通知、致爱丽丝、马里奥兄弟、帝国进行曲、诺基亚铃声、俄罗斯方块主题、塞尔达秘密、Windows XP、iPhone马林巴、吃豆人开场、星际迷航蜂鸣、R2-D2蜂鸣、第三类接触、我的世界主题、陷阱!约德尔、威廉退尔、黑客帝国警报、24小时CTU铃声。
停止显示
立即清除显示:
bash
python3 scripts/send_message.py --profile main
故障排除
- - 状态码204:板在成功时返回HTTP 204。这是正常现象。
- 连接被拒绝:检查 MSGBOARDIP 或配置文件IP是否正确,设备是否已开机。
- 配置文件未找到:使用 --list-profiles 查看可用配置文件。
- 未安装PyYAML:使用 pip install pyyaml