Skip to content

--factory-reset-device and --factory-reset fail with "Expected an int, got a boolean" (v2.7.8) #920

@michael-firebotlabs

Description

@michael-firebotlabs

Describe the bug

Running --factory-reset-device fails immediately with:

Field meshtastic.protobuf.AdminMessage.factory_reset_device: Expected an int, got a boolean.

To Reproduce

meshtastic --factory-reset-device

Expected behavior

Device receives the factory reset command and reboots with cleared BLE bonds and default config.

Root cause

In node.py, factoryReset() assigns Python booleans to protobuf fields that are typed as builtins.int in the generated stubs (admin_pb2.pyi):

p.factory_reset_device = True # raises TypeError in strict protobuf
p.factory_reset_config = True # same issue

Fix

p.factory_reset_device = 1
p.factory_reset_config = 1

Environment

  • meshtastic-python version: 2.7.8
  • Hardware: RAK4631
  • OS: macOS, Python 3.14
  • Connected via: USB serial

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions