Skip to content

room_server: add room.post command for server-originated posts - #2688

Merged
ripplebiz merged 2 commits into
meshcore-dev:devfrom
Che177:feature/room-server-system-posts
Jul 30, 2026
Merged

room_server: add room.post command for server-originated posts#2688
ripplebiz merged 2 commits into
meshcore-dev:devfrom
Che177:feature/room-server-system-posts

Conversation

@Che177

@Che177 Che177 commented Jun 5, 2026

Copy link
Copy Markdown

Based on #2686.

Summary

This PR adds support for room-server-originated posts to simple_room_server.

It introduces:

MyMesh::addSystemPost(const char* postData)

and exposes it through the serial console command:

room.post <message>

Motivation

The room server currently stores posts received from clients, but it has no simple API for creating a post using its own identity.

This change provides a reusable path for local room-server code to publish messages without duplicating the existing post storage and notification logic.

Implementation

This PR:

  • adds MyMesh::addSystemPost(const char* postData)
  • stores system posts using the room server's own identity
  • refactors the existing post logic into a shared storePost() method
  • preserves the existing timestamp, cyclic queue, push scheduling, and synchronization behavior
  • adds the room.post <message> serial console command
  • rejects empty messages with ERR empty message
  • introduces no protocol changes or new dependencies

Usage

From the room server's serial console:

room.post Equipment box opened

Successful commands return:

OK

Testing

Built successfully with:

pio run -e LilyGo_TLora_V2_1_1_6_room_server

Scope

This PR only adds the system-post helper and the room.post command. It does not include GPIO handling, sensor examples, or board-specific configuration.

@Che177
Che177 force-pushed the feature/room-server-system-posts branch from 435e984 to fd26f7c Compare June 9, 2026 06:25
@Che177
Che177 force-pushed the feature/room-server-system-posts branch from 440409f to 41b9645 Compare July 28, 2026 02:33
@Che177 Che177 changed the title room_server: add system post helper for local events room_server: add room.post command for server-originated posts Jul 28, 2026
@Che177
Che177 force-pushed the feature/room-server-system-posts branch from 41b9645 to 3a9f19c Compare July 28, 2026 02:59
Comment thread examples/simple_room_server/MyMesh.cpp Outdated
Comment thread examples/simple_room_server/MyMesh.cpp Outdated
@Che177

Che177 commented Jul 29, 2026

Copy link
Copy Markdown
Author

Updated in 5a04e06. I removed the dedicated ENABLE_ROOM_POST_DEBUG guards and replaced all room.post Serial logging with the existing MESH_DEBUG_PRINTLN macro. I also verified the Tbeam_SX1262_room_server build both normally and with MESH_DEBUG enabled. Thanks for the review!

@liamcottle
liamcottle marked this pull request as ready for review July 29, 2026 13:29
@ripplebiz
ripplebiz merged commit db23280 into meshcore-dev:dev Jul 30, 2026
15 checks passed
hermes-gadget added a commit to gadgethd/MeshCore-MQTT that referenced this pull request Jul 30, 2026
Upstream dev: 449f0b5..db23280 (22 commits)
- PR meshcore-dev#2688: room_server system posts (3a9f19c, 5a04e06, db23280)
- PR meshcore-dev#3004: preserve UTF-8 advert names (79dc1de, 57ddada)
- PR meshcore-dev#3060: fix mesh-debug-active (d7f378b, b797ca1)
- PR meshcore-dev#3063: unify IRQ timeout (a5c323c, a3732e1, 79eb7f5, a7426de, 6e39cff)
- PR meshcore-dev#3062: fix IRQ clear (20f55a4, 9f73fbf)
- PR meshcore-dev#3049: ethernet refactor (5de857f, b4143a4, e672679, 203fd4e, 834ad72, 279ac78)
- USB companion flag requirement (e7f2c71)
- Bluetooth toggle on UI tiny (dd778e2)

Conflicts resolved:
- variants/mesh_pocket/platformio.ini: USB companion AUTO_OFF_MILLIS + ENABLE_USB_INTERFACE

Clean auto-merge (no conflicts) in all MQTT files — guard pattern held.
MQTT additions preserved.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants