I have an autodetect application that does this, but I'm not able to share
it immediately.  I may be able to post this in the future, though, if
there's interest.  

In the meantime, I can describe how it works so you can try to implement it
yourself if you want.

This system requires a component to be installed on the mote and it works by
the computer polling the mote.  On the application on the mote, wire up the
AutoDetect component to Main.StdControl - that's all that's required.  This
autodetect component that sits on the mote detects a certain AM type message
from the UART.  When it receives the message, it responds with a packet
describing its mote type, application id, etc.  The mote type is setup
automatically through the platforms directory - each different platform
implements a PlatformType module that responds with a different number,
corresponding to the type of mote.

On the computer end, the Java application first finds all available COM
ports on the computer.  It traverses through the COM ports one by one,
sending a message to each.  There could be a problem here if there really is
a piece of hardware on the other end of that com ports that does something
incorrect with the incoming data, but this does not address that issue.  For
each COM port, the Java application sends several messages, adjusting the
baud rate and mote type for each one.  It waits for about a second on for
each message it sends for a response.  When it hears a response, the
response comes from the mote in the form of that packet described above.  At
that point, your computer knows the COM port to use, the mote type, the baud
rate, and the application ID (if defined).  To speed up the autodetection
process on the next run (because 1 second per possible mote type, per com
port takes awhile), the Java application records the valid information in a
file.  The next time it tries to autodetect the mote, it traverses and
attempts the latest connection settings on file first before trying the
manual detection process.  

The serial forwarder was also modified for this application so it doesn't
display errors, and also it remains open once the valid connection is found.

I have successfully tested this with mica2, mica2dot, micaz, and telosb
motes connected to various COM ports on the computer.

Now that I described how it works, is this the type of functionality you're
looking for?

David



-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Gelu
Contiu
Sent: Thursday, March 30, 2006 3:29 AM
To: tinyos-help
Subject: [Tinyos-help] Java and info about the connected motes


Hi all,

  Does anyone know how to detect the connected motes
to the pc (through usb) by using JAVA ? If detected, I
need to know the COM and the type ( tmote, mica... ).
Basicly, I need the same info that "motelist"
provides, but using java to retrieve it.

Thanks,
Gelu

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
_______________________________________________
Tinyos-help mailing list
[email protected]
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help


_______________________________________________
Tinyos-help mailing list
[email protected]
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to