Skip to content

Commit

Permalink
Configure LoRA gateway parameters at startup
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
  • Loading branch information
Grégoire Seux committed Jul 12, 2022
1 parent a388f14 commit d7dc0ea
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions main/ZgatewayLORA.ino
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,13 @@ 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.setFrequency(LORA_BAND);
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 d7dc0ea

Please sign in to comment.