KiwiBryn / SX127X-NetCore

C# Semtech SX127X library for .NET Core powered devices
4 stars 0 forks source link

Interaction with Lora-Soil Moisture Sensor #3

Closed GPT-John closed 2 years ago

GPT-John commented 2 years ago

Thanks again for the great work on this library.

I have a device that transmits with the following settings : https://github.com/Makerfabs/Lora-Soil-Moisture-Sensor/tree/master/V3/firmware/Moisture_LowPower_RadioLib_v2.1

#define FREQUENCY 915.0
#define BANDWIDTH 125.0
#define SPREADING_FACTOR 9
#define CODING_RATE 7
#define OUTPUT_POWER 10
#define PREAMBLE_LEN 8
#define GAIN 0

I'm trying to receive these message in my Pi LoRa Hat that seems to work for the other LoRa device I have.

I'm using

        sX127XDevice.Initialise(SX127XDevice.RegOpModeMode.ReceiveContinuous, 
            frequency: Frequency,
            bandwidth: SX127XDevice.RegModemConfigBandwidth._125KHz,
            codingRate: SX127XDevice.RegModemConfigCodingRate._4of7,
            spreadingFactor: SX127XDevice.RegModemConfig2SpreadingFactor._128ChipsPerSymbol,
            lnaGain: 0,
            preambleLength: 8,
            syncWord: 0x12,
            powerAmplifier: SX127XDevice.PowerAmplifier.PABoost, 
            rxPayloadCrcOn: true, 
            rxDoneignoreIfCrcMissing: false
            );

Can seem to see whats wrong.

GPT-John commented 2 years ago

....and with that posted I just got it working.

I found this article on the conversions

https://electronics.stackexchange.com/questions/278192/understanding-the-relationship-between-lora-chips-chirps-symbols-and-bits

Thus using _512ChipsPerSymbol works fine.