Bot Etiquette¶
MeshCore is a public, shared space. Airtime capacity - the ability for any one physical area to support simultaneous broadcasts of messages - is a fixed amount. You can't add more pipes or buy more bandwidth when it gets clogged, you can only send fewer messages. So don't waste this shared resource. When too many messages are flying about, they will get dropped, people won't get the messages they expect, while their devices will have their Rx Log fill up with packets for channels and information irrelevant to them.
By default every message sent that isn't a DM is broadcast AS FAR AS THE MESH CAN POSSIBLY REPEAT IT. Even if it is in a private channel, that encrypted packet can travel up to 64 repeaters away. With stable links to Scotland, Wales, England, and beyond, that means we are all subject to a lot more noise on the network.
At this time there is no way to block a channel from being repeated, the best option is to ensure all our repeaters have been configured with the correct regions, and then we can scope our automated messages accordingly.
To put simply: If you want to operate a bot, you must configure it properly so it scopes replies so they at most set to ioi for all of Ireland, or if your bot is to perform regional specific functions (like your weather), configure to your local / home region.
It doesn't matter if it is posting to a private channel, a private channel is private in that everyone on MeshCore who sees the message can't read it unless they know the channels private key
Some examples:
To use the MeshMapper app that lets us see the coverage of our repeaters, it can send pings to the channel #wardriving. The only people who care about this are the folks doing mapping on the island, we don't want ask repeaters no on the island to repeat the messages, so have those messages scoped to ioi. When the mesh grows and gets more users, we will have to fine tune the regions and scope MeshMapper to the province regions (so if you're mapping Ulster, your packets are scoped to bhd, etc).
There are test bots, useful for getting a quick "can you hear me" response and see what route the message took. These all live in #test and the bot Zoidberg doesn't need to reply to messages from 8 repeaters away - that's from someone not on the island, and since the response is part of the test, it should be as accurate as possible. The Bot Zoidberg scopes responses to ioi and has set it's devices packet size to 3 Bytes, capping the number of hops to 16 - while also providing the most accurate metadata about the mesh. Now sending a message in test and getting a response from Zoidberg means not only is there a clear path between you and it, all the repeaters are up to date and support the Island of Ireland's regions properly.
Meshcore-Bot Settings¶
For Meshcore-Bot, the suggested minimum setting changes to make (or change back in the case of some defaults) in config.ini are:
[Bot]
# this is default
advert_interval_hours = 0
# this is a default
startup_advert = false
[Channels]
flood_scope = #ioi
If using the dev branch of meshcore-bot, now that this PR has been merged, you can add the following to your [Channels] section to limit the maximum hops a message can have or else it will be ignored. This prevents the bot from responding to people who likely won't ever see the resposne:
MeshCore CLI¶
To set the scope, use the scope <region> option, which can be included inline with the message if firing this from a script:
# This example uses a WiFi companion
meshcli -t 10.10.10.10 scope ioi chan 1 "testing a scoped message"
To set the companion to use multibyte paths, this is a one time command of set path_hash_mode 2, requires the companion is on firmware 1.14+ and repeaters on 1.14+ (it does not require the repeaters to have a hash_mode set, they will repeat a message of any byte length once they have the latest firmware):