I’m trying to make a ping pong beetwen ESP32 V2 and CubeCell Module, I’m having problems with the CubeCell as a sender, I´m getting BoardInitMcu() was not declare in the scope and RGB_ON was not declare in the scope. What the problem could be?
here is the code:
#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 915000000 // 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 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 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;
int16_t txnumber;
int16_t RSSI,rxSize;
void setup() {
BoardInitMcu( );
Serial.begin(115200);
txnumber=0;
RSSI=0;
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()
{
delay(1000);
txnumber++;
sprintf(txpacket,"%s","how long can hello tx be");
sprintf(txpacket+strlen(txpacket),"%d",txnumber);
RGB_ON(COLOR_SEND,0);
Serial.printf("\r\nsending packet \"%s\" , length %d\r\n",txpacket, strlen(txpacket));
Radio.Send( (uint8_t *)txpacket, strlen(txpacket) );
}