Arduino on Debian Wheezy

I recently discovered the joys of [Arduino](http://arduino.cc)! But setting up the development environment on [Debian](http://debian.org) Testing (Wheezy) took me a while. Here is what I did…

Set up the Arduino IDE
================

Many packages required for Arduino development were recently removed from Debian’s testing repositories. At the time of writing, they are being held in sid, waiting on a [some issues](http://packages.qa.debian.org/g/gcc-avr.html) before being migrated.

In the mean-time, you can download pre-built binaries from the [arduino.cc download page](http://arduino.cc/en/Main/Software) is pretty simple. I downloaded version 0022 for 64-bit Linux. You just unpack this in to a directory and run the `arduino` script. You’ll need to have Java installed.

$ apt-get install openjdk-6-jre

Next, you have to get the Arduino device to be detected. This works ok on Wheezy. Plug it in and look in your `kern.log`. It should show up as a serial device (my [Ardino Uno](http://arduino.cc/en/Main/ArduinoBoardUno) shows up as `/dev/ttyACM0`).

So far so good.

Get the AVR C++ compiler working
————————————

You need to get the AVR C++ compiler and C-library. Unfortunately, the newer versions of the required packages in sid don’t work (which is why they’ve not been migrated). Fortunately, the ones in squeeze work fine. Download the following packages from squeeze

* [gcc-avr](http://packages.debian.org/squeeze/gcc-avr) (the compiler)
* [avr-libc](http://packages.debian.org/squeeze/avr-libc) (the C-library)
* [binutils-avr](http://packages.debian.org/squeeze/binutils-avr) (tools to work with AVR binaries)

And install them

$ dpkg -i avr-libc_*.deb binutils-avr_*.deb gcc-avr_*.deb

This way, when they are finally migrated to wheezy, they should just get upgraded normally.

Test the set-up
—————–

1. Open up the Arduino IDE.

2. Go to Tools -> Serial Port and select the serial port your Arduino is appearing as.

If you can’t see it, there is a problem with the device being detected. If you opened the IDE before the device was plugged in, try closing it and re-opening it.

3. Go to File -> Examples -> Basics -> Blink. Then go to Sketch -> Verify / Compile.

If there are compiler errors, you have a problem with the set-up of the AVR C++ compiler or the C-library.

4. Finally, go to File -> Upload to I/O Board. You should see the board’s serial TX/RX LEDs flicker, and then you should see the LED next to pin 13 blinking on and off. Congratulations.

*[sid]: Debian’s unstable repository, at time of writing
*[wheezy]: Debian’s testing repository, at time of writing
*[squeeze]: Debian’s stable repository, at time of writing

24th October, 2011 — computing — 3 comments

comments feed

Comments

  • Pierre
    9th November, 2011 at 2:05 pm
    reply
    permalink

    Thanks for the information.
    Missing a ‘b’ in the installation command line :
    dpkg -i avr-libc_.deb binutils-avr_.deb gcc-avr_*.de

    • edam
      9th November, 2011 at 4:49 pm
      reply
      permalink

      Fixed, thanks!

  • Pete Soper
    31st July, 2014 at 6:27 pm
    reply
    permalink

    (I can’t do OpenID and hope you’ll visit my local interest group’s web site to see that I’m not a spammer.)

    I’ve used your make file with fantastic results for some time. The performance difference compared to using the IDE on Linux is breathtaking, not to mention the minimal mouse movements involved, which is excellent for these fingers that got started with an ASR33. Thanks for sharing this!

    With Attiny chips, for instance the 84A, including the “-D” avrdude flag causes verification errors. The erase is only optional for some kinds of chips.

    Best Regards,
    Pete

Leave a Reply




XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

*/?>

Cancel Reply
    • Home
  • Categories
  • Archives
  • Meta
    • log in
    • site feed
  • Thanks!
    • Send me bitcoins
    • Flattr this

powered by WordPress and Gallery2   |   hosted at waxworlds.org   |   site design by edam