I would like to propose a small room server enhancement: provide a clean helper method that allows the room server to create a room post as the room server itself.
The proposed helper is:
MyMesh::addSystemPost(const char* postData)
This gives simple_room_server a clean local/server-side posting path without pretending the message came from a connected client and without duplicating the existing room post storage/push logic.
The helper keeps system/local posts on the existing room post path:
- posts use the room server’s own identity
- post storage is handled through the existing
storePost() logic
- post indexing, timestamping, and client sync behavior remain consistent with normal room posts
As part of this change, I also exposed the helper through a console command:
This makes the feature easy to test manually from the serial console.
I also created a small disabled-by-default GPIO contact demo to show the specific use case I was working on:
- equipment box opened
- dry contact closes
- room server posts a message into the chat
For example:
This could also be useful for similar simple local status events:
- tamper switch
- gate/contact switch
- equipment enclosure opened
Known limitation: this follows the current room server timestamp behavior. The room server clock needs to be synchronized before local/system posts are created. Otherwise, the post may be timestamped in the past and may not appear as expected in the client room view.
I published my current implementation here for review: https://github.com/Che177/MeshCore/tree/feature/room-server-system-posts
In that branch, the GPIO contact example and debug flags are disabled by default / commented out in the PlatformIO configuration.
The commented PlatformIO example is currently included in the LilyGo T-LoRa V2.1-1.6 room server environment:
variants/lilygo_tlora_v2_1/platformio.ini
[env:LilyGo_TLora_V2_1_1_6_room_server]
The GPIO part is only intended as a small demo/use-case implementation, not as a general sensor framework, protocol change, or app change.
I would like to propose a small room server enhancement: provide a clean helper method that allows the room server to create a room post as the room server itself.
The proposed helper is:
This gives
simple_room_servera clean local/server-side posting path without pretending the message came from a connected client and without duplicating the existing room post storage/push logic.The helper keeps system/local posts on the existing room post path:
storePost()logicAs part of this change, I also exposed the helper through a console command:
This makes the feature easy to test manually from the serial console.
I also created a small disabled-by-default GPIO contact demo to show the specific use case I was working on:
For example:
This could also be useful for similar simple local status events:
Known limitation: this follows the current room server timestamp behavior. The room server clock needs to be synchronized before local/system posts are created. Otherwise, the post may be timestamped in the past and may not appear as expected in the client room view.
I published my current implementation here for review: https://github.com/Che177/MeshCore/tree/feature/room-server-system-posts
In that branch, the GPIO contact example and debug flags are disabled by default / commented out in the PlatformIO configuration.
The commented PlatformIO example is currently included in the LilyGo T-LoRa V2.1-1.6 room server environment:
variants/lilygo_tlora_v2_1/platformio.ini
[env:LilyGo_TLora_V2_1_1_6_room_server]
The GPIO part is only intended as a small demo/use-case implementation, not as a general sensor framework, protocol change, or app change.