Skip to content

Commit

Permalink
Configure LoRA gateway parameters at startup (#1234)
Browse files Browse the repository at this point in the history
Without this (and without sending an initial MQTT message to the gateway
to configure it) messages are not necessarily received if parameters are
different from firmware defaults.

This patch helped at least two users:
- https://community.home-assistant.io/t/awesome-lora-soil-sensor/304351/23
- https://community.home-assistant.io/t/awesome-lora-soil-sensor/304351/18

Change-Id: Ia65ee5780b56f81fc73662c8779b79083805009b

Co-authored-by: Grégoire Seux <grego_openmqttgateway@familleseux.net>
  • Loading branch information
kamaradclimber and Grégoire Seux authored Jul 13, 2022
1 parent 9154e6c commit 537583e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions main/ZgatewayLORA.ino
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@ void setupLORA() {
Log.notice(F("LORA_SS: %d" CR), LORA_SS);
Log.notice(F("LORA_RST: %d" CR), LORA_RST);
Log.notice(F("LORA_DI0: %d" CR), LORA_DI0);
LoRa.setTxPower(LORA_TX_POWER);
LoRa.setSpreadingFactor(LORA_SPREADING_FACTOR);
LoRa.setSignalBandwidth(LORA_SIGNAL_BANDWIDTH);
LoRa.setCodingRate4(LORA_CODING_RATE);
LoRa.setPreambleLength(LORA_PREAMBLE_LENGTH);
LoRa.setSyncWord(LORA_SYNC_WORD);
Log.trace(F("ZgatewayLORA setup done" CR));
}

Expand Down

0 comments on commit 537583e

Please sign in to comment.