[Tinyos-help] Problems with TestSerial

Michael Schippling schip at santafe.edu
Sun Feb 17 17:20:50 PST 2008


OK, now we're getting someplace, however I don't know exactly where...
I don't use the TOSComm lib and I can't find all the pieces when
looking in CVS for the source. Specifically I found what appears
to be the linux C++ code at:
 
http://tinyos.cvs.sourceforge.net/tinyos/tinyos-2.x/tools/tinyos/java/serial/NativeSerial_linux.cpp?revision=1.5&view=markup

But not the JNI wrappers, nor actually any definition of the "open" method.

Perhaps someone who knows about that lib can elucidate for us?


Anyway you appear to be getting an anomalous error when using JNI to open
the serial port: "Not a directory", which is actually true, but I don't
know where that would be coming from. Are the permissions on your /dev
directory open to everyone? And you do have the right JNI library for
your brand of linux, right? Might be worthwhile reinstalling that...

As to the second "error", it is absolutely right. What you are doing
is typing the serial spec string into the bash shell as if it were a
command, like "ls", and the shell is telling you it can't find it:
"No such file or directory". The serial string is an arbitrary TOS
invention to describe the base-station data source and only has meaning
to some low level TOS Java code (which I also can't find in CVS for T2).

Hopefully someone who actually knows something will come to our aid.
MS


Leena Ganguli wrote:
> Ok here's the output for successfully installing TestSerial onto the 
> mote (works with any other application that I have tested so far as well):
> 
> ubuntu at ubuntu:/opt/tinyos-2.x/apps/tests/TestSerial$ make micaz install 
> mib510,/dev/ttyUSB0
> mkdir -p build/micaz
>     compiling TestSerialAppC to a micaz binary
> ncc -o build/micaz/main.exe -Os -finline-limit=100000 -Wall -Wshadow 
> -Wnesc-all -target=micaz -fnesc-cfile=build/micaz/app.c -board=micasb 
> -DIDENT_PROGRAM_NAME=\"TestSerialAppC\" -DIDENT_USER_ID=\"ubuntu\" 
> -DIDENT_HOSTNAME=\"ubuntu\" -DIDENT_USER_HASH=0xf67b89f7L 
> -DIDENT_UNIX_TIME=0x47b962e9L -DIDENT_UID_HASH=0x36a57241L 
> -fnesc-dump=wiring -fnesc-dump='interfaces(!abstract())' 
> -fnesc-dump='referenced(interfacedefs, components)' 
> -fnesc-dumpfile=build/micaz/wiring-check.xml TestSerialAppC.nc -lm
>     compiled TestSerialAppC to build/micaz/main.exe
>             5908 bytes in ROM
>              262 bytes in RAM
> avr-objcopy --output-target=srec build/micaz/main.exe build/micaz/main.srec
> avr-objcopy --output-target=ihex build/micaz/main.exe build/micaz/main.ihex
>     writing TOS image
> cp build/micaz/main.srec build/micaz/main.srec.out
>     installing micaz binary using mib510
> uisp -dprog=mib510 -dserial=/dev/ttyUSB0 --wr_fuse_h=0xd9 
> -dpart=ATmega128 --wr_fuse_e=ff  --erase --upload 
> if=build/micaz/main.srec.out
> Firmware Version: 2.1
> Atmel AVR ATmega128 is found.
> Uploading: flash
> 
> Fuse High Byte set to 0xd9
> 
> Fuse Extended Byte set to 0xff
> rm -f build/micaz/main.exe.out build/micaz/main.srec.out
> 
> -------------------------------------------------------------------------------------
> Here's the errors I get when typing in the java command (the USB port is 
> the same)
> 
> ubuntu at ubuntu:/opt/tinyos-2.x/apps/tests/TestSerial$ java 
> net.tinyos.tools.Listen -comm serial@/dev/ttyUSB0/:micaz
> Error on serial@/dev/ttyUSB0/:57600: java.io.IOException: Could not open 
> /dev/ttyUSB0/: TOSComm JNI library runtime error: open: Not a directory
> ---------------------------------------------------------------------------------------
> 
> here's the errors I get with the serial@ command (again, same USB port):
> 
> ubuntu at ubuntu:/opt/tinyos-2.x/apps/tests/TestSerial$ 
> serial@/dev/ttyUSB0:micaz
> bash: serial@/dev/ttyUSB0:micaz: No such file or directory
> 
> ---------------------------------------------------------------------------------------
> 
> I suppose I'm too new to this so I haven't the faintest idea where I'm 
> going wrong
> and I am unable to follow the Mote-PC tutorial due to this, however this 
> remains the same even if I use
>  sudo chmod 666 /dev/ttyUSB0
> 
> Leena Kowser Ganguli
> 
>  > Date: Sat, 16 Feb 2008 21:04:10 -0700
>  > From: schip at santafe.edu
>  > To: lk_ganguli at hotmail.com
>  > CC: tinyos-help at millennium.berkeley.edu
>  > Subject: Re: [Tinyos-help] Problems with TestSerial
>  >
>  > OK let's see...
>  > You were able to program the micaz using /dev/ttyUSB0 is that right?
>  > Then what is the exact error printed by Listen when you try to read data?
>  > The error below looks like the result of you typing that text directly to
>  > the bash command prompt.
>  > Please also include the actual commands that you run.
>  > I'm neither on T2 nor linux, but there should be a way to copy/paste
>  > the command window and send it to us....
>  > (Also if you have re-connected the basestation to a different USB port
>  > the name may have changed...that hasn't happened, right?)
>  >
>  > MS
>  >
>  > Leena Ganguli wrote:
>  > > My apologies for removing the traceback.
>  > > The error was:
>  > >
>  > > bash: serial@/dev/ttyUSB0:micaz: No such file or directory
>  > >
>  > > I am quite sure that the base-station was attached to USB0 (by the 
> way, I'm using a USB to Serial cable), since,
>  > > that is the only one I have been able to use for the motes, and I 
> have checked /dev/ to confirm that...
>  > > Now I'm wondering if something is wrong with my computer 
> itself...if that is the case, then it may be
>  > > easy to solve the problem I guess though I won't be able to test 
> this out on another machine until tomorrow
>  > >
>  > >
>  > > Leena Kowser Ganguli
>  > >
>  > > ----------------------------------------
>  > >> Date: Sat, 16 Feb 2008 18:34:55 -0700
>  > >> From: schip at santafe.edu
>  > >> To: lk_ganguli at hotmail.com
>  > >> CC: tinyos-help at millennium.berkeley.edu
>  > >> Subject: Re: [Tinyos-help] Problems with TestSerial
>  > >>
>  > >> ooh, I see, it's a "command" to the testserial program...hain't 
> never used it...
>  > >>
>  > >> But it sounds like you have the same problem with Listen as well,
>  > >> and kevin has fixed your '/' syntax too....unfortunately you have
>  > >> removed the email traceback and I can't remember what the original
>  > >> error message was. I think it was in the realm of file-not-found...
>  > >> Are you sure that your base-station is attached to USB0? And that
>  > >> is the correct name on your system?
>  > >>
>  > >> MS
>  > >>
>  > >> Leena Ganguli wrote:
>  > >>>> What command are you running to get the bash complaint?
>  > >>>> It looks like the shell wants a file name where you
>  > >>>> have put the serial... string.
>  > >>>>
>  > >>> I am using the command
>  > >>>
>  > >>> serial@/dev/ttyUSB0:micaz
>  > >>>
>  > >>> as described in the Mote to PC tutorial located here:
>  > >>> http://www.tinyos.net/tinyos-2.x/doc/html/tutorial/lesson4.html
>  > >>>
>  > >>> So the file name part doesn't really seem to make any sense...
>  > >>>
>  > >>> Leena Kowser Ganguli
>  > >>> _________________________________________________________________
>  > >>> It's simple! Sell your car for just $30 at CarPoint.com.au
>  > >>> 
> http://a.ninemsn.com.au/b.aspx?URL=http%3A%2F%2Fsecure%2Dau%2Eimrworldwide%2Ecom%2Fcgi%2Dbin%2Fa%2Fci%5F450304%2Fet%5F2%2Fcg%5F801459%2Fpi%5F1004813%2Fai%5F859641&_t=762955845&_r=tig_OCT07&_m=EXT
>  > >> --
>  > >> Platform: WinXP/Cygwin
>  > >> TinyOS version: 1.x, Boomerang
>  > >> Programmer: MIB510
>  > >> Device(s): Mica2, MicaZ, Tmote
>  > >> Sensor board: homebrew
>  > >>
>  > >
>  > > _________________________________________________________________
>  > > It's simple! Sell your car for just $30 at CarPoint.com.au
>  > > 
> http://a.ninemsn.com.au/b.aspx?URL=http%3A%2F%2Fsecure%2Dau%2Eimrworldwide%2Ecom%2Fcgi%2Dbin%2Fa%2Fci%5F450304%2Fet%5F2%2Fcg%5F801459%2Fpi%5F1004813%2Fai%5F859641&_t=762955845&_r=tig_OCT07&_m=EXT
>  >
>  > --
>  > Platform: WinXP/Cygwin
>  > TinyOS version: 1.x, Boomerang
>  > Programmer: MIB510
>  > Device(s): Mica2, MicaZ, Tmote
>  > Sensor board: homebrew
>  >
> 
> ------------------------------------------------------------------------
> Find it at www.seek.com.au Your Future Starts Here. Dream it? Then be 
> it! 
> <http://a.ninemsn.com.au/b.aspx?URL=http%3A%2F%2Fninemsn%2Eseek%2Ecom%2Eau%2F%3Ftracking%3Dsk%3Ahet%3Ask%3Anine%3A0%3Ahot%3Atext&_t=764565661&_r=OCT07_endtext_Future&_m=EXT>

-- 
Platform: WinXP/Cygwin
TinyOS version: 1.x, Boomerang
Programmer: MIB510
Device(s): Mica2, MicaZ, Tmote
Sensor board: homebrew



More information about the Tinyos-help mailing list