Arduino IDE on Ubuntu, how? - Page 1
Forum section: electronics / beginners

author: alpher
author_rank: Frequent Contributor
timestamp: February 06, 2018, 05:21:54 pm
content: 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.

author: rrinker
author_rank: Super Contributor
timestamp: February 06, 2018, 05:28:27 pm
content: 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.

author: Electroplated
author_rank: Regular Contributor
timestamp: February 06, 2018, 06:09:54 pm
content: 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...

author: rstofer
author_rank: Super Contributor
timestamp: February 06, 2018, 06:41:11 pm
content: Did you add your username to the dialout group?https://www.arduino.cc/en/Guide/Linux

author: paulca
author_rank: Super Contributor
timestamp: February 06, 2018, 07:40:25 pm
content: When you plug the Arduino in can you rundmesgin a terminal?There will be a block at the bottom which looks like:Code:[ 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 deviceIt might not look exactly like that but similar. This means you linux sees it.Now try:ls -l /dev/ttyACM*Code:paul@localhost ~ $ ls -l /dev/ttyACM*crw-rw---- 1 root uucp 166, 0 Feb 6 19:37 /dev/ttyACM0In 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_nameThen logout completely and log back in.

author: alsetalokin4017
author_rank: Super Contributor
timestamp: February 06, 2018, 11:50:34 pm
content: On mine: Ubuntu-gnome 16.04.3 LTSArduino IDE installed from the Ubuntu Software Center, IDE version 2:1.0.5+dfsg2-4UNO plugged in to a USB port, then start IDE, in Tools select Board = UNO, Programmer = AVRISP mkII and in Serial Port select /dev/tty/ACM0works for menote that the UNO must be plugged in for the ACM0 selection to show up

author: alpher
author_rank: Frequent Contributor
timestamp: February 07, 2018, 01:21:55 am
content: Quote from: alsetalokin4017 on February 06, 2018, 11:50:34 pmYo'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 pushI'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.

author: JustMeHere
author_rank: Frequent Contributor
timestamp: February 07, 2018, 01:49:09 am
content: 4GB is entry level on RAM.Check 'top' and see if you are using any of the swap file.

author: paulca
author_rank: Super Contributor
timestamp: February 07, 2018, 08:01:30 am
content: Quote from: alsetalokin4017 on February 06, 2018, 11:50:34 pmThis 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.

author: alsetalokin4017
author_rank: Super Contributor
timestamp: February 07, 2018, 05:57:40 pm
content: 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.

author: metrologist
author_rank: Super Contributor
timestamp: February 07, 2018, 06:34:43 pm
content: Totally wished I'd kept my Chevy. It'd be 36 years old now.

author: paulca
author_rank: Super Contributor
timestamp: February 07, 2018, 09:29:42 pm
content: Quote from: alsetalokin4017 on February 07, 2018, 05:57:40 pmIt'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/LinuxIf 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

author: plew_ar
author_rank: Newbie
timestamp: February 12, 2018, 04:45:57 pm
content: 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.

author: paulca
author_rank: Super Contributor
timestamp: February 12, 2018, 07:13:25 pm
content: Quote from: plew_ar on February 12, 2018, 04:45:57 pmIt'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.

author: paulca
author_rank: Super Contributor
timestamp: February 12, 2018, 07:18:41 pm
content: 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.

author: not1xor1
author_rank: Frequent Contributor
timestamp: February 13, 2018, 06:46:44 am
content: Quote from: paulca on February 12, 2018, 07:13:25 pmhttps://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.

author: not1xor1
author_rank: Frequent Contributor
timestamp: February 13, 2018, 07:12:25 am
content: Quote from: alpher on February 07, 2018, 01:21:55 amI 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=10Check 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.

author: paulca
author_rank: Super Contributor
timestamp: February 13, 2018, 08:00:32 am
content: Quote from: not1xor1 on February 13, 2018, 06:46:44 amApologies, 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.

author: djnz
author_rank: Regular Contributor
timestamp: February 13, 2018, 12:00:27 pm
content: 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.

author: not1xor1
author_rank: Frequent Contributor
timestamp: February 13, 2018, 12:51:00 pm
content: Quote from: paulca on February 13, 2018, 08:00:32 amCome on... I do not think you really have anything to apologize forI usually make much worst mistakes and more often than I'd like...

author: paulca
author_rank: Super Contributor
timestamp: February 13, 2018, 01:07:18 pm
content: Quote from: not1xor1 on February 13, 2018, 12:51:00 pmI have such strong opinions and am a know-it-all sometimes it is only fair to balance things by admitting when I'm wrong

author: alpher
author_rank: Frequent Contributor
timestamp: February 13, 2018, 02:32:53 pm
content: Quote from: djnz on February 13, 2018, 12:00:27 pmi5 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.

author: djnz
author_rank: Regular Contributor
timestamp: February 13, 2018, 04:06:52 pm
content: 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.