diff --git a/.github/workflows/main_matrix.yml b/.github/workflows/main_matrix.yml index 555d4d092..0853df19f 100644 --- a/.github/workflows/main_matrix.yml +++ b/.github/workflows/main_matrix.yml @@ -134,8 +134,8 @@ jobs: package-raspbian-armv7l: uses: ./.github/workflows/package_raspbian_armv7l.yml - # package-native: - # uses: ./.github/workflows/package_amd64.yml + package-native: + uses: ./.github/workflows/package_amd64.yml after-checks: runs-on: ubuntu-latest @@ -249,7 +249,7 @@ jobs: gather-artifacts, package-raspbian, package-raspbian-armv7l, - # package-native, + package-native, ] steps: - name: Checkout @@ -308,15 +308,15 @@ jobs: asset_name: meshtasticd_${{ steps.version.outputs.version }}_armhf.deb asset_content_type: application/vnd.debian.binary-package - # - name: Add raspbian amd64 .deb - # uses: actions/upload-release-asset@v1 - # env: - # GITHUB_TOKEN: ${{ github.token }} - # with: - # upload_url: ${{ steps.create_release.outputs.upload_url }} - # asset_path: ./output/meshtasticd_${{ steps.version.outputs.version }}_amd64.deb - # asset_name: meshtasticd_${{ steps.version.outputs.version }}_amd64.deb - # asset_content_type: application/vnd.debian.binary-package + - name: Add raspbian amd64 .deb + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ github.token }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ./output/meshtasticd_${{ steps.version.outputs.version }}_amd64.deb + asset_name: meshtasticd_${{ steps.version.outputs.version }}_amd64.deb + asset_content_type: application/vnd.debian.binary-package - name: Bump version.properties run: >- diff --git a/protobufs b/protobufs index fd5760108..49ebc4783 160000 --- a/protobufs +++ b/protobufs @@ -1 +1 @@ -Subproject commit fd5760108a2399ca58cd7df280afe2b434aae2c2 +Subproject commit 49ebc4783275f108a9f8723ca52a6edf0a954c55 diff --git a/src/mesh/FloodingRouter.cpp b/src/mesh/FloodingRouter.cpp index 23f6b6f92..33166e3e5 100644 --- a/src/mesh/FloodingRouter.cpp +++ b/src/mesh/FloodingRouter.cpp @@ -35,6 +35,12 @@ bool FloodingRouter::shouldFilterReceived(const meshtastic_MeshPacket *p) return Router::shouldFilterReceived(p); } +bool FloodingRouter::isRebroadcaster() +{ + return config.device.role != meshtastic_Config_DeviceConfig_Role_CLIENT_MUTE && + config.device.rebroadcast_mode != meshtastic_Config_DeviceConfig_RebroadcastMode_NONE; +} + void FloodingRouter::sniffReceived(const meshtastic_MeshPacket *p, const meshtastic_Routing *c) { bool isAckorReply = (p->which_payload_variant == meshtastic_MeshPacket_decoded_tag) && (p->decoded.request_id != 0); @@ -45,7 +51,7 @@ void FloodingRouter::sniffReceived(const meshtastic_MeshPacket *p, const meshtas } if (!isToUs(p) && (p->hop_limit > 0) && !isFromUs(p)) { if (p->id != 0) { - if (config.device.role != meshtastic_Config_DeviceConfig_Role_CLIENT_MUTE) { + if (isRebroadcaster()) { meshtastic_MeshPacket *tosend = packetPool.allocCopy(*p); // keep a copy because we will be sending it tosend->hop_limit--; // bump down the hop count @@ -62,7 +68,7 @@ void FloodingRouter::sniffReceived(const meshtastic_MeshPacket *p, const meshtas // We are careful not to call our hooked version of send() - because we don't want to check this again Router::send(tosend); } else { - LOG_DEBUG("Not rebroadcasting. Role = Role_ClientMute\n"); + LOG_DEBUG("Not rebroadcasting: Role = CLIENT_MUTE or Rebroadcast Mode = NONE\n"); } } else { LOG_DEBUG("Ignoring 0 id broadcast\n"); diff --git a/src/mesh/FloodingRouter.h b/src/mesh/FloodingRouter.h index a3adfe70c..0ed2b5582 100644 --- a/src/mesh/FloodingRouter.h +++ b/src/mesh/FloodingRouter.h @@ -29,6 +29,8 @@ class FloodingRouter : public Router, protected PacketHistory { private: + bool isRebroadcaster(); + public: /** * Constructor diff --git a/src/modules/AdminModule.cpp b/src/modules/AdminModule.cpp index 852e99626..bc0e74292 100644 --- a/src/modules/AdminModule.cpp +++ b/src/modules/AdminModule.cpp @@ -463,6 +463,14 @@ void AdminModule::handleSetConfig(const meshtastic_Config &c) requiresReboot = false; } config.device = c.payload_variant.device; + if (config.device.rebroadcast_mode == meshtastic_Config_DeviceConfig_RebroadcastMode_NONE && + IS_ONE_OF(config.device.role, meshtastic_Config_DeviceConfig_Role_ROUTER, + meshtastic_Config_DeviceConfig_Role_REPEATER)) { + config.device.rebroadcast_mode = meshtastic_Config_DeviceConfig_RebroadcastMode_ALL; + const char *warning = "Rebroadcast mode can't be set to NONE for a router or repeater\n"; + LOG_WARN(warning); + sendWarning(warning); + } // If we're setting router role for the first time, install its intervals if (existingRole != c.payload_variant.device.role) nodeDB->installRoleDefaults(c.payload_variant.device.role); @@ -1095,6 +1103,15 @@ bool AdminModule::messageIsRequest(const meshtastic_AdminMessage *r) return false; } +void AdminModule::sendWarning(const char *message) +{ + meshtastic_ClientNotification *cn = clientNotificationPool.allocZeroed(); + cn->level = meshtastic_LogRecord_Level_WARNING; + cn->time = getValidTime(RTCQualityFromNet); + strncpy(cn->message, message, sizeof(cn->message)); + service->sendClientNotification(cn); +} + void disableBluetooth() { #if HAS_BLUETOOTH diff --git a/src/modules/AdminModule.h b/src/modules/AdminModule.h index 0743cd7ae..766b2930c 100644 --- a/src/modules/AdminModule.h +++ b/src/modules/AdminModule.h @@ -59,6 +59,7 @@ class AdminModule : public ProtobufModule, public Obser bool messageIsResponse(const meshtastic_AdminMessage *r); bool messageIsRequest(const meshtastic_AdminMessage *r); + void sendWarning(const char *message); }; extern AdminModule *adminModule; diff --git a/variants/rp2040-lora/variant.h b/variants/rp2040-lora/variant.h index f1826605f..c93105f0e 100644 --- a/variants/rp2040-lora/variant.h +++ b/variants/rp2040-lora/variant.h @@ -54,7 +54,7 @@ #define SX126X_DIO1 LORA_DIO1 #define SX126X_BUSY LORA_BUSY #define SX126X_RESET LORA_RESET -#define SX126X_DIO2_AS_RF_SWITCH // Antenna switch CTRL -#define SX126X_RXEN LORA_DIO4 // Antenna switch !CTRL via GPIO17 +#define SX126X_DIO2_AS_RF_SWITCH // Antenna switch CTRL +#define SX126X_POWER_EN LORA_DIO4 // Antenna switch !CTRL via GPIO17 // #define SX126X_DIO3_TCXO_VOLTAGE 1.8 -#endif \ No newline at end of file +#endif