NerdKits - electronics education for a digital generation

You are not logged in. [log in]

NEW: Learning electronics? Ask your questions on the new Electronics Questions & Answers site hosted by CircuitLab.

Everything Else » Ok I have Ubuntu 12.04 now what do I do??

July 18, 2012
by Ralphxyz
Ralphxyz's Avatar

I have a dual boot Ubuntu with Windows 7.

The Nerdkits download for Ubuntu says it should not be needed.

What does that mean? Is everything preinstalled?

How do I find what USB device I am using?

I know ls /dev shows all of the devices(?) but there are lots of tty devices including

ttyUSB0
ttyUSB1

and a blue usb catagory(?) with the following under it.

usbmon0
usbmon1
usbmon2

I see lots of TTY and USB folders in /dev but how do I know what to put in my makefile?

And speaking of Make how do I get to my folder with my projects, from the command line (Terminal)?

My drive is called DDDDD nerdkits/code/projects.

The DDDDD drive is mounted I can see all of the folders and files.

I get this from the original initialload project:

AVRDUDEFLAGS=-c avr109 -p m328p -b 115200 -P /dev/ttyUSB0

This makes sense if I knew I was using ttyUSB0.

I suppose I could copy my files over to a new Nerdkits/code folder on the root drive that would work.

Thanks for the help,

Ralph

July 18, 2012
by missle3944
missle3944's Avatar

Ralph,

Ubuntu has the prolific serial to usb driver installed by default .YAY!

Go to the software center and get avrdude and the other things the guide tells you to get. Its a lot more straight forward than windows I think.

I have dual booted on 2 computers successfully and have programmed my nerdkit with ubuntu on both computers so this should work. Just use /dev/ttyUSB0 in the makefile.

To get to the folder with your projects just use change directory command "cd". The terminal in linux is like the windows terminal. Just treat it as your typing in windows terminal.

Lastly a word of warning. On my computer thats running ubuntu 12.04 it makes me type sudo make instead of just make. Its weird but just keep that in mind if it says you don't have the right permisions to access that usb.

I'm not sure if you can accses the other partition from ubuntu but just boot windows and put everything on a flash drive. I also highly recommend using UBUNTU one. Its a free cloud service that gives you 5 gigs for free.

Hope this helps

Dan

July 18, 2012
by Ralphxyz
Ralphxyz's Avatar

I made a Nerdkit/Code folder(s) in my HOME (root) folder:

So I tried running make:

ralphxyz@4CORE:~/Nerdkits/Code/PB0$ make
avrdude -c avr109 -p m328p -b 115200 -P  /dev/ttyUSB0 -U flash:w:button3.hex:a
make: avrdude: Command not found
make: *** [button3-upload] Error 127
ralphxyz@4CORE:~/Nerdkits/Code/PB0$ make
avrdude -c avr109 -p m328p -b 115200 -P  /dev/ttyUSB1 -U flash:w:button3.hex:a
make: avrdude: Command not found

I do not know what "Command" isn't found nor what ttydevice to use.

Ralph

July 18, 2012
by missle3944
missle3944's Avatar

Ralph,

You have to install avr dude from the software center. Just go to the ubuntu software center and search avrdude. It should show up and just click download.

-Dan

July 19, 2012
by Ralphxyz
Ralphxyz's Avatar

Thanks Dan, The "software Center" says avrdude is installed ;-(

Should I remove it and reinstall maybe?

How about finding my program files on my Windows disk, DDDDD?

Unix has a virtual file system (much before Windows came out with their "Shortcuts".

With the Unix method you would make copy of the file and place it in a different folder but it was a virtual file not actual copy until the original file was deleted then the virtual copy became the original.

With that I could make a virtual copy of my Windows folder and place it on my HOME drive and then any changes I made to it in Windows would be updated to my Ubuntu files on the next reboot.

Of course it has been 15 or so years since I used Unix or Linux so my memory might be off.

The simplest thing would be to just get to my DDDDD drive from the command line.

Ralph

July 19, 2012
by Ralphxyz
Ralphxyz's Avatar

Ah, I found my external Windows Drive!!

cd /media/DDDDD

Ralph

July 19, 2012
by killercow
killercow's Avatar

Hey Ralph,

I did a google install avrdude ubuntu. I've looked at this site also, recently.

I've been trying my hand at using the Nerdkits on Ubuntu 12.04 lately myself. I've also found a few serial ISP programmers to build.

HTH, Kevin

July 20, 2012
by Ralphxyz
Ralphxyz's Avatar

Hi killercow, so are you able to compile programs and load them?

How do you know which USB device to use?

Even if I unplug the Nerdkits cable from the computer /dev does not change, or at least I have not caught the change.

And then when I tried to run Make I got the "make: avrdude: Command not found".

I'll read up on Ubuntu and avrdude and probable re-install avrdude.

So far Ubuntu has been great except for the Firefox browser I've had to switch to Chrome, the horizontal scroll stop working in firefox.

Ralph

July 20, 2012
by Ralphxyz
Ralphxyz's Avatar

Ok I think I have re-installed avrdude but I still get errors this time I got:

ralphxyz@4CORE:/media/DDDDD/Nerdkits/code/initialload-328$ make
avrdude -c avr109 -p m168 -b 115200 -P /dev/ttyUSB0 -U     flash:w:initialload.hex:a
avrdude: ser_open(): can't open device "/dev/ttyUSB0": Permission  denied
Eavrdude: butterfly_recv(): programmer is not responding
make: *** [initialload-upload] Error 1

So I Googled "USB Permission denied" and found "lsusb"

ralphxyz@4CORE:/media/DDDDD/Nerdkits/code/initialload-328$ lsusb

Bus 002 Device 011: ID 067b:2303 Prolific Technology, Inc. PL2303 Serial Port

So I "guess" I need to use "Bus 002 Device 011" for my Prolific USB.

How do I do that?

Thanks,

Ralph

July 20, 2012
by missle3944
missle3944's Avatar

Ralph,

I got the same issue the first time on ubuntu. When it says permission denied that means that you have to type sudo make, instead of make. It should then prompt you for your password for ubuntu permissions and then avrdude should continue to load the program into your MCU.

July 20, 2012
by Ralphxyz
Ralphxyz's Avatar

Thanks Dan,that did it!!

Now how do I get permission to run make without having to enter my password everytime?

I suppose I could make up a script.

Turns out that Bus 002 Device 011 is /dev/ttyUSB1 who would have guessed?

Now I need to figure out what my programmers are called.

Ralph

July 20, 2012
by missle3944
missle3944's Avatar

No problem Ralph. I don't know how to fix that. I guess writing a script could work. It can be a pain but it only asks for your password if you havent been at your computer for more 10 min.

I've been able to program my nerdkit from multiple usbs and I've never had to change anything. Linux seems less of a fuss than windows.

-Dan

July 21, 2012
by Ralphxyz
Ralphxyz's Avatar

Linux seems less of a fuss than windows

Well I certainly have a fussy Linux (Ubuntu)!!

Right now my Prolific USB cable is not being detected!

I've had to dump Firefox and gedit because of no scroll bars.

It's been fun though, especially remembering things from 15 years ago.

At least I have not had a BSD (Blue Screen of Death) which I got every two days with Windows 7.

Ralph

July 21, 2012
by Rick_S
Rick_S's Avatar

I really don't know why the Windows 7 problems. It's been one of the most stable OS's I've run in a long time... Next to Windows XP. I could count on one hand the number of times I've had a serious crash. It's easy to setup just about any hardware, old or new, and for the most part just works. Every time I've attempted to learn Linux on hardware that wasn't designed with Linux in mind, I have major driver issues. Wireless can be a royal pain especially in some distro's. MP3 playback... something you don't even think about in Windows is treated like the plague in some Linux distro's (or at least it used to be). While Linux has a great position for certain tasks such as web servers, or dedicated devices, I just could not make a Linux PC my main machine.

Not trying to rain on anyone's parade, but I just don't get the logic in using an OS I would have to fight regularly to do what I wanted.

July 24, 2012
by Ralphxyz
Ralphxyz's Avatar

I've gone through adding various apparently non public "updates" with an enthusiast on the Windows support forum. We have managed to at least get a couple of days out of Windows before it crashes, violently now with lots of thrashings of the harddrives.

The thing I do not like about windows is when you "upgrade" to the newest version you have to buy new components.

Microsoft is almost as bad as Apple for abandoning legacy components,

Apple will abandon it's own computers. My four year old HP printer is not supported in Windows 7 and the substitute driver recommended by HP does not work. I know if I spent some time I could probable get it to work with limited capabilities, Ubuntu on the other hand recognized it imediately I didn't have to do anything. Same thing for my Cannon scanner.

Ubuntu recognizes all of my Prolific USB devices after a reboot, I don't know what that was about.

So far Ubuntu seems first rate, even gedit has stared behaving correctly showing scroll bars. Amazing what a couple of reboots will do.

Ralph

July 24, 2012
by Rick_S
Rick_S's Avatar

I had Ubuntu installed on a pc in my garage mainly for streaming music and to do the occasional internet browsing. For that it was fine. My biggest problems with Linux is somewhat the opposite problem you had with Windows. I have had terrible luck finding drivers for newer hardware. I also have little luck getting a distribution that just works out of the box for any laptop I've ever tried installing it on. I have a gateway netbook that the video crashes on any distro of linux I try, and I've tried several. I never run into these problems with Windows. I even have pretty good luck with older hardware. I had an HP Laserjet III that I hooked up to Win 7 and it worked out of the box with no driver download needed.

Anyway, I'm not trying to say either way is best, because the best way is always what works for the person using it. I glad you have something working better for you now. I will agree with you that as far as linux distro's go, the one I've caught myself trying the most was Ubuntu. They seem to really try to make it a first rate OS and for home use for the average Joe, I think they've done a pretty good job.

Rick

July 24, 2012
by JKITSON
JKITSON's Avatar

Rick & Ralph I have tried Vista & 7. Some nice things but a lot of not nice things. Went back to XP Pro on both computers and am happy. No problems with Nerdkits. Think this is were I will stay. I started with computers in the Air Force in 1960, all vacuum tubes then.

Just my 2 bits... Jim

July 25, 2012
by Rick_S
Rick_S's Avatar

Not to hijack the thread or anything, but did you ever get the I2C LCD working on your project Jim?

July 25, 2012
by JKITSON
JKITSON's Avatar

Not yet! Am working on adding a second sprocket & sensor so I can compute actual weight on the sled pan and also compute distace traveled and acutal speed plus max speed attained. Think I might have to upgrade to a (328?) for more program space.

Still plan to use the I2C LCD option. Have spent quite a bit of time reading all the posts on your application of it and think I finally have the concept in my mind now.

Thanks for all your ideas and help here on the NERDKITS site...

Jim

July 25, 2012
by Ralphxyz
Ralphxyz's Avatar

If I hadn't built a new x64 multi core computer I would have gladly stuck with XP.

For me the x64 and multi core is a waste I certainly have had more problems running Windows 7 and of course driver updates have been a pain.

XP Pro was working just fine in fact I could have stuck with Windows 3.

Except for occasionally compiling some program I really am not a power (demanding) user. In fact my usage (web browser and email) besides compiling would run on a Z80 or my old Commodore 64 or Atari.

Ralph

July 28, 2012
by killercow
killercow's Avatar

Ralph,

My 12.04 crashed on me once, all my typing was there (should've copied and pasted it to a file) then FireFox crashed on me just as I was finishing up my post. So, I'll done this again later on Sunday and post then.

Sorry, Kevin

July 29, 2012
by killercow
killercow's Avatar

Hey Ralph,

Take a look at this link.

I used this 'usbtinyisp permissions ubuntu 12.04' as the search string in google. I'll still do the instructions for this....thru the week.

HTH,

Kevin

July 30, 2012
by whitehatyoyoer
whitehatyoyoer's Avatar

Hey just to let you know, so you don't have to use sudo every time you run make, just execute this command once "sudo chmod 660 /dev/ttyUSB0"(without the quotes of course). It will give you the permission needed to read and write to the usb device without using sudo.

--Tyler

July 31, 2012
by Ralphxyz
Ralphxyz's Avatar

Thanks whitehatyoyoer, I knew there had to be a command after all this is unix/linux where everything is possible with the right command.

Ralph

August 02, 2012
by killercow
killercow's Avatar

This is what worked for me, this and the udev rule.

sudo chmod 666 /dev/ttyUSB0

Ciao, Kevin

August 15, 2012
by Ralphxyz
Ralphxyz's Avatar

I left Ubuntu for a while and went back to Windows 7.

Now once again I can not run make in ubuntu:

ralphxyz@4CORE:/media/DDDDD/nerdkits/code/tempsensor_328P$ sudo make
avrdude -c avr109 -p m328p -b 115200 -P /dev/ttyUSB0 -U flash:w:tempsensor.hex:a
avrdude: ser_open(): can't open device "/dev/ttyUSB0": No such file or directory
Eavrdude: butterfly_recv(): programmer is not responding
make: *** [tempsensor-upload] Error 1
ralphxyz@4CORE:/media/DDDDD/nerdkits/code/tempsensor_328P$ sudo make
avrdude -c avr109 -p m328p -b 115200 -P /dev/ttyUSB1 -U flash:w:tempsensor.hex:a
avrdude: ser_open(): can't open device "/dev/ttyUSB1": No such file or directory
Eavrdude: butterfly_recv(): programmer is not responding
make: *** [tempsensor-upload] Error 1

I am using sudo and I tried setting the permissions but neither connects.

Where do I look?

I do not ask where to look next as I haven't the slightest idea where to look for USB devices in Linux.

/dev is jam packed full of tty???? devies including ttyUSB0 and ttyUSB1 rather or not I have any Nerdkit USB cables plugged in they never disappear.

I have also looked in /dev/bus/usb and see 001/001 and 002/002 but they do not connect either.

Of course when I try to go back to Windows 7 now I do not have a USB keyboard or mouse so I cannot open windows 7.

I really would like to go back to my Mac mini except I can only use one monitor with that and I run three in Ubuntu and Windows.

Ralph

August 15, 2012
by Ralphxyz
Ralphxyz's Avatar

The Prolific USB device was not showing up with lsusb.

Also I did not see any reference to it with dmesg.

So I googled around and and came up with this:

sudo modprobe ftdi_sio

This apparently loads the some driver that is preinstalled in the kernal but does not load by default on startup (I probable can change a script somewhere to have it load on startup).

I have not tested it yet but the Prolific device appears in lsusb!!

Ralph

August 15, 2012
by Ralphxyz
Ralphxyz's Avatar

The "sudo modprobe ftdi_sio" did it I am now able to program the mcu geesch!!

Ralph

August 19, 2012
by killercow
killercow's Avatar

Great job!!!

Kevin

Post a Reply

Please log in to post a reply.

Did you know that an analog comparator can tell when one voltage input crosses another? Learn more...