chipKIT® Development Platform

Inspired by Arduino™

Trouble shooting Linux start up

Created Tue, 24 May 2011 21:48:43 +0000 by ricklon


ricklon

Tue, 24 May 2011 21:48:43 +0000

I've dug into this more. Here's what I found:

It's a requirement that you have Java, and librxtx-java installed. There is a bug in Sun Java version that doesn't include it in the path even if you have it installed. It's nicely documented here: [url]http://colinharrington.net/blog/2010/11/arduino-ubuntu-10-10-maverick-meerkat-no-rxtxserial[/url]

In any case here's what you'll need to do. If you know you don't have Java installed do:

sudo apt-get install openjdk-6-jdk

Check for librxtx-java via:

dpkg -l | grep rxtx

If not found do:

sudo apt-get install librxtx-java

If you have more than one version of Java then you'll need to check which version of Java you are running. You can do this by typing:

update-java-alternatives -l

This will list which version you have installed. Like:

java-6-openjdk 1061 /usr/lib/jvm/java-6-openjdk
java-6-sun 63 /usr/lib/jvm/java-6-sun

The easiest solution is to select java-6-openjkd

sudo update-java-alternatives -s java-6-openjdk

Once done you can double check by typing:

java -version

Then run mpide again.

If you have to use the Sun JDK here are the options from the article.

  1. don’t use sun-java but default-jre instead. This bug is actually a known bug in sun-java. (bug #325506)
  2. add export LD_LIBRARY_PATH=/usr/lib/jni to your .bashrc, the .deskop file (in /usr/share/desktop), or on the command line before starting arduino

funlw65

Wed, 25 May 2011 05:40:07 +0000

Unfortunately, still does not work.

user@pc:~$ dpkg -l | grep openjdk
ii  openjdk-6-dbg                         6b20-1.9.7-0ubuntu1                               Java runtime based on OpenJDK (debugging symbols)
ii  openjdk-6-jdk                         6b20-1.9.7-0ubuntu1                               OpenJDK Development Kit (JDK)
ii  openjdk-6-jre                         6b20-1.9.7-0ubuntu1                               OpenJDK Java runtime, using Hotspot JIT
ii  openjdk-6-jre-headless                6b20-1.9.7-0ubuntu1                               OpenJDK Java runtime, using Hotspot JIT (headless)
ii  openjdk-6-jre-lib                     6b20-1.9.7-0ubuntu1                               OpenJDK Java runtime (architecture independent libraries)
user@pc:~$ dpkg -l | grep rxtx
ii  librxtx-java                          2.2pre2-1                                         Full Java CommAPI implementation
user@pc:~$ java -version
java version "1.6.0_20"
OpenJDK Runtime Environment (IcedTea6 1.9.7) (6b20-1.9.7-0ubuntu1)
OpenJDK Client VM (build 19.0-b09, mixed mode, sharing)
user@pc:~$

Also, LD_LIBRARY_PATH is set, after reboot and mpide launch, I still get this error:

user@pc:~$ java -version
java version "1.6.0_20"
OpenJDK Runtime Environment (IcedTea6 1.9.7) (6b20-1.9.7-0ubuntu1)
OpenJDK Client VM (build 19.0-b09, mixed mode, sharing)
user@pc:~$
user@pc:~$ mpide/mpide
0 [main] DEBUG processing.app.Base  - DEBUG: Logging enabled.processing.app.Base
1382 [main] DEBUG processing.app.Base  - DEBUG:start: rebuilding import menu
Exception in thread "main" java.lang.NullPointerException
	at processing.app.Base.rebuildImportMenu(Base.java:1006)
	at processing.app.Editor.buildSketchMenu(Editor.java:640)
	at processing.app.Editor.buildMenuBar(Editor.java:485)
	at processing.app.Editor.<init>(Editor.java:208)
	at processing.app.Base.handleOpen(Base.java:732)
	at processing.app.Base.restoreSketches(Base.java:393)
	at processing.app.Base.<init>(Base.java:310)
	at processing.app.Base.main(Base.java:208)

P.S. Theme is nice but not suitable for a forum where user code and error message are posted. The theme must be wider...


ricklon

Wed, 25 May 2011 14:52:17 +0000

That's good feeback.

That kind of error indicates something is wrong in the path to Libraries. 1382 [main] DEBUG processing.app.Base - DEBUG:start: rebuilding import menu

Not guaranteed, but it's possible that some file got corrupted at some point in the process of download, or unpacking. There are a lot files that have to unpack properly.


hfb3

Wed, 25 May 2011 22:21:54 +0000

I've read a couple posts that mention problems with librxtxSerial. After further research, I found that mpide-0022-chipkit-linux32-20110520 includes librxtxSerial64.so. I'm running a 32 bit version of Slackware. My simple fix was to just transfer the librxtxSerial.so file from ~/arduino-0022/lib/ to ~/mpide-0022-chipkit-linux32-20110520/lib/.


funlw65

Thu, 26 May 2011 20:43:27 +0000

I've read a couple posts that mention problems with librxtxSerial. After further research, I found that mpide-0022-chipkit-linux32-20110520 includes librxtxSerial64.so. I'm running a 32 bit version of Slackware. My simple fix was to just transfer the librxtxSerial.so file from ~/arduino-0022/lib/ to ~/mpide-0022-chipkit-linux32-20110520/lib/.

I did it but no effect on my side (I even renamed the original Arduino library to have the exact name as mpide library). But I think it was not my problem.

I also downloaded the mpide archive again and same result: it trows the error on console and stuck.

Best regards.


ricklon

Thu, 26 May 2011 21:52:00 +0000

I'll see if I can install a 32 bit slackware and compare results. That might be the best course of action. I've test on Ubuntu 10.10, 11,04.

What's the PWD for the path your in when you run it? Also, the error message in the ticket you posted is that the complete error message? I could more info there was any to figure out what's going on. From the message the seems to be a problem importing from the libraries folder. That would be ./hardware/pic32/libraries if that directory doesn't exist there would a problem. Another thing to check is the permission on the compiler and that they are executable.


funlw65

Thu, 26 May 2011 22:37:15 +0000

All binaries are executable. Here are attached screenshots with the tree of mpide folders. Not the entire tree is expanded. Yes, the error message I posted is the only one.


funlw65

Thu, 26 May 2011 22:39:21 +0000

Here, another one with an empty "include" folder, don't know if is normal...

Also, I didn't got it, you said you already tested it under Ubuntu 10.10 ?!?


funlw65

Fri, 27 May 2011 01:22:47 +0000

I think I found it... Your mpide uses the same hidden ".arduino" folder for saving the settings. As I used Arduino IDE before, he created ".arduino" folder and wrote his preferences.

At mpide launch, it will never start. I erased the ".arduino" folder and launched mpide and this time I have your modified Arduino IDE window on my display :) Still a little warning:

Stable Library
=========================================
Native lib Version = RXTX-2.2pre2
Java lib Version   = RXTX-2.1-7
WARNING:  RXTX Version mismatch
	Jar version = RXTX-2.1-7
	native lib Version = RXTX-2.2pre2

but I will not go further as I don't have a chipkit board (at least, I'm glad I've contributed a little).

But you must fix this. I have my own tuned version of Arduino for my Sanguino board (EvB 4.3v4) and maybe others will like to keep their tuned Arduino (at least, until they will gain trust on your IDE).

Best regards, Vasi

P.S. You can close the issue on github ...


ricklon

Fri, 27 May 2011 02:26:52 +0000

That is a really good find. Thank you for working through this with me.

I'll get that fixed.


OppaErich

Fri, 15 Jul 2011 16:36:03 +0000

No worky on Fedora 15. :(

rxtx is installed, there is no librxtx-java available, /usr/lib/jni is in the library path

java version "1.6.0_22" OpenJDK Runtime Environment (IcedTea6 1.10.2) (fedora-58.1.10.2.fc15-i386) OpenJDK Server VM (build 20.0-b11, mixed mode)


hairymnstr

Fri, 15 Jul 2011 18:52:36 +0000

That's the right package for Fedora I checked it out when I wrote the Wiki page.

Can you post the output if you run it from the terminal (i.e. cd into the installed folder and run "./mpide"). Hopefully it's giving some error messages. What architecture are you on, i386 or x64?


OppaErich

Sat, 16 Jul 2011 10:31:22 +0000

Can you post the output if you run it from the terminal (i.e. cd into the installed folder and run "./mpide"). Hopefully it's giving some error messages.

I can't as I wrote already, looks too spamy :roll:

What architecture are you on, i386 or x64?

java version "1.6.0_22" OpenJDK Runtime Environment (IcedTea6 1.10.2) (fedora-58.1.10.2.fc15-i386) OpenJDK Server VM (build 20.0-b11, mixed mode)

java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver

OppaErich

Sun, 17 Jul 2011 09:49:41 +0000

Some more testing:

openSUSE 11.4 64bit - runs out of the box

Mageia 1 32bit - rxtx was installed, after installing librxtx2.1 and librxtx-devel the GUI is running but Serial port is greyed out and

java.lang.NoClassDefFoundError: Could not initialize class gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver

in terminal window.

FC15 - GUI does not even start


hairymnstr

Mon, 18 Jul 2011 10:01:27 +0000

Sorry, missed those details. You might have more success posting console output if you use the "code" tags.

Only thing I can think is that /usr/lib/jni isn't where rxtx is being installed for some reason. Can you see if that's where it was installed to?


OppaErich

Tue, 19 Jul 2011 10:01:11 +0000

:oops: Jesus Christ, haven't thought of that. We're on the the right trail methinks.

[oppa@core2duo mpide-0022-chipkit-linux32-20110619]$ rpm -ql rxtx
/usr/lib/rxtx
/usr/lib/rxtx/librxtxI2C-2.2pre1.so
/usr/lib/rxtx/librxtxI2C.so
/usr/lib/rxtx/librxtxParallel-2.2pre1.so
/usr/lib/rxtx/librxtxParallel.so
/usr/lib/rxtx/librxtxRS485-2.2pre1.so
/usr/lib/rxtx/librxtxRS485.so
/usr/lib/rxtx/librxtxRaw-2.2pre1.so
/usr/lib/rxtx/librxtxRaw.so
/usr/lib/rxtx/librxtxSerial-2.2pre1.so
/usr/lib/rxtx/librxtxSerial.so
/usr/share/doc/rxtx-2.2
/usr/share/doc/rxtx-2.2/AUTHORS
/usr/share/doc/rxtx-2.2/COPYING
/usr/share/doc/rxtx-2.2/ChangeLog
/usr/share/doc/rxtx-2.2/INSTALL
/usr/share/doc/rxtx-2.2/README
/usr/share/doc/rxtx-2.2/README.IPAQ
/usr/share/doc/rxtx-2.2/README.OSX
/usr/share/doc/rxtx-2.2/README.SCO
/usr/share/doc/rxtx-2.2/TODO
/usr/share/java/RXTXcomm.jar     <- this is missing ? 
[root@core2duo ~]# ls /usr/lib/j
jack/        java-1.5.0/  java-1.7.0/  jna/         jvm-commmon/ jvm-private/
java/        java-1.6.0/  java-ext/    jvm/         jvm-exports/

/usr/lib/jni does not exist. I'll try adding /usr/share/java to the library path.

Well, still no joy.

...
java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver
Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path
[oppa@core2duo mpide-0022-chipkit-linux32-20110619]echo $LD_LIBRARY_PATH
/usr/lib/alliance/lib:/usr/lib/jni:/usr/lib/alliance/lib:/usr/share/java/

hairymnstr

Tue, 19 Jul 2011 10:22:49 +0000

I think it's actually the .so (shared objects, linux equivalent of a .dll) that you want in your path. Try adding /usr/lib/rxtx to the end of LD_LIBRARY_PATH.

I'm not sure if the jni thing is a red-herring and to do with using sun-java rather than iced tea which I think you're using.


OppaErich

Tue, 19 Jul 2011 10:30:34 +0000

Got it, CLASSPATH is the name of the game.

So if you're running Fedora 15, add

export CLASSPATH=/usr/share/java/RXTXcomm.jar:

to your ~/.bashrc

Thank you hairymnstr


hairymnstr

Tue, 19 Jul 2011 11:00:02 +0000

Excellent, glad that's working, I've added a line to the Wiki with your solution for future reference.