Merge pull request #365 from femtofox/noon2

Fix meshtastic_cli support
This commit is contained in:
noon92 2025-02-23 15:52:40 +02:00 • committed by GitHub
commit 70ce2d8eb7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 7 additions and 2 deletions

View file

@ -21,6 +21,11 @@
### Meshtastic settings
## Multiple meshtastic_cli lines can be added. This is important, as the Meshtastic CLI requires that different settings categories (such as device and lora) be handled in separate commands.
## See Meshtastic CLI docs (https://meshtastic.org/docs/software/python/cli/) for more information.
#meshtastic_cli="--set lora.modem_preset LONG_FAST"
#meshtastic_cli="--set device.role CLIENT"
## Radio module to use. Options are:
## "ebyte-e22-900m30s"
## "ebyte-e22-900m22s"

View file

@ -47,9 +47,9 @@ meshtastic_update() {
echo "${ref:+$ref}meshtastic --host $command"
echo "Submitting to Meshtastic..."
for retries in $(seq 1 $attempts); do
output=$(meshtastic --host --info | tee /dev/fd/2)
output=$(eval meshtastic --host $command 2>&1 | tee /dev/fd/2) # display the output on screen live. Use eval so quotes will be handled correctly in $command
logger "$output"
if echo "$output" | grep -qiE "Abort|invalid|Error|refused|Errno|failed|Failed"; then
if echo "$output" | grep -qiE "Abort|invalid|Error|error|unrecognized|refused|Errno|failed|Failed"; then
if [ "$retries" -lt $attempts ]; then
local msg="${ref:+$ref}Meshtastic command failed, retrying ($(($retries + 1))/$attempts)..."
echo "$msg"