Skip to main content

Canned Message Module

warning

GPIO access is fundamentally dangerous because invalid options can physically damage or destroy your hardware. Ensure that you fully understand the schematic for your particular device before trying this as we do not offer a warranty. Use at your own risk.

important
The name of ths option changed between Meshtastic 1.2 and 1.3. This documentaton already reflects the 1.3 syntax. Please substitute 'canned_message_module' prefix with 'canned_message_plugin' to get the 1.2 compatible command name.
note

This module requires attaching a peripheral accessory to your device. It will not work without one. It also requires use of the Rotary Encoder Module to configure the input source.

Overview

The CannedMessage Module will allow you to send messages to the mesh network from the device without using the phone app. You can predefine text messages to choose from.

tip

Once module settings are changed, a reset is required for them to take effect.

Settings

SettingAcceptable ValuesDefault
canned_message_module_allow_input_sourcerotEnc1, _any_any
canned_message_module_enabledtrue, falsefalse
canned_message_module_messagesstring""
canned_message_module_send_belltrue, falsefalse
(Messages)*string""
  • Messages can be set with a dedicated option:

--set-canned-message "<messages>"

canned_message_module_allow_input_source

Input event source accepted by the canned message module.

ValueDescription
_anyDefault. Allows any peripheral input device connected to the device.
rotEnc1Hardcoded value naming the input device that this module listens to. This could allow multiple input devices to be named with future software development. At present, this doesn't do anything differently than the default setting.

Set input source

Set Allowed Input Source
meshtastic --set canned_message_module_allow_input_source "_any"
Specify Allowed Input Source
meshtastic --set canned_message_module_allow_input_source "rotEnc1"

canned_message_module_enabled

Enables the module.

tip

Using the canned message module requires you set up the Rotary Encoder Module. See prerequisites below.

Enable/Disable the module

Enable Canned Message Module
meshtastic --set canned_message_module_enabled true
Disable Canned Message Module
meshtastic --set canned_message_module_enabled false

canned_message_module_send_bell

CannedMessageModule also sends a "bell character" with the messages. The External Notification Module can benefit from this feature as it utilizes the bell character.

We have an "External Notification Module", that can be set up to beep, when new message arrives. This module can also be configured to beep only when message contains the "bell character". See module documentation (link above) for details.

Enable/Disable bell character

Enable Bell Character
meshtastic --set canned_message_module_send_bell true
Disable Bell Character
meshtastic --set canned_message_module_send_bell false

Messages

CLI has a dedicated option for canned message module to set predefines messages: --set-canned-message <message> Predefined messages separated by | characters.

You can define up to 50 messages with a total length 800 bytes.

Existing configuration can be queried with CLI option: --get-canned-message

Set canned messages

Set Canned Messages
meshtastic --set canned_message_module_messages "I'm fine|I'm out|I'm back|Need helping hand|Help me with saw|I need an alpinist|I need ambulance|Keep Calm|On my way|I will be late|I'm already waiting|We have company|Beer is cold|Roger"

Details

Prerequisites

  • Attach a compatible peripheral device. Take note of the GPIO numbers you use, as they will be used in the following step.
  • Once attached, configure peripheral device with Rotary Encoder Module Settings.
note

Replace each GPIO (x3) below with the GPIO numbers from hardware setup.

Canned Message Module - Required Rotary Encoder Module Settings
meshtastic --set rotary1_pin_a GPIO
meshtastic --set rotary1_pin_b GPIO
meshtastic --set rotary1_pin_press GPIO
meshtastic --set rotary1_event_cw KEY_UP
meshtastic --set rotary1_event_ccw KEY_DOWN
meshtastic --set rotary1_event_press KEY_SELECT
meshtastic --set rotary1_enabled True

That's it! With a functioning and enabled rotary encoder, you're ready to begin configuring the Canned Message Module.