Hello everyone,
I am trying to set up a private LoRa network. In order to start, I am trying to set up a simple PING-PONG communication between to LoRa development boards, just over PHY layer (not using LoRaWAN).
I have correctly configured SX1261MB2BAS shield and it is reporting successful tx_done
callbacks. On the other hand, I am trying to use SX1272 MB2DASshield unsuccessfully, it is reporting TX Timeout all the time with the SAME configuration as SX1261MB2BAS.
I am reproducing the SX1272PingPong using Mbed OS 6 API.
LoRa configuration is the following:
#define RF_FREQUENCY 868000000 // Hz
#define TX_OUTPUT_POWER 14 // 14 dBm
#define LORA_BANDWIDTH 2 // [0: 125 kHz,
// 1: 250 kHz,
// 2: 500 kHz,
// 3: Reserved]
#define LORA_SPREADING_FACTOR 7 // [SF7..SF12]
#define LORA_CODINGRATE 1 // [1: 4/5,
// 2: 4/6,
// 3: 4/7,
// 4: 4/8]
#define LORA_PREAMBLE_LENGTH 8 // Same for Tx and Rx
#define LORA_SYMBOL_TIMEOUT 5 // Symbols
#define LORA_FIX_LENGTH_PAYLOAD_ON false
#define LORA_FHSS_ENABLED false
#define LORA_NB_SYMB_HOP 4
#define LORA_IQ_INVERSION_ON false
#define LORA_CRC_ENABLED true
Simplified code is
RadioEvents.tx_done = callback(OnTxDone);
RadioEvents.rx_done = callback(OnRxDone);
RadioEvents.rx_error = callback(OnRxError);
RadioEvents.tx_timeout = callback(OnTxTimeout);
RadioEvents.rx_timeout = callback(OnRxTimeout);
Radio.standby();
Radio.sleep();
Radio.init_radio(&RadioEvents);
Radio.set_channel(RF_FREQUENCY);
Radio.set_tx_config(
MODEM_LORA, TX_OUTPUT_POWER, 0,
LORA_BANDWIDTH, LORA_SPREADING_FACTOR,
LORA_CODINGRATE, LORA_PREAMBLE_LENGTH,
LORA_FIX_LENGTH_PAYLOAD_ON, LORA_CRC_ENABLED,
LORA_FHSS_ENABLED, LORA_NB_SYMB_HOP,
LORA_IQ_INVERSION_ON, 2000);
Radio.set_rx_config(
MODEM_LORA, LORA_BANDWIDTH,
LORA_SPREADING_FACTOR, LORA_CODINGRATE,
0, LORA_PREAMBLE_LENGTH,
LORA_SYMBOL_TIMEOUT, LORA_FIX_LENGTH_PAYLOAD_ON,
0, LORA_CRC_ENABLED, LORA_FHSS_ENABLED, LORA_NB_SYMB_HOP,
LORA_IQ_INVERSION_ON, true);
while( 1 )
{
led = !led;
tr_info("Tx...");
Radio.send(Buffer, strlen((const char *)PingMsg));
thread_sleep_for(10000);
}
SPI is working as expected, I can read SEMTECH version by reading 0x42 register.