Skip to content

Pin protobuf to <5 for Meshtastic 2.7.8 compatibility (fix factoryReset TypeError)#914

Open
Mickyleitor wants to merge 1 commit intomeshtastic:masterfrom
Mickyleitor:fix-protobuf-compatibility-issue
Open

Pin protobuf to <5 for Meshtastic 2.7.8 compatibility (fix factoryReset TypeError)#914
Mickyleitor wants to merge 1 commit intomeshtastic:masterfrom
Mickyleitor:fix-protobuf-compatibility-issue

Conversation

@Mickyleitor
Copy link
Copy Markdown

This PR adds an upper bound for protobuf to prevent runtime breakage observed with newer protobuf major versions.

Problem
Using Meshtastic CLI 2.7.8 with protobuf 7.x causes a runtime error in factoryReset paths:

TypeError: Cannot set meshtastic.protobuf.AdminMessage.factory_reset_config to True
Field expects int, but a bool is rejected by newer protobuf type checking behavior.
This can be reproduced on Python 3.11 after dependency resolution installs protobuf 7.x (for some reason).

Root cause
meshtastic 2.7.8 currently allows protobuf versions that are too new for its generated protobuf/message assignment behavior in this code path.
With protobuf 7.x, setter validation is stricter and fails where 4.x still works.

Change in this PR
Constrain protobuf dependency to a compatible range:
protobuf>=4.21.12,<5

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Apr 9, 2026

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants