Hi Ngoc Thanh The error you see now is because you did not specify the serial port. By default, TestSerial tries to connect to the serial forwarder. You can specify the serial port with the "-comm" parameter. For detaisl see the tutorials: http://docs.tinyos.net/index.php/Mote-PC_serial_communication_and_SerialForwarder
Cheers, Urs On 10/17/10 10:37 AM, [email protected] wrote: > Thanks you very much for your helps. > Now 2 files .dll loaded successfully. But this bug: > > " >> $java TestSerial >> >> s...@localhost:9902 died - > exiting<java.net.ConnectException: >> Connection refuse: connect> >> >> " > It still exist. So we cannot run Serial. > I try to change to another port but it always run default as 9002 -> it > died. > Do you know the solution ?How can I fix it? > > Thanks you very much and have nice weekend, > > Ngoc Thanh > > > P/s: this is report when I run test program: "java -jar tosruntime.jar" > > ----------------------------------------------------------------- > > Java Version: 1.6.0_23-ea - Sun Microsystems Inc. > Installation base: C:\Program Files\Java\jre6 > > Library search path: > c:\WINDOWS\system32;.;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS > ;C:\cygwin\opt\msp430\bin;C:\cygwin\opt\jflashmm;C:\cygwin\opt\msp430\bin;C: > \cygwin\opt\jflashmm;C:\cygwin\usr\local\bin;C:\cygwin\bin;C:\cygwin\bin;c:\ > Program Files\PC Connectivity > Solution\;c:\WINDOWS\system32;c:\WINDOWS;c:\WINDOWS\System32\Wbem;c:\Program > Files\ATI Technologies\ATI.ACE\Core-Static;c:\Program > Files\TortoiseSVN\bin;c:\PROGRA~1\ATT\Graphviz\bin;c:\PROGRA~1\ATT\Graphviz\ > bin\tools;c:\WINDOWS\system32;c:\WINDOWS;c:\Program > Files\Java\jdk1.6.0_23\bin;c:\WINDOWS > > Taking first existing path (low confidence) > The recommended path for JNI library extensions is: 'c:\WINDOWS\system32' > > Getenv found in 'c:\WINDOWS\system32\getenv.dll' > The getenv library is in the recommeded location. > > Toscomm found in 'c:\WINDOWS\system32\toscomm.dll' > The toscomm library is in the recommeded location. > WARNING: Path 'C:\WINDOWS\Sun\Java\bin' does not exist! > Getenv found in 'C:\WINDOWS\system32\getenv.dll' > The getenv library is in the recommeded location. > > Toscomm found in 'C:\WINDOWS\system32\toscomm.dll' > The toscomm library is in the recommeded location. > WARNING: Path 'C:\cygwin\opt\jflashmm' does not exist! > WARNING: Path 'C:\cygwin\opt\jflashmm' does not exist! > Getenv found in 'c:\WINDOWS\system32\getenv.dll' > The getenv library is in the recommeded location. > > Toscomm found in 'c:\WINDOWS\system32\toscomm.dll' > The toscomm library is in the recommeded location. > Getenv found in 'c:\WINDOWS\system32\getenv.dll' > The getenv library is in the recommeded location. > > Toscomm found in 'c:\WINDOWS\system32\toscomm.dll' > The toscomm library is in the recommeded location. > WARNING: getenv library installed multiple times. Potential conflicting > installation. > WARNING: toscomm library installed multiple times. Potential conflicting > installation. > > Attempting to load the library 'getenv' via the normal mechanism. > Loading the library succeeded! > > Attempting to load the library 'toscomm' via the normal mechanism. > Loading the library succeeded! > > Attempting to load the library 'getenv' by extracting a resource from the > classpath. > Trying to locate the file 'windows_x86_getenv' in the classpath. > Temporary file created: 'C:\Documents and > Settings\ngocthanhdinh\getenv7668354017876558301.lib'. > Library copied successfully. Let's load it. > Library loaded successfully. > > Attempting to load the library 'toscomm' by extracting a resource from the > classpath. > Trying to locate the file 'windows_x86_toscomm' in the classpath. > Temporary file created: 'C:\Documents and > Settings\ngocthanhdinh\toscomm5650868194789514058.lib'. > Library copied successfully. Let's load it. > Library loaded successfully. > ------------------------------------------------------------------- > -----Original Message----- > From: Urs Hunkeler [mailto:[email protected]] > Sent: Sunday, October 17, 2010 3:57 PM > To: [email protected] > Cc: [email protected] > Subject: Re: [Tinyos-help] please Help me for bug in JNI > > 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 > No virus found in this incoming message. > Checked by AVG - www.avg.com > Version: 9.0.862 / Virus Database: 271.1.1/3201 - Release Date: 10/17/10 > 03:33:00 > > _______________________________________________ Tinyos-help mailing list [email protected] https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
