Translation(s): English - Français - 한국어


Arduino Logo

If we talk about Arduino we need to differentiate between the Company Arduino CC that is selling single-board microcontrollers and microcontroller kits for building digital devices and the Arduino IDE which is written in the programming language Java. You are here mostly for the latter, Debian is providing packages for Arduino IDE.

The Arduino IDE interacts very nicely with the micocontroller boards from Arduino CC but also to the widely available clones of these. The IDE can be used on various not only Atmel based boards. This wiki page is mainly about the Arduino IDE packaged within Debian.

Arduino IDE

The Arduino community offer a IDE to code, compile and upload the code directly to the microcontroller board. The software is available in the main Debian repository, you need to install the package arduino. All required depending additional packages will get installed automatically.

$ sudo apt install arduino

The preferred way for starting the IDE is calling the starter through the menu of your desktop environment, or if you not using a graphical desktop running the following command line:

$ arduino

All possible and required configuration of the IDE (like required extra libraries) is done through the preferences menu and the library manager. This is not special to Debian and the normal behavior of the IDE. You need direct access to internet for this! If this isn't possible you need to place the libraries manually to the folder there Arduino is looking for these. This is typically in $(HOME)/.arduino15 if you haven't modified this setting within the preferences.

Hardware detection

In order to let the software play with the Arduino Board, it's necessary to open few permissions to the current user. If you have just connected the card to your computer, you should look at the last kernel messages:

dmesg | tail

And you should see something like that:

[ 280.694367] usb 3-10: new full-speed USB device number 10 using xhci_hcd
[ 280.824363] usb 3-10: New USB device found, idVendor=2a03, idProduct=0043
[ 280.824366] usb 3-10: New USB device strings: Mfr=1, Product=2, SerialNumber=220
[ 280.824367] usb 3-10: Product: Arduino Uno
[ 280.824367] usb 3-10: Manufacturer: Arduino Srl
[ 280.824368] usb 3-10: SerialNumber: 85xx4383xxxxxxxxxx
[ 280.824544] usb 3-10: ep 0x82 - rounding interval to 1024 microframes, ep desc says 2040 microframes
[ 280.824926] cdc_acm 3-10:1.0: ttyACM0: USB ACM device

In this case, the board appears under the name ttyACM0 in the /dev folder, and if you list its content, you can see that the card own by the dialout group. You may see on your side USB based adapters (e.g. ttyUSB0 or similar), this depends on the USB adapter and the used chipset on your Arduino board. This makes no difference for the following section and possible required action to being able to get the Arduino IDE work with your Arduino board.

ls -l /dev/tty*
crw-rw---- 1 root       dialout 166,  0 nov.   6 17:38 /dev/ttyACM0

You need to add your user to the group dialout in order to use the card directly from the arduino software without using root or sudo. The Debian packaged Arduino IDE will detect some possible required action on this and will open a dialog which you can follow. Note you will needed to at least log out and log in again to the user session to make the modifications work!

Or you do the modification of the user access rights manually on the CLI. You need to be root (or have at least sudo rights) for running the following command.

# usermod -a -G dialout My_User_Name

Some cards could need other groups like tty or uucp.

Once that done, at the next reboot, you should see your board in "Tools > Serial Port".

FAQ

Some questions reach the package maintainer very often. Answering these here so all readers can see them.

Are there any differences between the upstream provided installer for the IDE and the packages provided by Debian?
Yes, due the DFSG we need to modify some things to provide the Arduino IDE within the main part of Debian. For a long time the source for IDE wasn't free from POV of Debian to provide any recent version of Arduino. And also right now we still need to cut out parts that do no fulfill the DFSG. This is mainly that we can't rebuild every thing from source and by this can't provide some binary stuff that the upstream installer script is installing. Happily the differences for the Arduino IDE are more of a cosmetically thing so you can expect the complete same technical behavior of the IDE as you would see if you use the version from installer script from Arduino CC.
So what differences are between the Debian version and the version from the upstream installer?

So far there are two main differences, one is the depending package arduino-core-avr that doesn't can contain all the binary files that the upstream version is containing. This means that some .hex files are excluded in the Debian version because we aren't able to get them built while package creation. If you need some of the by upstream offered .hex files you will need to pick them from the ArduinoCore-avr upstream tree on GitHub. The other main difference to the upstream version is the currently not included Reference in the Help menu. This reference is a HTML tree which we are also not able to rebuild from the sources. You can always use here the online available Language Reference

Why you don't provide all actual versions of the toolchain?
This is mostly a lack of resource to get recent versions of the tools packaged. Or the new versions come along with new required build dependencies which can be tricky. So it's not that Debian don't want to have recent versions, but all work is done by volunteers and they do this all in their free time. If you think you can improve the situation here than yes, please get in contact with the package maintainers! We aThe ppreciate any help.
Why is arduino-builder used as this tool isn't recommended to use any more? Why not use the successor arduino-cli?

This is basically already answered by the previous point. We needed to take for now that pill as arduino-cli comes with a lot of new Go related build dependencies and we wanted at least something that is working again. So we decided to stick with arduino-builder and also with the not most recent version of this tool, the most recent versions cames also with new required build dependencies which we didn't get managed to get into the archive before the Bullseye freeze. So better have arduino and required packages ready for Bullseye than nothing.

External Links


Packaging

Some minds and thinking about packaging the Arduino IDE

The upstream structure of relevant components has moved a lot since the last package update of the Arduino IDE.


The Arduino IDE

The main package as this is the source for the visible IDE.


arduino-builder

arduino-builder is currently the component that compiles (aka "building") the sketch files and transfers it into the target. It's based on Go! It will be replaced by arduino-cli in midterm. Some explanation to this from the user matthijskooijman based on Issue #376


arduino-cli

This part will supersede arduino-builder and is also build up on Go! We should probably focus on this new part instead of working on arduino-builder.

Both packages (arduino-builder and arduino-cli) requiring new Go -dev packages first! There are some ITP already created for this.

  • golang-github-arduino-go-timeutils #922528

  • golang-github-arduino-go-paths-helper #921150

  • golang-github-arduino-go-properties-map-dev


Arduino Core Packages

The Arduino UI is more or less only the IDE, without further packages the usage of it is quite limited. There are some so called Core packages needed. One of them is ArduinoCore-avr which is basically the minimum a user is needing as Arduino is all about Atmels MCUs. Upstream is shipping pre compiled .hex files which we finally want to build while package creation.

Parts of arduino-core-avr requires header files from LUFA which isn't packaged yet. In detail this is needed to (re)build the .hex files within the folders bootloaders/caterina*.

The current solution is to filter out all these folders from the source tarball and work later on this. These means we currently cannot provide any bootloader files for cateria based devices.


New package layout

We probably need to adjust the binary package names and relations.

Arduino package dependencies

Source of the graphic (arduino.dot)

digraph ArduinoIDE {

  rankdir = LR;

  arduino [color="red", fillcolor="lightblue", style="filled"];
  "arduino-core-avr" [style="dashed"];

  arduino -> "arduino-core-avr" [fontname="italic", fontsize="10", style="dashed", label="potential Depends"];
  arduino -> "arduino-builder"  [label="Depends"];
  "arduino-builder" -> "arduino-ctags"  [label="Depends"];

}

Build a PNG file from it

dot -Tpng arduino.dot > arduino.png