CubeCell Compilation Problemas

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) );

}

Which version development framework did you install?

The last one 5.0.0 And I don’t know why its still not working

Please update the development framework to V1.1.0

How do I install the new framework?

I got installed the last Framework for Cubecell https://resource.heltec.cn/download/package_CubeCell_index.json

Clear the Arduino environment cache first: Arduino Boards Manager: Cannot select release V1.0.0

And then follow this quick start manual: https://heltec-automation-docs.readthedocs.io/en/latest/cubecell/quick_start.html

I have update perfectly but still the same problem

I GOT THIS MESSAGE:

Arduino: 1.8.12 (Windows 10), Board: “CubeCell-Board(HTCC-AB01), REGION_EU868, CLASS_A, OTAA, ON, CONFIRMED, OFF, ON, ACTIVE, None”

WARNING: library LoRa claims to run on ASR650x-Arduino architecture(s) and may be incompatible with your current board which runs on CubeCell architecture(s).
WARNING: library RGB claims to run on ASR650x-Arduino architecture(s) and may be incompatible with your current board which runs on CubeCell architecture(s).
C:\Users\currogp96\Documents\Arduino\Send\Send.ino: In function ‘void setup()’:

Send:58:19: error: ‘BoardInitMcu’ was not declared in this scope

 BoardInitMcu( );

               ^

C:\Users\currogp96\Documents\Arduino\Send\Send.ino: In function ‘void loop()’:

Send:89:28: error: ‘RGB_ON’ was not declared in this scope

     RGB_ON(COLOR_SEND,0);

                        ^

Send:97:24: error: ‘LowPower_Handler’ was not declared in this scope

   LowPower_Handler();

                    ^

Send:99:15: error: ‘RGB_OFF’ was not declared in this scope

   RGB_OFF();

           ^

In file included from C:\Users\currogp96\Documents\Arduino\Send\Send.ino:2:0:

Send:104:17: error: ‘ADC_CTL’ was not declared in this scope

     pinMode(ADC_CTL,OUTPUT);

             ^

C:\Users\currogp96\AppData\Local\Arduino15\packages\CubeCell\hardware\CubeCell\1.0.0\cores\asr650x/Arduino.h:92:37: note: in definition of macro ‘PINMODE_OUTPUT’

#define PINMODE_OUTPUT(pin) pinMode(pin,OUTPUT)

                                 ^

C:\Users\currogp96\Documents\Arduino\Send\Send.ino:104:9: note: in expansion of macro ‘pinMode’

     pinMode(ADC_CTL,OUTPUT);

     ^

C:\Users\currogp96\Documents\Arduino\Send\Send.ino: In function ‘void OnTxDone()’:

Send:121:13: error: ‘RGB_ON’ was not declared in this scope

RGB_ON(0,0);

         ^

exit status 1
‘BoardInitMcu’ was not declared in this scope

This report would have more information with
“Show verbose output during compilation”
option enabled in File -> Preferences.

There is something wrong in your code, the correct code should like this:

#include "LoRaWan_APP.h"
#include "LoRa_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);
   
    turnOnRGB(COLOR_SEND,0);

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

    Radio.Send( (uint8_t *)txpacket, strlen(txpacket) );
}

Some function names in the newest framework had been changed. Just use the newest example will have no problem.

newest framework had been changed, you can make some changes in your code, if i not wrong some like this.

RGB_ON() RGB_OFF() by turnOnRGB() turnOffRGB()
LowPower_Handler() by lowPowerHandler()
BoardInitMcu( ); by boardInitMcu( );
pinMode(ADC_CTL,OUTPUT); by pinMode(Vext,OUTPUT);

goodbye

:upside_down_face: