Computer Arduino: Difference between revisions

From Open Source Ecology
Jump to navigation Jump to search
No edit summary
Line 1: Line 1:
    Getting Arduino UNO to work in Linux
    ...
last edited 12 months ago by Pierre
Document Actions
    Send this page to somebody
    Print this page
As of now (early July, 2011), the UNO is broken in Linux. The board is shipped with a firmware that makes it practically impossible to use in Linux.
The symptoms are :
    Arduino IDE unable to detect serial port, or loosing it randomly, making it very difficult to upload a sketch or to open serial monitor.
    Inability to detect the board from within Pd in a predictable fashion. [comport] detects it very erratically, outputs an error when you try to open your device, and generally takes ages to react to [open( or [close(, or even [devices(.
Fortunately, there is a fix! You will need to flash the firmware with an updated version. This may sound like a perilous thing to do, but it's actually pretty safe, and there is no risk of bricking your board (according to some people in the Arduino team). In order to flash the firmware, you will have to put the board into "firmware update" mode.
If you own the first version of the UNO board ("UNO" should be written on the back of the board), you can refer to this tutorial :
http://arduino.cc/en/Hacking/DFUProgramming8U2
If you own a "revised" UNO ("UNO R2" on the back), then follow these steps:
    Download the updated firmware from this page (.hex file): https://github.com/arduino/Arduino/tree/master/hardware/arduino/firmwares/arduino-usbserial
    Install dfu-programmer by pasting this command in the terminal:
    sudo apt-get install dfu-programmer
    Connect your board to the computer, and locate the six upright pins close to the USB plug(circled in red in the picture below).
    Briefly connect the two pins closest to the USB plug (using a wire, for instance). You should see the "L" LED blink once or twice. Both the "Rx" and "Tx" LEDs? should now be off : your board is now ready for a firmware update.
    In the terminal, cd to the directory in which you have saved the updated firmware, and run the following commands:
    sudo dfu-programmer at90usb82 erase
    sudo dfu-programmer at90usb82 flash Arduino-usbserial-uno.hex
    sudo dfu-programmer at90usb82 reset
    Unplug and replug your UNO board.
    Open Arduino IDE : it should now work flawlessly. You can now upload any sketch to your board. And [comport] in Pd is now able to detect it.
Please note that this fix also supposedly works for Arduino Mega boards, though not owning a Mega myself, I haven't tested it. Also, the new UNOs are expected to be shipped with the updated firmware. I bought mine in April, 2011, so any UNO bought before will have to be flashed for sure. I don't know about the boards bought afterwards.
Now that your UNO is working properly in Linux, you may download Pduino from Hans-Christoph Steiner's website. Pduino requires firmata to be uploaded on the board. It is the most flexible and comprehensive way of controlling the board's pins from within PD, both for input and output.
=Linux=
=Linux=



Revision as of 19:20, 15 July 2012

   Getting Arduino UNO to work in Linux
   ...

last edited 12 months ago by Pierre Document Actions

   Send this page to somebody
   Print this page


As of now (early July, 2011), the UNO is broken in Linux. The board is shipped with a firmware that makes it practically impossible to use in Linux.

The symptoms are :

   Arduino IDE unable to detect serial port, or loosing it randomly, making it very difficult to upload a sketch or to open serial monitor.
   Inability to detect the board from within Pd in a predictable fashion. [comport] detects it very erratically, outputs an error when you try to open your device, and generally takes ages to react to [open( or [close(, or even [devices(.

Fortunately, there is a fix! You will need to flash the firmware with an updated version. This may sound like a perilous thing to do, but it's actually pretty safe, and there is no risk of bricking your board (according to some people in the Arduino team). In order to flash the firmware, you will have to put the board into "firmware update" mode.

If you own the first version of the UNO board ("UNO" should be written on the back of the board), you can refer to this tutorial :

http://arduino.cc/en/Hacking/DFUProgramming8U2

If you own a "revised" UNO ("UNO R2" on the back), then follow these steps:

   Download the updated firmware from this page (.hex file): https://github.com/arduino/Arduino/tree/master/hardware/arduino/firmwares/arduino-usbserial
   Install dfu-programmer by pasting this command in the terminal:
   sudo apt-get install dfu-programmer
   Connect your board to the computer, and locate the six upright pins close to the USB plug(circled in red in the picture below).
   Briefly connect the two pins closest to the USB plug (using a wire, for instance). You should see the "L" LED blink once or twice. Both the "Rx" and "Tx" LEDs? should now be off : your board is now ready for a firmware update.
   In the terminal, cd to the directory in which you have saved the updated firmware, and run the following commands:
   sudo dfu-programmer at90usb82 erase
   sudo dfu-programmer at90usb82 flash Arduino-usbserial-uno.hex
   sudo dfu-programmer at90usb82 reset
   Unplug and replug your UNO board.
   Open Arduino IDE : it should now work flawlessly. You can now upload any sketch to your board. And [comport] in Pd is now able to detect it.

Please note that this fix also supposedly works for Arduino Mega boards, though not owning a Mega myself, I haven't tested it. Also, the new UNOs are expected to be shipped with the updated firmware. I bought mine in April, 2011, so any UNO bought before will have to be flashed for sure. I don't know about the boards bought afterwards.

Now that your UNO is working properly in Linux, you may download Pduino from Hans-Christoph Steiner's website. Pduino requires firmata to be uploaded on the board. It is the most flexible and comprehensive way of controlling the board's pins from within PD, both for input and output.

Linux

http://puredata.info/docs/GettingArduinoUNOToWorkInLinux/?portal_status_message=Getting%20Arduino%20UNO%20to%20work%20in%20Linux%20copied.

http://arduino.cc/en/Hacking/DFUProgramming8U2

Windows