I've downloaded the source for RXTX and have been trying to compile it for the Yun.
I have the toolchain installed, and have made some progress, haven't finished yet.
Does anyone know the correct settings for --build, --target, --host on configure?
I've downloaded the source for RXTX and have been trying to compile it for the Yun.
I have the toolchain installed, and have made some progress, haven't finished yet.
Does anyone know the correct settings for --build, --target, --host on configure?
Here is a post concerning a totally different program that happens to use ./configure, it should have some good hints Running the motion library on the Yun - #9 by noblepepper - Arduino Yún - Arduino Forum
I used mips-openwrt-linux-uclibc for host. Give it a try without target.
Thank you, will give it a try tonight after work.
Even if nodejs related, this post from fibasile helped me out in compiling nodejs for the yun Compiling Node.js for Arduino YUN
Thank you,
Build script made:
STAGING_DIR=/home/simon/openwrt/staging_dir
CFLAGS=-I$STAGING_DIR/target-mips_r2_uClibc-0.9.33.2/usr/include
export CFLAGS
LDFLAGS=-L$STAGING_DIR/target-mips_r2_uClibc-0.9.33.2/usr/lib
export LDFLAGs
CC=/yun_toolchain/mips-openwrt-linux-uclibc-gcc
export CC
./configure --host=mips-openwrt-linux-uclibc
mkdir $STAGING_DIR/usr/include/linux
make
I now have a set of libraries, that I will try out tonight.
/yun_toolchain is a symbolic link I created to the actual location of the compiler:
/home/simon/openwrt/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_uClibc-0.9.33.2/bin
Haven't been home to test the libs yet, but there is one possible issue to resolve. The built libraries are only found in:
/home/simon/RXTX/mips-openwrt-linux-uclibc/.libs
Not sure if this is an issue or not, I would have expected the build to put them some place not hidden.
-rw-rw-r-- 1 simon simon 10000 May 7 16:30 fuserImp.o
-rw-rw-r-- 1 simon simon 28208 May 7 16:30 I2CImp.o
-rwxrwxr-x 1 simon simon 29561 May 7 16:30 librxtxI2C-2.2.so
lrwxrwxrwx 1 simon simon 16 May 7 16:30 librxtxI2C.la -> ../librxtxI2C.la
-rw-rw-r-- 1 simon simon 962 May 7 16:30 librxtxI2C.lai
lrwxrwxrwx 1 simon simon 17 May 7 16:30 librxtxI2C.so -> librxtxI2C-2.2.so
-rwxrwxr-x 1 simon simon 17913 May 7 16:30 librxtxParallel-2.2.so
lrwxrwxrwx 1 simon simon 21 May 7 16:30 librxtxParallel.la -> ../librxtxParallel.la
-rw-rw-r-- 1 simon simon 992 May 7 16:30 librxtxParallel.lai
lrwxrwxrwx 1 simon simon 22 May 7 16:30 librxtxParallel.so -> librxtxParallel-2.2.so
-rwxrwxr-x 1 simon simon 30618 May 7 16:30 librxtxRaw-2.2.so
lrwxrwxrwx 1 simon simon 16 May 7 16:30 librxtxRaw.la -> ../librxtxRaw.la
-rw-rw-r-- 1 simon simon 962 May 7 16:30 librxtxRaw.lai
lrwxrwxrwx 1 simon simon 17 May 7 16:30 librxtxRaw.so -> librxtxRaw-2.2.so
-rwxrwxr-x 1 simon simon 30627 May 7 16:30 librxtxRS485-2.2.so
lrwxrwxrwx 1 simon simon 18 May 7 16:30 librxtxRS485.la -> ../librxtxRS485.la
-rw-rw-r-- 1 simon simon 974 May 7 16:30 librxtxRS485.lai
lrwxrwxrwx 1 simon simon 19 May 7 16:30 librxtxRS485.so -> librxtxRS485-2.2.so
-rwxrwxr-x 1 simon simon 91186 May 7 16:30 librxtxSerial-2.2.so
lrwxrwxrwx 1 simon simon 19 May 7 16:30 librxtxSerial.la -> ../librxtxSerial.la
-rw-rw-r-- 1 simon simon 980 May 7 16:30 librxtxSerial.lai
lrwxrwxrwx 1 simon simon 20 May 7 16:30 librxtxSerial.so -> librxtxSerial-2.2.so
-rw-rw-r-- 1 simon simon 14608 May 7 16:30 ParallelImp.o
-rw-rw-r-- 1 simon simon 29040 May 7 16:30 RawImp.o
-rw-rw-r-- 1 simon simon 29444 May 7 16:30 RS485Imp.o
-rw-rw-r-- 1 simon simon 87320 May 7 16:30 SerialImp.o
It does look strange, especially since there are several links to the parent directory.
This will be controlled by ./configure, does ./configure --help give any hints?
I'll re-run and capture the output.
It's actually quite common. Only running make install those files are put in more meaningful folders like /usr/lib.
Thank you, "make install" did the trick, files installed in:
/usr/lib/jvm/java-7-oracle/jre/lib/amd64
Although, I'm not sure why amd64, could be because I'm running Ubuntu 14.04LTS in Oracle VirtualBox, my system is an i7.
It is strange that they ended up there, I think that location will be where your virtual machine libraries go.
Run file on one of the libraries, here is what I get on libglib for the Yun:
file staging_dir/target-mips_r2_uClibc-0.9.33.2/lib/libudev.so.0.12.0
staging_dir/target-mips_r2_uClibc-0.9.33.2/lib/libudev.so.0.12.0: ELF 32-bit MSB shared object, MIPS, MIPS32 rel2 version 1 (SYSV), dynamically linked, with unknown capability 0x41000000 = 0xf676e75, with unknown capability 0x10000 = 0x70403, not stripped
Here is what I get for a libudev for my desktop:
file /lib/i386-linux-gnu/libudev.so.1.3.5
/lib/i386-linux-gnu/libudev.so.1.3.5: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked, BuildID[sha1]=0x90e1b857dd268065195c5aadd9abe6b59600a368, stripped
The part you are looking for is the processor it should be MIPS for a Yun library
Thanks for the reply:
simon@ubuntu:/usr/lib/jvm/java-7-oracle/jre/lib/amd64$ file librxtxSerial-2.2.so
librxtxSerial-2.2.so: ELF 32-bit MSB shared object, MIPS, MIPS32 rel2 version 1 (SYSV), dynamically linked, not stripped
Happy to report that the build library works !
I've written a simple test program which makes calls to the native libary:
for( File objFile : aryFiles ) {
Enumeration ePorts = CommPortIdentifier.getPortIdentifiers();
String strName = objFile.getName();
if ( strName.startsWith(strPrefix) != true ) {
continue;
}
if ( marylstDevices == null ) {
marylstDevices = new ArrayList<CommPortIdentifier>();
}
String strAbsPath = objFile.getAbsolutePath();
System.out.println(strAbsPath);
System.out.println("More elements: " + ePorts.hasMoreElements() );
while ( ePorts.hasMoreElements() ) {
CommPortIdentifier portId = (CommPortIdentifier)ePorts.nextElement();
System.out.println("Port Type: " + portId.getPortType() + ", " + CommPortIdentifier.PORT_SERIAL);
if ( portId.getPortType() == CommPortIdentifier.PORT_SERIAL ) {
System.out.println(strAbsPath);
if ( portId.getName().compareToIgnoreCase(strAbsPath) == 0 ) {
marylstDevices.add(portId);
}
}
}
}
Although the loop displays the following:
/dev/ttyS13
/dev/ttyATH0
/dev/ttyS15
/dev/ttyS14
/dev/ttyS12
/dev/ttyS11
/dev/ttyS10
/dev/ttyS9
/dev/ttyS8
/dev/ttyS7
/dev/ttyS6
/dev/ttyS5
/dev/ttyS4
/dev/ttyS3
/dev/ttyS2
/dev/ttyS1
/dev/ttyS0
/dev/tty
When I examine the enumerator for the ports, there are no elements. Should I be able to detect a serial device?
Anyone?
Are you sure that is the actual output? It does look like
Yes, although when I cut and paste I chopped off the bit at the bottom which was:
More elements: 0
You should look at RXTX code. I guess it's filtering devices based on path names. We patched it ourselves, before switching to JSSC GitHub - arduino/RXTX: Arduino version of RXTX
Thats the distribution I downloaded and compiled. The array list that I am iterating through in the test example contains all paths with the prefix '/dev/tty'.
Do you have a JSSC build for the Yun?
No, we use the upstream binaries Releases · scream3r/java-simple-serial-connector · GitHub