Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ lib_deps = ${arduino_base.lib_deps}
[linux_base]
platform =
# renovate: datasource=git-tags depName=ardulinux packageName=https://github.com/l5yth/ardulinux
git+https://github.com/l5yth/ardulinux.git#v0.2.1
git+https://github.com/l5yth/ardulinux.git#v0.2.2
framework = arduino
board = linux
board_level = extra
Expand Down
13 changes: 7 additions & 6 deletions variants/linux/LinuxBoard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,22 +69,22 @@ void LinuxBoard::begin() {

int failures = 0;
if (config.lora_nss_pin != RADIOLIB_NC) {
failures += initGPIOPin(config.lora_nss_pin, "gpiochip0", config.lora_nss_pin);
failures += initGPIOPin(config.lora_nss_pin, config.lora_gpiochip, config.lora_nss_pin);
}
if (config.lora_busy_pin != RADIOLIB_NC) {
failures += initGPIOPin(config.lora_busy_pin, "gpiochip0", config.lora_busy_pin);
failures += initGPIOPin(config.lora_busy_pin, config.lora_gpiochip, config.lora_busy_pin);
}
if (config.lora_irq_pin != RADIOLIB_NC) {
failures += initGPIOPin(config.lora_irq_pin, "gpiochip0", config.lora_irq_pin);
failures += initGPIOPin(config.lora_irq_pin, config.lora_gpiochip, config.lora_irq_pin);
}
if (config.lora_reset_pin != RADIOLIB_NC) {
failures += initGPIOPin(config.lora_reset_pin, "gpiochip0", config.lora_reset_pin);
failures += initGPIOPin(config.lora_reset_pin, config.lora_gpiochip, config.lora_reset_pin);
}
if (config.lora_rxen_pin != RADIOLIB_NC) {
failures += initGPIOPin(config.lora_rxen_pin, "gpiochip0", config.lora_rxen_pin);
failures += initGPIOPin(config.lora_rxen_pin, config.lora_gpiochip, config.lora_rxen_pin);
}
if (config.lora_txen_pin != RADIOLIB_NC) {
failures += initGPIOPin(config.lora_txen_pin, "gpiochip0", config.lora_txen_pin);
failures += initGPIOPin(config.lora_txen_pin, config.lora_gpiochip, config.lora_txen_pin);
}

if (failures > 0) {
Expand Down Expand Up @@ -149,6 +149,7 @@ int LinuxConfig::load(const char *filename) {
}

if (strcmp(key, "spidev") == 0) spidev = safe_copy(value, 32);
else if (strcmp(key, "lora_gpiochip") == 0) lora_gpiochip = safe_copy(value, 32);
else if (strcmp(key, "lora_freq") == 0) lora_freq = atof(value);
else if (strcmp(key, "lora_bw") == 0) lora_bw = atof(value);
else if (strcmp(key, "lora_sf") == 0) lora_sf = (uint8_t)atoi(value);
Expand Down
1 change: 1 addition & 0 deletions variants/linux/LinuxBoard.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ class LinuxConfig {
bool rx_boosted_gain = true;

char* spidev = "/dev/spidev0.0";
char* lora_gpiochip = "gpiochip0";

float lora_tcxo = 1.8f;

Expand Down
13 changes: 7 additions & 6 deletions variants/linux/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ sudo pacman -S pkgconf libgpiod i2c-tools bluez-libs libuv
sudo apt install pkg-config libgpiod-dev libi2c-dev libbluetooth-dev libuv1-dev
```

> On DietPi the base image does not include `pkg-config`; without it the build
> silently falls back to simulated GPIO/I2C even when `libgpiod-dev` is
> installed, and the resulting `meshcored` won't talk to the radio.

The ArduLinux platform always links `bluetooth`, `uv`, `pthread`, and
`stdc++fs`; `gpiod`/`i2c` are added automatically when libgpiod is detected via
`pkg-config`. Missing `bluez-libs`/`libbluetooth-dev` shows up as a `cannot
find -lbluetooth` link error.
`pkg-config`. If `pkg-config` is missing (e.g. on DietPi, which does not ship
it in the base image), libgpiod goes undetected and the build falls back to
simulated GPIO/I2C — the resulting `meshcored` will refuse to start with a
`FATAL: meshcored was built without libgpiod support` message pointing back at
the missing dep. Missing `bluez-libs`/`libbluetooth-dev` shows up at link time
as `cannot find -lbluetooth`.

You also need **PlatformIO Core** (`pio`) to build:

Expand Down Expand Up @@ -85,6 +85,7 @@ Key settings:
| Key | Default | Notes |
|-----|---------|-------|
| `spidev` | `/dev/spidev0.0` | SPI device node |
| `lora_gpiochip` | `gpiochip0` | Name of the `/dev/gpiochip*` device (or kernel label). `gpiochip0` is correct for Pi 3/4/Zero 2W; Pi 5 may need `gpiochip4` or `pinctrl-rp1` depending on kernel |
| `lora_irq_pin` | (none) | GPIO line number for IRQ |
| `lora_reset_pin` | (none) | GPIO line number for RESET |
| `lora_nss_pin` | (none) | GPIO line number for NSS/CS (if not handled by the SPI driver) |
Expand Down
1 change: 1 addition & 0 deletions variants/linux/meshcored.ini
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ lora_reset_pin = 13
#lora_txen_pin

spidev = /dev/spidev0.0
# lora_gpiochip = gpiochip0 # Pi 3/4/Zero 2W default; Pi 5 may need gpiochip4 or pinctrl-rp1
lora_freq = 869.618
lora_bw = 62.5
lora_sf = 8
Expand Down
1 change: 1 addition & 0 deletions variants/linux/meshcored.ini.pow-sx1262
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

# Hardware config (read on every startup):
spidev = /dev/spidev0.0
# lora_gpiochip = gpiochip0 # Pi 3/4/Zero 2W default; Pi 5 may need gpiochip4 or pinctrl-rp1
lora_irq_pin = 22
lora_reset_pin = 13
# lora_nss_pin - SS is handled by the SPI driver; not needed
Expand Down
1 change: 1 addition & 0 deletions variants/linux/meshcored.ini.waveshare
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

# Hardware config (read on every startup):
spidev = /dev/spidev0.0
# lora_gpiochip = gpiochip0 # Pi 3/4/Zero 2W default; Pi 5 may need gpiochip4 or pinctrl-rp1
lora_irq_pin = 16
lora_reset_pin = 18
lora_nss_pin = 21
Expand Down
Loading