Skip to main content
Version: 2.8

Canned Message Module Configuration

The Canned Message 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.

The canned message module config options are: 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. Canned Message config uses an admin message sending a ConfigModule.CannedMessage protobufProtobuf (Protocol Buffers). A method developed by Google for serializing structured data, used in Meshtastic for efficient communication protocol between devices..

Canned Message Module Config Values

Enabled

Enables the canned message module.

Send Bell

Sends a bell character with each message.

The External Notification Module can be set up to beep when a new message arrives. This module can also be configured to beep only when a message contains the bell character.

Messages

The list of pre-set messages as 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.

ValueDescription
_anyDefault. Allows any peripheral input device connected to the device.
rotEnc1Basic Rotary Encoder
upDownEnc1Up Down Encoder (use this also for RAK14006 Rotary Encoder)
scanAndSelectSingle push-button (short and long press)
cardkbM5 Stack CardKB (this covers RAK14004 Keymatrix)
serialkbChatter serial keypad

Rotary Encoder Enabled

Enable the default rotary encoder.

Up Down Encoder Enabled

Enable the up / down encoder.

Input Broker Pin A

GPIOGPIO (General Purpose Input/Output). An uncommitted digital signal pin on a device. Pin Value (1-39) For encoder port A

Input Broker Pin B

GPIOGPIO (General Purpose Input/Output). An uncommitted digital signal pin on a device. Pin Value (1-39) For encoder port B

Input Broker Pin Press

GPIOGPIO (General Purpose Input/Output). An uncommitted digital signal pin on a device. 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 Config Client Availability

Apple

info

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

warning

GPIOGPIO (General Purpose Input/Output). An uncommitted digital signal pin on a device. 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.

This module requires attaching a peripheral accessory to your device. It will not work without one.

Hardware

To navigate through messages and select one, you will require 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 I2CI2CA two-wire bus used to attach peripherals such as sensors and displays to a device. Keyboards. Further input methods will be added in the future.

I2C Keymatrix

This is tested with the RAK14004 Keyboard. A keypress will immediately send the message attached to the button number. Buttons are numbered from upper left to lower right on the keypanels. So 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 keymatrix is missing the 4th button row while scanning, so you have to skip every 4th message slot. Button 1 sends message 1 and button 4 will send message 5 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 select a predefined message and send it. For a freetext message, just type it in and press ENTER to send it.

If you don't want 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

Just 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

  • Connect a normally-open push-button between ground and a GPIOGPIO (General Purpose Input/Output). An uncommitted digital signal pin on a device. pin of your choice
  • Configure the canned messages module

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 has five legs where two is dedicated to a "press" action, but any other types will likely do the job. You can also use a three-legged version, where the "press" action should be wired from an independent switch.

Connect your rotary encoder as follows. The rotary encoder has two rows of legs. One of the rows contains two legs, the other contains three legs. Bottom side view:

B o --- o PRESS
GND o | |
A o --- o GND

The two legs is to sense the press action (or push). Connect one of the two to GROUND and the other to a GPIOGPIO (General Purpose Input/Output). An uncommitted digital signal pin on a device. pin. (No matter which one goes where.) Let's call this connected ports 'PRESS'.

The three legs is to sense the rotation action. Connect the middle leg to GROUND and the ones on the side to GPIOGPIO (General Purpose Input/Output). An uncommitted digital signal pin on a device. pins. Let's call these ports 'A' and 'B', according to the scheme below.

A --||
GND --||]========
B --||

Recommended GPIOGPIO (General Purpose Input/Output). An uncommitted digital signal pin on a device. pins for connecting a rotary encoder.

  • TTGO LoRaLoRaA low-power, long-range wireless communication technology used by Meshtastic devices to enable communication over distances of several kilometers without the need for cellular, Wi-Fi, or other traditional network infrastructures. V1:
    • A - GPIOGPIO (General Purpose Input/Output). An uncommitted digital signal pin on a device.-22
    • B - GPIOGPIO (General Purpose Input/Output). An uncommitted digital signal pin on a device.-23
    • PRESS - GPIOGPIO (General Purpose Input/Output). An uncommitted digital signal pin on a device.-21

There is a reference case 3D-design utilizing the rotary encoder for TTGO LoRaLoRaA low-power, long-range wireless communication technology used by Meshtastic devices to enable communication over distances of several kilometers without the need for cellular, Wi-Fi, or other traditional network infrastructures. V1: Case for TTGO-ESP32-LORA-OLED-v1.0 with rotary encoder

Examples

  • Attach a compatible peripheral device. Take note of the GPIOGPIO (General Purpose Input/Output). An uncommitted digital signal pin on a device. numbers you use, as they will be used in the following step.
note

Replace each GPIO (x3) below with the GPIOGPIO (General Purpose Input/Output). An uncommitted digital signal pin on a device. numbers from your hardware setup.

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 begin configuring the Canned Message Module.