Hi Ngoc Thanh,

In order for Java to access the serial port (and some system 
information), an extension to Java is needed. This extension is provided 
by TinyOS in the form of two libraries: toscomm.dll and getenv.dll. The 
error that you are seeing when trying to execute the TestSerial program 
means that these libraries were somehow not properly installed (the 
TinyOS installation procedure has some problems there).

To fix this, you can manually copy these two libraries into the jre/bin 
folder (if they are called toscomm-32.dll and getenv-32.dll, you'll have 
to rename them).

If this doesn't work, you can download a test program and execute it (if 
double-clicking on the program won't start it you can execute it with 
the command "java -jar tosruntime.jar"). The program should tell you all 
sorts of diagnostic information about your Java installation and you can 
copy/paste this information into an e-mail which helps us understand 
what is not working with your installation.
http://www.schlangenstein.ch/tosruntime.jar

Cheers,
Urs


On 10/17/10 5:54 AM, [email protected] wrote:
> Dear Tiny-OS help member,
>
>
>
> I've got a big trouble when I try to run TestSerial example of tinyos-2.x.
>
> It has bug as :
>
>   "
>
>                  $java TestSerial
>
>                  Getenv JNI library not found. Env.getenv not work
>
>                  <run the tos-install-jni tool, see man ts-install-jnifor
> more detail>
>
>
>
>                  s...@localhost:9902 died - exiting<java.net.ConnectException:
> Connection refuse: connect>
>
> "
>
> And when I run:  tos-install-jni, it had another bug:
>
>
>
> "
>
> $ tos-install-jni
>
> Installing 32-bit java JNI code in /cygdrive/c/Program
> Files/Java/jdk1.6.0.23/jre/bin.
>
> Install: cannot stat '/usr/lib/tinyos/*-32.dll': no such file or directory
>
> "
>
> My jre path is: /cygdrive/c/Program Files/Java/jdk1.6.0.23/jre/bin
>
> I used tinyos-2.x and use cygwin on windows.
>
> I tried a lot of ways from internet but it cannot work for me.
>
>
>
> I tried the way: rename file toscomm.dll to toscomm-32.dll .
>
> at the first time my folder usr/lib (at c/cygwin/usr/lib) does not has
> subfolder tinyos.
>
> But I create this folder and copy file toscomm.dll and getenv.dll, I rename
> toscomm.dll to toscomm-32.dll .
>
> But it still has this bug:
>
> "
>
> $ tos-install-jni
>
> Installing 32-bit java JNI code in /cygdrive/c/Program
> Files/Java/jdk1.6.0.23/jre/bin.
>
> Install: cannot stat '/usr/lib/tinyos/*-32.dll': no such file or directory
>
> "
>
> I don't know which file I missed. Because I had 2 .dll file already.
>
>
>
> I checked and try to install : tinyos-tools-1.3.0-1.cygwin.i386.rpm again.
>
> And I reported:
>
> "
>
> $ rpm -Uvh tinyos-tools-1.3.0-1.cywin.i386.rpm
>
> Error: failed to open etc/mtab: not a directory
>
> Preparing. ############################100%
>
> Package tinyof-tools-1.3.0-1 is intended for a cygwin operating system
>
> Package tinyof-tools-1.3.0-1 is already installed".
>
> How can I install it again?
>
> I read some website talk about tinyos-2.x/tools/tinyos/tinyos/java.
>
> But I don't have this folder "tinyos-2.x/tools", I don't know why.
>
> I just have folder of java in: tinyos-2.x/support/sdk
>
>
>
> I spent a lot of time for it but cannot fix it.
>
> Do you have any suggestion for me? Do you know what is my problem?
>
>
>
> I hope to receive your email with useful help.
>
>
>
> Thanks you very much and wishing you have a nice weekend.
>
>
>
> Ngoc Thanh
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to