Skip to content

Re-use channel Uplink / Downlink for UDP controls - #8134

Open
thebentern wants to merge 12 commits into
masterfrom
uplink-downlink-udp-controls
Open

Re-use channel Uplink / Downlink for UDP controls#8134
thebentern wants to merge 12 commits into
masterfrom
uplink-downlink-udp-controls

Conversation

@thebentern

Copy link
Copy Markdown
Contributor

For consideration

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds channel-specific uplink and downlink control for UDP multicast communication by leveraging the existing channel configuration settings.

Key changes:

  • Adds channel validation for both UDP uplink and downlink operations
  • Modifies the onSend method signature to include channel index parameter
  • Updates Router.cpp to pass channel information to UDP handler

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
src/mesh/udp/UdpMulticastHandler.h Adds channel downlink/uplink validation and updates onSend method signature
src/mesh/Router.cpp Updates UDP handler calls to pass channel index and reorganizes UDP handling logic

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread src/mesh/udp/UdpMulticastHandler.h
Comment thread src/mesh/udp/UdpMulticastHandler.h
Comment thread src/mesh/Router.cpp Outdated
@thebentern thebentern added the enhancement New feature or request label Sep 27, 2025
thebentern and others added 3 commits September 27, 2025 06:06
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@jp-bennett

Copy link
Copy Markdown
Collaborator

Only thing to consider is whether we would eventually want to control the UDP uplink separately from the MQTT.

@thebentern

Copy link
Copy Markdown
Contributor Author

Agreed. I think in the long term we can split this control out into it's own levers

Only thing to consider is whether we would eventually want to control the UDP uplink separately from the MQTT.

@thebentern

Copy link
Copy Markdown
Contributor Author

@GUVWAF added the default key fallback to this one

Comment thread src/mesh/Router.cpp Outdated
Comment thread src/mesh/Router.cpp Outdated
Comment thread src/mesh/udp/UdpMulticastHandler.h Outdated
@thebentern
thebentern requested a review from GUVWAF September 28, 2025 11:39
Comment thread src/mesh/Router.cpp
udpHandler->onSend(const_cast<meshtastic_MeshPacket *>(p));
// For packets that are already encrypted, we need to determine the channel from packet info
else if (udpHandler && config.network.enabled_protocols & meshtastic_Config_NetworkConfig_ProtocolFlags_UDP_BROADCAST &&
isFromUs(p)) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

isFromUs(p) is here still.

Comment thread src/mesh/Router.cpp
else if (udpHandler && config.network.enabled_protocols & meshtastic_Config_NetworkConfig_ProtocolFlags_UDP_BROADCAST &&
isFromUs(p)) {
// Check if any channel has uplink enabled (for PKI support)
bool uplinkEnabled = false;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Maybe instead of this bool we can use an int8_t to store the channel index where uplink is enabled, and -1 if none was found such that we can eliminate the same loop hereafter.

@HansvanMeer

HansvanMeer commented Oct 19, 2025

Copy link
Copy Markdown

We are using this on the moment to connect MF en LF.
It was running fine on 2.7.10. But on version 2.7.11 is isn't working anymore.

@Talie5in

Copy link
Copy Markdown
Contributor

We are using this on the moment to connect MF en LF. It was running fine on 2.7.10. But on version 2.7.11 is isn't working anymore.

As per the notes on the 2.7.11 release
https://github.com/meshtastic/firmware/releases/tag/v2.7.11.ee68575

Important

Due to feedback received from users, UDP has been disabled by default and the default PSK decryption bridging logic has been removed for now until channel level controls can be added to a future release.

2.7.10 will be the release you can use to continue the bridging at this time.

@github-actions github-actions Bot added the Stale Issues that will be closed if not triaged. label Dec 7, 2025
@github-actions github-actions Bot closed this Dec 16, 2025
@caveman99 caveman99 added triaged Reviewed by the team, has enough information and ready to work on now. and removed Stale Issues that will be closed if not triaged. labels Feb 12, 2026
@caveman99 caveman99 reopened this Feb 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request triaged Reviewed by the team, has enough information and ready to work on now.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants