This commit is contained in:
KrazyKerbalnaut 2021-10-25 14:25:37 -06:00
commit 0d783a0d5b
10 changed files with 210 additions and 173 deletions

@ -1 +1 @@
Subproject commit 6b4f6d60b91c127f4c3cc0f15e52b6166302863e
Subproject commit 13fb87d4e037ee8e77945b5b38881dfa4ca8d898

View file

@ -10,6 +10,11 @@ import TabItem from '@theme/TabItem';
### Check Data Cable
Plug your device into your computer using a USB cable and then do the following:
:::important
You may need to install a driver from Silicon Labs for the [CP210X USB to UART bridge](https://www.silabs.com/products/development-tools/software/usb-to-uart-bridge-vcp-drivers)
:::
<Tabs
groupId="operating-system"
defaultValue="linux"
@ -20,40 +25,26 @@ import TabItem from '@theme/TabItem';
]}>
<TabItem value="linux">
To check if you have a data cable that will work, plug your device into the computer and **then** navigate to `Terminal` and enter the following command:
```bash
lsusb
```
you should see something like `CP210X USB to UART Bridge Controller`.
:::note
You may need to install a driver from Silicon Labs for the [CP210X USB to UART bridge](https://www.silabs.com/products/development-tools/software/usb-to-uart-bridge-vcp-drivers)
:::
> Open a `Terminal` and enter the following command:
> ```bash
> lsusb
> ```
</TabItem>
<TabItem value="macos">
To check if you have a data cable that will work, plug your device into the computer and **then** navigate to `Apple Menu  > About This Mac > System Report... > Hardware > USB` you should see something like `CP210X USB to UART Bridge Controller`.
:::note
You may need to install a driver from Silicon Labs for the [CP210X USB to UART bridge](https://www.silabs.com/products/development-tools/software/usb-to-uart-bridge-vcp-drivers)
:::
> Navigate to `Apple Menu  > About This Mac > System Report... > Hardware > USB`.
</TabItem>
<TabItem value="windows">
To check if you have a data cable that will work, plug your device into the computer and navigate to `Device Manager > Ports` and ensure the device is shown. You should see something like `CP210X USB to UART Bridge Controller`.
If your device is showing up under `Device Manager > Ports > Other Devices` you need to install the driver from Silicon Labs for the CP210X USB to UART bridge
:::note
You may need to install a driver from Silicon Labs for the [CP210X USB to UART bridge](https://www.silabs.com/products/development-tools/software/usb-to-uart-bridge-vcp-drivers)
:::
> Navigate to `Device Manager > Ports (COM & LPT)`.
</TabItem>
</Tabs>
You should see something like `CP210X USB to UART Bridge Controller`. If you don't, you will need to install the appropriate driver from [Silicon Labs](https://sliabs.com/developers/usb-to-uart-bridge-vcp-drivers).
### Download Latest Firmware
Prebuilt binaries for the supported radios are available in our releases. Your initial installation has to happen over USB from your Mac, Windows or Linux PC. Once our software is installed, all future software updates happen over bluetooth from your phone.
@ -70,8 +61,6 @@ The [T-Beam 0.7](../hardware/tbeam-hardware#t-beam---v07) board is an earlier ve
## Command Line Interface Instructions
### Install Prerequisite Software
<Tabs
groupId="operating-system"
defaultValue="linux"
@ -82,25 +71,35 @@ The [T-Beam 0.7](../hardware/tbeam-hardware#t-beam---v07) board is an earlier ve
]}>
<TabItem value="linux">
Check if you have `python3` and `pip` installed with the following command
```bash
python3 --version
pip3 --version
```
If `python3` is not installed, install with
```bash
sudo apt-get update
sudo apt-get install python3.6
```
If `pip` is not installed, install with
```bash
sudo apt-get install python3-pip
```
### Install Prerequisite Software
> Check if you have `python3` and `pip` installed with the following command
> ```bash
> python3 --version
> pip3 --version
> ```
> If `python3` is not installed, install with
> ```bash
> sudo apt-get update
> sudo apt-get install python3.6
> ```
> If `pip` is not installed, install with
> ```bash
> sudo apt-get install python3-pip
> ```
### Install `esptool`
> ```bash
> pip3 install --upgrade esptool
> ```
</TabItem>
<TabItem value="macos">
OS X comes with `Python 2.7` installed, but not `pip`. The following uses Homebrew to install `python3` which includes `pip3`. On MacOS you will use `pip3` instead of `pip`.
### Install Prerequisite Software
> OS X comes with `Python 2.7` installed, but not `pip`. The following uses Homebrew to install `python3` which includes `pip3`. On MacOS you will use `pip3` instead > of `pip`.
:::note
Check if you have Homebrew installed with the following command
@ -110,26 +109,33 @@ brew -v
If it's not installed, follow the instructions on the [Homebrew website](https://brew.sh) before continuing.
:::
Check if you have `python3` and `pip` installed with the following command
```bash
python3 --version
pip3 --version
```
If `python3` is not installed, install with
Install Python3
```bash
brew install python3
```
Confirm `pip3` was installed alongside `python3`
```bash
pip3 -v
```
> Check if you have `python3` and `pip` installed with the following command
> ```bash
> python3 --version
> pip3 --version
> ```
> If `python3` is not installed, install with
> Install Python3
> ```bash
> brew install python3
> ```
> Confirm `pip3` was installed alongside `python3`
> ```bash
> pip3 -v
> ```
### Install `esptool`
> ```bash
> pip3 install --upgrade esptool
> ```
</TabItem>
<TabItem value="windows">
- Download and install [Python](https://www.python.org/). When installing, make sure to click `Add Python X.Y to PATH`.
- Download and install [Gitbash](https://gitforwindows.org/) (or other appropriate shell) and run all subsequent commands from that shell.
> - Download and install [Python](https://www.python.org/). When installing, make sure to click `Add Python X.Y to PATH`.
> - Download and install [Gitbash](https://gitforwindows.org/) (or other appropriate shell) and run all subsequent commands from that shell.
:::note
Confirm installation of `python` & `pip` with the following commands.
@ -141,49 +147,23 @@ pip --version
```
:::
</TabItem>
</Tabs>
### Install `esptool`
### Install `esptool`
<Tabs
groupId="operating-system"
defaultValue="linux"
values={[
{label: 'Linux', value: 'linux'},
{label: 'macOS', value: 'macos'},
{label: 'Windows', value: 'windows'},
]}>
<TabItem value="linux">
```bash
pip3 install --upgrade esptool
```
</TabItem>
<TabItem value="macos">
```bash
pip3 install --upgrade esptool
```
</TabItem>
<TabItem value="windows">
```bash
pip install --upgrade esptool
```
> ```bash
> pip install --upgrade esptool
> ```
</TabItem>
</Tabs>
### Confirm Communication With Chip
Connect the radio to your computer using a data USB cable. Confirm your device is talking to your computer using the following command:
:::important
On windows, you must explicitly declare esptools as a .py script. Use `esptools.py chip_id`.
:::
```bash title="Command"
esptool chip_id
```
@ -214,30 +194,67 @@ cd /Downloads/firmware/
```
### Install/Update Firmware
Install or Update the device that you have by using the following commands according to your operating system:
:::caution
Be very careful to install the correct load for your board. In particular the popular 'T-BEAM' radio from TTGO is not called 'TTGO-Lora' (that is a different board). So don't install the 'TTGO-Lora' build on a TBEAM, it won't work correctly.
:::
#### Install Firmware
<Tabs
groupId="operating-system"
defaultValue="linux"
values={[
{label: 'Linux', value: 'linux'},
{label: 'macOS', value: 'macos'},
{label: 'Windows', value: 'windows'},
]}>
<TabItem value="linux">
Install the correct firmware for your board using the following command. Be sure to select the correct board and frequency.
```bash title="Command"
./device-install.sh -f firmware-BOARD-VERSION.bin
```
```bash title="Example"
./device-install.sh -f firmware-heltec-EU865-1.2.0.bin
```
#### Install
> ```bash title="Command"
> ./device-install.sh -f firmware-BOARD-VERSION.bin
> ```
#### Update Firmware
#### Update
> ```bash title="Command"
> ./device-update.sh -f firmware-BOARD-VERSION.bin
> ```
</TabItem>
<TabItem value="macos">
#### Install
> ```bash title="Command"
> ./device-install.sh -f firmware-BOARD-VERSION.bin
> ```
#### Update
> ```bash title="Command"
> ./device-update.sh -f firmware-BOARD-VERSION.bin
> ```
</TabItem>
<TabItem value="windows">
#### Install
> ```bash title="Command"
> ./device-install.bat -f firmware-BOARD-VERSION.bin
> ```
#### Update
> ```bash title="Command"
> ./device-update.bat -f firmware-BOARD-VERSION.bin
> ```
</TabItem>
</Tabs>
To update a the firmware on an existing Meshtastic device use the following command. Be sure to select the correct board and frequency.
```bash title="Command"
./device-update.sh -f firmware-BOARD-VERSION.bin
```
```bash title="Example"
./device-update.sh -f firmware-heltec-EU865-1.2.0.bin
```
## Graphical User Interface Instructions
@ -261,66 +278,43 @@ ESPHome Flasher also provides instructions to build from source or install via `
| [ESPHome Flasher](https://github.com/esphome/esphome-flasher/releases/latest) |
| :-----------------------------------------------------------: |
### Open ESPHome Flasher
> There should be no installation required. Connect your device using a data USB cable and refresh the `Serial Port`. Select the port that your device is connected to.
:::note
ESPHome Flasher for linux is a prebuilt binary for Ubuntu. These instructions were only tested on Ubuntu. Mileage may very on other distros.
:::
</TabItem>
<TabItem value="macos">
| [ESPHome Flasher](https://github.com/esphome/esphome-flasher/releases/latest) |
| :-----------------------------------------------------------: |
</TabItem>
<TabItem value="windows">
| [ESPHome Flasher](https://github.com/esphome/esphome-flasher/releases/latest) |
| :-----------------------------------------------------------: |
</TabItem>
</Tabs>
### Open ESPHome Flasher
<Tabs
groupId="operating-system"
defaultValue="linux"
values={[
{label: 'Linux', value: 'linux'},
{label: 'macOS', value: 'macos'},
{label: 'Windows', value: 'windows'},
]}>
<TabItem value="linux">
There should be no installation required. Connect your device using a data USB cable and refresh the `Serial Port`. Select the port that your device is connected to.
</TabItem>
<TabItem value="macos">
There should be no installation required. Connect your device using a data USB cable and refresh the `Serial Port`. Select the port that your device is connected to.
### Open ESPHome Flasher
> There should be no installation required. Connect your device using a data USB cable and refresh the `Serial Port`. Select the port that your device is connected to.
:::note
If you get an error saying `The application "ESPHome-Flasher.app" can't be opened` it is likely a permissions issue. See [here](https://github.com/esphome/esphome-flasher/issues/26#issuecomment-671061140) for instructions.
:::
:::note
If you get an error saying `"ESPHome-Flasher.app" cannot be opened because the developer cannot be verified`, click `cancel`. Right click on the application and select `Open`. Select `Open` on the confirmation alert.
>If you get an error saying `"ESPHome-Flasher.app" cannot be opened because the developer cannot be verified`, click `cancel`. Right click on the application and select `Open`. Select `Open` on the confirmation alert.
:::
</TabItem>
<TabItem value="windows">
There should be no installation required. Connect your device using a data USB cable and refresh the `Serial Port`. Select the port that your device is connected to.
| [ESPHome Flasher](https://github.com/esphome/esphome-flasher/releases/latest) |
| :-----------------------------------------------------------: |
### Open ESPHome Flasher
> There should be no installation required. Connect your device using a data USB cable and refresh the `Serial Port`. Select the port that your device is connected to.
</TabItem>
</Tabs>
:::note
If your device is not showing under `Serial Port` you may need to install the drivers for the [CP210X USB to UART bridge](https://www.silabes.com/products/development-tools/sofware/usb-to-uart-bridge-vcp-drivers).
:::
### Select Firmware
Browse to the previously downloaded firmware and select the correct firmware based on the board type and frequency.

View file

@ -11,12 +11,23 @@ The app is also available on the Amazon [Appstore](https://www.amazon.com/Geeksv
The application may not be found if your phone/Android version are too old. The minimum Android version is 5.0 (Lollipop 2014, first BLE support). However Android 6, Marshmallow 2015, is recommended as the Bluetooth is more stable.
The app can also be sideloaded by downloading the .apk from the <a href="https://github.com/meshtastic/Meshtastic-Android/releases/latest">GitHub releases</a> page. If you wish to view the code or contribute to development of the app, please visit the app's <a href="https://github.com/meshtastic/Meshtastic-Android">GitHub page</a>.
The app can also be sideloaded by downloading the .apk from the <a href="https://github.com/meshtastic/Meshtastic-Android/releases/latest">GitHub releases</a> page. If you do sideload, you may have to give your browser permissions to run a package installer. If you wish to view the code or contribute to development of the app, please visit the app's <a href="https://github.com/meshtastic/Meshtastic-Android">GitHub page</a>.
:::note
Be aware that you may have to open the drop down menu for "Compare" to see the latest alpha/beta builds. Generally the versions will follow the device versions.
:::
On installing the Meshtastic app, load it and navigate to the settings page. The app will ask you to give it permissions to access your location. This is needed for any app to use bluetooth, as the app is then able to scan the local area for bluetooth devices and, in theory, could triangulate your location based the devices it sees. If you give location permissions "only while using the app", the app will only be able to use bluetooth while it is open and visible to the user. This means if the screen is locked, or you are using another app, Meshtastic will not be able to use bluetooth, and will not be able to receive any messages from the node.
After installing the Meshtastic app, open it and navigate to the settings page. The app will ask you to give it permissions to access your location. This is needed for any app to use bluetooth, as the app is then able to scan the local area for bluetooth devices. If you give location permissions "only while using the app", the app will only be able to use bluetooth while it is open and visible to the user. This means if the screen is locked, or you are using another app, Meshtastic will not be able to use bluetooth, and will not be able to receive any messages from the node.
[![Messages page](/img/android/android-messages-sm.png)](/img/android/android-messages-sm.png) [![Nodes page](/img/android/android-nodes-sm.png)](/img/android/android-nodes.png) [![Channel page](/img/android/android-channel-sm.png)](/img/android/android-channel.png) [![Settings page](/img/android/android-settings-sm.png)](/img/android/android-settings.png) [![Debug page](/img/android/android-debug-sm.png)](/img/android/android-debug.png)
:::note
Be aware that every OS has a different way of handling permissions. In order to prevent the user from accidently allowing background location services, the dialog box may not give you the option.
Click on the image to see a quick video of where I found it on my phone.
[![Background Permissions Video](/img/android/android-bg-location-permissions.png)](https://youtu.be/YAFLxoeVIHg)
:::
There is a [beta program](https://play.google.com/apps/testing/com.geeksville.mesh) for the app, which will let you test the cutting edge changes, though this may come with extra bugs. You can join this via Google Play. It is recommended that you follow the [Meshtastic Discourse Alpha Testers](https://meshtastic.discourse.group/c/development/alpha-testers) channel if you decide to join this.
The app uses anonymous usage statistics and crash reports to allow us to catch problems with Meshtastic and fix them. Analytics are also required to be able to use the "free" plan of our map provider [Mapbox](https://docs.mapbox.com/help/how-mapbox-works/). You can disable this by unticking the checkbox on the settings page.

View file

@ -7,14 +7,14 @@ sidebar_label: Multiple channels
Version 1.2 of the software adds support for multiple (simultaneous) channels. The idea behind this feature is that a mesh can allow multiple users/groups to be share common mesh infrastructure. Even including routing messages for others when no one except that subgroup of users has the encryption keys for their private channel.
:::note
Older meshtastic applications that don't yet understand multi-channel support will only show the user the primary channel.
Older Meshtastic applications that don't yet understand multi-channel support will only show the user the primary channel.
:::
### What is the Primary channel
The way this works is that each node keeps a list of channels it knows about. One of those channels (normally the first one) is labelled as the "PRIMARY" channel. The primary channel is the **only** channel that is used to set radio parameters. This channel controls things like spread factor, coding rate, bandwidth etc... Indirectly this channel also is used to select the specific frequency that all members of this mesh are talking over.
This channel may or may not have a PSK (encryption). If you are providing mesh to 'the public' we recommend that you always leave this channel with its default psk. The default PSK is technically encrypted (and random users sniffing the ether would have to use meshtastic to decode it), but the key is included in the github source code and you should assume any 'attacker' would have it. But for a 'public' mesh you want this, because it allows anyone using meshtastic in your area to send packets through 'your' mesh.
This channel may or may not have a PSK (encryption). If you are providing mesh to 'the public' we recommend that you always leave this channel with its default psk. The default PSK is technically encrypted (and random users sniffing the ether would have to use Meshtastic to decode it), but the key is included in the github source code and you should assume any 'attacker' would have it. But for a 'public' mesh you want this, because it allows anyone using Meshtastic in your area to send packets through 'your' mesh.
```bash title="Setting default channel"
$ meshtastic --seturl https://www.meshtastic.org/d/#CgUYAyIBAQ
@ -34,7 +34,7 @@ Primary channel URL: https://www.meshtastic.org/d/#CgUYAyIBAQ
### How to use Secondary channels
Any channel you add after that Primary channel is Secondary. Secondary channels are used only for encyryption and (in the case of some special applications) security. If you would like to have a private channel over a more public mesh, you probably want to create a secondary channel. When sharing that URL with your private group you will share the "Complete URL". The complete URL includes your secondary channel (for encryption) and the primary channel (to provide radio/mesh access).
Any channel you add after that Primary channel is Secondary. Secondary channels are used only for encryption and (in the case of some special applications) security. If you would like to have a private channel over a more public mesh, you probably want to create a secondary channel. When sharing that URL with your private group you will share the "Complete URL". The complete URL includes your secondary channel (for encryption) and the primary channel (to provide radio/mesh access).
Secondary channels **must** have a PSK (encryption).

View file

@ -30,11 +30,11 @@ The screen is split up into pages, through which you can navigate using the prog
![Message page](/img/screen/mesh-message.jpg)
The next pages display information about the nodes that are currently on the mesh. This includes the distance and direction to that node, along with signal strenth and time last seen.
The next pages display information about the nodes that are currently on the mesh. This includes the distance and direction to that node, along with signal strength and time last seen.
![Node page](/img/screen/mesh-node1.jpg) ![Node page](/img/screen/mesh-node2.jpg)
The next page shows information about the device, battery power, number of nodes and how many are connected current, number of GPS satalites being received, channel name, last digits of the MAC address, and names of the last nodes to join the mesh.
The next page shows information about the device, battery power, number of nodes and how many are connected current, number of GPS satellites being received, channel name, last digits of the MAC address, and names of the last nodes to join the mesh.
![Channel page](/img/screen/mesh-channel.jpg)

View file

@ -4,7 +4,7 @@ title: Power Management State Machine
sidebar_label: Power Management
---
Long battery life is one of the main goals of this project. Based on intial measurements, the current code should run for about three days between charging (assuming using a t-beam with a 3500mAh 18650 battery). This will hopefully be increased to around eight days in the future.
Long battery life is one of the main goals of this project. Based on initial measurements, the current code should run for about three days between charging (assuming using a t-beam with a 3500mAh 18650 battery). This will hopefully be increased to around eight days in the future.
## States

View file

@ -4,11 +4,11 @@ title: Remote node administration
sidebar_label: Remote node admininstration
---
This feature will allow you to use the multiple channels feature to enable remote adminstration of meshtastic nodes. This will let you talk through the mesh to some far away node and change that node's settings. This is an advanced feature that (currently) few users would need. Also, keep in mind it is possible (if you are not careful) to assign settings to that remote node that cause it to completely drop off of your mesh.
This feature will allow you to use the multiple channels feature to enable remote adminstration of meshtastic nodes. This will let you talk through the mesh to some far away node and change that node's settings. This is an advanced feature that (currently) few users would need. Also, keep in mind it is possible (if you are not careful) to assign settings to that remote node that cause it to completely drop off of your mesh. We advise network admins have a test node to test settings with before applying changes to a remote node to prevent this.
## Creating the admin channel
By default, nodes will **only** respond to adminstrative commands via the local USB/bluetooth/TCP interface. This provides basic security to prevent unauthorized access. This is how normal administration and settings changes work. The only difference for the remote case is that we are sending those commands over the mesh.
By default, nodes will **only** respond to adminstrative commands via the local USB/bluetooth/TCP interface. This provides basic security to prevent unauthorized access and is how normal administration and settings changes work. The only difference for the remote case is that we are sending those commands over the mesh.
Before a node will allow remote admin access, it must have a primary channel:
```bash title="Expected output"
@ -20,16 +20,16 @@ Channels:
Primary channel URL: https://www.meshtastic.org/d/#CgUYAyIBAQ
```
So from this output you see that this node knows about only one channel and that its PSK is set to the default value.
So from this output you see can that this node knows about only one channel and that its PSK is set to the default value.
Now add an admin channel:
Now we add an admin channel:
```bash title="Command"
meshtastic --ch-add admin
```
:::note
The name of the channel is important, it must be `admin`.
The name of the channel is important and must be `admin`.
:::
Your channels will now look like this:
@ -47,11 +47,11 @@ Primary channel URL: https://www.meshtastic.org/d/#CgUYAyIBAQ
Complete URL (includes all channels): https://www.meshtastic.org/d/#CgUYAyIBAQopIiAdbsTecxuI1u-voyGwOicsKaPt5ICG23ONsjH-vk5CaCoFYWRtaW4
```
Notice that now we have a new secondary channel. Also, the `--info` option prints out TWO URLs. The `Complete URL` includes all of the channels this node understands. You should consider this URL something you should be very cautious about sharing. In the case of remote adminstration, you only need the node you want to adminster and the node you are locally connected to know this new "admin" channel.
Notice that now we have a new secondary channel and the `--info` option prints out TWO URLs. The `Complete URL` includes all of the channels this node understands. The URL contains the preshared keys and should be treated with caution and kept a secret. When deploying remote adminstration, you only need the node you want to administer and the node you are locally connected to know this new "admin" channel. All of the other nodes will forward the packets as long as they are a member of the primary channel.
## Sharing the admin channel with other nodes
I'm going to assume you've already created the admin channel on your "local node" i.e. the meshtastic node sitting on your desk at your home. But now you want to enable access on the "remote node" you want to eventually have far away from you.
Creating an "admin" channel automatically generates a preshared key, just like with [Multiple channel support](./device-channels). In order to administer to other nodes remotely, we need to copy the preshared key to the new nodes.
For this step you need physical access to both the nodes.
@ -68,7 +68,7 @@ At this point you can take your remote node and install it far away and still be
## Remotely administering your node
Now that both your local node and the remote node contain your secret admin channel key, you can do things like this:
Now that both your local node and the remote node contain your secret admin channel key, you can do things like:
Get the node list from the local node:
@ -94,6 +94,9 @@ INFO:root:Requesting configuration from remote node (this could take a while)
:::note
You will need to escape the `!` using `\!` otherwise the command will fail.
:::
:::note
The above note needs clarification. Currently, you refer to other nodes with `!########`. No backslashes are used.
:::
And you can now confirm via the local node that the remote node has changed:
@ -123,6 +126,23 @@ Primary channel URL: https://www.meshtastic.org/d/#CgUYAyIBAQ
Complete URL (includes all channels): https://www.meshtastic.org/d/#CgUYAyIBAQopIiAdbsTecxuI1u-voyGwOicsKaPt5ICG23ONsjH-vk5CaCoFYWRtaW4
```
## Admin Channel Setup is Complete
You've finished setting up and adding 2 devices to the admin channel. Remember, because this is a mesh network, it doesn't matter which node you are at; you could administer your first device we set up from the second one we added to the channel. And the settings and examples on this page are just a taste of the other settings you can set. Also, if you ever want to view a setting without having to read through the `--info`, you can always do the following:
```bash title="--get vs. --info"
$ meshtastic --dest \!28979058 --get ls_secs
Connected to radio
INFO:root:Requesting preferences from remote node (this could take a while)
ls_secs: 301
Completed getting preferences
```
For further reading, I recommend starting out with [Meshtastic-python](../python/python-cli) if you haven't already gone through this (hopefully you have since you are reading this). But for a full reference to the settings you can change, please see:
[Settings Overview](/docs/settings)
[Complete list of user settings in Protobufs](https://meshtastic.org/docs/developers/protobufs/api#radioconfiguserpreferences)
## Areas for future development
In the future we will add a "deadman timer" to this feature so that the remote node will revert any changes if you fail to send a special "commit changes" command. This will protect against sending bad settings to nodes that you can't physically access. Instead if the node does not receive a commit message within 10 minutes it will revert all changes and (hopefully) rejoin the mesh.

View file

@ -4,21 +4,24 @@ title: Command line interface
sidebar_label: CLI usage
---
This pip package will also install a "meshtastic" command line executable, which displays packets sent over the network as JSON and lets you see serial debugging information from the meshtastic devices. The source code for this tool is also a good [example](https://github.com/meshtastic/Meshtastic-python/blob/master/meshtastic/__main__.py) of a 'complete' application that uses the meshtastic python API.
This section covers installing a "meshtastic" command line executable, which displays packets sent over the network as JSON and lets you see serial debugging information from the Meshtastic devices. The source code for this tool is also a good [example](https://github.com/meshtastic/Meshtastic-python/blob/master/meshtastic/__main__.py) of a 'complete' application that uses the Meshtastic python API.
:::note
This command is not run inside of python, you run it from your operating system shell prompt directly. If when you type "meshtastic" it doesn't find the command and you are using Windows: Check that the python "scripts" directory [is in your path](https://datatofish.com/add-python-to-windows-path/).
The `meshtastic` command is not run within python but is a script run from your operating system shell prompt. When you type "meshtastic" and the prompt is unable to find the command in Windows, check that the python "scripts" directory [is in your path](https://datatofish.com/add-python-to-windows-path/).
:::
To display a (partial) list of the available commands:
To display a list of the available commands:
```bash
meshtastic -h
```
:::note
Because of the growing nature of this project, not all commands may appear when using the help command with `meshtastic -h`.
:::
## Changing device settings
You can also use this tool to set any of the device parameters which are stored in persistent storage. For instance, here's how to set the device
to keep the bluetooth link alive for eight hours (any usage of the bluetooth protcol from your phone will reset this timer)
to keep the bluetooth link alive for eight hours (any usage of the bluetooth protocol from your phone will reset this timer)
```bash title="Expected Output"
# You should see a result similar to this:
@ -47,21 +50,20 @@ meshtastic --set wifi_ap_mode true --set wifi_ssid mywifissid --set wifi_passwor
```
:::note
For a full list of preferences which can be set (and their documentation) can be found in the [protobufs](/docs/developers/protobufs/api#radioconfiguserpreferences)
For a full list of preferences which can be set (and their documentation) can be found in the [protobufs](/docs/developers/protobufs/api#radioconfiguserpreferences).
:::
### Changing channel settings
The channel settings can be changed similiarly. Either by using a standard (sharable) meshtastic URL or you can set partiular channel parameters (for advanced users).
The channel settings can also be changed, either by using a standard (sharable) meshtastic URL or you can set particular channel parameter (for advanced users).
The URL is constructed automatically based off of the current channel settings. So if you want to customize a channel you could do something like:
:::warning
Meshtastic encodes the radio channel and PSK in the channel's URL. All nodes must connect to the channel again by using the URL provided after a change in this section by performing the `--info` switch. Please refer to [Multiple Channel Support](../device/device-channels).
```bash
meshtastic --ch-set name mychan --ch-set channel_num 4 --info
```
This will change some channel params and then show device info (which will include the current channel URL)
You can even set the channel preshared key to a particular AES128 or AES256 sequence.
```bash

View file

@ -6,13 +6,16 @@ sidebar_label: Installation
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
This is a python library for using Meshtastic devices. This small library (and example application) provides an easy API for sending and receiving messages over mesh radios. It also provides access to any of the operations/data available in the device user interface or the Android application. Events are delivered using a publish-subscribe model, and you can subscribe to only the message types you are interested in.
This small library provides a command line interface for Meshtastic nodes and provides an easy API for sending and receiving messages over mesh radios, in addition to changing user settings. Using the command line is currently the most powerful w. Events are delivered using a publish-subscribe model, and you can subscribe to only the message types you are interested in.
[Full documentation](https://meshtastic.github.io/Meshtastic-python) for the library, including examples, is available.
If you wish to view the code or contribute to development of the python library or the command line interface, please visit the Meshtastic python <a href="https://github.com/meshtastic/Meshtastic-python">GitHub page</a>.
Installation is easily done through the [Python package installer pip](https://pypi.org/project/meshtastic/) (note, you must use pip version 20 or later):
Installation is easily done through the [Python package installer pip](https://pypi.org/project/meshtastic/):
:::note
You must use pip version 20 or later. To upgrade to the latest pip, do: `pip install --upgrade pip`
:::
<Tabs
groupId="operating-system"
@ -100,7 +103,10 @@ Installation is easily done through the [Python package installer pip](https://p
* Connect your Meshtastic device to your USB port
* Open Device Manager
* Under `Ports (COM & LPT)` you should see something like `Silicon Labs CP210X USB to UART Bridge (COM5)`
* If not download the drivers from [Silicon Labs](https://www.silabs.com/developers/usb-to-uart-bridge-vcp-drivers).
* If not download the drivers from [Silicon Labs](https://www.silabs.com/developers/usb-to-uart-bridge-vcp-drivers) or use the direct link below.
:::warning
You must install the [CP210x Universal Windows Driver](https://www.silabs.com/documents/public/software/CP210x_Universal_Windows_Driver.zip). If you do not install this driver, your device may not work and the driver may need to be uninstalled from device manager before installing the correct driver.
:::
* Check that your computer has Python 3 installed.
* Use the command
```powershell
@ -125,6 +131,10 @@ Installation is easily done through the [Python package installer pip](https://p
</TabItem>
<TabItem value="termux">
:::note
Wifi connection is currently under development and may not be working properly just yet. If you would like to provide feedback or test this feature, please visit our [forum](https://meshtastic.discourse.group/) or join our [Discord server](https://discord.gg/RjQKWHmzPZ) for more information.
:::
* Install [Termux](https://f-droid.org/en/packages/com.termux/) from the F-Droid app store (Google play does not currently support the latest builds)
* Load Termux and update the package list
```
@ -144,7 +154,7 @@ Installation is easily done through the [Python package installer pip](https://p
```
:::note
Be aware that currently the Meshtastic CLI is not able to control the nodes over USB through termux, but you can control devices over wifi using the `--host x.x.x.x` option with the device IP address. However, only ESP32 devices can use wifi currently.
Be aware that the Meshtastic CLI is not able to control the nodes over USB through termux, but you can control devices over wifi using the `--host x.x.x.x` option with the device IP address. However, only ESP32 devices can use wifi currently.
:::
</TabItem>
</Tabs>

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB