2021-04-27 14:08:43 -07:00
---
2022-03-08 23:10:41 -08:00
id: store-and-forward-module
2021-04-27 14:08:43 -07:00
title: Store and Forward Settings
sidebar_label: Store and Forward
---
2022-03-08 23:10:41 -08:00
2021-05-05 09:18:44 -07:00
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
2022-03-18 05:53:08 -07:00
import PluginModule from '@site/docs/_blocks/_plugin_module.mdx';
2021-05-05 09:18:44 -07:00
2022-02-11 12:23:54 -08:00
:::info
Currently only available for ESP32 based devices with external PSRAM. Requires the device to be set as a router.
2022-04-08 07:47:32 -07:00
**Don't enable Store and Forward Module on multiple [routers](/docs/settings/router).**
2022-02-11 12:23:54 -08:00
:::
2021-04-27 14:08:43 -07:00
## Overview
2021-05-03 13:18:22 -07:00
:::caution
2022-01-27 12:55:41 -08:00
This is a work in progress and is partially available. Stability is not guaranteed.
2021-05-03 13:18:22 -07:00
:::
2021-04-27 14:08:43 -07:00
2022-03-30 19:13:30 -07:00
<PluginModule name="store_forward_module" rename="store_forward_plugin" />
2022-03-18 05:53:08 -07:00
2022-03-08 23:10:41 -08:00
The Store Forward Module is an implementation of a Store and Forward system to enable resilient messaging in the event that a client device is disconnected from the main network.
2021-05-03 13:18:22 -07:00
2022-01-02 22:53:45 -08:00
Because of the increased network traffic for this overhead, it's not advised to use this if you are duty cycle limited for your airtime usage nor is it advised to use this for SF12 (Long Range / Slow).
2021-04-27 14:08:43 -07:00
2022-01-28 10:11:19 -08:00
:::tip
2022-03-08 23:10:41 -08:00
Once module settings are changed, a **reset** is required for them to take effect.
2022-01-27 20:32:18 -08:00
:::
2021-04-27 14:08:43 -07:00
## Settings
2022-03-08 23:10:41 -08:00
| Setting | Acceptable Values | Default |
| :----------------------------------------: | :---------------: | :-----: |
| store_forward_module_enabled | `true`, `false` | `false` |
| store_forward_module_heartbeat | `true`, `false` | `false` |
| store_forward_module_history_return_max | `integer` | `0` |
| store_forward_module_history_return_window | `integer` | `0` |
| store_forward_module_records | `integer` | `0` |
2021-05-03 13:18:22 -07:00
2022-03-08 23:10:41 -08:00
### store_forward_module_enabled
2021-05-03 13:18:22 -07:00
2022-03-08 23:10:41 -08:00
Enables the module.
2021-05-03 13:18:22 -07:00
2022-02-01 17:58:26 -08:00
<Tabs
2022-03-08 23:10:41 -08:00
groupId="settings"
defaultValue="cli"
values={[
{label: 'CLI', value: 'cli'},
{label: 'Android', value: 'android'},
{label: 'iOS', value: 'iOS'},
{label: 'Web', value: 'web'},
]}>
<TabItem value="cli">
2022-04-01 06:34:49 -07:00
```shell title="Enable the module"
2022-03-08 23:10:41 -08:00
meshtastic --set store_forward_module_enabled true
```
2022-04-01 06:34:49 -07:00
```shell title="Disable the module"
2022-03-08 23:10:41 -08:00
meshtastic --set store_forward_module_enabled false
```
2022-02-01 17:58:26 -08:00
</TabItem>
<TabItem value="android">
:::info
Configuring this setting is not yet available for the selected platform. If this is incorrect please update the documentation for this page.
:::
</TabItem>
<TabItem value="iOS">
:::info
Configuring this setting is not yet available for the selected platform. If this is incorrect please update the documentation for this page.
:::
</TabItem>
<TabItem value="web">
:::info
Configuring this setting is not yet available for the selected platform. If this is incorrect please update the documentation for this page.
:::
</TabItem>
</Tabs>
2022-03-08 23:10:41 -08:00
### store_forward_module_heartbeat
2022-01-26 15:24:41 -08:00
2022-02-11 12:23:54 -08:00
The Store & Forward Router sends a periodic message onto the network. This allows connected devices to know that a router is in range and listening to received messages. A client like Android, iOS, or Web can (if supported) indicate to the user whether a store and forward router is available.
2022-01-26 15:24:41 -08:00
2022-02-01 17:58:26 -08:00
<Tabs
2022-03-08 23:10:41 -08:00
groupId="settings"
defaultValue="cli"
values={[
{label: 'CLI', value: 'cli'},
{label: 'Android', value: 'android'},
{label: 'iOS', value: 'iOS'},
{label: 'Web', value: 'web'},
]}>
<TabItem value="cli">
2022-04-01 06:34:49 -07:00
```shell title="Set store_forward_module_heartbeat to default"
2022-03-08 23:10:41 -08:00
meshtastic --set store_forward_module_heartbeat 0
```
2022-02-01 17:58:26 -08:00
</TabItem>
<TabItem value="android">
:::info
Configuring this setting is not yet available for the selected platform. If this is incorrect please update the documentation for this page.
:::
</TabItem>
<TabItem value="iOS">
:::info
Configuring this setting is not yet available for the selected platform. If this is incorrect please update the documentation for this page.
:::
</TabItem>
<TabItem value="web">
:::info
Configuring this setting is not yet available for the selected platform. If this is incorrect please update the documentation for this page.
:::
</TabItem>
</Tabs>
2022-03-08 23:10:41 -08:00
### store_forward_module_history_return_max
2022-01-26 15:25:07 -08:00
2022-02-11 12:23:54 -08:00
Sets the maximum number of messages to return to a client device.
2022-01-26 15:25:07 -08:00
2022-02-01 17:58:26 -08:00
<Tabs
2022-03-08 23:10:41 -08:00
groupId="settings"
defaultValue="cli"
values={[
{label: 'CLI', value: 'cli'},
{label: 'Android', value: 'android'},
{label: 'iOS', value: 'iOS'},
{label: 'Web', value: 'web'},
]}>
<TabItem value="cli">
2022-04-01 06:34:49 -07:00
```shell title="Set store_forward_module_history_return_max to default"
2022-03-08 23:10:41 -08:00
meshtastic --set store_forward_module_history_return_max 0
```
2022-04-01 06:34:49 -07:00
```shell title="Set store_forward_module_history_return_max to 100 messages"
2022-03-08 23:10:41 -08:00
meshtastic --set store_forward_module_history_return_max 100
```
2022-02-01 17:58:26 -08:00
</TabItem>
<TabItem value="android">
:::info
Configuring this setting is not yet available for the selected platform. If this is incorrect please update the documentation for this page.
:::
</TabItem>
<TabItem value="iOS">
:::info
Configuring this setting is not yet available for the selected platform. If this is incorrect please update the documentation for this page.
:::
</TabItem>
<TabItem value="web">
:::info
Configuring this setting is not yet available for the selected platform. If this is incorrect please update the documentation for this page.
:::
</TabItem>
</Tabs>
2022-03-08 23:10:41 -08:00
### store_forward_module_history_return_window
2022-01-26 15:25:24 -08:00
2022-02-11 12:23:54 -08:00
Limits the time period (in minutes) a client device can request.
2022-01-26 15:25:24 -08:00
2022-02-01 17:58:26 -08:00
<Tabs
2022-03-08 23:10:41 -08:00
groupId="settings"
defaultValue="cli"
values={[
{label: 'CLI', value: 'cli'},
{label: 'Android', value: 'android'},
{label: 'iOS', value: 'iOS'},
{label: 'Web', value: 'web'},
]}>
<TabItem value="cli">
2022-04-01 06:34:49 -07:00
```shell title="Set store_forward_module_history_return_window to default"
2022-03-08 23:10:41 -08:00
meshtastic --set store_forward_module_history_return_window 0
```
2022-04-01 06:34:49 -07:00
```shell title="Set store_forward_module_history_return_window to 1 day (1440 minutes)"
2022-03-08 23:10:41 -08:00
meshtastic --set store_forward_module_history_return_window 1440
```
2022-02-01 17:58:26 -08:00
</TabItem>
<TabItem value="android">
:::info
Configuring this setting is not yet available for the selected platform. If this is incorrect please update the documentation for this page.
:::
</TabItem>
<TabItem value="iOS">
:::info
Configuring this setting is not yet available for the selected platform. If this is incorrect please update the documentation for this page.
:::
</TabItem>
<TabItem value="web">
:::info
Configuring this setting is not yet available for the selected platform. If this is incorrect please update the documentation for this page.
:::
</TabItem>
</Tabs>
2022-03-08 23:10:41 -08:00
### store_forward_module_records
2022-02-01 17:58:26 -08:00
2022-03-08 23:10:41 -08:00
Set this to the maximum number of records to save. Best to leave this at the default (`0`) where the module will use 2/3 of your device's available PSRAM. This is about 11,000 records.
2021-04-27 14:08:43 -07:00
2022-02-01 17:58:26 -08:00
<Tabs
2022-03-08 23:10:41 -08:00
groupId="settings"
defaultValue="cli"
values={[
{label: 'CLI', value: 'cli'},
{label: 'Android', value: 'android'},
{label: 'iOS', value: 'iOS'},
{label: 'Web', value: 'web'},
]}>
<TabItem value="cli">
2022-04-01 06:34:49 -07:00
```shell title="Set store_forward_module_records to default (≈11,000 records)"
2022-03-08 23:10:41 -08:00
meshtastic --set store_forward_module_records 0
```
2022-04-01 06:34:49 -07:00
```shell title="Set store_forward_module_records to 100 records"
2022-03-08 23:10:41 -08:00
meshtastic --set store_forward_module_records 100
```
2022-02-01 17:58:26 -08:00
</TabItem>
<TabItem value="android">
:::info
Configuring this setting is not yet available for the selected platform. If this is incorrect please update the documentation for this page.
:::
</TabItem>
<TabItem value="iOS">
:::info
Configuring this setting is not yet available for the selected platform. If this is incorrect please update the documentation for this page.
:::
</TabItem>
<TabItem value="web">
:::info
Configuring this setting is not yet available for the selected platform. If this is incorrect please update the documentation for this page.
:::
</TabItem>
</Tabs>
2021-04-27 14:08:43 -07:00
## Details
2021-05-03 15:25:24 -07:00
2022-01-27 12:55:41 -08:00
### How it works
2022-03-08 23:10:41 -08:00
![Store & Forward - Overview](/img/modules/store_and_forward/store_and_forward-overview.png)
2022-01-27 12:55:41 -08:00
### Requirements
Initial Requirements:
2022-03-08 23:10:41 -08:00
- Must be installed on a router node.
- This is an artificial limitation, but is in place to enforce best practices.
- Router nodes are intended to be always online. If this module misses any messages, the reliability of the stored messages will be reduced.
- Esp32 Processor based device with external PSRAM. (tbeam v1.0 and tbeamv1.1, and maybe others)
2022-01-27 12:55:41 -08:00
### Usage Overview
2022-03-08 23:10:41 -08:00
- To use / test this you will want at least 3 devices
- One device will (currently) need be a tbeam v1.0 and tbeamv1.1 configured as a Meshtastic router. Other devices with built in PSRAM will be supported at some point.
- Two others will be regular clients. Nothing special required.
2022-01-27 12:55:41 -08:00
### Meshtastic channel configuration
2022-03-09 01:47:24 -08:00
Don't use this on the "Long Range / Slow" or "Long Range / Fast" channel settings. You're welcome to try and report back, but those channels have a [very low bitrate](/docs/developers/firmware/radio-settings#pre-defined).
2022-01-27 12:55:41 -08:00
Either use a custom channel configuration with at an at least 1kbit data rate or use "Medium Range / Fast".
Recommended channel setting is for 1.343kbps:
2022-04-01 06:34:49 -07:00
```shell title="Recommended channel setting for S&F module"
2022-05-06 18:32:37 -07:00
meshtastic --setchan spread_factor 11 --setchan coding_rate 5 --setchan bandwidth 500
2022-01-27 12:55:41 -08:00
```
With an aftermarket coaxial antenna or moxon antenna, that will give you roughly the same range as "Long Range / Slow" and 5x the bitrate.
### Router setup
2022-02-11 12:38:12 -08:00
:::warning
2022-03-08 23:10:41 -08:00
Don't enable the Store and Forward module on multiple routers!
2022-02-11 12:38:12 -08:00
:::
2022-04-08 07:49:05 -07:00
- Configure your device as a [meshtastic router](/docs/settings/router).
2022-03-08 23:10:41 -08:00
- Name your router node something that makes it easily identifiable, aka "Router".
- Configure the Store and Forward module
2022-04-01 06:34:49 -07:00
```shell title="Required - Enable the module"
2022-03-08 23:10:41 -08:00
meshtastic --set store_forward_module_enabled true
2022-02-11 12:23:54 -08:00
```
2022-04-01 06:34:49 -07:00
```shell title="Optional - Set maximum number of records to save to device"
2022-03-08 23:10:41 -08:00
meshtastic --set store_forward_module_records 100
2022-02-11 12:23:54 -08:00
```
2022-03-08 23:10:41 -08:00
:::tip
Best to leave `store_forward_module_records` at the default (`0`) where the module will use 2/3 of your device's available PSRAM. This is about 11,000 records.
:::
2022-01-27 12:55:41 -08:00
### Client Usage
Currently, no special configuration is required. To request your history sent to you, send the command into the message field "SF". That's it. This will eventually change to make it easier. At the moment, that message will be sent to everyone on the mesh but we'll (eventually) make it easier to use where there'll be a button (or maybe it'll be transparent) and the command isn't sent as a text message to the mesh.
Available Commands:
2022-03-08 23:10:41 -08:00
| Command | Definition |
| :-----: | :------------------------------------------: |
| SF | Send the last few messages I may have missed |
| SFm | Send a 240 byte payload (Used for testing) |
2022-01-27 12:55:41 -08:00
2022-03-08 23:10:41 -08:00
The Store and Forward module will only service one client at a time. If a second client requests messages while the S&F is busy, the S&F will send a private message to the second client that they will need to wait.