ArduinoOTA Library

Hello:

I’m trying to import a working Arduino project into the PlatformIO environment. The issue I’m having is with the ArduinoOTA library, unfortunately, this isn’t the one listed in the PlatformIO registry. The one I need is on Github is version 1.0 and authored by Ivan Grokhotkov and Miguel Angel Ajo (according to the libraries.properties file)

It has some class members that I need for my code.

The github page for this library doesn’t have a pull-down menu to copy the *.git link for this library. In the past, I’ve had no problem adding Lib_deps using

pio pkg install -l https://linktolibrary.git

I’ve sent an email to the maintainer of the code to add git link to the github page with this library. In the meantime, I’ve tried using a local copy of this library from Arduino using the above pio pkg install command but I get this error:

VCSBaseException: VCS: Could not process command [‘git’, ‘clone’, ‘–recursive’, ‘–depth’, ‘1’, ‘arduino-esp32/libraries/ArduinoOTA at 9eb7dc6f7bddf98600f6e8de3ccc19cc8ba5281b · espressif/arduino-esp32 · GitHub’, ‘/Users/rschaller/.platformio/.cache/tmp/pkg-installing-s3w5qxgr’]

Anyone has an suggestions for installing this library? In the meantime, hopefully the authors will add a *.git link that I can use.

Thanks in Advance

That library is already builtin and must not installed.
Simply use it as it is shown in the example arduino-esp32/libraries/ArduinoOTA/examples/BasicOTA/BasicOTA.ino at master · espressif/arduino-esp32 · GitHub

All libraries which are listed here arduino-esp32/libraries at master · espressif/arduino-esp32 · GitHub are builtin libraries.

I followed your first link and saw that ArduinoOTA file in that github link does have the required class members I need.

Do I have to pull in these built in esp32 libraries into my project? I looked at my project tree and don’t see anything but the stuff I’ve added as lib_deps. Where would I see the esp32 libraries if they were added to my project?

Thanks,
Rob

No you don’t! These libraries are builtin to the Espressif32 Arduino Framework and located on your harddrive %HOMEPATH%/.platformio/packages/framework-arduinoespressif32/libraries.

Simply do a #include <ArduinoOTA.h> and use the library.
No settings are required.

I already have that declared in my code but when I look at the definition by right clicking over <Ardunio.h> It points to a library in Lib_deps. I just issued a pio pkg uninstall command, and by accident, I wiped out most of the lib_deps. I meant to only delete the ArduinoOTA under lib_deps

I don’t understand. Can you explain this in detail ?

Simply list your lib_deps in in the platformio.ini. See lib_deps — PlatformIO latest documentation
No need to run commands.

Note the path of the resulting header file, it points to libdeps folder, from what you are saying, it should be somewhere else?

I tried posting you video showing you exactly what I did when I right clicked over #include <ArduinoOTA.h> but it was rejected because of the file type (.mov)

Also, before doing the last step, I did a pio pkg update AFTER I deleted the Arduino directory under libdeps folder.

What Arduino folder?
Looks like you’re messing things up!

Please show the content of your platformio.ini

I put an ArduinoOTA directory under .pio/libdeps/d1/

Ok, One thing i have to correct. I thought you where using Espressif32 - My bad.

But your lib_deps lists a lot of thirdparty libraries which are not compatible to the ESP8266 and have builtin counterparts. Those libraries must be removed from the lib_deps.
Unfortunately I’m unable to edit n screenshot.
Please post file content and logs as pre-formatted text next time.

Remove all unnecessary libraries like
jandrassy/ARduinoOTA (a builtin library is available!)
Nearly all “arduino-libraries/…” are not compatible to the ESP8266 and should be removed. If there is no builtin library available, look for a thirdparty library at the registry or on github for an ESP8266 compatible library.

SD is a builtin library
Keyboard → not supported by ESP8266
Mouse → not supported by ESP8266
Ethernet → not needed! You’re using wifi…

I’ve got the feeliing that the whole project was not meant to run on an ESP8266 ?

You’ll find the builtin libraries on your harddrive in %HOMEPATH%/.platformio/packages/framework-arduinoespressif8266/libraries

The corresponding github repository is GitHub - esp8266/Arduino: ESP8266 core for Arduino

After my post I was wonder if text would be better, so here it is. When I started this project I might have had more confusion about libraries so I probably added some that aren’t applicable, as you pointed out. I’m running code on Wemos D1 mini which is an ESP8266 device.

[env:d1]
platform = espressif8266
board = d1
framework = arduino
lib_deps =
ayushsharma82/EasyDDNS@^1.8.0
bodmer/TFT_eSPI@^2.5.43
jandrassy/ArduinoOTA@^1.1.0
adbancroft/avr-fast-shift@^1.1.0
arduino-libraries/LiquidCrystal@^1.0.7
arduino-libraries/SD@^1.3.0
arduino-libraries/Keyboard@^1.0.6
arduino-libraries/Mouse@^1.0.1
arduino-libraries/Arduino_BuiltIn@^1.0.0
arduino-libraries/Ethernet@^2.0.2
firmata/Firmata@^2.5.9
knolleary/PubSubClient@^2.8
ssd1306-1.8.5
adafruit/Adafruit Unified Sensor@^1.1.14
Adafruit_BME280_Library-2.2.4.zip
Adafruit-GFX-Library-1.8.4.zip
arduino-libraries/ArduinoHttpClient@^0.6.1
thingpulse/ESP8266 and ESP32 OLED driver for SSD1306 displays@^4.6.1
adafruit/Adafruit BME280 Library@^2.2.4

adafruit/Adafruit ILI9341@^1.6.1

To remove the libraries you pointed out, is there a preferred method for this or can simply delete the folders and then build or issue pio pkg update?

Simply remove the lines from the lib_deps setting in the platformio.ini

Then perform a “Full Clean”:

PIO-Icon / Project Tasks / Default / General / Full Clean:
image

2 Likes