Meshtastic Guide - Canned Messages Module Configuration Tips

The Canned Message Module allows you to send messages to the mesh network from the device without using the phone app. You can predefine text messages to choose from.
The canned message module config options include: Enabled, Send Bell, Messages, Input Source, Rotary Encoder Enabled, Up Down Encoder Enabled, Input Broker Pin A, Input Broker Pin B, Input Broker Pin Press, Input Broker Event Clockwise, Input Broker Event Counter Clockwise, and Input Broker Event Press. The Canned Message config utilizes an admin message to send a ConfigModule.CannedMessage protobuf.

Canned Message Module Configuration Values

  • Enabled: Enables the canned message module.
  • Send Bell: Sends a bell character with each message. The External Notification Module can be configured to beep when a new message arrives. Additionally, this module can be set up to beep only when a message contains the bell character.
  • Messages: The list of pre-set messages configured by the user. Messages should be separated by pipes |. The total byte count for the message list can be up to 200 bytes.
  • Input Source: Input event sources accepted by the canned message module.
Value Description
_any Default. Allows any peripheral input device connected to the device.
rotEnc1 Basic Rotary Encoder
upDownEnc1 Up Down Encoder (use this also for RAK14006 Rotary Encoder)
scanAndSelect Single push-button (short and long press)
cardkb M5 Stack CardKB (this covers RAK14004 Keymatrix)
serialkb Chatter serial keypad
  • Rotary Encoder Enabled: Enable the default rotary encoder.
  • Up Down Encoder Enabled: Enable the up/down encoder.
  • Input Broker Pin A: GPIO Pin Value (1-39) for encoder port A.
  • Input Broker Pin B: GPIO Pin Value (1-39) for encoder port B.
  • Input Broker Pin Press: GPIO Pin Value (1-39) for encoder Press port.
  • Input Broker Event Clockwise: Generate the rotary clockwise event.
  • Input Broker Event Counter Clockwise: Generate the rotary counter clockwise event.
  • Input Broker Event Press: Generate input event on Press of this kind.

Canned Message Module Configuration Client

Android

Canned Message Config options are available for Android.
  1. Open the Meshtastic App.
  2. Navigate to: Vertical Ellipsis (3 dots top right) > Radio Configuration > Canned Message.

Apple

All canned message module config options are available on iOS, iPadOS, and macOS at Settings > Module Configuration > Canned Messages.

CLI

All canned message module config options are available in the Python CLI.
Setting Acceptable Values Default
canned_message.enabled true, false FALSE
canned_message.send_bell true, false FALSE
canned_message.allow_input_source rotEnc1, _any, upDownEnc1, cardkb _any
--set-canned-message string "" (separate using pipes)
canned_message.inputbroker_event_cw InputEventChar (not defined)
canned_message.inputbroker_event_ccw InputEventChar (not defined)
canned_message.inputbroker_event_press InputEventChar (not defined)
canned_message.inputbroker_pin_a integer (not defined)
canned_message.inputbroker_pin_b integer (not defined)
canned_message.inputbroker_pin_press integer (not defined)
  • Enable/Disable the Canned Message Module
 meshtastic --set canned_message.enabled true
 meshtastic --set canned_message.enabled false
  • Enable/Disable send bell character
 meshtastic --set canned_message.send_bell true
 meshtastic --set canned_message.send_bell false
  • Set Messages
 meshtastic --set-canned-message "I need an alpinist!|Call Me|Roger Roger|Keep Calm|On my way"
  • Set Input Source
 meshtastic --set canned_message.allow_input_source "_any"
 meshtastic --set canned_message.allow_input_source "rotEnc1"
  • Enable/Disable rotary1
 meshtastic --set canned_message.rotary1_enabled 1
  • Set/Unset Encoder Pin A
 meshtastic --set canned_message.inputbroker_pin_a 17
 meshtastic --set canned_message.inputbroker_pin_a 0
  • Set/Unset Encoder Pin B
 meshtastic --set canned_message.inputbroker_pin_b 39
 meshtastic --set canned_message.inputbroker_pin_b 0
  • Set/Unset Encoder Pin Press
 meshtastic --set canned_message.inputbroker_pin_press 21
 meshtastic --set canned_message.inputbroker_pin_press 0
  • Set/Unset Input Broker CW Event
 meshtastic --set canned_message.inputbroker_event_cw UP
 meshtastic --set canned_message.inputbroker_event_cw ""
  • Set/Unset Input Broker CCW Event
 meshtastic --set canned_message.inputbroker_event_ccw DOWN
 meshtastic --set canned_message.inputbroker_event_ccw ""
  • Set/Unset Input Broker Press Event
 meshtastic --set canned_message.inputbroker_event_press SELECT
meshtastic --set canned_message.inputbroker_event_press ""
NOTE: Since the device will reboot after each command is sent via CLI, it is recommended to chain commands together as one when setting multiple values in a config section. For example:
 meshtastic --set canned_message.enabled true --set canned_message.send_bell true

Web

All canned message module config options are available in the Web UI.

Hardware

To navigate through messages and select one, you will need some hardware attached to your device. Currently, the module is tested with a generic rotary encoder, an up/down/select 3 button logic, and several I2C Keyboards. Additional input methods will be added in the future.

I2C Keymatrix

This has been tested with the RAK14004 Keyboard. A keypress will immediately send the message attached to the respective button number. Buttons are numbered from the upper left to the lower right on the key panels. Therefore, pressing the upper left button will send the first message, the second button will send the second message, and so on.
Caveat: The RAK 3x4 key matrix is missing the 4th button row while scanning, so you must skip every 4th message slot. Button 1 sends message 1, and button 4 will send message 5. For example: 1|2|3||5|6|7||9|10|11||13|14|15 — the slots 4, 8, and 12 cannot be used.

CardKB

The CardKB is fully supported in freetext mode and select mode. Use UP/DOWN/ENTER to choose a predefined message and send it. For a freetext message, simply type it in and press ENTER to send it.
If you prefer not to broadcast your freetext message, you can use the CardKB to send it to a specific node. Just press TAB and select the target node with the LEFT/RIGHT keys. The message will be sent to the node with the matching name and node number. The target node will be remembered for your next message.

3 Button up/down and RAK rotary encoder

Simply use UP/DOWN/ENTER to select a predefined message and send it.

Scan and Select

Use a single push-button to select and send predefined messages.

Setup

Usage

  • Short press: Scroll through messages.
  • Long press: Send the currently highlighted message to your primary channel.

Rotary encoder

Meshtastic supports hardwired rotary encoders as input devices.
You will need a generic rotary encoder. The types listed below have five legs, with two dedicated to a "press" action, but other types will likely work as well. You can also use a three-legged version, where the "press" action should be connected from an independent switch.
Connect your rotary encoder as follows: the rotary encoder has two rows of legs. One row contains two legs, while the other contains three legs. Bottom side view:
      B o --- o PRESS
GND o | |
      A o --- o GND
The two legs are for sensing the press action (or push). Connect one of the two legs to GROUND and the other to a GPIO pin (it doesn't matter which goes where). We'll refer to these connected ports as 'PRESS'.
The three legs are for sensing the rotation action. Connect the middle leg to GROUND and the ones on the sides to GPIO pins. We'll label these ports as 'A' and 'B', according to the scheme below.
 A --||
 GND --||]========
 B --||
Recommended GPIO pins for connecting a rotary encoder:
TTGO LoRa V1:
  • A - GPIO-22
  • B - GPIO-23
  • PRESS - GPIO-21
There is a reference case 3D design utilizing the rotary encoder for TTGO LoRa V1: Case for TTGO-ESP32-LORA-OLED-v1.0 with rotary encoder.

Examples

Attach a compatible peripheral device. Take note of the GPIO numbers you use, as they will be needed in the following step.
Note: Replace each GPIO (x3) below with the GPIO numbers from your hardware setup.
Here is the Canned Message Module - Required Rotary Encoder Module Settings.
 meshtastic --set canned_message.inputbroker_pin_a GPIO
 meshtastic --set canned_message.inputbroker_pin_b GPIO
 meshtastic --set canned_message.inputbroker_pin_press GPIO
 meshtastic --set canned_message.inputbroker_event_cw UP
 meshtastic --set canned_message.inputbroker_event_ccw DOWN
 meshtastic --set canned_message.inputbroker_event_press SELECT
 meshtastic --set canned_message.rotary1_enabled True
That's it! With a functioning and enabled rotary encoder, you're ready to start configuring the Canned Message Module.

 

Barra lateral

Última publicación

Esta sección actualmente no incluye ningún contenido. Agrega contenido a esta sección usando la barra lateral.

Regístrate para nuestro boletín

Obtenga la información más reciente sobre nuestros productos y ofertas especiales.