mirror of
https://github.com/meshtastic/meshtastic.git
synced 2025-02-21 03:25:51 -08:00
Linux docs overhaul
This commit is contained in:
parent
69f5133bc8
commit
9d41dd3876
127
docs/blocks/_linux-install.mdx
Normal file
127
docs/blocks/_linux-install.mdx
Normal file
|
@ -0,0 +1,127 @@
|
|||
import Tabs from "@theme/Tabs";
|
||||
import TabItem from "@theme/TabItem";
|
||||
import { Icon } from "@iconify/react";
|
||||
|
||||
<Tabs groupId="operating-systems" queryString="os">
|
||||
<TabItem value="debian" label={<><Icon icon="mdi:debian" style={{ marginRight: "0.25rem" }} height="1.5rem" /> Debian</>} default>
|
||||
Debian packages are provided via [OpenSUSE Build Service](https://build.opensuse.org/project/show/network:Meshtastic:beta).
|
||||
|
||||
Supported: `bookworm` (12)
|
||||
|
||||
**Install - Debian 12 (`bookworm`):**
|
||||
|
||||
```shell
|
||||
echo 'deb http://download.opensuse.org/repositories/network:/Meshtastic:/beta/Debian_12/ /' | sudo tee /etc/apt/sources.list.d/network:Meshtastic:beta.list
|
||||
curl -fsSL https://download.opensuse.org/repositories/network:Meshtastic:beta/Debian_12/Release.key | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/network_Meshtastic_beta.gpg > /dev/null
|
||||
sudo apt update
|
||||
sudo apt install meshtasticd
|
||||
```
|
||||
|
||||
<details>
|
||||
<summary>Experimental builds</summary>
|
||||
|
||||
These builds are provided without support, please **do not file issues** relating to Experimental builds.
|
||||
|
||||
Experimental Support: `trixie` (testing), `sid` (unstable)
|
||||
|
||||
**Install - Debian 13 (`trixie`):**
|
||||
|
||||
```shell
|
||||
echo 'deb http://download.opensuse.org/repositories/network:/Meshtastic:/beta/Debian_Testing/ /' | sudo tee /etc/apt/sources.list.d/network:Meshtastic:beta.list
|
||||
curl -fsSL https://download.opensuse.org/repositories/network:Meshtastic:beta/Debian_Testing/Release.key | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/network_Meshtastic_beta.gpg > /dev/null
|
||||
sudo apt update
|
||||
sudo apt install meshtasticd
|
||||
```
|
||||
|
||||
**Install - Debian unstable (`sid`):**
|
||||
|
||||
```shell
|
||||
echo 'deb http://download.opensuse.org/repositories/network:/Meshtastic:/beta/Debian_Unstable/ /' | sudo tee /etc/apt/sources.list.d/network:Meshtastic:beta.list
|
||||
curl -fsSL https://download.opensuse.org/repositories/network:Meshtastic:beta/Debian_Unstable/Release.key | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/network_Meshtastic_beta.gpg > /dev/null
|
||||
sudo apt update
|
||||
sudo apt install meshtasticd
|
||||
```
|
||||
</details>
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="raspbian" label={<><Icon icon="cib:raspberry-pi" style={{ marginRight: "0.25rem" }} height="1.5rem" /> Raspbian</>}>
|
||||
Raspbian (Raspberry Pi OS) packages are provided via [OpenSUSE Build Service](https://build.opensuse.org/project/show/network:Meshtastic:beta).
|
||||
|
||||
Supported: `bookworm` (12)
|
||||
|
||||
**Install - Raspbian 12 (`bookworm`):**
|
||||
|
||||
```shell
|
||||
echo 'deb http://download.opensuse.org/repositories/network:/Meshtastic:/beta/Raspbian_12/ /' | sudo tee /etc/apt/sources.list.d/network:Meshtastic:beta.list
|
||||
curl -fsSL https://download.opensuse.org/repositories/network:Meshtastic:beta/Raspbian_12/Release.key | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/network_Meshtastic_beta.gpg > /dev/null
|
||||
sudo apt update
|
||||
sudo apt install meshtasticd
|
||||
```
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="ubuntu" label={<><Icon icon="mdi:ubuntu" style={{ marginRight: "0.25rem" }} height="1.5rem" /> Ubuntu</>}>
|
||||
Ubuntu packages are provided via [Canonical Launchpad](https://launchpad.net/~meshtastic/+archive/ubuntu/beta).
|
||||
|
||||
Supported: `oracular` (24.10), `noble` (24.04 LTS), `jammy` (22.04 LTS)
|
||||
|
||||
**Install:**
|
||||
|
||||
```shell
|
||||
# Install requirements for add-apt-repository
|
||||
sudo apt install software-properties-common
|
||||
# Add Meshtastic repo
|
||||
sudo add-apt-repository ppa:meshtastic/beta
|
||||
# Install meshtasticd
|
||||
sudo apt install meshtasticd
|
||||
```
|
||||
|
||||
<details>
|
||||
<summary>Experimental builds</summary>
|
||||
|
||||
These builds are provided without support, please **do not file issues** relating to Experimental builds.
|
||||
|
||||
Experimental Support: `plucky` (25.04)
|
||||
|
||||
**Install:**
|
||||
|
||||
> Install via the instructions above.
|
||||
</details>
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="fedora" label={<><Icon icon="mdi:fedora" style={{ marginRight: "0.25rem" }} height="1.5rem" /> Fedora</>}>
|
||||
Fedora packages are provided via [Fedora COPR](https://copr.fedorainfracloud.org/coprs/g/meshtastic/beta/).
|
||||
|
||||
Supported: Fedora `41`, Fedora `40`
|
||||
|
||||
**Install:**
|
||||
|
||||
```shell
|
||||
# Add Meshtastic COPR repo
|
||||
sudo dnf copr enable @meshtastic/beta
|
||||
# Install meshtasticd
|
||||
sudo dnf install meshtasticd
|
||||
```
|
||||
|
||||
</TabItem>
|
||||
|
||||
<TabItem value="docker" label={<><Icon icon="mdi:docker" style={{ marginRight: "0.25rem" }} height="1.5rem" /> Docker</>}>
|
||||
Docker containers are provided via [DockerHub](https://hub.docker.com/r/meshtastic/meshtasticd).
|
||||
|
||||
Supported platforms: `linux/amd64`, `linux/arm64`, `linux/arm/v7`
|
||||
|
||||
**Pull Debian:**
|
||||
|
||||
```shell
|
||||
docker pull meshtastic/meshtasticd:beta-debian
|
||||
```
|
||||
|
||||
**Pull Alpine:**
|
||||
|
||||
```shell
|
||||
docker pull meshtastic/meshtasticd:beta-alpine
|
||||
```
|
||||
|
||||
See: [Docker Usage](/docs/software/linux/usage/#usage-with-docker)
|
||||
|
||||
</TabItem>
|
||||
</Tabs>
|
|
@ -1,9 +1,26 @@
|
|||
- Necessary system libraries should be installed before building or installing Meshtasticd.
|
||||
import Tabs from "@theme/Tabs";
|
||||
import TabItem from "@theme/TabItem";
|
||||
import { Icon } from "@iconify/react";
|
||||
|
||||
```shell
|
||||
sudo apt install libgpiod-dev libyaml-cpp-dev libbluetooth-dev libusb-1.0-0-dev libi2c-dev
|
||||
```
|
||||
- And optionally for web server support
|
||||
```shell
|
||||
sudo apt install openssl libssl-dev libulfius-dev liborcania-dev
|
||||
```
|
||||
The following libraries must be installed before building `meshtasticd`:
|
||||
<Tabs groupId="operating-systems" queryString="os">
|
||||
<TabItem value="debian" label={<><Icon icon="mdi:debian" style={{ marginRight: "0.25rem" }} height="1.5rem" /> Debian</>} default>
|
||||
```shell
|
||||
# Base dependencies
|
||||
sudo apt install libgpiod-dev libyaml-cpp-dev libbluetooth-dev libusb-1.0-0-dev libi2c-dev
|
||||
# Optional dependencies for web server support
|
||||
sudo apt install openssl libssl-dev libulfius-dev liborcania-dev
|
||||
```
|
||||
</TabItem>
|
||||
|
||||
<TabItem value="fedora" label={<><Icon icon="mdi:fedora" style={{ marginRight: "0.25rem" }} height="1.5rem" /> Fedora</>}>
|
||||
```shell
|
||||
# Enable the Meshtastic build tools COPR repository
|
||||
sudo dnf copr enable @meshtastic/build-tools
|
||||
# Base dependencies
|
||||
sudo dnf install gcc-c++ pkgconfig(yaml-cpp) pkgconfig(libgpiod) pkgconfig(bluez) pkgconfig(libusb-1.0) libi2c-devel
|
||||
# Optional dependencies for web server support
|
||||
sudo dnf install pkgconfig(openssl) pkgconfig(liborcania) pkgconfig(libyder) pkgconfig(libulfius)
|
||||
```
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
|
27
docs/development/linux.mdx
Normal file
27
docs/development/linux.mdx
Normal file
|
@ -0,0 +1,27 @@
|
|||
---
|
||||
id: linux
|
||||
title: Linux Development
|
||||
sidebar_label: Linux
|
||||
sidebar_position: 2
|
||||
description: Building and packaging Meshtastic for Linux.
|
||||
---
|
||||
|
||||
import NativeLibraries from "@site/docs/blocks/_native-libraries.mdx";
|
||||
|
||||
The device software can also run on a native Linux machine thanks to the [Portduino framework](https://github.com/meshtastic/framework-portduino).
|
||||
|
||||
The application either simulates some of the interfaces, or uses the real hardware of your machine.
|
||||
Device firmware from 1.3.42 and on even allows you to simulate the LoRa chip by sending and receiving Meshtastic packets via a local TCP port.
|
||||
In this way, you can let multiple instances of the application communicate with each other as if they did via LoRa.
|
||||
For instructions on how to use it, see the [interactive simulator](https://github.com/GUVWAF/Meshtasticator/blob/master/INTERACTIVE_SIM.md) that also emulates a wireless environment using simulated positions of the nodes.
|
||||
|
||||
<NativeLibraries />
|
||||
|
||||
## Building
|
||||
|
||||
The easiest way of building the native application is using Visual Studio Code with the PlatformIO extension.
|
||||
See the instructions for creating such a building environment [here](/docs/development/firmware/build).
|
||||
|
||||
Then after opening the firmware repository in Visual Studio Code, simply click on the PlatformIO extension in the left bar, select `native` and click on 'Build'.
|
||||
This will generate the binary file 'program' which you can find in `.pio/build/native/`.
|
||||
Once in this directory or when you copied the file to your current directory, launch the application with `./program`.
|
|
@ -6,11 +6,7 @@ sidebar_position: 11
|
|||
description: Set up and configure Meshtastic on Linux-native devices using the meshtasticd binary.
|
||||
---
|
||||
|
||||
<!-- markdownlint-disable code-block-style -->
|
||||
|
||||
import Tabs from "@theme/Tabs";
|
||||
import TabItem from "@theme/TabItem";
|
||||
import { Icon } from "@iconify/react";
|
||||
import LinuxInstall from "@site/docs/blocks/_linux-install.mdx";
|
||||
|
||||
This page outlines the setup of Meshtastic on Linux-native devices, utilizing portduino to run the Meshtastic firmware under Linux.
|
||||
|
||||
|
@ -35,12 +31,16 @@ Before proceeding with the setup, ensure the device meets the following requirem
|
|||
### Hardware Compatibility
|
||||
|
||||
:::caution Warning
|
||||
- UART HATs and SX1302/SX1303 chip-based HATs are not supported. Only hats that use a SPI radio can work with Meshtastic.
|
||||
- Waveshare SX1262 LoRaWAN Node Module Expansion Board for Raspberry Pi, while supported, does have known hardware limitations that may affect longer messages. Users should be mindful of this when composing messages. It is also recommended to use the CLIENT_MUTE role to avoid rebroadcasting larger messages.
|
||||
- **UART** HATs and SX1302/SX1303 chip-based HATs are not supported. Only hats that use a SPI radio can work with Meshtastic.
|
||||
- The Waveshare SX1262 LoRaWAN Hat for Raspberry Pi is not recommended for deployment. It has known hardware limitations that may affect longer messages. If you must use it, please use the **CLIENT_MUTE** role to avoid rebroadcasting.
|
||||
- The Pine64 Pinedio is also not recommended for deployment, as it suffers from similar hardware limitations as the Waveshare SX1262 LoRaWAN Hat.
|
||||
|
||||
See: [The Meshtastic CRC Problem](https://www.youtube.com/watch?v=PND1GlMSrEM)
|
||||
:::
|
||||
|
||||
- Tested USB devices include the [MeshStick](https://github.com/markbirss/MESHSTICK) and Pinedio CH341 USB adapter.
|
||||
- Tested Raspberry Pi LoRa hats include the [MeshAdv-Pi v1.1](https://github.com/chrismyers2000/MeshAdv-Pi-Hat), Adafruit RFM9x, and Elecrow Lora RFM95 IOT.
|
||||
- Support for I2C displays, SPI displays, and keyboard input has been confirmed. It is necessary to be aware of potential pin conflicts when stacking hats.
|
||||
- Support for I²C displays, SPI displays, and keyboard input has been confirmed. It is necessary to be aware of potential pin conflicts when stacking hats.
|
||||
|
||||
### System Requirements
|
||||
|
||||
|
@ -51,121 +51,25 @@ Before proceeding with the setup, ensure the device meets the following requirem
|
|||
|
||||
### Installing Meshtasticd
|
||||
|
||||
<!-- markdownlint-disable no-inline-html -->
|
||||
<LinuxInstall />
|
||||
|
||||
<Tabs groupId="operating-systems" queryString="os">
|
||||
<TabItem value="debian" label={<><Icon icon="mdi:debian" height="1.5rem" /> Debian</>} default>
|
||||
Debian packages are provided via [OpenSUSE Build Service](https://build.opensuse.org/project/show/network:meshtastic).
|
||||
## Hardware Interfaces
|
||||
|
||||
Supported: `bookworm`
|
||||
### USB
|
||||
|
||||
**Install - Debian 12 (`bookworm`):**
|
||||
```shell
|
||||
```
|
||||
USB support via the **CH341** was added in Meshtastic 2.5.18.
|
||||
|
||||
<details>
|
||||
<summary>Experimental builds</summary>
|
||||
Note that in order for Linux to recognize multiple CH341-USB devices, an EEPROM must be included onboard, burned with a unique serial number.
|
||||
Devices like the Pine64 Pinedio v1 do not include this.
|
||||
|
||||
These builds are provided without support, please **do not file issues** relating to Experimental builds.
|
||||
### SPI (Raspberry Pi)
|
||||
|
||||
Experimental Support: `trixie` (testing), `sid` (unstable)
|
||||
|
||||
**Install - Debian 13 (`trixie`):**
|
||||
```shell
|
||||
```
|
||||
|
||||
**Install - Debian unstable (`sid`):**
|
||||
```shell
|
||||
```
|
||||
</details>
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="raspbian" label={<><Icon icon="cib:raspberry-pi" height="1.5rem" /> Raspbian</>}>
|
||||
Raspbian (Raspberry Pi OS) packages are provided via [OpenSUSE Build Service](https://build.opensuse.org/project/show/network:meshtastic).
|
||||
|
||||
Supported: `bookworm`
|
||||
|
||||
**Install - Raspbian 12 (`bookworm`):**
|
||||
```shell
|
||||
```
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="ubuntu" label={<><Icon icon="mdi:ubuntu" height="1.5rem" /> Ubuntu</>}>
|
||||
Ubuntu packages are provided via [Canonical Launchpad](https://launchpad.net/~meshtastic).
|
||||
|
||||
Supported: `oracular` (24.10), `noble` (24.04 LTS), `jammy` (22.04 LTS)
|
||||
|
||||
**Install:**
|
||||
```shell
|
||||
# Install requirements for add-apt-repository
|
||||
sudo apt install software-properties-common
|
||||
# Add Meshtastic repo
|
||||
sudo add-apt-repository ppa:meshtastic/beta
|
||||
# Install meshtasticd
|
||||
sudo apt install meshtasticd
|
||||
```
|
||||
|
||||
<details>
|
||||
<summary>Experimental builds</summary>
|
||||
|
||||
These builds are provided without support, please **do not file issues** relating to Experimental builds.
|
||||
|
||||
Experimental Support: `plucky` (25.04)
|
||||
|
||||
**Install:**
|
||||
> Install via the instructions above.
|
||||
</details>
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="fedora" label={<><Icon icon="mdi:fedora" height="1.5rem" /> Fedora</>}>
|
||||
Fedora packages are provided via Fedora COPR.
|
||||
|
||||
Supported[^1]: `41`, `40`
|
||||
|
||||
**Install:**
|
||||
```shell
|
||||
# Add Meshtastic COPR repo
|
||||
sudo dnf copr enable <insert_copr_here>
|
||||
# Install meshtasticd
|
||||
sudo dnf install meshtasticd
|
||||
```
|
||||
|
||||
<details>
|
||||
<summary>Experimental builds</summary>
|
||||
|
||||
These builds are provided without support, please **do not file issues** relating to Experimental builds.
|
||||
|
||||
Experimental Support: `rawhide`
|
||||
|
||||
**Install - `rawhide`:**
|
||||
> Install via the instructions above.
|
||||
</details>
|
||||
|
||||
</TabItem>
|
||||
|
||||
<TabItem value="docker" label={<><Icon icon="mdi:docker" height="1.5rem" /> Docker</>}>
|
||||
Docker containers are provided via [DockerHub](https://hub.docker.com/r/meshtastic/meshtasticd).
|
||||
|
||||
**Pull:**
|
||||
```shell
|
||||
docker pull meshtastic/meshtasticd
|
||||
```
|
||||
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
<!-- markdownlint-enable no-inline-html -->
|
||||
|
||||
## Configuration
|
||||
|
||||
### Hardware Interfaces
|
||||
|
||||
For devices requiring SPI or I2C:
|
||||
Enable SPI support for LoRa Radio
|
||||
|
||||
- This can be done by running the below commands on a Raspberry Pi (2-5)
|
||||
|
||||
```shell
|
||||
sudo raspi-config nonint set_config_var dtparam=spi on /boot/firmware/config.txt # Enable SPI
|
||||
sudo raspi-config nonint set_config_var dtparam=i2c_arm on /boot/firmware/config.txt # Enable i2c_arm
|
||||
|
||||
# Ensure dtoverlay=spi0-0cs is set in /boot/firmware/config.txt without altering dtoverlay=vc4-kms-v3d or dtparam=uart0
|
||||
sudo sed -i -e '/^\s*#\?\s*dtoverlay\s*=\s*vc4-kms-v3d/! s/^\s*#\?\s*(dtoverlay|dtparam\s*=\s*uart0)\s*=.*/dtoverlay=spi0-0cs/' /boot/firmware/config.txt
|
||||
|
@ -183,13 +87,25 @@ dtparam=spi=on
|
|||
dtoverlay=spi0-0cs
|
||||
```
|
||||
|
||||
- I2C support is enabled with:
|
||||
### I²C (Raspberry Pi)
|
||||
|
||||
Enable I²C support
|
||||
|
||||
Enabled with:
|
||||
|
||||
```shell
|
||||
sudo raspi-config nonint set_config_var dtparam=i2c_arm on /boot/firmware/config.txt # Enable i2c_arm
|
||||
```
|
||||
|
||||
Or manually enabled in `/boot/firmware/config.txt`:
|
||||
|
||||
```plaintext
|
||||
dtparam=i2c_arm=on
|
||||
```
|
||||
|
||||
### GPS Support
|
||||
### UART (Raspberry Pi)
|
||||
|
||||
Enable UART support for GPS
|
||||
|
||||
- You can enable UART by running the below commands (which additionally will disable serial console tty)
|
||||
|
||||
|
@ -216,31 +132,31 @@ dtoverlay=uart0
|
|||
sudo raspi-config nonint do_serial_cons 1 # Disable Serial Console
|
||||
```
|
||||
|
||||
## Configuration
|
||||
|
||||
### Meshtasticd Configuration
|
||||
|
||||
- The meshtasticd configuration is at `/etc/meshtasticd/config.yaml` by default. If a `config.yaml` is found in the current directory, that takes precedence. And a config file specified with the `-c/--config` option has the highest precedence.
|
||||
|
||||
To enable a LoRa radio connected to your device, uncomment the appropriate lines in the config file, including the Module line. As an example, the Waveshare SX126X module would have a Lora section that looks like this:
|
||||
To enable a LoRa radio connected to your device, first locate it's configuration in the presets, then copy to `config.d`.
|
||||
|
||||
```yaml
|
||||
Lora:
|
||||
Module: sx1262 # Waveshare SX126X XXXM
|
||||
DIO2_AS_RF_SWITCH: true
|
||||
CS: 21
|
||||
IRQ: 16
|
||||
Busy: 20
|
||||
Reset: 18
|
||||
```shell
|
||||
# First, locate your radio hardware
|
||||
ls /etc/meshtasticd/available.d
|
||||
# Ex: display-waveshare-2.8.yaml lora-MeshAdv-900M30S.yaml lora-meshstick-1262.yaml
|
||||
|
||||
# Then, copy desired config to `config.d`
|
||||
# Example:
|
||||
cp /etc/meshtasticd/available.d/lora-MeshAdv-900M30S.yaml /etc/meshtasticd/config.d/
|
||||
```
|
||||
|
||||
:::info
|
||||
The config.yaml file is sensitive to spacing, so ensure that the indentation and spacing are correct.
|
||||
The `config.yaml` file is sensitive to spacing, so ensure that the indentation and spacing are correct.
|
||||
:::
|
||||
|
||||
### Web Server
|
||||
|
||||
`meshtasticd` has web server support starting with release `2.3.0`.[^1]
|
||||
|
||||
[^1]: Fedora packages do not currently include **web server** support.
|
||||
`meshtasticd` has web server support starting with release `2.3.0`.
|
||||
|
||||
To enable this:
|
||||
|
||||
|
@ -258,54 +174,50 @@ Bluetooth is currently unsupported and not functional on Linux Native devices. T
|
|||
|
||||
- The persistent .proto db files of the portduino version of meshtasticd are stored under: `/root/.portduino/default/prefs/`.
|
||||
|
||||
### Advanced Setup and Troubleshooting
|
||||
## Advanced Setup and Troubleshooting
|
||||
|
||||
#### Enabling the systemd service
|
||||
### Enabling the systemd service
|
||||
|
||||
To configure the device to start and stop meshtasticd as as service using systemctl you can setup the service unit using the instructions below.
|
||||
|
||||
<!-- markdownlint-disable no-inline-html -->
|
||||
|
||||
<details>
|
||||
<summary>Create the systemd service (only for manual installs)</summary>
|
||||
|
||||
The `meshtasticd` systemd service is automatically installed when using the official Meshtastic packages.
|
||||
These instructions are only needed when installing manually.
|
||||
The `meshtasticd` systemd service is automatically installed when using the official Meshtastic packages.
|
||||
These instructions are only needed when installing manually.
|
||||
|
||||
Create the service unit file:
|
||||
Create the service unit file:
|
||||
|
||||
Create a new file in the /etc/systemd/system/ directory with a name like meshtasticd.service.
|
||||
Create a new file in the /etc/systemd/system/ directory with a name like meshtasticd.service.
|
||||
|
||||
```shell
|
||||
sudo nano /etc/systemd/system/meshtasticd.service
|
||||
```
|
||||
```shell
|
||||
sudo nano /etc/systemd/system/meshtasticd.service
|
||||
```
|
||||
|
||||
Add the following content to the file:
|
||||
Add the following content to the file:
|
||||
|
||||
```plaintext
|
||||
[Unit]
|
||||
Description=Meshtastic Daemon
|
||||
After=network.target
|
||||
```plaintext
|
||||
[Unit]
|
||||
Description=Meshtastic Daemon
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
ExecStart=/usr/sbin/meshtasticd
|
||||
Restart=always
|
||||
User=root
|
||||
Group=root
|
||||
Type=simple
|
||||
[Service]
|
||||
ExecStart=/usr/sbin/meshtasticd
|
||||
Restart=always
|
||||
User=root
|
||||
Group=root
|
||||
Type=simple
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
```
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
```
|
||||
|
||||
Reload systemd to recognize the new service:
|
||||
|
||||
```shell
|
||||
sudo systemctl daemon-reload
|
||||
```
|
||||
Reload systemd to recognize the new service:
|
||||
|
||||
```shell
|
||||
sudo systemctl daemon-reload
|
||||
```
|
||||
</details>
|
||||
<!-- markdownlint-enable no-inline-html -->
|
||||
|
||||
Enable the service to start on boot:
|
||||
|
||||
|
@ -313,7 +225,7 @@ Enable the service to start on boot:
|
|||
sudo systemctl enable meshtasticd
|
||||
```
|
||||
|
||||
##### Starting and Stopping the Service
|
||||
#### Starting and Stopping the Service
|
||||
|
||||
Start the service:
|
||||
|
||||
|
@ -337,7 +249,7 @@ sudo systemctl stop meshtasticd
|
|||
|
||||
By following these steps, you set up a systemd service for meshtasticd that will start automatically at boot and restart if it crashes. You can manage it using the standard systemctl commands (start, stop, restart, status, etc.).
|
||||
|
||||
#### View Logs of Meshtastic
|
||||
### View Logs of Meshtastic
|
||||
|
||||
To view the log output of the meshtasticd service, use the below command to read them out of the system journal.
|
||||
|
||||
|
@ -345,7 +257,7 @@ To view the log output of the meshtasticd service, use the below command to read
|
|||
journalctl -u meshtasticd -b
|
||||
```
|
||||
|
||||
#### Avahi setup
|
||||
### Avahi setup
|
||||
|
||||
This will allow the Android client to auto-discover your Linux Native device.
|
||||
|
||||
|
|
|
@ -1,98 +0,0 @@
|
|||
---
|
||||
id: linux-native
|
||||
title: Linux Native Application
|
||||
sidebar_label: Linux Native
|
||||
sidebar_position: 5
|
||||
---
|
||||
|
||||
import NativeLibraries from "@site/docs/blocks/_native-libraries.mdx";
|
||||
|
||||
The device software can also run on a native Linux machine thanks to the [Portduino framework](https://github.com/geeksville/framework-portduino).
|
||||
|
||||
The application either simulates some of the interfaces, or uses the real hardware of your machine.
|
||||
Device firmware from 1.3.42 and on even allows you to simulate the LoRa chip by sending and receiving Meshtastic packets via a local TCP port.
|
||||
In this way, you can let multiple instances of the application communicate with each other as if they did via LoRa.
|
||||
For instructions on how to use it, see the [interactive simulator](https://github.com/GUVWAF/Meshtasticator/blob/master/INTERACTIVE_SIM.md) that also emulates a wireless environment using simulated positions of the nodes.
|
||||
|
||||
## Usage with a Linux machine
|
||||
|
||||
The easiest way of building the native application is using Visual Studio Code with the PlatformIO extension.
|
||||
See the instructions for creating such a building environment [here](/docs/development/firmware/build).
|
||||
|
||||
<NativeLibraries />
|
||||
|
||||
Then after opening the firmware repository in Visual Studio Code, simply click on the PlatformIO extension in the left bar, select native and click on 'Build'.
|
||||
This will generate the binary file 'program' which you can find in `.pio/build/native/`.
|
||||
Once in this directory or when you copied the file to your current directory, launch the application with `./program`.
|
||||
|
||||
Additional arguments can be given to the program, which are listed as follows:
|
||||
|
||||
- `-d DIRECTORY`: The directory to use as the virtual filesystem (VFS).
|
||||
- `-e`: Erase the virtual filesystem before use.
|
||||
- `-h MAC_ADDRESS`: The MAC address to assign to this virtual machine.
|
||||
- `-p TCP_PORT`: The local TCP port to use for running the Meshtastic API.
|
||||
|
||||
## Usage with Docker
|
||||
|
||||
If you do not own a Linux machine, or you just want to separate things, you might want
|
||||
to run the application inside a docker container.
|
||||
|
||||
### The Image
|
||||
|
||||
To build docker image, type
|
||||
|
||||
`docker build -t meshtastic/device .`
|
||||
|
||||
### Usage
|
||||
|
||||
To run a container, type
|
||||
|
||||
`docker run --rm -p 4403:4403 meshtastic/device`
|
||||
|
||||
or, to get an interactive shell on the docker created container:
|
||||
|
||||
`docker run -it -p 4403:4403 meshtastic/device bash`
|
||||
|
||||
You might want to mount your local development folder:
|
||||
firmware
|
||||
`docker run -it --mount type=bind,source=/PathToMyProjects/Meshtastic/Meshtastic-device-mybranch,target=/Meshtastic-device-mybranch -p 4403:4403 meshtastic/device bash`
|
||||
|
||||
### Build the native application
|
||||
|
||||
Linux native application should be built inside the container.
|
||||
For this you must run container with interactive console
|
||||
"-it", as seen above.
|
||||
|
||||
First, some environment variables need to be set up with command:
|
||||
|
||||
`. ~/.platformio/penv/bin/activate`
|
||||
|
||||
You can build amd64 image with command
|
||||
|
||||
`./bin/build-native.sh`
|
||||
|
||||
### Executing the application interactively
|
||||
|
||||
The built binary file should be found under name
|
||||
`release/latest/bins/universal/meshtastic_linux_amd64`.
|
||||
If this is not the case, you can also use the direct program name:
|
||||
`.pio/build/native/program`
|
||||
|
||||
To use Python CLI against exposed TCP port 4403,
|
||||
type this in the host machine:
|
||||
|
||||
`meshtastic --info --host localhost`
|
||||
|
||||
While you can interact with it in the same way as a normal device using a client that supports TCP connections, the application has its limitations. For example, rebooting is not implemented, so for some settings to apply you have to restart the application.
|
||||
|
||||
### Stop the container
|
||||
|
||||
Run this to get the ID:
|
||||
|
||||
`docker ps`
|
||||
|
||||
Stop the container with command:
|
||||
|
||||
`docker kill <id>`
|
||||
|
||||
> Tip: you can just use the first few characters of the ID in docker commands
|
6
docs/software/linux/_category_.yml
Normal file
6
docs/software/linux/_category_.yml
Normal file
|
@ -0,0 +1,6 @@
|
|||
label: Linux
|
||||
collapsible: true
|
||||
position: 5
|
||||
link:
|
||||
type: generated-index
|
||||
title: Linux
|
16
docs/software/linux/installation.mdx
Normal file
16
docs/software/linux/installation.mdx
Normal file
|
@ -0,0 +1,16 @@
|
|||
---
|
||||
id: installation
|
||||
title: Installation - meshtasticd
|
||||
description: Install the Meshtastic daemon on Linux systems.
|
||||
sidebar_label: Installation
|
||||
sidebar_position: 1
|
||||
---
|
||||
|
||||
import LinuxInstall from "@site/docs/blocks/_linux-install.mdx";
|
||||
|
||||
<LinuxInstall />
|
||||
|
||||
See Also:
|
||||
- [Linux Devices](/docs/hardware/devices/linux-native-hardware)
|
||||
- [Linux Usage](/docs/software/linux/usage)
|
||||
- [Linux Development](/docs/development/linux)
|
102
docs/software/linux/usage.mdx
Normal file
102
docs/software/linux/usage.mdx
Normal file
|
@ -0,0 +1,102 @@
|
|||
---
|
||||
id: usage
|
||||
title: Usage - meshtasticd
|
||||
description: Usage of the Meshtastic daemon on Linux systems.
|
||||
sidebar_label: Usage
|
||||
sidebar_position: 2
|
||||
---
|
||||
|
||||
## meshtasticd CLI options
|
||||
|
||||
Additional arguments can be given to the program, which are listed as follows:
|
||||
|
||||
- `-c CONFIG_FILE`: The configuration file to use.
|
||||
- `-d DIRECTORY`: The directory to use as the virtual filesystem (VFS).
|
||||
- `-e`: Erase the virtual filesystem before use.
|
||||
- `-h MAC_ADDRESS`: The MAC address to assign to this virtual machine.
|
||||
- `-p TCP_PORT`: The local TCP port to use for running the Meshtastic API.
|
||||
|
||||
## Usage with Docker
|
||||
|
||||
If you do not own a Linux machine, or you just want to separate things, you might want
|
||||
to run the application inside a docker container.
|
||||
|
||||
### Usage
|
||||
|
||||
First, [Pull the image](/docs/software/linux/installation/?os=docker)
|
||||
|
||||
To run a container, type
|
||||
|
||||
```shell
|
||||
docker run -p 4403:4403 --restart unless-stopped --name meshtasticd meshtastic/meshtasticd:beta
|
||||
```
|
||||
|
||||
or, to get an interactive shell on the docker created container:
|
||||
|
||||
```shell
|
||||
docker run -it -p 4403:4403 --restart unless-stopped --name meshtasticd meshtastic/meshtasticd:beta bash
|
||||
```
|
||||
|
||||
### CH341 USB
|
||||
|
||||
If you want to use a `CH341` USB adapter (MeshStick), you need to pass the `bus` device to the container with the `--device` flag:
|
||||
|
||||
First, locate the USB device with `lsusb`:
|
||||
|
||||
```shell
|
||||
lsusb
|
||||
```
|
||||
|
||||
You should see something like this:
|
||||
|
||||
```plaintext
|
||||
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
|
||||
Bus 001 Device 002: ID 1199:9091 Sierra Wireless, Inc. EM7565-9
|
||||
Bus 001 Device 003: ID 8087:0032 Intel Corp. AX210 Bluetooth
|
||||
Bus 001 Device 004: ID 13d3:56b2 IMC Networks Integrated Camera
|
||||
Bus 001 Device 005: ID 06cb:009a Synaptics, Inc. Metallica MIS Touch Fingerprint Reader
|
||||
Bus 001 Device 006: ID 1a86:5512 QinHeng Electronics CH341 in EPP/MEM/I2C mode, EPP/I2C adapter
|
||||
```
|
||||
|
||||
Locate the `CH341` device and take note of the **Bus** and **Device** numbers. In this example: `001/006`.
|
||||
|
||||
Then, run the container with the `--device` flag,
|
||||
additionally mounting a local configuration file:
|
||||
|
||||
```shell
|
||||
docker run -it -p 4403:4403 --restart unless-stopped --name meshtasticd --device=/dev/bus/usb/001/006 -v ./config.yaml:/etc/meshtasticd/config.yaml:ro meshtastic/meshtasticd:beta
|
||||
```
|
||||
|
||||
### Executing the application interactively
|
||||
|
||||
To use Python CLI against exposed TCP port 4403,
|
||||
type this in the host machine:
|
||||
|
||||
```shell
|
||||
meshtastic --info --host localhost
|
||||
```
|
||||
|
||||
You can interact with the container in the same way as a normal device using a client that supports TCP connections.
|
||||
|
||||
|
||||
### Stop the container
|
||||
|
||||
If started with the `--name meshtasticd` arg, you can stop the container with the following command:
|
||||
|
||||
```shell
|
||||
docker kill meshtasticd
|
||||
```
|
||||
|
||||
Else, run this to get the ID:
|
||||
|
||||
```shell
|
||||
docker ps
|
||||
```
|
||||
|
||||
Then, stop the container with command:
|
||||
|
||||
```shell
|
||||
docker kill <id>
|
||||
```
|
||||
|
||||
> Tip: you can just use the first few characters of the ID in docker commands
|
Loading…
Reference in a new issue