python icon indicating copy to clipboard operation
python copied to clipboard

CLI reports success when setting power values that are overridden by device role

Open C3B2W23 opened this issue 2 weeks ago • 2 comments

Description

When using --set to change power configuration values on a device with the ROUTER role, the CLI reports success but the values are silently ignored/overridden by role-enforced defaults.

Steps to Reproduce

  1. Set device to ROUTER role: meshtastic --set device.role ROUTER
  2. Attempt to disable light sleep: meshtastic --set power.ls_secs 0
  3. CLI reports: "Set power.ls_secs to 0" and "Writing power configuration to device"
  4. Verify the value: meshtastic --get power.ls_secs
  5. Returns: power.ls_secs: 86400 (not 0)

Expected Behavior

The CLI should either:

  • Warn that this value will be overridden by the current device role, or
  • Refuse to write the value with an explanatory error

Actual Behavior

CLI reports success, device reboots, but the value reverts to the role-enforced default (86400 for ROUTER). This is confusing and leads to wasted debugging time.

Environment

  • meshtastic CLI version: 2.7.5
  • Firmware: 2.7.16
  • Hardware: ESP32
  • OS: macOS

Additional Context

The ROUTER role forcing is_power_saving is documented behavior, but users have no way to know from the CLI that their settings are being ignored. Related firmware issue: https://github.com/meshtastic/firmware/issues/2203

C3B2W23 avatar Dec 08 '25 01:12 C3B2W23

Good point, this is indeed not so nice. But I guess the problem is even more general: The radio does not give a feedback to CLI if settings are not applied due to other constraints (and for what reason). This might be something to think about as improvement.

juergenRe avatar Dec 08 '25 09:12 juergenRe

@juergenRe The problem is more general.

For example, I have a 20 argument meshtastic command that includes:

    --set bluetooth.enabled true \
    --set bluetooth.mode FIXED_PIN \
    --set bluetooth.fixedPin 654321 \

The result is often

Connected to radio
Set bluetooth.enabled to true
Set bluetooth.mode to FIXED_PIN
Set bluetooth.fixed_pin to 654321
...
Writing modified preferences to device
Using a configuration transaction
INFO file:node.py beginSettingsTransaction line:622 Telling open a transaction to edit settings
Writing position configuration to device
Writing security configuration to device
Writing bluetooth configuration to device
Writing device configuration to device

Afterward, I discover that the BLE PIN is not changed.

I have similar problems with some other attributes. For example, setting the device IP address (network.ipv4Config.ip) is not reliable.

meshtastic --port \
    --set-owner-short $MSHORT \
    --set-owner "$MLONG" \
    --set network.ipv4Config.ip "$MURLINT" \
    --set security.publicKey   "$MPUBLIC" \
    --set security.adminKey   "$MADMIN" \
    --timeout $MTIMEOUT
sleep $MSLEEP

roberthadow avatar Dec 15 '25 19:12 roberthadow