There has been some discussion about adding chatrooms to Meshtastic. That could be done within the app only, or on mesh protocol level.
If the rooms are created and maintained strictly within the app, the workflow could be something like this:
- open the app and connect to the mesh
- add a room with a long name and a short name
- send the room information to all nodes within the mesh, as a broadcast, as a normal text message
- the recipient app parses the information and adds the room #1 to be visible for all users
- when a user send messages within the room, the message starts with the room number (#1), and is broadcasted to all members as a normal text
- the recipient app parses the text and shows the message within the room #1
If rooms are handled strictly within the app, as described, every message would always be broadcasted (flooded) to all nodes, as we can not route one message to selected couple of recipients. This could jam the mesh. Optionally, the user could invite only certain users to the room, and the room information could be sent only to room members (as separate unicast messages). This would work for only a couple of users, as messages within the room populates separate unicast packets for every user on the room. This could also eventually jam the mesh.
If the rooms would be supported within the mesh routing protocol, the workflow could be something like this:
- open the app and connect to the mesh
- add a room with a long name and a short name
- broadcast the room information to all nodes within the mesh as a defined room -type message (add or remove)
- all nodes do add this room to their database (to avoid rooms with the same name later), and the nodes then add a room specific ID (virtual node ID) they listens messages for
- the nodes joined the room send a ACK of the added room with its room ID, to notify the mesh (to update the routing tables of other mesh nodes)
- the node then advertise the room for only the invited users app
- the app shows the room for users invited to the room
- when a user sends text within the room, the node adds the room ID as the packet recipient
- the node unicast the packet to the mesh, for only the room members (as one routed packet)
- the room member nodes listen to the room packets and forwards it to the app
This would minimize the need to do broadcast on the whole mesh, or send separate unicast packets for every room member. Unfortunately, linking room IDs and node IDs would need a) ACKs sent from nodes within the room (to notify the mesh nodes to update their node databases), b) advertising room membership in some another way, or c) not being sure the messages are routed correctly.
There are two unsolved interesting parts. First, how to unicast one packet to many recipients (add all recipients to the header separately, or add a message type indicating room #). Second, how to update the node databases of nodes registered to a certain room (using room specific node IDs when a node is sending, or advertising and adding a linkage of the room # to the node databases).
Optionally, there could be a possibility to crypt messages per room. This could be done with a separate PSK shared by room members. The app could crypt and decrypt messages with a separate key depending on the room.
To add, there should be a way to send unencrypted messages within the mesh, to be sure all mesh participants can receive emergency messages. The emergency messages should be highlighted the way they are not missed. I believe this was already mentioned somewhere.
Please comment and correct me freely.