mirror of
https://github.com/meshtastic/meshtastic.git
synced 2025-03-05 21:00:08 -08:00
Linux docs overhaul (#1669)
* Linux docs overhaul * push updated lock file and formatting fixes * Linux docs overhaul --------- Co-authored-by: rcarteraz <robert.l.carter2@gmail.com>
This commit is contained in:
parent
5d2a5f1973
commit
1042f18650
130
docs/blocks/_linux-install.mdx
Normal file
130
docs/blocks/_linux-install.mdx
Normal file
|
@ -0,0 +1,130 @@
|
|||
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).
|
||||
[](https://build.opensuse.org/package/show/network:Meshtastic:beta/meshtasticd)
|
||||
|
||||
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).
|
||||
[](https://build.opensuse.org/package/show/network:Meshtastic:beta/meshtasticd)
|
||||
|
||||
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/).
|
||||
[](https://copr.fedorainfracloud.org/coprs/g/meshtastic/beta/package/meshtasticd/)
|
||||
|
||||
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,7 +6,7 @@ sidebar_position: 11
|
|||
description: Set up and configure Meshtastic on Linux-native devices using the meshtasticd binary.
|
||||
---
|
||||
|
||||
import NativeLibraries from "@site/docs/blocks/_native-libraries.mdx";
|
||||
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.
|
||||
|
||||
|
@ -15,50 +15,61 @@ This page outlines the setup of Meshtastic on Linux-native devices, utilizing po
|
|||
Before proceeding with the setup, ensure the device meets the following requirements:
|
||||
|
||||
### Tested Devices
|
||||
- Raspberry Pi zero, zero 2 , 3,4, Pi 400, and Pi 5.[^1]
|
||||
- Ubuntu 22.04 X86_64 with a CH341-SX1262 DIY dongle.[^2]
|
||||
- Debian GNU/Linux trixie/sid riscv64 on Cvitek CV180X ASIC, C906 (Milk-V Duo), on the SPI bus.
|
||||
|
||||
[^1]: While the Raspberry Pi Zero has been tested with meshtasticd, building as a native ARM32 binary has proven challenging. As a workaround, consider building on a Raspberry Pi 4 or 5 with a 32-bit OS and copying the output file to the Pi Zero.
|
||||
[^2]: **Limited Functionality with CH341-SX1262 Device:** Please be aware that the CH341-SX1262 device is currently experiencing partial functionality issues. For reasons yet to be determined, this device struggles with sending packets larger than a few bytes.
|
||||
#### SPI
|
||||
|
||||
- Raspberry Pi: Zero, Zero 2, 3, 4, Pi 400, and Pi 5 on Raspbian `bookworm`.
|
||||
- Luckfox Pico: [femtofox](https://github.com/noon92/femtofox/tree/main) on Ubuntu 22.04 `jammy`.
|
||||
|
||||
#### USB (CH341)
|
||||
|
||||
- Debian 12 (`bookworm`) with MeshStick.
|
||||
- Ubuntu LTS (`24.04`, `22.04`) with MeshStick.
|
||||
- Fedora `41` with MeshStick.
|
||||
- meshtasticd Docker container with MeshStick passed-through.
|
||||
|
||||
### 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 radios include the Waveshare SX126X (SPI version), 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.
|
||||
- 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 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
|
||||
|
||||
- The Meshtastic binary, `meshtasticd`, necessitates root access or a user with permissions to access GPIO, SPI, and other interfaces.
|
||||
- A Linux distribution compatible with the Meshtastic installation package, which is compiled for Debian Bookworm and not compatible with Bullseye.
|
||||
- A Linux distribution compatible with the Meshtastic installation packages.
|
||||
|
||||
## Installation
|
||||
|
||||
### Installing Meshtasticd
|
||||
|
||||
<NativeLibraries />
|
||||
<LinuxInstall />
|
||||
|
||||
- The .deb Package is available as [part of the release](https://github.com/meshtastic/firmware/releases/latest), installing the binary, a systemd service, and a config file. It is compiled for Debian Bookworm and incompatible with Bullseye.
|
||||
```shell
|
||||
wget https://github.com/meshtastic/firmware/releases/download/v{version}/meshtasticd_{version}_arm64.deb
|
||||
sudo apt install ./meshtasticd_{version}arm64.deb
|
||||
```
|
||||
## Hardware Interfaces
|
||||
|
||||
## Configuration
|
||||
### USB
|
||||
|
||||
### Hardware Interfaces
|
||||
USB support via the **CH341** was added in Meshtastic 2.5.18.
|
||||
|
||||
For devices requiring SPI or I2C:
|
||||
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.
|
||||
|
||||
### SPI (Raspberry Pi)
|
||||
|
||||
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
|
||||
|
@ -76,44 +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
|
||||
```
|
||||
|
||||
### Meshtasticd Configuration
|
||||
### UART (Raspberry Pi)
|
||||
|
||||
- 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:
|
||||
|
||||
```yaml
|
||||
Lora:
|
||||
Module: sx1262 # Waveshare SX126X XXXM
|
||||
DIO2_AS_RF_SWITCH: true
|
||||
CS: 21
|
||||
IRQ: 16
|
||||
Busy: 20
|
||||
Reset: 18
|
||||
```
|
||||
:::info
|
||||
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 To enable this:
|
||||
|
||||
```plaintext
|
||||
Webserver:
|
||||
Port: 443 # Port for Webserver & Webservices
|
||||
RootPath: /usr/share/doc/meshtasticd/web # Root Dir of WebServer
|
||||
```
|
||||
### Bluetooth Support
|
||||
Bluetooth is currently unsupported and not functional on Linux Native devices. This may change in the future.
|
||||
|
||||
### GPS Support
|
||||
Enable UART support for GPS
|
||||
|
||||
- You can enable UART by running the below commands (which additionally will disable serial console tty)
|
||||
|
||||
|
@ -135,99 +127,138 @@ dtoverlay=uart0
|
|||
- The correct port for UART GPS on the Pi 5 after a reboot is `/dev/ttyAMA0`.
|
||||
- The correct port for UART GPS on earlier Pi versions after a reboot is `/dev/ttyS0`.
|
||||
- You may need to disable the serial console on a Pi and then reboot
|
||||
|
||||
```shell
|
||||
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, first locate it's configuration in the presets, then copy to `config.d`.
|
||||
|
||||
```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.
|
||||
:::
|
||||
|
||||
### Web Server
|
||||
|
||||
`meshtasticd` has web server support starting with release `2.3.0`.
|
||||
|
||||
To enable this:
|
||||
|
||||
```yaml
|
||||
Webserver:
|
||||
Port: 443 # Port for Webserver & Webservices
|
||||
RootPath: /usr/share/meshtasticd/web # Root Dir of WebServer
|
||||
```
|
||||
|
||||
### Bluetooth Support
|
||||
|
||||
Bluetooth is currently unsupported and not functional on Linux Native devices. This may change in the future.
|
||||
|
||||
### Persistence
|
||||
|
||||
- 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
|
||||
|
||||
#### Creating and Enabling a Systemctl Script (non .deb installs)
|
||||
### 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.
|
||||
|
||||
Create the service unit file:
|
||||
<details>
|
||||
<summary>Create the systemd service (only for manual installs)</summary>
|
||||
|
||||
Create a new file in the /etc/systemd/system/ directory with a name like meshtasticd.service.
|
||||
```shell
|
||||
sudo nano /etc/systemd/system/meshtasticd.service
|
||||
```
|
||||
Add the following content to the file:
|
||||
The `meshtasticd` systemd service is automatically installed when using the official Meshtastic packages.
|
||||
These instructions are only needed when installing manually.
|
||||
|
||||
```plaintext
|
||||
[Unit]
|
||||
Description=Meshtastic Daemon
|
||||
After=network.target
|
||||
Create the service unit file:
|
||||
|
||||
[Service]
|
||||
ExecStart=/usr/sbin/meshtasticd
|
||||
Restart=always
|
||||
User=root
|
||||
Group=root
|
||||
Type=simple
|
||||
Create a new file in the /etc/systemd/system/ directory with a name like meshtasticd.service.
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
```
|
||||
```shell
|
||||
sudo nano /etc/systemd/system/meshtasticd.service
|
||||
```
|
||||
|
||||
Reload systemd to recognize the new service:
|
||||
```shell
|
||||
sudo systemctl daemon-reload
|
||||
```
|
||||
Add the following content to the file:
|
||||
|
||||
```plaintext
|
||||
[Unit]
|
||||
Description=Meshtastic Daemon
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
ExecStart=/usr/sbin/meshtasticd
|
||||
Restart=always
|
||||
User=root
|
||||
Group=root
|
||||
Type=simple
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
```
|
||||
|
||||
Reload systemd to recognize the new service:
|
||||
|
||||
```shell
|
||||
sudo systemctl daemon-reload
|
||||
```
|
||||
</details>
|
||||
|
||||
Enable the service to start on boot:
|
||||
|
||||
```shell
|
||||
sudo systemctl enable meshtasticd
|
||||
```
|
||||
|
||||
##### Starting and Stopping the Service
|
||||
#### Starting and Stopping the Service
|
||||
|
||||
Start the service:
|
||||
|
||||
```shell
|
||||
sudo systemctl start meshtasticd
|
||||
```
|
||||
|
||||
Check the status of the service:
|
||||
|
||||
```shell
|
||||
sudo systemctl status meshtasticd
|
||||
```
|
||||
|
||||
This will give you a detailed view of the service status and any potential errors.
|
||||
|
||||
Stop the service:
|
||||
|
||||
```shell
|
||||
sudo systemctl stop meshtasticd
|
||||
```
|
||||
|
||||
This will give you a detailed view of the service status and any potential errors.
|
||||
|
||||
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.
|
||||
|
||||
```shell
|
||||
journalctl -u meshtasticd -b
|
||||
```
|
||||
|
||||
#### Installation of drivers
|
||||
### Avahi setup
|
||||
|
||||
- Installation of drivers for CH341 is required for Ubuntu 22.04 and other systems for SPI/I2C/GPIO support.
|
||||
|
||||
```shell
|
||||
git clone https://github.com/frank-zago/ch341-i2c-spi-gpio.git
|
||||
cd ch341-i2c-spi-gpio
|
||||
make
|
||||
sudo insmod ch341-core.ko
|
||||
sudo insmod gpio-ch341.ko
|
||||
sudo insmod i2c-ch341.ko
|
||||
sudo insmod spi-ch341.ko
|
||||
```
|
||||
|
||||
- Devices with kernels older than 5.16 may need to blacklist ch341, while kernels 6.0 and newer are observed to work more reliably.
|
||||
|
||||
#### Avahi setup
|
||||
This will allow the Android client to auto-discover your Linux Native device.
|
||||
|
||||
- Install avahi-daemon (debian/ubuntu)
|
||||
|
@ -239,11 +270,13 @@ sudo apt install avahi-daemon
|
|||
- Configure Avahi to advertise the node
|
||||
|
||||
Create the service file:
|
||||
|
||||
```shell
|
||||
sudo nano /etc/avahi/services/meshtastic.service
|
||||
```
|
||||
|
||||
And paste the following:
|
||||
|
||||
```xml
|
||||
<?xml version="1.0" standalone="no"?><!--*-nxml-*-->
|
||||
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
|
||||
|
@ -255,12 +288,18 @@ And paste the following:
|
|||
</service>
|
||||
</service-group>
|
||||
```
|
||||
|
||||
Then save and exit.
|
||||
|
||||
## CLI Configuration
|
||||
|
||||
Interaction with Meshtastic can be conducted via the command line:
|
||||
|
||||
```shell
|
||||
```plaintext
|
||||
meshtastic --host localhost ...
|
||||
```
|
||||
|
||||
See:
|
||||
|
||||
- [CLI Installation](/docs/software/python/cli/installation/)
|
||||
- [CLI Usage](/docs/software/python/cli/usage/)
|
||||
|
|
|
@ -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