13 Replies Latest reply on Mar 20, 2013 4:28 PM by gdstew

    how to download arduino on raspberry pi

    chiversj

      I followed the instructions from the book, titled Installing Arduino in Raspian. BIG FAIL. The word electronics did not show up. I have the latest download of Wheezy. Would appreciate some help on this. Thanks Jimmy

        • Re: how to download arduino on raspberry pi
          mconners

          I am not familiar with the book, but I did install the Arduino IDE on the pi and was able to communicate with the board. I assume the word "Electronics" you refer to is what you are expecting in a menu.

           

          Check to see if there is an arduino folder under /usr/share. It may be a link to arduino or could be arduino-1.0 or 1.1 whatever version you installed.

           

          Also you may have to reboot or log off/log back in to get it to show up in any of the menus.

           

          You can also type

           

          dpkg -l arduino

           

          to see if the package manager thinks it is installed.

           

          Good luck,

           

          Mike

          • Re: how to download arduino on raspberry pi
            chiversj

            I checked user/share and there is NO Arduino folder. Also did dpkg -l arduino and that too was fail. So it looks like I need to download the file in order for it to work. Thank you for your help. JCC

            • Re: how to download arduino on raspberry pi
              chiversj

              Mike that is where I started and I was looking for electronics in the menu and I never found it. I found a linux file for Arduino IDE on the Arduino home page/site and I am going to try and download it to the Rpi. Thanks JCC

              • Re: how to download arduino on raspberry pi
                chiversj

                Mike I hit a snag. Can you tell me how to download Arduino IDE to Pi. I have all the files on my PC but do not know which goes where. Thanks JCC

                • Re: how to download arduino on raspberry pi
                  mconners

                  You don't want to dl the stuff from the arduino site. That is going to be compiled for X86, not Arm, so it won't work on your machine.

                   

                  You may also need to dl arduino-core

                   

                  sudo apt-get install arduino-core

                   

                  I'm not near my pi at the moment, but I can look later and see if I can walk you through it.

                   

                   

                  Mike

                  • Re: how to download arduino on raspberry pi
                    gdstew

                    Here's what I did to get the Arduino IDE on the Raspberry Pi:

                     

                    sudo apt-get update

                    sudo apt get install arduino

                     

                    The update command will make sure that you get the latest versions of all the files. If you do not do this it may not find

                    some of the files and it will not install. I've had this happen to me twice now.

                     

                    The install command will automatically download and install all the files needed  (including arduino-core) for the Arduino IDE.

                     

                    After you have have done this you should see the Electronics folder in your Applications menu. The Arduino IDE should be in

                    that folder.

                     

                    Good luck.

                      • Re: how to download arduino on raspberry pi
                        chiversj

                        Mr Stewart Idid exactly that more than once and it did NOT work. Do not know why but the electronics folder does not come up. Thank you. Jimmy

                          • Re: how to download arduino on raspberry pi
                            gdstew

                            OK, let's try this, I know it looks like a lot but you will only need to do 1 or 2 (not both), and

                              3 only if 1 or 2 fails:

                             

                            1) If you know how to use the vi editor:

                             

                              a. Make a backup copy first:

                             

                                sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak

                             

                              b. Edit the file:

                             

                                sudo vi /etc/apt/sources.list

                             

                              c. Add this line:

                             

                                deb http://mirrordirector.raspbian.org/raspbian wheezy main contrib non-free rpi

                             

                              d. Try the apt-get update and install again.

                             

                            2) If you do not know how to use vi use a graphical interface editor by:

                             

                              a. Make a backup copy as shown in 1a

                             

                              b. Assuming you are in the pi home directory (/home/pi) so you know where the file is,

                                  copy the sources.list file:

                             

                                sudo cp /etc/apt/sources.list .

                             

                              c. Change the ownership so you can modify it:

                             

                                sudo chown pi:pi sources.list

                             

                              d. Use any text editor you like to add the same line as in 1c

                             

                              e. Put the modified file back where it belongs:

                             

                                sudo chown root:root sources.list

                             

                                sudo mv sources.list /etc/apt

                             

                               Note:  using chown again is probably not needed if sudo is used to move it back, but

                                         just in case I added the command anyway.

                             

                              f. Try the atp-get update and install again.

                             

                            3) If 1 or 2 fails

                             

                            Do another apt-get install and send the error output and standard output from that command to

                            the file arduino.txt using this command:

                             

                            sudo apt-get install arduino 2>&1 arduino.txt

                             

                            None of the normal text output from the command will be sent to the screen so just wait until the

                            command line prompt is displayed before going to the next command.

                             

                            Change the ownership of arduino.txt to make sure you can read and write it:

                             

                            sudo chown pi:pi arduino.txt

                             

                            Attach the arduino.txt file to an email and send it to the email address in my profile.

                             

                            If there is an error message in the file I should be able to find it and help fix it.

                            • Re: how to download arduino on raspberry pi
                              mconners

                              Just for fun I started with a fresh install.

                               

                              I did

                               

                              sudo apt-get update

                               

                              sudo apt-get upgrade

                               

                              sudo reboot

                               

                              sudo apt-get install arduino

                               

                              everything worked fine.

                               

                              Now it did install java, the avr tools, etc...

                               

                              the only think I can think of is that the installation did not complete somehow. Do what Gary said and capture your output. Are you sure you have plenty of diskspace? I did this on a 16gb card, a 2 or a 4 may be too small.

                               

                              It definitely installed it in /usr/share/arduino and it created the Electronics folder in the menu and put Arduin IDE

                              in there.

                               

                              We can solve this for you, I'm sure it is something silly.

                               

                              Mike

                                • Re: how to download arduino on raspberry pi
                                  gdstew

                                  Hi Mike and Jimmy,

                                   

                                  I have installed the Arduino IDE five or six times on the Pi (I have two Pi's, one 256MB and one 512MB, and have upgraded Raspbian and

                                  the SD card disks a couple of times on each) and the only thing I've had problems with recently is forgetting to update before the install.

                                  However Jimmy, Mike's disk size question is a good one. The Arduino IDE install requires a quite a bit of disk space mainly because of

                                  Java and the way apt-get caches packages it is installing and I'm pretty sure that it was a problem on one of my earliest install attempts

                                  with a 2GB SD card. This was one of the main reasons for my first SD card upgrades. I definitely recommend a 4GB SD card minimum if

                                  you plan to add any software at all to  the Pi.

                                   

                                  If you have a 4 GB or larger SD card or just prefer to skip my first two suggestions and go directly to the ouput capture go ahead. Like Mike

                                  said I'm sure we can help you get this working.

                                    • Re: how to download arduino on raspberry pi
                                      mconners

                                      I didn't remember having any issues when I had installed it before either. As a matter of fact tonight I did it on 2 seperate pi's and had no issues with the instructions I gave. One I did over VNC and one through ssh on the console. I've gotta believe something went wrong in the install, either ran out of disk space, or something couldnt get resolved. But the packages seemed pretty tight tonight.

                                       

                                      We'll get him going.

                                       

                                      Mike

                              • Re: how to download arduino on raspberry pi
                                chiversj

                                Gary you are on the right track when you said to add the line about the mirrordirector. Unfortunately I could not follow the instructions. I had no idea I was that illiterate but I am. At this point anyway, but I did find aptitude package management in the GUI and I drilled down and found there are four errors that prevent electronics from loading. Mirrordirector was two of them. I also found the electronics package is indeed in the pi.If you could tell me again how to use vi. or GUI I may can get it to work. Thanks Jimmy

                                • Re: how to download arduino on raspberry pi
                                  gdstew

                                  OK Jimmy, here is a more detailed version on how to use vi to add the site to sources.list

                                   

                                  1)  Start up the vi editor (make sure you have made a backup copy first as I described previously):

                                   

                                    sudo vi /etc/apt/sources.list

                                   

                                  2) Type i to put vi in the insert mode

                                   

                                  3) Type in the line I gave you from the previous post. If you make a typing mistake the Backspace key can

                                        be used to delete the previous characture(s).

                                   

                                  4) After you have completed entering in the line make sure you press the Enter/Return key to seperate the line

                                       you just entered from the line that was already in the file.

                                   

                                  5) Exit the insert mode by pressing the Esc key

                                   

                                  6) To write the file back to disk and exit the vi editor type in :wq (the : tells vi that you are about to enter a

                                        command, wq tells it to write the file and quit.

                                   

                                  If you run into trouble with vi and can't figure out how to fix it press the Esc key once or twice then press :q!

                                   

                                  This will exit the vi editor without writing the file to disk so you can start over. In the worst case you can always

                                  replace the file you have modified with the backup by typing:

                                   

                                  sudo cp /etc/apt/sources.list.bak /etc/apt/sources.list