TTGO LoRa ESP32 OLED - Error when compiling

Hi.
I have used Arduino IDE to test my Lora ESP32 board and it works.
Then, I try to do the same with the ARduino Cloud Portal and it fails. Why ?

In the Arduino Cloud portal : I have created a LoRaWAN device and associated a boolean item.
A sketch is automatically created by the portal and when I try to compile it in the Full Editor, WITHOUT ADDING ANY CODE, I've got an error message :

''''
/usr/local/bin/arduino-cli compile --fqbn esp32:esp32:ttgo-lora32:DebugLevel=none,EraseFlash=none,FlashFreq=80,Revision=TTGO_LoRa32_V1,UploadSpeed=921600 --build-cache-path /tmp --output-dir /tmp/924829455/build --build-path /tmp/arduino-build-62D7920D836512D59165E249DB3E0C3F /tmp/924829455/Untitled_jan26c
In file included from /tmp/924829455/Untitled_jan26c/Untitled_jan26c.ino:18:
/tmp/924829455/Untitled_jan26c/thingProperties.h:18:1: error: 'LoRaConnectionHandler' does not name a type; did you mean 'WiFiConnectionHandler'?
LoRaConnectionHandler ArduinoIoTPreferredConnection(APPEUI, APPKEY, _lora_band::EU868);

^~~~~~~~~~~~~~~~~~~~~
WiFiConnectionHandler
/tmp/924829455/Untitled_jan26c/Untitled_jan26c.ino: In function 'void setup()':
/tmp/924829455/Untitled_jan26c/Untitled_jan26c.ino:30:22: error: 'ArduinoIoTPreferredConnection' was not declared in this scope
ArduinoCloud.begin(ArduinoIoTPreferredConnection);

^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Multiple libraries were found for "WiFi.h"
Used: /home/builder/.arduino15/packages/esp32/hardware/esp32/2.0.5/libraries/WiFi
Not used: /home/builder/opt/libraries/seeed_arduino_rpcwifi_1_0_6
Not used: /home/builder/opt/libraries/wifi_1_2_7
Not used: /home/builder/opt/libraries/wifiespat_1_4_3
Not used: /home/builder/opt/libraries/vega_wifinina_1_0_1
Not used: /home/builder/opt/libraries/nina_wi_fi_1_0_1
Not used: /home/builder/opt/libraries/indhilib_3_0_5
Not used: /home/builder/opt/libraries/da16200_wi_fi_library_for_arduino_1_1_0
Not used: /home/builder/opt/libraries/wifinina_1_8_14
Multiple libraries were found for "WiFiClientSecure.h"
Used: /home/builder/.arduino15/packages/esp32/hardware/esp32/2.0.5/libraries/WiFiClientSecure
Not used: /home/builder/opt/libraries/seeed_arduino_rpcwifi_1_0_6
Error during build: exit status 1
''''

That's quite possibly a clue. You would appear to have at least 9 different libraries that offer Wifi support installed. The IDE doesn't know which library is the proper one, and has chosen the wrong one.

Thanks a lot for your input.
What shall I do ? (pb is that teh pb happens on 2 different PCs.... So I'm surprised that on both I have a duplication)...

You are going to have to figure out which library is the right one for your board, and get rid of the others.

IIRC (and to be fair, I may not), WiFi, like Wire and SPI, is one of the libraries that's specific to a particular core, and so is included with the core when it's installed. So theoretically, there shouldn't be any WiFi libraries in your user library subdirectory; the "right" one is the one in the core directory tree. But as I've never actually run into your particular situation myself, I could quite well be wrong is both my diagnosis and solution.

I have the same pb on a PC without the IDE Arduino GUI installed.

Does my architecture seem to be correct ?

  1. I want to use a LORA Network delivered by Orange (public gateways)
  2. I have therefore ordered TTGO LOra ESP32 Lora device
  3. I create in the Arduino IoT Cloud a device LoraWan
  4. I have created a simple THING and I associate the Lora device with EUI and APP keys
  5. Then I try to compile a "standard" sketch "automatically" created by Arduino IoT CLoud

Does it seems to be OK ?
When I will be able to compile and download the sketch on the board I will create an Object in the Orange Live Object portal.

Hi @essarts-le-roi.

As documented here, support for LoRaWAN network connectivity to Arduino Cloud IoT is limited to these boards:

You can use ESP32 boards with Arduino Cloud IoT, but only via Wi-Fi network connectivity. This is the cause of the error when compiling the Thing sketch.

Although that certainly does happen sometimes, fortunately the build system was smart enough to select the correct one this time so this is no problem:

OK. Thanks.

You are welcome. I'm glad if I was able to be of assistance.

Regards,
Per

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.