Installing Libraries in Arduino PLC IDE

Hi, i have an Arduino Opta that I'm using to develop teaching materials for a University course in Advanced Manufacturing, and I need to connect it to the Arduino Cloud. Direct deployment of a sketch from the cloud doesn't allow all the PLC aspects of the board, and so not useful. What I'm trying to do is build the sketch within the Arduino PLC IDE as if the board was a manually configured device. This requires:

#include <ArduinoIoTCloud.h>
#include <Arduino_ConnectionHandler.h>

However there doesn't seem to be any options within the IDE to install new libraries or point to existing ones. The Arduino_ConnectionHandler is there, but throws errors when it tries to use one of it's dependencies (Arduino_DebugUtils.h), and the ArduinoIoTCloud isn't there at all. Just looking for any guidance on how to include extra libraries and dependencies in the PLC IDE, thanks.

I found this post while looking for answers to use an Opta with the Arduino PLC IDE myself, so I thought I would share what I found. It seems you cannot manually install new libraries, but the IDE will allow you to point to existing public libraries. That includes only those libraries found at https://www.arduinolibraries.info/. The method to include public libraries can be found in the programming introduction for the PLC IDE, at https://docs.arduino.cc/software/plc-ide/tutorials/plc-programming-introduction/#library-management.

I am not sure how to get dependencies to work - in my case I was trying to use some features from mbed_mktime.h which are included in a sample sketch, but the PLC IDE apparently will not allow use of it.

Hi bwool, yes i managed to find the solution i was looking for. Noted it here also - Sketch libraries for Opta - #10 by dwholmesphd. The most useful part is the list of available libraries found in the C:\Users\[user]\AppData\Local\T\A folder. It's important to get the version right, and that file has all available versions for your PLC IDE install. Also, you can also use custom libraries if you put the library zip in the C:\Users\[user]\AppData\Local\T\D\libraries folder, but it won't manage dependencies automatically, so you might find yourself going down a rabbit hole of copy library, find dependency, copy new library, repeat.

Perfect, thank you for that additional information! I hadn't found that list or the process to use custom libraries yet, but they sound very helpful for my project.

HI did you manage to get this going? i''m doing a similar project with out any luck so far

Yep. Note the comments above and other information in this post - Opta MQTT over port 8883 using a TLS cert for encryption

Hello!

Please ensure you have installed the latest version of the PLC IDE available in: https://www.arduino.cc/en/software

Adding libraries is described in this tutorial: https://docs.arduino.cc/software/plc-ide/tutorials/plc-programming-introduction/#library-management

To connect to the Arduino Cloud, the libraries listed below are required. Please make sure to add them, along with their latest version available on GitHub:

Best,

arduinolibraries.info fails... any idea where they've moved it? I need to include the Blueprint lib but all arduino doc links point to a github page?

How do I add a library from github?

Hi @wh00ten-isa.

Thanks for bringing this to our attention. I have submitted a report on your behalf to the team at Arduino responsible for this documentation.

arduinolibraries.info is a 3rd party website created independently by a community member. Unfortunately, as is often the case with hobby projects, the website is not actively maintained. Fortunately Arduino has created our own official equivalent of the website:

https://docs.arduino.cc/libraries/

That site should provide you with the information you need.

Do you mean the "Arduino_Opta_Blueprint" library? If so, here is its page on the Arduino Library Reference website:

https://docs.arduino.cc/libraries/arduino_opta_blueprint/

This is only needed under one of the following specific conditions:

  • the library has not been registered with the Arduino Library Manager system
  • the library is in Library Manager, but you want to use an unstable development version of the library that is not available for installation from Library Manager

The "Arduino_Opta_Blueprint" library is in Library Manager, and you have not expressed the need to use a development version (the latest 0.2.8 release is state of the art anyway). So I don't think you have any need to install the library from GitHub. If you find you truly do have such a need, then you can let us know and the forum helpers will advise you on doing that.

Top-tier reply, thanks!

Looks like the only way to learn about how to use the library is to read the repo, though, is that right?

Tried troubleshooting the sketch, checking for errors... all kosher. Seems like your library v0.2.8 doesn't work. Any advice?

Have you also included the dependencies for Arduino_Opta_Blueprint (i.e. Arduino_SerialUpdater and Arduino_DebugUtils). The entry that you find in the library_index.json that is in the AppData folder (see my post above regarding finding this) gives you all available versions and the resulting dependencies. In an Arduino IDE project, it’ll download those automatically, but in the PLC IDE you have to go down the rabbit hole manually (i.e. add those libraries and then check for their dependencies). On my install, Arduino_SerialUpdater there is only version 0.0.1 and it has no additional dependencies.

You might also try some earlier versions of the package you’re trying to use, as I’ve found that to work sometimes as well.