CubeCell Sender to Wifi LoRa 32 Receiver not working

I’m struggling to get a CubeCell sending messages to a WiFi Lora 32 V2.1 board over a private LoRa network.

I run a receiver on a Heltec Wifi Lora 32 V2 board. It receives messages from other Wifi Lora boards just fine. Recently, I got a CubeCell (HTCC-AB01) board had no success yet to send any message to the receiver.

The receiver is set up using the following code - slightly adapted from the OLED Receiver Example:

#include “heltec.h”
#include “images.h”

#define BAND 868E6 //you can set band here directly,e.g. 868E6,915E6
String rssi = “RSSI --”;
String packSize = “–”;
char packet[13] ;
byte rec_buf[256];
int packetSize = 0;

void logo(){
Heltec.display->clear();
Heltec.display->drawXbm(0,5,logo_width,logo_height,logo_bits);
Heltec.display->display();
}

void LoRaData(){
Heltec.display->clear();
Heltec.display->setTextAlignment(TEXT_ALIGN_LEFT);
Heltec.display->setFont(ArialMT_Plain_10);
Heltec.display->drawString(0 , 15 , "Received “+ String(packetSize) + " bytes”);
sprintf(packet, “%02X%02X%02X%02X%02X%02X”, rec_buf[8], rec_buf[7], rec_buf[6], rec_buf[5], rec_buf[4], rec_buf[3]);
Heltec.display->drawStringMaxWidth(0 , 26 , 128, packet);
Heltec.display->drawString(0, 0, rssi);
Heltec.display->display();
}

void cbk(int packetSize) {
Serial.println(“Incoming Package”);
for (int i = 0; i < packetSize; i++) { rec_buf[i] = LoRa.read(); }
rssi = "RSSI " + String(LoRa.packetRssi(), DEC) ;
packet == " ";
LoRaData();
}

void setup() {
//WIFI Kit series V1 not support Vext control
Heltec.begin(true /DisplayEnable Enable/, true /Heltec.Heltec.Heltec.LoRa Disable/, true /Serial Enable/, true /PABOOST Enable/, BAND /long BAND/);

Heltec.display->init();
Heltec.display->flipScreenVertically();
Heltec.display->setFont(ArialMT_Plain_10);
logo();
delay(1500);
Heltec.display->clear();

Heltec.display->drawString(0, 0, “Heltec.LoRa Initial success!”);
Heltec.display->drawString(0, 10, “Wait for incoming data…”);
Heltec.display->display();
delay(1000);
LoRa.setSyncWord(0x12);
// LoRa.onReceive(cbk);
LoRa.receive();

// LoRa.dumpRegisters(Serial);

}

void loop() {
packetSize = LoRa.parsePacket();
if (packetSize) { cbk(packetSize); }
delay(10);
}

Messages from a Wifi Lora 32 V2 board are received and the result shows on the OLED screen.

When I setup a CubeCell Sender with the out-of-the box example code LoRaSender.ino
with the frequency and Spreadingfactor adapted to the Wifi Lora board, no message will get through from the CubeCell. I played around with the SyncWord, too, with no success.
Can anyone give me a hint what I can do that the CubeCelll message is received on the Wifi LoRa 32 board ?

CubeCell Code is:

#include “LoRaWan_APP.h”
#include “Arduino.h”

/*

  • set LoraWan_RGB to 1,the RGB active in loraWan
  • RGB red means sending;
  • RGB green means received done;
    */
    #ifndef LoraWan_RGB
    #define LoraWan_RGB 0
    #endif

#define RF_FREQUENCY 868000000 // Hz

#define TX_OUTPUT_POWER 14 // dBm

#define LORA_BANDWIDTH 0 // [0: 125 kHz,
// 1: 250 kHz,
// 2: 500 kHz,
// 3: Reserved]
#define LORA_SPREADING_FACTOR 11 // [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 0 // Symbols
#define LORA_FIX_LENGTH_PAYLOAD_ON false
#define LORA_IQ_INVERSION_ON false

#define RX_TIMEOUT_VALUE 1000
#define BUFFER_SIZE 30 // Define the payload size here

char txpacket[BUFFER_SIZE];
char rxpacket[BUFFER_SIZE];

static RadioEvents_t RadioEvents;

double txNumber;

int16_t rssi,rxSize;
void DoubleToString( char *str, double double_num,unsigned int len);

void setup() {
Serial.begin(115200);

txNumber=0;
rssi=0;

Radio.SetSyncWord(0x1424);
Radio.Init( &RadioEvents );
Radio.SetChannel( RF_FREQUENCY );
Radio.SetTxConfig( MODEM_LORA, TX_OUTPUT_POWER, 0, LORA_BANDWIDTH,
                               LORA_SPREADING_FACTOR, LORA_CODINGRATE,
                               LORA_PREAMBLE_LENGTH, LORA_FIX_LENGTH_PAYLOAD_ON,
                               true, 0, 0, LORA_IQ_INVERSION_ON, 3000 ); 

}

void loop()
{
txNumber += 0.01;
sprintf(txpacket,"%s",“Hello world number”); //start a package
// sprintf(txpacket+strlen(txpacket),"%d",txNumber); //add to the end of package

DoubleToString(txpacket,txNumber,3);	   //add to the end of package

turnOnRGB(COLOR_SEND,0); //change rgb color

Serial.printf("\r\nsending packet \"%s\" , length %d\r\n",txpacket, strlen(txpacket));

Radio.Send( (uint8_t *)txpacket, strlen(txpacket) ); //send the package out	

delay(100);
turnOnRGB(0,0); //change rgb color
delay(10000);

}

/**

  • @brief Double To String
  • @param str: Array or pointer for storing strings
  • @param double_num: Number to be converted
  • @param len: Fractional length to keep
  • @retval None
    */
    void DoubleToString( char *str, double double_num,unsigned int len) {
    double fractpart, intpart;
    fractpart = modf(double_num, &intpart);
    fractpart = fractpart * (pow(10,len));
    sprintf(str + strlen(str),"%d", (int)(intpart)); //Integer part
    sprintf(str + strlen(str), “.%d”, (int)(fractpart)); //Decimal part
    }

Hello!

(at first: sorry for my weak english) I use same boards. The ESP32 need some extra lora settings. Check the example code in Arduino IDE:

Examples -> Heltec ESP32 Dev Boards -> Lora -> ReceiveCubeCellData. There is the solution, worked for me well.

Greetings,
G. Molnar

Hello and Köszönöm, Molnar.

although the further example didn’t bring the solution, I got it running now. The LoRa settings were correct already - all but one. Since I am planning to cover long distances, I selected a spreading factor of 11 - and with that the ESP32 board wont listen to the CubeCell board. I played around with the spreading factor and it worked up to SF10 for me.
If someone deeper into the network basics here could post a link to further documentation (heltec, semtech or else) here it could help others to understand better what the problem of this is…

Thanks again and good night…
Wolfi44