Main /
Nrjavaserialnrjavaserial is one of the Java Serial Port Interfaces. nrjavaserial is a port of RxTx that includes the shared libraries in the jar file. DebuggingTo debug nrjavaserial Java code, set export JAVAFLAGS=-Dgnu.io.log.mode=PRINT_MODE $PTII/bin/vergil To debug C code, edit #define DEBUG 1 #define DEBUG_VERBOSE 1 and rebuild. BuildingWe need to rebuild nrjavaserial because of RxTx Hanging. 1. Check out the repo: git clone https://github.com/NeuronRobotics/nrjavaserial.git git clone https://github.com/terraswarm/nrjavaserial 2. Install sudo port install gradle For Ubuntu, a recent version of sudo add-apt-repository ppa:cwchien/gradle sudo apt-get update sudo apt-get install gradle 3. To rebuild the C version, see Building the Native Code Portion below, to rebuild just the Java: cd nrjavaserial gradle build If you have trouble, see Problems
4. Running cp ./build/libs/nrjavaserial-3.11.0.jar $PTII/lib/nrjavaserial-3.11.0.devel.jar 5. Optional: Configure looks for bash-3.2$ cd $PTII bash-3.2$ svn diff configure.in Index: configure.in =================================================================== --- configure.in (revision 74002) +++ configure.in (working copy) @@ -3855,7 +3855,7 @@ #-------------------------------------------------------------------- # We only need to look for rxtx if $PTII/ptolemy/actor/lib/io/comm is present RXTX_USER_DIR="$PTII/ptolemy/actor/lib/io/comm" -RXTX_JAR_DEFAULT='${PTII}/lib/nrjavaserial-3.11.0.jar' +RXTX_JAR_DEFAULT='${PTII}/lib/nrjavaserial-3.11.0.7Dec2015jar' RXTX_PRESENT=no # PTLEGO_DIR is set to lego # $PTII/ptolemy/apps/makefile if the Java Communications API was found @@ -3883,7 +3883,7 @@ AC_ARG_WITH(rxtx, [ --with-rxtx=DIR use Java Serial Port Interfacrxtx from DIR, defaults to $RXTX_JAR_DEFAULT], RXTX_JAR=$withval, - RXTX_JAR=$PTII/lib/nrjavaserial-3.11.0.devel.jar) + RXTX_JAR=$PTII/lib/nrjavaserial-3.11.1.jar) if test -f "$RXTX_JAR"; then PT_MSG_RESULT($RXTX_JAR) @@ -3931,7 +3931,7 @@ You need not download rxtx unless you plan the actors in actor.lib.comm. The rxtx package can be found at https://github.com/NeuronRobotics/nrjavaserial/releases and the jar - file placed at $PTII/lib/nrjavaserial-3.11.0.devel.jar and configure rerun.]) + file placed at $PTII/lib/nrjavaserial-3.11.1.jar and configure rerun.]) fi fi bash-3.2$ 6. Run commit configure.in, run autoconf and commit configure: bash-3.2$ svn commit -m "Updated the nrjavaserial jar file to the head of the repo to fix a hanging problem, see https://chess.eecs.berkeley.edu/ptexternal/wiki/Main/Nrjavaserial." configure.in Sending configure.in Transmitting file data . Committed revision 74007. bash-3.2$ autoconf bash-3.2$ svn commit -m "configure.in changed" configure Sending configure Transmitting file data . Committed revision 74008. bash-3.2$ 7. Add the new library, delete the old library (Could be done in one step) bash-3.2$ svn add lib/nrjavaserial-3.11.1.jar A (bin) lib/nrjavaserial-3.11.1.jar bash-3.2$ svn delete --force lib/nrjavaserial-3.11.0.devel.jar D lib/nrjavaserial-3.11.0.devel.jar bash-3.2$ svn commit -m "Updated the nrjavaserial jar file to the head of the repo to fix a hanging problem, see https://chess.eecs.berkeley.edu/ptexternal/wiki/Main/Nrjavaserial." lib/nrjavaserial-3.11.0.devel.jar lib/nrjavaserial-3.11.1.jar 11.0.7Dec2015.jar Adding (bin) lib/nrjavaserial-3.11.0.1.jar Deleting lib/nrjavaserial-3.11.0.develjar Transmitting file data . Committed revision 74009. bash-3.2$ Building the Native Code Portion of nrserialjavaSee https://github.com/NeuronRobotics/nrjavaserial, which says to run Building the Native Code Under OS Xhttps://github.com/NeuronRobotics/nrjavaserial says: "We're pretty big on maintaining backwards compatibility as far as reasonable. Our OS X natives target OS X 10.5, so to build them, you'll need an appropriate SDK installed. This StackOverflow answer provides pointers for getting the appropriate SDK installed."
To do this, we download an old version of Xcode and install the
Building the Native Code Under UbuntuRun make linux64 Update the PTII Jar FileUpdate the PTII Jar File ''note that the actual name of the file in cp ./build/libs/nrjavaserial-3.11.0.jar $PTII/lib/nrjavaserial-3.11.0.devel.jar ProblemsGradle fails with jcenter missingUnder Ubuntu 14.04.3 LTS, running sbuser@swarmnuc001:~/src/nrjavaserial$ gradle build FAILURE: Build failed with an exception. * Where: Build file '/home/sbuser/src/nrjavaserial/build.gradle' line: 41 * What went wrong: A problem occurred evaluating root project 'nrjavaserial'. > Could not find method jcenter() for arguments [] on root project 'nrjavaserial'. * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug op\ tion to get more log output. BUILD FAILED Total time: 4.238 secs The problem is that sbuser@swarmnuc001:~/src/nrjavaserial$ gradle --version ------------------------------------------------------------ Gradle 1.4 ------------------------------------------------------------ Gradle build time: Monday, September 9, 2013 8:44:25 PM UTC Groovy: 1.8.6 Ant: Apache Ant(TM) version 1.9.3 compiled on April 8 2014 Ivy: non official version JVM: 1.7.0_85 (Oracle Corporation 24.85-b03) OS: Linux 3.13.0-66-lowlatency amd64 The solution is at http://askubuntu.com/questions/328178/gradle-in-ubuntu sudo add-apt-repository ppa:cwchien/gradle sudo apt-get update sudo apt-get install gradle After the install, the version is updated: sbuser@swarmnuc001:~/src/nrjavaserial$ gradle --version ------------------------------------------------------------ Gradle 2.9 ------------------------------------------------------------ Build time: 2015-11-17 07:02:17 UTC Build number: none Revision: b463d7980c40d44c4657dc80025275b84a29e31f Groovy: 2.4.4 Ant: Apache Ant(TM) version 1.9.3 compiled on December 23 2013 JVM: 1.8.0_65 (Oracle Corporation 25.65-b01) OS: Linux 3.13.0-66-lowlatency amd64 sbuser@swarmnuc001:~/src/nrjavaserial$ See Also
|