Articles Hierarchy

Articles Home » Arduino Projects » RPI + Arduino IDE & the JESSIE challenge

RPI + Arduino IDE & the JESSIE challenge

when you use RPI ( with debian wheezy ) you can install a arduino IDE 1.0.1 ?
what is rather old to actual 1.6.4 and does not support DUE .. board types.

so i was looking for any update on that.

RPI forum
nicohood


new setup:
2015-05-05-raspbian-wheezy.zip (in download page say 990MB) by torrent download at 1.3MB/s in 12 min.
show 1.038.523kB unpack 2015-05-05-raspbian-wheezy.img 3.276.800kB
i use a 8GB Sundisk ULTRA microSD I (class 10), format with "SDFormatter V4.0"
and use "Win32 Disk Imager" to write to SD at about 13MB/s in 4 min.
( delete the img file ( keep the zip ) )
put SD in RPI, powerup and check router DHCP clients RPI IP.
use "putty" / "bitvise SSH client" / for headless operation
sudo raspi-config / expand file system / rename HOSTNAME / reboot
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install xrdp // for headless operation WIN PC
sudo reboot

ready in about 30min.


back to above Raspbery Pi Forum thread,
i try to fly over it to find the WAY to load a newer Arduino IDE,
but it looks confusing, there seems to be
the LONG WAY by ShorTie
using jessie instead of wheezy, and finally he states ... and got 1.6.4 to work.
but i not see exactly how. ( slowly i understand, besides his later comments he updates the first post
to the latest version and info / pls read that carefully )
and a follower of that info NicoHood who try to provide a compiled version and more info, see also
https://github.com/NicoHood/Arduino-IDE-for-Raspberry/releases
https://github.com/NicoHood/Arduino-IDE-for-Raspberry
http://dumb-looks-free.blogspot.fr/2015/01/compile-arduino-ide-16-on-beaglebone.html

sometimes the tone in that thread is bad, as i see it many times in that forum,
especially towards beginners and non native english speaking/writing users, so i stopped posting there.
It is that we beginners have to bow to that specialists, however cryptic and arrogant their posts might be.


ok, i try: ( and just for info: i use/have only a old RPI B )


-a- JESSIE

cd /etc/apt/
sudo cp sources.list sources.list.wheezy
sudo nano sources.list

exchange in first line "wheezy" to "jessie" ctrl O ctrl X
sudo apt-get update
sudo apt-get dist-upgrade -y
takes 3.5h
While the system is upgraded it will ask you to change a few configs. Always say 'N', except to
ssh cron say OK
bashrc NO ?why?
sysctl NO ?why?
logindefs NO ?why?
i see a warning unable to delete old dir, /etc/python2.7/ dir not empty
ssh ntp say OK .....
lightdm.conf say 'Y'.


sudo nano /etc/lightdm/lightdm.conf change #autologin-user= autologin-user=pi
sudo reboot
i can start putty, but at
login as: pi it hangs until timeout error.

on HDMI monitor see
[failed] failed to start login service
[failed] failed to start LSB
[failed] failed to start Avahi
[failed] failed to start Modem manager
and after that hangs there.
( later i see exactly that problem in the forum )
4 hours for nothing


what can i do? unzip image (2min) and burn wheezy (4min), update, upgrade, xrdp again

now i have to dig what jessie distro upgrade mistakes might have been there
( from nicohood section How to recompile )
now i follow gdt
change wheezy to jessie in
sudo nano /etc/apt/sources.list
sudo nano /etc/apt/sources.list.d/raspi.list
do
sudo apt-get update
sudo apt-get dist-upgrade (
( this blog not say anything about the questions/answers
so i list them here again and answer like nicohood again all but one "N" as i have no other info,
pls we all understand that i not know what i am doing here!
also both not tell you that you have to expect a 3.5h job?
so i add a time log what should help you
and not need to sit 3.5hours in front of the stupid terminal.
in above first try it was in a 37degC room / my private hell / but can not change or stop, only hope my desktop computer not stops from overheating /
the RPI was cool / downstairs / powerline - ethernet - headless)
second try: start 0:00
0:33 download finished, start extracting
0:35 question: openshh=server NO
0:36 question: libc6 armhf NO
0:36 question: ssh cron OK
1:02 question: .bashrc NO ( keep installed version ?)
1:07 question: sysctl.conf NO ( keep installed version ?)
1:36 question: login.defs NO ( keep installed version ?)
1:41 question: libssl1.0.0:armhf: ssh ntp OK
3:01 start setting up
3:18 question: rc.xml NO ( keep installed version ?)
3:18 question: pcmanfm.conf NO ( keep installed version ?)\
3:25 question: dphys-swapfile NO ( keep installed version ?)
3:30 question: lightdm-gtk-greeter.conf NO ( keep installed version ?)
3:30 question: lightdm.conf YES
3:32 finished
)
anyhow do the
sudo nano /etc/lightdm/lightdm.conf from nicohood
autologin-user=pi
and follow gdt
sudo apt-get autoremove YES 112MB
DO NOT REBOOT HERE

cd /etc/udev/rules.d
but not find the 2 files he talk about to rename, i see only files:
40-scratch.rules and 99-com.rules, so i don't know what to do.

sudo apt-get purge ifplugd YES
sudo apt-get purge cgmanager cgroup-bin cgroup-tools libcgroup1 YES
sudo apt-get purge systemd-stub
create the directory /var/log/journal/
cd /var/log/
sudo mkdir journal
i not consider booting in single user mode
sudo reboot
good, putty login OK, HDMI boot OK

sudo apt-get clean


74 J 69 E 83 S 83 S 73 I 69 E



and first i want play little bit with the new system
sudo apt-get install mc ( i can not work without that, use from desktop and putty )
the USB stick now is not accessible via /media/KINGSTON/ but /media/pi/KINGSTON/ works

Remote Desktop login works OK ( i installed under wheezy )

menu/internet/web or webbrowser first start not work,
but terminal ping google.com OK
later test browser ( epiphany ) again ( via link ) and now works ??

IDLE 2.7.9 shell OK
IDLE 3.4.2 shell OK
pygame OK
filemanager and terminal OK
time and date settings / from wheezy raspi-config / OK

SONIC PI shows 2 init pages but i not see the operation window
SCRATCH not start
ok, i purge sonicPI and scratch (112MB)

AND make backup of the SD card, with "Win32 Disk Imager" at 15MB/s in 9min and zip/move 7.0GB to 3.7GB in 15min.

also install synaptic ( very slow but good to see all what is installed / or could be installed )

but do not get confused, doing a
cat /proc/version give you the exact same linux OS info on both systems,
but a lsb_release -sr show you the DEBIAN version / WHEEZY 7.8 / JESSIE 8.0 /

so i need to read what is it about the 2 DEBIANs anyhow, but, for the first look, over all:
JESSIE is surprisingly usable!


-b- make arduino IDE
following forum by ShorTie

usual update:
sudo apt-get update
sudo apt-get upgrade
sudo apt-get autoremove ( 50MB more libs... deleted )
sudo apt-get dist-upgrade
sudo reboot

install JAVA, AVR tools and compiler:
sudo apt-get install debhelper javahelper default-jdk default-jre libastylej-jni libjssc-java libjna-java libjsch-java libjmdns-java libcommons-logging-java libcommons-httpclient-java libcommons-exec-java ant astyle extra-xdg-menus avr-libc avrdude gcc-avr bossa-cli gcc-arm-none-eabi

742MB more, need 1h
my cat closed the terminal window so i don't know what happened
run taskmanager (++view menu ) and wait until cpu usage down and root jobs (apt-get...) finished \
the logfile is /var/log/dpkg.log
anyhow just try again for recheck 5secs OK

get the source:
cd /usr/local/src
sudo wget https://github.com/arduino/Arduino/archive/1.6.4.zip (91MB, 3min)
sudo unzip -q 1.6.4.zip
cd Arduino-1.6.4
sudo wget https://www.dropbox.com/s/xpalmwf4psb3qab/Arduino_1.6.4.debian.tar.gz what is that and who make it??
sudo tar -zxf Arduino_1.6.4.debian.tar.gz

compile the package:
sudo dpkg-buildpackage -uc -b -tc (45min )
cd ..
sudo apt-get remove -y arduino arduino-core ( error because no prior arduino installed, needed?)

install the package:
sudo dpkg -i arduino-core_1.6.4_all.deb arduino_1.6.4_all.deb (18min)

and under START / programming or electronics / find Arduino IDE

THANKS ShorTie
again would be nice ( like nicohood tried ) to distribute that compiled version
and save us some hours.






when i work arduino code from 2 win PC i use google drive ( installed on both PC )
( so the code is on both PC and synced via the web cloud )
now that i don't know how to do from RPI,
so i copy my old arduino projects ( from google drive ) to the USB stick at the RPI.
for more easy cross update i should install samba for the RPI USB stick.
but the "bitvise SSH client" SFTP tool is ok too.
after adjust arduino IDE / file / preferences / "/media/pi/KINGSTON/...." i have all my projects available.


but arduino IDE / tools / port / is grey? even on the first test it worked already ( incl terminal )
/ try reboot but not help /
now the MICRO ( leonardo family ) is tricky for USB, OR
powerproblems? so first i try using a powered USB HUB for the arduino.
even i check now with
lsusb and see a "Arduino SA" as Bus 1 Device 6, IDE port still grey
sudo /etc/init.d/udev restart [ok] but IDE port still grey
must test with old system OR with different Arduinos.

sudo apt-get install screenbut first install GNU screen ( terminal emulator ) to check line without Arduino IDE.
open terminal
screen /dev/ttyACM0 and i see the strings my arduino sends,
but as i don't know how to close i just close window and a second start not work??
ok better use [CTRL][a][k] ( in docu called 'C-a k' ) and answer [y]


a recheck with a updated wheezy and arduino IDE 1.0.1 shows that terminal works at same hardware situation, only other SD card.

back with IDE 164 start without any arduino connected i see port and /dev/ttyAMA0
when i connect a Ardunio UNO and wait i see /dev/ttyACM0 (Arduino UNO )
and its selectable and terminal works. So possibly its just difficult with Arduino Leonardo / Micro Pro...

to verify:
i reboot RPI ( model B,JESSIE, Arduino IDE 164 ), start IDE, connect UNO, compile download ( my alarmtimer sketch ), close IDE,
reboot, start IDE and port is grey again
if i start terminal get error: board at /dev/ttyACM0 is not available
Now that says that it is not a question of Arduino model... more about the RPI boot (and a arduino sending to ttyACM0 ?)
for the remote application i think about, that is a KILLER.
change SD card ( model B,WHEEZY, Arduino IDE 101 ) , boot with connected Arduino UNO,

terminal works.


later in the forum a lucky hevangel states in a summary
that he do add a
3. sudo ln -s /dev/ttyUSB0 /dev/ttyACM0
4. sudo usermod -a -G dialout pi
5. sudo usermod -a -G tty pi
6. *** disconnect the Arduino before starting the Arduino IDE ***


now, i did not use (3) (4) (5)
and as he states (6) that could be a confirmation that he has also the reboot problem,
and that even after he used above 3 add commands?
still i want to mention them here.
pls see also ( when there was a arduino installed already ):
cat /usr/bin/arduino calls
cat /usr/bin/arduino-add-groups



-c- why not test JESSIE with IDE101
overwrite SD with above JESSIE backup01 and again
usual update:
sudo apt-get update
sudo apt-get upgrade
sudo apt-get autoremove
sudo apt-get dist-upgrade
sudo reboot
sudo apt-get install arduino
when i start Arduino IDE it is called: Ardunio 2:1.0.5+dfsg2-4
Serial Port is grey. ( even no Arduino was connected )
( what can i say: more tests more questions! )
anyhow reboot, connect arduino UNO ( no powersupply), start IDE, port ok, can select /dev/ttyACM0
Monitor ok. close IDE,
reboot with connected arduino, start IDE, port OK, monitor OK
NOW WE KNOW:
ITS NOT A JESSIE PROBLEM
IDE 2:1.05 OK
IDE 1.6.4 (ShorTie version) NOT OK when arduino connected at REBOOT

( but even i ask in forum, that was not confirmed by anybody )


-d- IDE 1.6.5
now i see CRImier say he has a different way, using 1.6.5, not use patches but build file / works for RPI 2 and JESSIE / and just to follow official Building Arduino only use his git clone https://github.com/CRImier/Arduino.git
actually i not understand what i would be supposed to do.
new post
but CRImier ( 16.6.2015) supplied a link to his files at dropbox
and i have the above good situation ( SD with fresh JESSIE and IDE 2:1.05 ) to test.
but now as he use
ls /usr/share/arduino/
i think i first have to pruge the existing arduino
sudo apt-get purge arduino ( 1.7MB )
sudo apt-get autoremove ( 107MB )
ok that dir is gone.copy the file from dropbox by WIN PC (250MB), SFTP to /home/pi/ at RPI
sudo tar xvf -C / arduino-1.6.5-armv6.tar.bz2 does not work,
tar: -C: Cannot open: No such file or directory

ok i try
cd /
sudo tar xvf /home/pi/arduino-1.6.5-armv6.tar.bz2 OK
ls /usr/share/arduino

so, now what needs to be installed? i expect need same as with ShorTie version.
last time it took an hour.
but that is supposed to be same?
CRImier: For this to work, you have to have following packages:
1) openjdk-7-jre (I guess version 7 work as well, honestly, I have no idea. If it doesn't complain about the executable 'java' missing, then it should be okay.)
2) gcc-avr, avrdude and libusb-dev
3) libastylej-jni

ok just do same again:
sudo apt-get install debhelper javahelper default-jdk default-jre libastylej-jni libjssc-java libjna-java libjsch-java libjmdns-java libcommons-logging-java libcommons-httpclient-java libcommons-exec-java ant astyle extra-xdg-menus avr-libc avrdude gcc-avr bossa-cli gcc-arm-none-eabi 740MB 1h
oh, the libusb-dev is missing: try
sudo apt-get install libusb-dev ok
now execute it
/usr/share/arduino/arduino
error jawa.awt.HeadlessException ( because i try in PUTTY )
try again in desktop terminal: OK
well i expected a compile job, or minimum a installation job... but actually it is just a arduino start via terminal ( as not installed / not in menu ) a kind of basic way to distribute, but right, it runs on RPI B too.
in his post i only saw Okay, I've packaged my version. It's here.
now i can connect arduino UNO... monitor OK
and reboot test: OK

pls see the IDE 1.6.5
i also install the 1.6.5 version on the PC, some real good things happed, see ReleaseNotes
but mainly: the RECENT ( open files ) works now. ( a feature what was/is in processing, but erased when they made the first arduino IDE for unknown reasons)
sadly it not runs on the win7 64bit laptop what should we do? i not see an answer there??


now even that 1.6.5 copy is a good version i delete it ( still keep the original ZIP )
cd /usr/share/
sudo rm -R arduino
and now i try to compile it / the above TOO MUCH installs should fit /
cd /usr/local/src/ its empty ( because i used a "new" JESSIE
get the GIT from CrImier
sudo git clone https://github.com/CRImier/Arduino.git about 1.36GiB at 1MiB/s (23min)
checking delta,out files...5min more
cd /usr/local/src/Arduino/build/
sudo ant 13min
sudo ant run after 4 min BUILD FAILED,
i try again from (remote) desktop instead via putty
and it worked / i see the arduino IDE 1.6.5 window, but where is the program? path? i not find it
try again with "mc" command / file find / "arduino"
from terminal ( desktop)
/usr/local/src/Arduino/build/linux/work/arduino
( there is even a install.sh, but i not know how to use.)
but when i use terminal i have the
nano /home/pi/.bash_aliases
and i put in one more line
alias arduino='/usr/local/src/Arduino/build/linux/work/arduino' [ctrl][o][ctrl][x]
and at next start from terminal on desktop type:
arduino arduino IDE 1.6.5 start
connect a arduino UNO, select my project ( its still there on USB stick )
try verify ( and upload / even after restart IDE) and get a error
/usr/local/src/Arduino/build/linux/work/hardware/tools/avr/bin/avr-g++ syntax error "(" unexpected,
return 2
error compiling

to recheck i install normal arduino IDE 1.0.5, upload OK,
test again new compiled 1.6.5 ERROR



i want play little bit with the versions.
so first i
sudo nano /usr/share/applications/arduino.desktop
change NAME to Arduino IDE 1.0.5
change Exec=arduino to Exec=arduino105
and see that in desktop menu
when i also rename the
sudo mv /usr/share/applications/arduino.desktop /usr/share/applications/arduino105.desktop
it can not be overwritten by a new installation.

add i want free that path, change the directory name, so i can try other version.
cd /usr/share/
sudo mv arduino arduino105
change the call
cd /usr/bin/
sudo mv arduino arduino105
sudo nano arduino105
change java -jar /user/share/arduino/arduinopc.jar to java -jar /user/share/arduino105/arduinopc.jar
change APPDIR=/usr/share/arduino to APPDIR=/usr/share/arduino105
now it starts from desktop menu,
sketchpath, compile, upload, monitor OK
but the entry picture is missing ( just long wait )

here i now do the ShorTie install 1.6.4. again ( see above )
while remove arduino arduino core, librxtx-java ( used by 1.0.5) might be removed / old USB-serial software

here i do also the rename of file and directories and links to 164

now i can copy/unzip again the 1.6.5 ( COPY version / zip style still have from dropbox)
cd /
sudo tar xvf /home/pi/arduino-1.6.5-armv6.tar.bz2


here i do also the rename / edit of desktop file to 165

all 3 versions 1.0.5, 1.6.4, 1.6.5 copy run, but the 1.6.5 compile still has the avr-g++ syntax error
but possibly there is a update by CRImier, following Arduino build i try:
cd /usr/local/src/Arduino-1.6.5/
sudo git pull say already up to date
sudo git update error, not a git command.
cd build
sudo ant
sudo ant run that downloads a new gcc, avrdude ...
IDE 1.6.5 start ok, verify same error.

after new info i try again to compile CRImier version
cd /usr/local/src/Arduino-1.6.5/
sudo git pull
sudo git reset --hard 6f1bfe1
cd /usr/local/src/Arduino-1.6.5/build/
sudo ant 5min
that must do from desktop terminal window
sudo ant run 18min IDE 1.6.5 start OK
still have that same error when i compile a sketch, some talking here imply that instead of raspbian JESSIE there is a wrong avr-g++ for PC installed see hardware/tools/avr/bin/ and must do a
To have the “Compile” and “Upload” functions working, you need to replace all the files in ‘build/linux/work/hardware/tools/avr/bin‘ by their symlinks in /usr/bin. You’ll also want the ‘build/linux/work/hardware/tools/avr/etc/avrdude.conf‘ to point to ‘/etc/avrdude.conf‘. Here’s an one-liner that you have to execute in the bin directory to make symlinks:

for i in *; do echo $i; rm $i; ln -s /usr/bin/$i $i; done

hmm, but i found a empty
ls /usr/local/src/Arduino-1.6.5/hardware/tools/ thats it.
update: 5.7.2015 run same BUILD again with RPI2B, JESSIE SD, build OK, verify/compile sketch: same error,
so its not a problem about the cpu...


87 W 72 H 69 E 69 E 90 Z 89 Y


more news from CRImier, now his version should run on WHEEZY also ( from dropbox i get arduino-1.6.5-arm_wheezy.tar.xz 38MB),

as i have there a Arduino 1.0.1 already running i want to do the rename thing here too.
cd /usr/share/applications/
sudo cp arduino.desktop arduino101.desktop
sudo nano /usr/share/applications/arduino101.desktop
Name=Arduino IDE 1.0.1
Exec=arduino101
cd /usr/share/
sudo mv arduino arduino101

cd /usr/bin/
sudo cp arduino arduino101
sudo nano arduino101
change 2 times "/usr/share/arduino" to "/usr/share/arduino101"
( ok start from desktop menu )
pls note, this time i copy the file from dropbox to my RPI usb drive first,
but you can just get it with
cd /usr/share/
sudo wget https://www.dropbox.com/s/m4pp9stjhsrc0nf/arduino-1.6.5-arm_wheezy.tar.xz

cd / WRONG, this time he pack different
cd /usr/share/
sudo tar xvf arduino-1.6.5-arm_wheezy.tar.xz now path correct.
from RPI desktop ( win7 PC RDP ) open terminal,
cd /usr/share/arduino-1.6.5
./arduino
and it starts !UNDER WHEEZY! after a bunch of GtkSettings warnings.
for desktop change :
cd /usr/bin/
sudo nano arduino ( the old original now used for 1.6.5 )
change 2 times "/usr/share/arduino" to "/usr/share/arduino-1.6.5"
now both start from desktop, without the intro picture, just a long wait.

now test:
adjust preferences ( sketchbook on RPI USB stick )
connect arduino to RPI,
adjust board ( arduino micro )
adjust port (/dev/ttyACM0 )
compile, upload, monitor OK



update 01/2016
i just installed on a new SD card with JESSIE the actual arduino IDE( 1.8.1 nightly ) following this, just from the Desktop... ( one error msg:
sudo ./install.sh
Adding desktop shortcut, menu item and file associations for Arduino IDE...touch: cannot touch ‘/root/.local/share/applications/mimeapps.list’: No such file or directory
/usr/bin/xdg-mime: 781: /usr/bin/xdg-mime: cannot create /root/.local/share/applications/mimeapps.list.new: Directory nonexistent
done! )






for getting/updating to the very newest pls use the nightly build.
a big advantage is that you not have to think about version numbers, name and location is always same:
pls prepare a install script ( like in /home/pi/Downloads/ )
nano arduinoinst.sh#!/bin/sh
# arduino update
cd /home/pi/Downloads
rm -v arduino-nightly-linuxarm.tar.xz
sudo rm -r arduino-nightly
wget https://downloads.arduino.cc/arduino-nightly-linuxarm.tar.xz
tar xvJf arduino-nightly-linuxarm.tar.xz
cd arduino-nightly
echo 'setup arduino IDE'
./install.sh
# show version ( 1.8.2 == 1.8.1 ++ nightly )
sed -n '1p' revisions.txt
echo 'now pls try in desktop'