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

Support messages sent by detection sensor module #84

Merged

Conversation

fphammerle
Copy link
Contributor

Hi @jeremiah-k,

I created a draft supporting detection messages (https://meshtastic.org/docs/configuration/module/detection-sensor/)

Block invoking meshtastic_interface.sendData(…) is untested.
Remaining part tested successfully with meshtasticd v2.3.13.83f5ba0.

Could you review my changes? Thank you!

Solves second part of #75

Copy link
Collaborator

@jeremiah-k jeremiah-k left a comment

Choose a reason for hiding this comment

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

Very cool! I like it!

To give users more control over what data types are relayed to Matrix, I think it would be good to add a configuration option (defaulting to false) in config.yaml.

People already have to opt in to send meshnet data to Matrix with broadcast_enabled: true otherwise it only sends one way Matrix -> Meshtastic. (It's not the best name for that option, but that's what it does.)

New config variable:

detection_sensor_enabled = relay_config["meshtastic"].get("detection_sensor", False)

And something like this in on_meshtastic_message() that would prevent sending detection sensor messages if disabled:

if decoded.get("portnum") == "DETECTION_SENSOR_APP" and not detection_sensor_enabled:
    logger.debug("Detection sensor packet received, but detection sensor processing is disabled.")
    return

So to enable the feature in config.yaml it would look like:

meshtastic:
    detection_sensor: true

What are your thoughts on that?

@fphammerle
Copy link
Contributor Author

Sounds great, thank you! I'll integrate the requested changes.

@fphammerle
Copy link
Contributor Author

I added the "detection_sensor" setting. Could you do another review?

@fphammerle fphammerle requested a review from jeremiah-k October 4, 2024 19:05
Copy link
Collaborator

@jeremiah-k jeremiah-k left a comment

Choose a reason for hiding this comment

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

lgtm!

Thank you, I appreciate the contribution!

@jeremiah-k jeremiah-k merged commit 0c496c5 into geoffwhittington:main Oct 4, 2024
@fphammerle
Copy link
Contributor Author

Thank you!

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