Author Topic: Arduino IDE on Ubuntu, how?  (Read 4825 times)

0 Members and 1 Guest are viewing this topic.

Offline alpherTopic starter

  • Frequent Contributor
  • **
  • Posts: 348
  • Country: ca
Arduino IDE on Ubuntu, how?
« on: February 06, 2018, 05:21:54 pm »
Hi, total noob here. :-//
I'm trying to play with arduino stuff so decided to install the IDE.
Cause I have this blazingly fast Acer netbook gathering dust, decided to install Lubuntu on it to use it as a platform to play.
Lubuntu runs just barely passable on this Atom killer C50 cpu, but I don't complain.
What I cannot wrap my head arround is this, how do you make the IDE connect to actual arduino through USB ?
I know I'm probably missing something very basic here, but I really have no idea how do you work with USB/serial in linux?
Steps that I did so far, in IDE I go to tools choose my board ( UNO ) , then I go to programmer and ?? tried AVRisp, but then i see a  message that I need to pick a serial port, unfortunately that option is grayed out.
Any pointers?
Thanks in advance.

 

Offline rrinker

  • Super Contributor
  • ***
  • Posts: 2046
  • Country: us
Re: Arduino IDE on Ubuntu, how?
« Reply #1 on: February 06, 2018, 05:28:27 pm »
 This may be the same problem I had with my model railroad control program using the USB port to communicate to the interface board, while running Ubuntu. Your user does not have the required permissions to the USB port. That was a long time ago and I rarely use that machine any more so I do not recall exactly what I had to do to fix it (assign myself permissions, of course, but I forget the actual commands required).  That should at least point you in the right direction. Someone who more regularly uses Linux will I'm sure be able to show the command from memory.
 

Offline Electroplated

  • Regular Contributor
  • *
  • Posts: 79
  • Country: gb
Re: Arduino IDE on Ubuntu, how?
« Reply #2 on: February 06, 2018, 06:09:54 pm »
I'm using mint 18 but I think maybe the problem you have with the ports grayed out is similar.

First off, the port could be greyed out due to a bug in the IDE itself, in my case the list doesn't have any ports just a few lines of space where ports would be listed, like its listed in invisible print, fun right ?

I would suggest plugging the uno in to the usb port first then starting the IDE, if nothing is listed under ports but there is a blank space under 'ports' try clicking it, it may highlight and allow you to select /dev/tty whatever.

If that fails then it maybe you do not have the IDE installed correctly or you are using an older version, I am using version 1.8.5.

..
50 years working with electronics and I still wonder how small parts can have all that smoke inside !
 

Online rstofer

  • Super Contributor
  • ***
  • Posts: 9889
  • Country: us
Re: Arduino IDE on Ubuntu, how?
« Reply #3 on: February 06, 2018, 06:41:11 pm »
Did you add your username to the dialout group?
https://www.arduino.cc/en/Guide/Linux
 

Offline paulca

  • Super Contributor
  • ***
  • Posts: 4031
  • Country: gb
Re: Arduino IDE on Ubuntu, how?
« Reply #4 on: February 06, 2018, 07:40:25 pm »
When you plug the Arduino in can you run

dmesg

in a terminal?

There will be a block at the bottom which looks like:
Code: [Select]
[ 5713.313402] usb 3-1: new full-speed USB device number 4 using xhci_hcd
[ 5713.509587] usb 3-1: ep 0x82 - rounding interval to 1024 microframes, ep desc says 2040 microframes
[ 5713.511652] cdc_acm 3-1:1.0: ttyACM0: USB ACM device

It might not look exactly like that but similar.  This means you linux sees it.

Now try:
ls -l /dev/ttyACM*

Code: [Select]
paul@localhost ~ $ ls -l /dev/ttyACM*
crw-rw---- 1 root uucp 166, 0 Feb  6 19:37 /dev/ttyACM0

In my case I need to be in the "uucp" group to use it.  Some Linux's use "dialout".

You can add yourself to that group with:

sudo gpasswd -a your_user_name the_group_name

Then logout completely and log back in.
"What could possibly go wrong?"
Current Open Projects:  STM32F411RE+ESP32+TFT for home IoT (NoT) projects.  Child's advent xmas countdown toy.  Digital audio routing board.
 
The following users thanked this post: wilfred

Offline alsetalokin4017

  • Super Contributor
  • ***
  • Posts: 2055
  • Country: us
Re: Arduino IDE on Ubuntu, how?
« Reply #5 on: February 06, 2018, 11:50:34 pm »
On mine: Ubuntu-gnome 16.04.3 LTS

Arduino IDE installed from the Ubuntu Software Center, IDE version 2:1.0.5+dfsg2-4

UNO plugged in to a USB port, then start IDE, in Tools select Board = UNO,  Programmer = AVRISP mkII and in Serial Port select /dev/tty/ACM0

works for me

note that the UNO must be plugged in for the ACM0 selection to show up
The easiest person to fool is yourself. -- Richard Feynman
 
The following users thanked this post: alpher

Offline alpherTopic starter

  • Frequent Contributor
  • **
  • Posts: 348
  • Country: ca
Re: Arduino IDE on Ubuntu, how?
« Reply #6 on: February 07, 2018, 01:21:55 am »
On mine: Ubuntu-gnome 16.04.3 LTS

Arduino IDE installed from the Ubuntu Software Center, IDE version 2:1.0.5+dfsg2-4

UNO plugged in to a USB port, then start IDE, in Tools select Board = UNO,  Programmer = AVRISP mkII and in Serial Port select /dev/tty/ACM0

works for me

note that the UNO must be plugged in for the ACM0 selection to show up

Yo're a genious man!!! :-+
When i plugged the UNO before starting IDE everytnings's fallen in place, I have a /dev/tty/USB0 as a default, moreover now I can start the IDE and then plugg the Uno and still works fine. Must've needed that initial push :)
I'm sure other solutions would have worked as well, so thanks to everybody again.

On the other hand, any pointers how to make this damn netbook run half decently.
Jeez, even Lubuntu crawls on this speed demon, should i try a different distro?
Mint maybe? I meand lubuntu runs better than the win7 that originally came with it, but just marginally. :(
I gave it a SSD instead of the HDD, upgraded ram to 4G, the beast stil crawls. >:(
 

Offline JustMeHere

  • Frequent Contributor
  • **
  • Posts: 736
  • Country: us
Re: Arduino IDE on Ubuntu, how?
« Reply #7 on: February 07, 2018, 01:49:09 am »
4GB is entry level on RAM.

Check 'top' and see if you are using any of the swap file.
 

Offline paulca

  • Super Contributor
  • ***
  • Posts: 4031
  • Country: gb
Re: Arduino IDE on Ubuntu, how?
« Reply #8 on: February 07, 2018, 08:01:30 am »
Arduino IDE installed from the Ubuntu Software Center, IDE version 2:1.0.5+dfsg2-4


This is a common issue with distros.  I believe that version is severely out of date.  Isn't the current version something like 1.7.0?

Gentoo was the same.  I use the binary download, but I have instructions for compiling from source, but it looked like a faff.   I did however compile the cross compile tool chain for AVR-GCC.
"What could possibly go wrong?"
Current Open Projects:  STM32F411RE+ESP32+TFT for home IoT (NoT) projects.  Child's advent xmas countdown toy.  Digital audio routing board.
 

Offline alsetalokin4017

  • Super Contributor
  • ***
  • Posts: 2055
  • Country: us
Re: Arduino IDE on Ubuntu, how?
« Reply #9 on: February 07, 2018, 05:57:40 pm »
Well, so what? Installing from the Software Center is easy and fast and does not require compiling from scratch, and the IDE does everything I need it to do and is compatible with all of the hundreds of sketches in my six sketchbooks. Not only that but it appears that my post may have been actually helpful to the OP.

I also drive a 27 year old Chevy. It gets me where I need to go and gets reasonably good gas mileage. Even though it is severely out of date.
The easiest person to fool is yourself. -- Richard Feynman
 

Offline metrologist

  • Super Contributor
  • ***
  • Posts: 2199
  • Country: 00
Re: Arduino IDE on Ubuntu, how?
« Reply #10 on: February 07, 2018, 06:34:43 pm »
Totally wished I'd kept my Chevy. It'd be 36 years old now.  >:D
 

Offline paulca

  • Super Contributor
  • ***
  • Posts: 4031
  • Country: gb
Re: Arduino IDE on Ubuntu, how?
« Reply #11 on: February 07, 2018, 09:29:42 pm »
Well, so what? Installing from the Software Center is easy and fast and does not require compiling from scratch, and the IDE does everything I need it to do and is compatible with all of the hundreds of sketches in my six sketchbooks. Not only that but it appears that my post may have been actually helpful to the OP.

It's not difficult, you download it from the download link on the arduino website, unpack it and run the IDE installer.

https://www.arduino.cc/en/Guide/Linux

If you want to run older versions that's fine.  But you don't need to compile from scratch to get the most recent version.  The main reason the distros don't upgrade it all that often is because nobody uses the distro version.  The most recent is 1.8.5 BTW.  Beside you lose all the new functionality, though I have no idea what that is.

In that sense your advice might work, but it's not... proper.

As to compiling the avr-gcc tool chain for cross compiling it's mostly irrelevant, but it allows you to use the Arduino and the AVR itself without having to use the Arduino IDE or the inefficient libraries it gives you.

As to your block iron gas guzzling American barge... don't care.  I have a light weight efficient Japanese sports car which has modern technology like bluetooth and heated seats :P
"What could possibly go wrong?"
Current Open Projects:  STM32F411RE+ESP32+TFT for home IoT (NoT) projects.  Child's advent xmas countdown toy.  Digital audio routing board.
 

Offline plew_ar

  • Newbie
  • Posts: 3
  • Country: us
Re: Arduino IDE on Ubuntu, how?
« Reply #12 on: February 12, 2018, 04:45:57 pm »
Back in my old *nix classes we learned to always add double the swap as ram installed. Maybe adding more swap space would help increase the performance.

swap is virtual memory that utilizes hard drive space. Id set the swap to 8gb... In my humble opinion, I would imagine it will help.
 

Offline paulca

  • Super Contributor
  • ***
  • Posts: 4031
  • Country: gb
Re: Arduino IDE on Ubuntu, how?
« Reply #13 on: February 12, 2018, 07:13:25 pm »
Back in my old *nix classes we learned to always add double the swap as ram installed. Maybe adding more swap space would help increase the performance.

swap is virtual memory that utilizes hard drive space. Id set the swap to 8gb... In my humble opinion, I would imagine it will help.

It's as old as the hills that advice.  It stems back to when machines had in the order of 256Mb of RAM.  With the 32bit machines reaching to 2Gb it became defunct.  You can't have more than 4Gb of total RAM and swap on 32bit.  You can create it, but it won't be used.

Beyond that 64bit machines are now running 4Gb as a minimum usually and 8Gb of swap, if you ever had to use it would ... well... you could get a cup of coffee while it churns you HDD for ages.

Swap only prevents OOM situations by shifting the last accessed memory pages to disk, leaving room for current pages.  The disc is many orders of magnitude slower than memory.  Memory access is around 5-10ns where as HDD access is usually around 10-50us.  SDD faster, but don't use SDD for swap!

And, to be a pedant, virtual memory is a term often used incorrectly.  Virtual memory refers to the total address space of the computer.  4Gbyte on 32bit.  Many terrabytes on 64bit.  A process has access to that completely memory address space.  The OS then maps different processes to pages which exist either in pyshical memory, disc "swap" or other memory paging storage, which can even be network attached memory.  But it's pedantry.  We knew what you meant. ;)

For swap space size these days I give it a token 2Gb.  I have 16Gb RAM, if I start seeing swap being used, something has gone horribly wrong.

For systems using a lot of swap a performance increase (though temporary) can be achieved by closing most of your applications, removing the swap and adding it back on.  This forces a completely flush of swap back to main memory.
"What could possibly go wrong?"
Current Open Projects:  STM32F411RE+ESP32+TFT for home IoT (NoT) projects.  Child's advent xmas countdown toy.  Digital audio routing board.
 

Offline paulca

  • Super Contributor
  • ***
  • Posts: 4031
  • Country: gb
Re: Arduino IDE on Ubuntu, how?
« Reply #14 on: February 12, 2018, 07:18:41 pm »
For performance improvements for the OP.

Don't run KDE or Gnome.  Try BlackBox of XFCE.  These are much lighter.

Run "top" in a terminal and sort by memory "Shift+M" or CPU (the default sort).  When things get really slow, checking this will reveal what is using the most CPU or memory.  Firefox for example can use a huge amount of RAM, closing it, waiting a for moments and relaunching it will clean things up.  Crashed or upset processes can happily spin at 100% CPU making things run slow.  You can kill things within top by pressing "k" and entering the PID number.

However you are on 4Gb.  So you are unlikely to me memory limited.  You have an SSD (assuming you removed the HDD). More likely CPU limited.  Not much you can do about that, save run leaner software and desktop environments or overclock it.
"What could possibly go wrong?"
Current Open Projects:  STM32F411RE+ESP32+TFT for home IoT (NoT) projects.  Child's advent xmas countdown toy.  Digital audio routing board.
 

Offline not1xor1

  • Frequent Contributor
  • **
  • Posts: 716
  • Country: it
Re: Arduino IDE on Ubuntu, how?
« Reply #15 on: February 13, 2018, 06:46:44 am »
It's as old as the hills that advice.  It stems back to when machines had in the order of 256Mb of RAM.  With the 32bit machines reaching to 2Gb it became defunct.  You can't have more than 4Gb of total RAM and swap on 32bit.  You can create it, but it won't be used.


https://en.wikipedia.org/wiki/Physical_Address_Extension#Linux :
The Linux kernel includes full PAE-mode support starting with version 2.3.23, in 1999 enabling access of up to 64 GB of memory on 32-bit machines. A PAE-enabled Linux kernel requires that the CPU also support PAE. The Linux kernel supports PAE as a build option and major distributions provide a PAE kernel either as the default or as an option.
 

Offline not1xor1

  • Frequent Contributor
  • **
  • Posts: 716
  • Country: it
Re: Arduino IDE on Ubuntu, how?
« Reply #16 on: February 13, 2018, 07:12:25 am »
On the other hand, any pointers how to make this damn netbook run half decently.
Jeez, even Lubuntu crawls on this speed demon, should i try a different distro?
Mint maybe? I meand lubuntu runs better than the win7 that originally came with it, but just marginally. :(
I gave it a SSD instead of the HDD, upgraded ram to 4G, the beast stil crawls. >:(

I never tried any PC with that CPU (AMD C50)
It looks like it is a 64bit one so you could install a 64bit version of linux which should be faster.
Linux doesn't use so much RAM so I doubt you would ever need swap.

Since you have a SSD and 4MiB of RAM you might reduce the swappiness threshold adding in /etc/sysctl.conf:
vm.swappiness=10

Check what services are running and try to disable all the ones you do not use (e.g.. bluetooth, wifi, etc.)
I'm not experienced with lubuntu, if there is no GUI application, you can check the desktop files in /etc/xdg/autostart.

It might also be useful to search on the net for "AMD C50 linux" and see what other people have done.
 

Offline paulca

  • Super Contributor
  • ***
  • Posts: 4031
  • Country: gb
Re: Arduino IDE on Ubuntu, how?
« Reply #17 on: February 13, 2018, 08:00:32 am »
The Linux kernel includes full PAE-mode support starting with version 2.3.23

Apologies, I kinda excluded that after I got burnt by the WindowsXP implementation of same.  There was a bug which caused invalid address application lock ups which pretty much meant my XP install was useless once i went to 4Gb of RAM.  Anything memory intensive like Flight Sim would run into the bug at some point and lock up a few hours into a game.

I never tested the Linux version as my Linux box never needed the 4Gb.
"What could possibly go wrong?"
Current Open Projects:  STM32F411RE+ESP32+TFT for home IoT (NoT) projects.  Child's advent xmas countdown toy.  Digital audio routing board.
 

Offline djnz

  • Regular Contributor
  • *
  • Posts: 179
  • Country: 00
Re: Arduino IDE on Ubuntu, how?
« Reply #18 on: February 13, 2018, 12:00:27 pm »
I don't think it is your RAM. I've been running Ubuntu (not lubuntu, actual 'heavy' ubuntu)  on an i5 2nd gen with 4GB RAM, 8GB swap, SSD for a long time and Arduino runs just fine. The machine is quite breezy. If anything, it is probably your CPU.

Adding an SSD was probably a good idea, I doubt you can make the machine any better.
 

Offline not1xor1

  • Frequent Contributor
  • **
  • Posts: 716
  • Country: it
Re: Arduino IDE on Ubuntu, how?
« Reply #19 on: February 13, 2018, 12:51:00 pm »
The Linux kernel includes full PAE-mode support starting with version 2.3.23

Apologies, I kinda excluded that after I got burnt by the WindowsXP implementation of same.  There was a bug which caused invalid address application lock ups which pretty much meant my XP install was useless once i went to 4Gb of RAM.  Anything memory intensive like Flight Sim would run into the bug at some point and lock up a few hours into a game.

I never tested the Linux version as my Linux box never needed the 4Gb.

Come on... I do not think you really have anything to apologize for  :)
I usually make much worst mistakes and more often than I'd like...
 

Offline paulca

  • Super Contributor
  • ***
  • Posts: 4031
  • Country: gb
Re: Arduino IDE on Ubuntu, how?
« Reply #20 on: February 13, 2018, 01:07:18 pm »
The Linux kernel includes full PAE-mode support starting with version 2.3.23

Apologies, I kinda excluded that after I got burnt by the WindowsXP implementation of same.  There was a bug which caused invalid address application lock ups which pretty much meant my XP install was useless once i went to 4Gb of RAM.  Anything memory intensive like Flight Sim would run into the bug at some point and lock up a few hours into a game.

I never tested the Linux version as my Linux box never needed the 4Gb.

Come on... I do not think you really have anything to apologize for  :)
I usually make much worst mistakes and more often than I'd like...

I have such strong opinions and am a know-it-all sometimes it is only fair to balance things by admitting when I'm wrong :)
"What could possibly go wrong?"
Current Open Projects:  STM32F411RE+ESP32+TFT for home IoT (NoT) projects.  Child's advent xmas countdown toy.  Digital audio routing board.
 

Offline alpherTopic starter

  • Frequent Contributor
  • **
  • Posts: 348
  • Country: ca
Re: Arduino IDE on Ubuntu, how?
« Reply #21 on: February 13, 2018, 02:32:53 pm »
I don't think it is your RAM. I've been running Ubuntu (not lubuntu, actual 'heavy' ubuntu)  on an i5 2nd gen with 4GB RAM, 8GB swap, SSD for a long time and Arduino runs just fine. The machine is quite breezy. If anything, it is probably your CPU.

Adding an SSD was probably a good idea, I doubt you can make the machine any better.

i5 is a speed demon compared to C50, this AMD is probably the sheetiest cpu made in recent history.
For some reason though netbooks made at the time came either came with an Atom and 1000x600 resolution screen or AMD C50/60 and much better 1200x760 resolution.
Frankly I much preffered the Atom but the screen was a huge factor too, even 270 atom probably would run circles arround this p.o.s. AMD.  ;D

 

Offline djnz

  • Regular Contributor
  • *
  • Posts: 179
  • Country: 00
Re: Arduino IDE on Ubuntu, how?
« Reply #22 on: February 13, 2018, 04:06:52 pm »
Atoms from that period lack out of order execution, but this processor (AMD C50) seems to have it I guess, so I think this is actually a better processor than an atom. However they are both pretty bad, so it probably doesn't matter.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf