Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds the ok_to_mqtt bit #4643

Merged
merged 10 commits into from
Sep 7, 2024
Merged

Adds the ok_to_mqtt bit #4643

merged 10 commits into from
Sep 7, 2024

Conversation

jp-bennett
Copy link
Collaborator

@jp-bennett jp-bennett commented Sep 6, 2024

This adds the ok_to_mqtt bit on outgoing messages, as set by the device config. It also checks for the bit on incoming messages before uploading to an MQTT server with a known key.

Depends on meshtastic/protobufs#573

@caveman99
Copy link
Member

Principle is ok, CI carnage needs to be addressed :-)

Copy link
Member

@GUVWAF GUVWAF left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Besides my comment, isn't there a better way to set this at only one place? E.g. in MeshService::sendToMesh()?
I think this would then also account for MQTT proxy.

Edit: I now see MQTT proxy is already accounted for with this, but anything that goes over the PhoneAPI is not, so e.g. if someone is doing a serial to MQTT bridge it can't honor the setting.

src/mesh/Router.cpp Outdated Show resolved Hide resolved
Copy link
Member

@caveman99 caveman99 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As discussed, can we introduce a bitflag field instead?

@jp-bennett
Copy link
Collaborator Author

jp-bennett commented Sep 6, 2024

As discussed, can we introduce a bitflag field instead?

I love the idea, but I forgot how ridiculous Protobufs is. There is no uint8 type. The official recommendation is to use uint32 and hope it only takes only one or two bytes. sigh

Edit: Ric pointed out that I can add the int_size:8 option in mesh.options. Doing a bool costs us 2 bytes, and a single byte bitfield costs 3.

src/mesh/Router.cpp Outdated Show resolved Hide resolved
@jp-bennett jp-bennett merged commit bf34329 into master Sep 7, 2024
105 checks passed
@jp-bennett jp-bennett deleted the doNotMqttMeBro branch September 7, 2024 23:22
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.

4 participants