From 74680568001b2061141a87a012bef5b19fd2d036 Mon Sep 17 00:00:00 2001 From: vidplace7 Date: Thu, 9 Jan 2025 22:46:28 -0500 Subject: [PATCH] Linux docs overhaul --- .../linux-native-hardware.mdx | 127 ++++++++++-------- 1 file changed, 73 insertions(+), 54 deletions(-) diff --git a/docs/hardware/devices/linux-native-hardware/linux-native-hardware.mdx b/docs/hardware/devices/linux-native-hardware/linux-native-hardware.mdx index 93073ad4..65035213 100644 --- a/docs/hardware/devices/linux-native-hardware/linux-native-hardware.mdx +++ b/docs/hardware/devices/linux-native-hardware/linux-native-hardware.mdx @@ -53,7 +53,7 @@ UART HATs and SX1302/SX1303 chip-based HATs are not supported. Only hats that us - Debian} default> + Debian} default> Debian packages are provided via [OpenSUSE Build Service](https://build.opensuse.org/project/show/network:meshtastic). Supported: `bookworm` @@ -79,7 +79,7 @@ UART HATs and SX1302/SX1303 chip-based HATs are not supported. Only hats that us - Raspbian}> + Raspbian}> Raspbian (Raspberry Pi OS) packages are provided via [OpenSUSE Build Service](https://build.opensuse.org/project/show/network:meshtastic). Supported: `bookworm` @@ -89,7 +89,7 @@ UART HATs and SX1302/SX1303 chip-based HATs are not supported. Only hats that us ``` - Ubuntu}> + Ubuntu}> Ubuntu packages are provided via [Canonical Launchpad](https://launchpad.net/~meshtastic). Supported: `oracular` (24.10), `noble` (24.04 LTS), `jammy` (22.04 LTS) @@ -116,7 +116,7 @@ UART HATs and SX1302/SX1303 chip-based HATs are not supported. Only hats that us - Fedora}> + Fedora}> Fedora packages are provided via Fedora COPR. Supported[^1]: `41`, `40` @@ -142,7 +142,7 @@ UART HATs and SX1302/SX1303 chip-based HATs are not supported. Only hats that us - Docker}> + Docker}> Docker containers are provided via [DockerHub](https://hub.docker.com/r/meshtastic/meshtasticd). **Pull:** @@ -158,77 +158,96 @@ UART HATs and SX1302/SX1303 chip-based HATs are not supported. Only hats that us ### Hardware Interfaces -For devices requiring SPI or I2C: + + + USB}> + USB support via the CH341 was added in Meshtastic 2.5.18. -- This can be done by running the below commands on a Raspberry Pi (2-5) + Note that in order for Linux to recognize multiple CH341-USB devices, an EEPROM must be included onboard. Devices like the `Pinedio` do not include this. -```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 + + Raspberry Pi Hat (SPI)}> + **Enable SPI support for LoRa Radio** -# 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 + - This can be done by running the below commands on a Raspberry Pi (2-5) -# Insert dtoverlay=spi0-0cs after dtparam=spi=on if not already present -if ! sudo grep -q '^\s*dtoverlay=spi0-0cs' /boot/firmware/config.txt; then - sudo sed -i '/^\s*dtparam=spi=on/a dtoverlay=spi0-0cs' /boot/firmware/config.txt -fi -``` + ```shell + sudo raspi-config nonint set_config_var dtparam=spi on /boot/firmware/config.txt # Enable SPI -- Or this can be accomplished by manually enabling SPI support in `/boot/firmware/config.txt`: + # 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 -```plaintext -dtparam=spi=on -dtoverlay=spi0-0cs -``` + # Insert dtoverlay=spi0-0cs after dtparam=spi=on if not already present + if ! sudo grep -q '^\s*dtoverlay=spi0-0cs' /boot/firmware/config.txt; then + sudo sed -i '/^\s*dtparam=spi=on/a dtoverlay=spi0-0cs' /boot/firmware/config.txt + fi + ``` -- I2C support is enabled with: + - Or this can be accomplished by manually enabling SPI support in `/boot/firmware/config.txt`: -```plaintext -dtparam=i2c_arm=on -``` + ```plaintext + dtparam=spi=on + dtoverlay=spi0-0cs + ``` -### GPS Support + **Enable I2C support** -- You can enable UART by running the below commands (which additionally will disable serial console tty) + Enabled with: -```shell -sudo raspi-config nonint do_serial_hw 0 # Enable Serial Port (enable_uart=1) -sudo raspi-config nonint do_serial_cons 1 # Disable Serial Console -``` + ```shell + sudo raspi-config nonint set_config_var dtparam=i2c_arm on /boot/firmware/config.txt # Enable i2c_arm + ``` -- Or you can manually enable UART for GPS hats by making modifications in `/boot/firmware/config.txt`: + Or manually enabled in `/boot/firmware/config.txt`: -```plaintext -# Needed for all Pi device. -enable_uart=1 + ```plaintext + dtparam=i2c_arm=on + ``` -# Needed for the Pi 5 only. -dtoverlay=uart0 -``` + **Enable UART support for GPS** -- 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 + - You can enable UART by running the below commands (which additionally will disable serial console tty) -```shell -sudo raspi-config nonint do_serial_cons 1 # Disable Serial Console -``` + ```shell + sudo raspi-config nonint do_serial_hw 0 # Enable Serial Port (enable_uart=1) + sudo raspi-config nonint do_serial_cons 1 # Disable Serial Console + ``` + + - Or you can manually enable UART for GPS hats by making modifications in `/boot/firmware/config.txt`: + + ```plaintext + # Needed for all Pi device. + enable_uart=1 + + # Needed for the Pi 5 only. + 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 + ``` + + + ### 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 -lah /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