Jamvm help...please

Robert the author of jamvm has been assisting me with this and he has managed find another error message, which does give a good clue as to what the problem is.

I am using RXTXcomm package, which of course on my dev. system works because there are supported libraries, however on the Yun I don't think they're are.

So I will probably need to roll my own native library and JNI package to provide the serial interfacing.

There is no need to build your own RXTX library on the Yun: if you have an usb/serial connector and installed the correct driver (see the opkg packages) you have a /dev/ttyUSB 'file' (mind the quotes). You can open it both for reading (FileInputStream) and writing (FileOutputStream) from Java and voila.

kind regards,

Jos

But what about the library?

RXTXcomm has both a java package and a native library on Windows its rxtxSerial.dll and rxtxParallel.dll

Are they're equivalents for Yun?

You don't need it; e.g.

String serial= "/dev/ttyUSB0";
InputStream in= new FileInputStream(serial);
OutputStrea out= new FileOutputStream(serial);

... and read and write your bytes through 'in' and 'out'; that's all.

kind regards,

Jos

ps. you can set the baudrate before you start your Java program (see stty)

Ty, but this is polling the port instead of interrupt driven, there is a chance the app. could miss data, I'll try it out, could always create a thread just to poll te port I guess.

I've tried opening the device as a stream and I just can't get it to read anything, having spent a while searching, it seems that others use either javax or rxtx.

Since neither are available in jamvm I'm back to writing a native library.

JSSC seems to be the replacement for RXTX - does it work with the Yun?

...R

I'm away from home atm, will try it this weekend, when I get home.

JSSC is no different from RXTX in that it relies on a native library to do the actual hardware interfacing, I don't see any native library or support for the Yun.

I started installing the SDK for the Yun in Ubuntu last night, will try to get that complete and working,

Do you have a file 'ttyUSB0' (or similar) in your /dev directory? If not, install the needed package(s) first.

kind regards,

Jos

I do, but in order to try what you recommend a native library is also required...like RXTX JSSC makes reference to native calls.

Trying streams did not work, hence the reason why someone took the time to write RXTX and JSSC.

SPlatten:
I do, but in order to try what you recommend a native library is also required...like RXTX JSSC makes reference to native calls.

Trying streams did not work, hence the reason why someone took the time to write RXTX and JSSC.

How strange, because I've been using streams using Java alone on that /dev/ttyUSB0 device for months now (polling them) and it works as a breeze ...

kind regards,

Jos

Ok, when I get home this weekend, I will try it on the Yun, so far I've tried it only in Ubuntu and on Windows.

SPlatten, if you manage to make it, please share your script as it could be turned into an openwrt Makefile, thus making that package available to everyone

Will do.