Standard Arduino Libraries (i.e. Wire.h, Servo.h) not included in arduino-cli?

149 views Asked by At

I am trying to flash an arduino from my raspberry pi through ssh so I decided to use arduino-cli. I have been able to set it up and flash a standard blinking sketch to the arduino without any issues. But when I try to flash any sketch that uses the libraries that would normally come with the Arduino IDE (Wire.h, Servo.h, Firmata.h) I get the following error:

fatal error: Servo.h: No such file or directory
 #include <Servo.h>
          ^~~~~~~~~
compilation terminated

I know you can install specific arduinolibraries through arduino cli commands:

arduino-cli lib search <library>
arduino-cli lib install <library>

but the standard Wire or Servo libraries do not come up in the search.

Is there a way for me to add these libraries to my RPi/arduino-cli that will still allow me to use ssh in the future (not IDE and an HDMI connection to my RPi)? Please let me know.

P.S. I setup arduino-cli following this tutorial: https://siytek.com/arduino-cli-raspberry-pi/

1

There are 1 answers

2
Juraj On

There are a few libraries historically bundled with IDE in libraries folder. These are not available in CLI unless you install them.

Adafruit_Circuit_Playground  Firmata        Mouse          SD            Temboo
Bridge                       GSM            Robot_Control  Servo         TFT
Esplora                      Keyboard       RobotIRremote  SpacebrewYun  WiFi
Ethernet                     LiquidCrystal  Robot_Motor    Stepper

The Wire library and a few other basic hardware dependent libraries are bundled with the boards package. Again IDE has historically bundled the AVR package in hardware folder. CLI doesn't have any bundled packages. You have to install them.