[Tinyos-help] DelugeT2 and MIB600, serialforwarder

Vincent Borrel vincent.borrel at lip6.fr
Wed Aug 20 19:09:41 PDT 2008


Hi,

I have been trying to get Deluge T2 to work with an MIB600 programming  
board.

I finally managed to get it to work using a serialforwarder (on  
default port 9002), and adding two modifications:

in $TOSROOT/tinyos-2.x/support/sdk/python/tos.py, I added the timeout  
parameter to SFClient.write()
@line 713
     def write(self, payload, timeout):
instead of
     def write(self, payload):
(hoping it doesn't break havoc, which normally shouldn't)


the python script tos-deluge has also been modified. Here is the diff:

402,403c402,403
<     if sys.argv[2] == 'sf':
<         baudrate = 0
---
 >     if sys.argv[2] in BAUDRATES:
 >         baudrate = BAUDRATES[sys.argv[2]]
405,428c405,417
<       if sys.argv[2] in BAUDRATES:
<           baudrate = BAUDRATES[sys.argv[2]]
<       else:
<           try:
<               baudrate = int(sys.argv[2])
<           except:
<               print "ERROR: Wrong baudrate"
<               sys.exit(-1)
<
<     # Initializes serial or serialforwarder port communication
<     if baudrate == 0:
<       try:
<           s = tos.SFClient(sys.argv[1], 9002)
<           am = tos.AM(s)
<       except:
<           print "ERROR: Unable to initialize network port connection  
to", sys.argv[1]
<           sys.exit(-1)
<     else:
<       try:
<           s = tos.Serial(sys.argv[1], baudrate, flush=True,  
debug=False)
<           am = tos.AM(s)
<       except:
<           print "ERROR: Unable to initialize serial port connection  
to", sys.argv[1]
<           sys.exit(-1)
---
 >         try:
 >             baudrate = int(sys.argv[2])
 >         except:
 >             print "ERROR: Wrong baudrate"
 >             sys.exit(-1)
 >
 >     # Initializes serial port communication
 >     try:
 >         s = tos.Serial(sys.argv[1], baudrate, flush=True,  
debug=False)
 >         am = tos.AM(s)
 >     except:
 >         print "ERROR: Unable to initialize serial port connection  
to", sys.argv[1]
 >         sys.exit(-1)

I hope this can be useful to the community.

Vincent.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://www.millennium.berkeley.edu/pipermail/tinyos-help/attachments/20080821/b7ba0ff2/attachment.htm 


More information about the Tinyos-help mailing list