Merge pull request #337 from jfirwin/rangetest-csv

Module Edits work in progress
This commit is contained in:
Foster Irwin 2022-05-16 15:49:53 -06:00 committed by GitHub
commit 8323efe66a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 88 additions and 328 deletions

View file

@ -0,0 +1,17 @@
Modules are included in the firmware and allow users to extend the functionality of their mesh or device.
The list of current modules is as follows:
| Name | Description |
|:----:|:-----------:|
| Canned Message Module | Set a number of predefined messages to send out directly from the device with the use of an input device like a rotary encoder. |
| External Notification Module | Incoming messages are able to alert you using circuits you attach to the device (LEDs, Buzzers, etc) |
| Input Broker Module | Attach and define input devices such as external keyboards and rotary encoders. |
| Range Test Module | Send messages with GPS location at an interval to test the distance your devices can communicate. Requires (at least) one device set up as a sender and one as a receiver. The receiver(s) will log all incoming messages to a CSV. |
| Serial Module | Send messages across the mesh by sending strings over a serial port. |
| Store and Forward Module | Set a designated node to store messages and resend them to nodes with intermittent connection to a mesh. |
| Telemetry Module | Attach sensors to the device and transmit readings on a regular interval to the mesh. |
:::tip
Once module settings are changed, a **reset** is required for them to take effect.
:::

View file

@ -0,0 +1,8 @@
---
id: modules
title: Firmware Modules Overview
sidebar_label: Firmware Modules
---
import ModuleOverviewText from '@site/docs/_blocks/_module_overview_text.mdx';
<ModuleOverviewText/>

View file

@ -77,7 +77,7 @@ Configuring this setting is not yet available for the selected platform. If this
### range_test_module_save
If enabled, we will save a log of all received messages to `/static/rangetest.csv` which you can access from the web server. We will abort writing if there is less than 50k of space on the filesystem to prevent filling up the storage.
If enabled, we will save a log of all received messages to a file named `rangetest.csv` which you can access from the web server `Extensions > File Browser > rangetest.csv`. The file will be created after receiving messages. The device will abort writing if there is less than 50k of space on the filesystem to prevent filling up the storage.
#### Enable/Disable range test save `csv`
@ -187,11 +187,11 @@ Leaving this module on can slow down your mesh. Currently, the messages are sent
### Accessing your CSV
Connect to your device over WiFi, either using the [software access point](/docs/settings/wifi#software-access-point) or [WiFi Client](/docs/settings/wifi#wifi-client). Then navigate to `meshtastic.local` (or your IP address) `/static/rangetest.csv` where your file will be available for download.
Connect to your device over WiFi, either using the [software access point](/docs/settings/wifi#software-access-point) or [WiFi Client](/docs/settings/wifi#wifi-client). Then navigate to `meshtastic.local` (or your IP address). Your file will be available for download under `Extensions > File Browser > rangetest.csv` once it has been created by receiving messages.
```plaintext title="Example URLs"
http://meshtastic.local/static/rangetest.csv
http://198.168.0.X/static/rangetest.csv
http://meshtastic.local
http://198.168.0.15
```
### Recommended Sender Settings

View file

@ -4,33 +4,21 @@ title: Canned messages
sidebar_label: Canned messages
sidebar_position: 3
---
import PluginModule from '@site/docs/_blocks/_plugin_module.mdx';
## About
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 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.
## 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, but this is
not a limitation further input methods can be added in the future.
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, but this is not a limitation further input methods can be added in the future.
### Rotary encoder
Meshtastic supports hardwired rotary encoders as input devices.
(Technically the Canned Message Module is independent of rotary
encoders. It is described here, because no other module utilizes rotary encoders just yet.)
Meshtastic supports hardwired rotary encoders as input devices. (Technically the Canned Message Module is independent of rotary encoders. It is described here, because no other module utilizes rotary encoders just yet.)
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.
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.
<!--- TODO move links to hardware section --->
- [Amazon link](https://www.amazon.com/Rotary-Encoder-Washers-Digital-Potentiometer/dp/B07Y619CZR/ref=sr_1_21?keywords=rotary+encoder&qid=1642317807&sprefix=rotary+enco%2Caps%2C186&sr=8-21)
- [Amazon.DE link](https://www.amazon.de/-/en/sourcing-Degree-Rotary-Encoder-Digital/dp/B07RLZPX5K/ref=sr_1_12?keywords=rotary+encoder&qid=1642320025&sprefix=rotary%2Caps%2C105&sr=8-12)
@ -38,26 +26,23 @@ an independent switch.
- [Aliexpress link2](https://www.aliexpress.com/item/32946444853.html?spm=a2g0o.productlist.0.0.1afe21a50SLvi2&algo_pvid=a19c4182-08aa-406d-bfdf-132582ef5ebb&aem_p4p_detail=2022011523263276283624312400022072680&algo_exp_id=a19c4182-08aa-406d-bfdf-132582ef5ebb-6&pdp_ext_f=%7B%22sku_id%22%3A%2266223434642%22%7D&pdp_pi=-1%3B1.91%3B-1%3B-1%40salePrice%3BUSD%3Bsearch-mainSearch)
- [Aliexpress link3](https://www.aliexpress.com/item/10000056483250.html?spm=a2g0o.productlist.0.0.1afe21a50SLvi2&algo_pvid=a19c4182-08aa-406d-bfdf-132582ef5ebb&algo_exp_id=a19c4182-08aa-406d-bfdf-132582ef5ebb-9&pdp_ext_f=%7B%22sku_id%22%3A%2220000000116682147%22%7D&pdp_pi=-1%3B2.51%3B-1%3B-1%40salePrice%3BUSD%3Bsearch-mainSearch)
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:
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
```
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 GPIO pin. (No matter which one
goes where.) Let's call this connected ports 'PRESS'.
The two legs is to sense the press action (or push). Connect one of the two to GROUND and the other to a GPIO 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 GPIO pins. Let's call these ports 'A' and 'B', according to
the scheme below.
The three legs is to sense the rotation action. Connect the middle leg to GROUND and the ones on the side to GPIO pins. Let's call these ports 'A' and 'B', according to the scheme below.
A --||
GND --||]========
B --||
```
A --||
GND --||]========
B --||
```
Recommended GPIO pins for connecting a rotary encoder.
@ -69,87 +54,12 @@ Recommended GPIO pins for connecting a rotary encoder.
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](https://www.thingiverse.com/thing:5178495)
### Configuration of the rotary encoder #1
## Configuration
rotary1_enabled
Enable the rotary encoder #1
rotary1_pin_a
GPIO pin for rotary encoder A port.
rotary1_pin_b
GPIO pin for rotary encoder B port.
rotary1_pin_press
GPIO pin for rotary encoder Press port.
rotary1_event_cw
Generate input event on CW of this kind.
For using with CannedMessageModule you must choose value "UP" here!
rotary1_event_ccw
Generate input event on CCW of this kind.
For using with CannedMessageModule you must choose value "DOWN" here!
rotary1_event_press
Generate input event on Press of this kind.
For using with CannedMessageModule you must choose value "SELECT" here!
The rotary encoder #1 will send input events under name "rotEnc1".
## Configuration of the module
<PluginModule name="canned_message_plugin" rename="canned_message_module" />
Following configuration can be set for the module.
canned_message_module_enabled
Enable/disable CannedMessageModule.
canned_message_module_allow_input_source
Input event origin accepted by the Canned Message Module.
Can be e.g. "rotEnc1" or keyword "_any"
canned_message_module_messages
Predefined messages for CannedMessageModule separated by '|' characters.
canned_message_module_send_bell
CannedMessagemodule also sends a bell character with the messages.
ExternalNotificationModule can benefit from this feature.
## Usage Notes
For setting up the rotary encoder #1 using the Python CLI you will
need to execute a sequence like this:
meshtastic --set rotary1_pin_a 22
meshtastic --set rotary1_pin_b 23
meshtastic --set rotary1_pin_press 21
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
For setting up the module you will
need to execute a sequence like this:
meshtastic --set canned_message_module_allow_input_source "_any"
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"
meshtastic --set canned_message_module_enabled True
meshtastic --set-canned-message "What am I doing?|I'm fine|Don't follow me|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|Need 5 mins|I will be late|I'm already waiting|I couldn't join|We have company|Beer is cold|Roger"
:::note
You can define up to 50 messages with a total length 800 bytes.
Use short texts as end of line will be truncated on the screen.
:::
:::note
The device must be restarted after the settings have been changed for the module to take effect.
:::
Configuration details are available on the [Device Settings](/docs/settings) pages. Configuring the Canned Message Module requires configuring both of the following modules:
- [Input Broker Module](/docs/settings/modules/input-broker-module)
- [Canned Message Module](/docs/settings/modules/canned-message-module).
## Known Problems
- Rotary encoder input uses a technology called "interrupts". Using the
rotary encoder might cause unexpected software problems. This needs to be
tested.
- Rotary encoder input uses a technology called "interrupts". Using the rotary encoder might cause unexpected software problems. This needs to be tested.

View file

@ -4,69 +4,10 @@ title: External notifications
sidebar_label: External notifications
sidebar_position: 2
---
import PluginModule from '@site/docs/_blocks/_plugin_module.mdx';
## About
The ExternalNotification Module will allow you to connect a speaker, LED or other device to notify you when a message has been received from the mesh network.
## Configuration
<PluginModule name="ext_notification_plugin" rename="ext_notification_module" />
These are the settings that can be configured.
ext_notification_module_enabled
Is the module enabled?
0 = Disabled (Default)
1 = Enabled
ext_notification_module_active
Is your external circuit triggered when our GPIO is low or high?
0 = Active Low (Default)
1 = Active High
ext_notification_module_alert_message
Do you want to be notified on an incoming message?
0 = Disabled (Default)
1 = Alert when a text message comes
ext_notification_module_alert_bell
Do you want to be notified on an incoming bell?
0 = Disabled (Default)
1 = Alert when the bell character is received
ext_notification_module_output
What GPIO is your external circuit attached?
GPIO of the output. (Default = 13)
ext_notification_module_output_ms
How long do you want us to trigger your external circuit?
Amount of time in ms for the alert. Default is 1000.
## Usage Notes
For basic usage, start with:
ext_notification_module_enabled = 1
ext_notification_module_alert_message = 1
Depending on how your external circuit is configured, you may need to set the active state to true.
ext_notification_module_active = 1
:::note
The device must be restarted after the settings have been changed for the module to take effect.
:::
### Alert Types
We support being alerted on two events:
@ -75,9 +16,9 @@ We support being alerted on two events:
2. Incoming Text Message that contains the ASCII bell character. At present, only the Python API can send an ASCII bell character, but more support may be added in the future.
#### Bell Character
:::info
The bell character is ASCII 0x07. Include 0x07 anywhere in the text message and with ext_notification_module_alert_bell enabled, we will issue an external notification.
:::
## External Hardware
@ -91,6 +32,11 @@ Ideas for external hardware:
- Strobe Light
- Siren
## Configuration
Configuration details are available on the [Device Settings](/docs/settings) pages. Configuring the External Notification Module requires configuring the following modules:
- [External Notification Module](/docs/settings/modules/external-notification-module)
## Known Problems
- This won't directly support a passive (normal) speaker as it does not generate any audio wave forms.

View file

@ -1,19 +1,12 @@
---
id: modules
title: Modules overview
sidebar_label: Built-in modules
title: Firmware Modules Overview
sidebar_label: Firmware Modules
---
import ModuleOverviewText from '@site/docs/_blocks/_module_overview_text.mdx';
There are a number of modules that have been integrated into the device firmware. These can be turned on using the Meshtastic python command line program. Please note that these modules require the device to be rebooted once they have been enabled for them to start running.
<ModuleOverviewText/>
These modules are currently integrated into the firmware:
## Configuration
- Range test - Allows automated testing of communication range of nodes
- External notifications - Allows a speaker, LED or other device to indicate when a message has been received
- Canned messages - Device can be used without the phone to send a message by choosing a predefined text
- Serial - Allows messages to be sent across the mesh by sending strings across a serial port
These modules are currently in development:
- Store and forward - Allows a node to store messages and resend them to nodes that have intermittent connection to the mesh
- Telemetry - Allows a node to measure it's local environment and report across the mesh
Configuration details are available on the [Device Settings](/docs/settings/modules) pages.

View file

@ -4,8 +4,7 @@ title: Range Test Module
sidebar_label: Range Test
sidebar_position: 1
---
import PluginModule from '@site/docs/_blocks/_plugin_module.mdx';
## About
This module allows you to test the range of your Meshtastic nodes. It uses two nodes, one to send a message every minute, and another to receive the messages. The receiving node then saves the messages along with the GPS coordinates at which they were received into a .csv file. This .csv file can then be integrated into, for example, Google Earth, allowing you to see where you have coverage.
@ -15,69 +14,6 @@ The Range Test module is currently only compatible with ESP32 devices. nRF52 dev
:::
## Configuration
<PluginModule name="range_test_module_" rename="range_test_plugin_" />
These are the settings that can be configured.
range_test_module_enabled
Is the Module enabled?
0 = Disabled (Default)
1 = Enabled
range_test_module_save
If enabled, we will save a log of all received messages to /static/rangetest.csv which you can access from the webserver. We will abort
writing if there is less than 50k of space on the filesystem to prevent filling up the storage.
0 = Disabled (Default)
1 = Enabled
range_test_module_sender
Number of seconds to wait between sending packets. Using the long_slow channel configuration, it's best not to go more frequent than once every 60 seconds. You can be more agressive with faster settings. 0 is default which disables sending messages.
:::note
The device must be restarted after the settings have been changed for the module to take effect.
:::
### Usage Notes
For basic usage, you will need two devices both with a GPS. A device with a paired phone with GPS may work, I have not tried it.
The first thing to do is to turn on the module. The device will need to be restarted after applying the settings. With the module turned on, the other settings will be available:
range_test_module_enabled = 1
If you want to send a message every 60 seconds:
range_test_module_sender = 60
To save a log of the messages:
range_test_module_save = 1
Recommended settings for a sender at different radio settings:
Long Slow ... range_test_module_sender = 60
Long Alt ... range_test_module_sender = 30
Medium ... range_test_module_sender = 15
Short Fast ... range_test_module_sender = 15
### Python API Examples
Sender
`meshtastic --set range_test_module_enabled 1`
`meshtastic --set range_test_module_sender 60`
Receiver
`meshtastic --set range_test_module_enabled 1`
`meshtastic --set range_test_module_save 1`
### Other things to keep in mind
Be sure to turn off either the module configured as a sender or the device where the module setup as sender when not in use. This will use a lot of time on air and will spam your channel.
@ -111,6 +47,11 @@ Google has instructions on how to do that [here](https://support.google.com/myma
You can style the ranges differently based on the values, so you can have the pins be darker the if the SNR or RSSI (if that gets added) is higher.
## Configuration
Configuration details are available on the [Device Settings](/docs/settings) pages. Configuring the Range Test Module requires configuring the following modules:
- [Range Test Module](/docs/settings/modules/range-test-module)
## Known Problems
If turned on, using mesh network will become unwieldy because messages are sent over the same channel as the other messages. See TODO below.
@ -123,7 +64,7 @@ Right now range test messages go over the `TEXT_MESSAGE_APP` port. We need a tog
Q: Where is rangetest.csv saved?
- Turn on the WiFi on your device as either a WiFi client or a WiFi AP. Once you can connect to your device, go to /static and you will see rangetest.csv.
- Turn on the WiFi on your device as either a WiFi client or a WiFi AP. Once you can connect to your device, navigate to `Extensions > File Browser` and you will see `rangetest.csv` once messages have been saved and the file has been created.
Q: Do I need to have WiFi turned on for the file to be saved?

View file

@ -4,17 +4,11 @@ title: Serial communication module
sidebar_label: Serial communication
sidebar_position: 4
---
import PluginModule from '@site/docs/_blocks/_plugin_module.mdx';
## About
This is a simple interface to send messages over the mesh network by sending strings over a serial port.
Default is to use RX GPIO 16 and TX GPIO 17.
<PluginModule name="serial_plugin" rename="serial_module" />
## Basic Usage:
1. Enable the module by setting `serial_module_enabled` to `1`.
@ -39,6 +33,11 @@ The device must be restarted after the settings have been changed for the module
This won't happen any time soon.
:::
## Configuration
Configuration details are available on the [Device Settings](/docs/settings) pages. Configuring the Serial Module requires configuring the following modules:
- [Serial Module](/docs/settings/modules/serial-module)
## Known Problems
- Until the module is initialized by the startup sequence, the TX pin is in a floating state. Device connected to that pin may see this as "noise".

View file

@ -4,9 +4,6 @@ title: Store and Forward Module
sidebar_label: Store and Forward
sidebar_position: 5
---
import PluginModule from '@site/docs/_blocks/_plugin_module.mdx';
## About
:::caution
@ -53,8 +50,6 @@ With an aftermarket coaxial antenna or moxon antenna, that will give you roughly
### Router setup
<PluginModule name="store_forward_module" rename="store_forward_plugin" />
- Configure your device as a [Meshtastic router](/docs/settings/router).
- Configure the Store and Forward Module
- Required configuration
@ -175,6 +170,11 @@ When a message is 'real time', time a message is sent is the same as the time th
Where the message is a delayed broadcast, the "To" is _not_ a broadcast address but rather the address of the device that requested the messages to be replayed. This is to allow the message to be routed over the mesh network and not displayed in the message screen of other devices.
## Configuration
Configuration details are available on the [Device Settings](/docs/settings) pages. Configuring the Store and Forward requires configuring the following modules:
- [Store and Forward](/docs/settings/modules/store-and-forward-module)
## Developer TODO
Not necessarily in this order:

View file

@ -4,71 +4,12 @@ title: Telemetry
sidebar_label: Telemetry
sidebar_position: 6
---
import PluginModule from '@site/docs/_blocks/_plugin_module.mdx';
<PluginModule name="telemetry_module_environment" rename="environmental_measurement_plugin" />
## About
The Telemetry Module will allow nodes to send a specific message with information from connected sensors. Currently supported sensors are `BME280`, `BME680`, `DHT11`, `DHT12`, `DHT21`, `DHT22`, Dallas 1-wire `DS18B20`, and `MCP9808`.
The preferred setup is using I2C, so the `telemetry_module_sensor_pin` may not be needed.
## Configuration
These are the settings that can be configured.
telemetry_module_enabled
Is the module enabled?
0 = Disabled (Default)
1 = Enabled
telemetry_module_screen_enabled
Show received sensor readings on device screen.
0 = Disabled (Default)
1 = Enabled
telemetry_module_read_error_count_threshold
Error count threshold for failed sensor readings.
Default = 0
preferences.telemetry_module_update_interval
How often (in seconds) should sensor readings be broadcasted?
Default = 0
telemetry_module_recovery_interval
For how long should we wait (in seconds) before trying to read sensors again upon exceeded error threshold?
Default = 0
telemetry_module_display_fahrenheit
Should temperature readings be converted to fahrenheit?
0 = Disabled (Default)
1 = Enabled
telemetry_module_sensor_type
What sensor is connected?
0 = DHT11 (Default)
1 = Dallas 1-wire DS18B20
2 = DHT12
3 = DHT21
4 = DHT22
5 = BME280
6 = BME680
7 = MCP9808
telemetry_module_sensor_pin
Which pin is the sensor connected to?
Default = 0
## Usage Notes
For basic usage, start with:
@ -222,6 +163,11 @@ meshtastic --info
and verify the the `telemetry_module_sensor_type`
## Configuration
Configuration details are available on the [Device Settings](/docs/settings) pages. Configuring the Telemetry Module requires configuring the following modules:
- [Telemetry Module](/docs/settings/modules/telemetry-module)
## Known Problems
- No default configuration values are currently set, so this must be done when enabling the module.