Example LoRaMultipleCommunication.ino doesnt build

hi
I check the example in ESP32 repo:

and it doesnt build:

vscode shows errors:

................
................
Compiling .pio\build\cubecell_board_plus\lib669\LoraWan102\loramac\region\RegionEU433.c.o
    src\cubecell_ab02.cpp: In function 'void setup()':
    src\cubecell_ab02.cpp:43:3: error: 'Mcu' was not declared in this scope
       43 |   Mcu.begin();
          |   ^~~
    src\cubecell_ab02.cpp: In function 'void loop()':
    src\cubecell_ab02.cpp:55:5: error: 'sendMessage' was not declared in this scope
       55 |     sendMessage(message);
          |     ^~~~~~~~~~~
    src\cubecell_ab02.cpp:62:13: error: 'LoRa' was not declared in this scope; did you mean 'LoRaWAN'?
       62 |   onReceive(LoRa.parsePacket());
          |             ^~~~
          |             LoRaWAN
    src\cubecell_ab02.cpp:62:3: error: 'onReceive' was not declared in this scope
       62 |   onReceive(LoRa.parsePacket());
          |   ^~~~~~~~~
    src\cubecell_ab02.cpp: In function 'void sendMessage(String)':
    src\cubecell_ab02.cpp:67:3: error: 'LoRa' was not declared in this scope; did you mean 'LoRaWAN'?
       67 |   LoRa.beginPacket();                   // start packet
          |   ^~~~
          |   LoRaWAN
    src\cubecell_ab02.cpp: In function 'void onReceive(int)':
    src\cubecell_ab02.cpp:82:19: error: 'LoRa' was not declared in this scope; did you mean 'LoRaWAN'?
       82 |   int recipient = LoRa.read();          // recipient address
          |                   ^~~~
          |                   LoRaWAN
    *** [.pio\build\cubecell_board_plus\src\cubecell_ab02.cpp.o] Error 1
    =============================================================== [FAILED] Took 3.54 seconds ===============================================================

any advices?

Are you compiling for a V3 board or a pre-V3 board? This code looks like it’s intended for a pre-V3 board, which uses the SX1276 LoRa chip (and the LoRa library), rather than the V3 boards, which use the SX1262 LoRa chip (and the Radio library).

actually I wanted to run this code on HTCC-AB02…

I saw that this example uses “LoRaWan_APP.h” module:

and thought that it is possible to run it on CubeCell device…

but now I realized that this module probably should come from this repo:

my VSCode+PlatformIO used some own LoRaWan_APP.h file and it seems change everything…
total mess…

The WiFi_Kit_series is also based on the ESP32, so that probably won’t work either. You should probably be looking somewhere like:

1 Like

it seems that LoRa library works in different way from Radio library.

“LoRa” lib allows to prepare LoRa packet with LoRa.beginPacket() method which declared in the LoRa.h module, and this allows make addresses for nodes.

But in the “Radio lib” for CubeCell (radio/radio.h) - there no similar method to do same thing…

See

1 Like