Assumptions:
- Environment used is: TinyOS 2.1.0 with Ubuntu
- Knowledge to compile "BaseStation" application (coming with TinyOS) with a modification in Makefile : CFLAGS += - TOSH_DATA_LENGTH
- Basic understanding of file operations in Java
- No other nodes are in the vicinity which are transmitting data at that time
- Run SerialForwarder with Java applications in TinyOS
- Transfer is only for "text files"
Steps:
General
- Download the code from here
- Install BaseStation in two motes
- Put one mote in computer 1 and other in computer 2.
- Run the SerialForwarder
Sender /Receiver
- ECopy the FileSender folder
- Open a shell, navigate to this above folder
- Type in CLASSPATH=/opt/tinyos-2.1.0/support/sdk/java/tinyos.jar:.
- Type in make
- Type in java FileSender
- Repeat the same with Receiver
- Enter the file name with absolute path and extension at sender side
- Wait for the message "File ended"
PS:
- Please come up with a reliable file transfer (like ftp)
- Please fix this code for any (byte) file instead of text files
- If you do any/both, please upload and post the link here
15 comments:
Sir,Can U give us the changed program that work for audio files rather then txt files....
@n
i do post in my blog 2 encourage beginners !!! if i post what u wan, u miss the fun of learning. Pl try t for urself and pls.. pls blog it for others 2 follow
Hi sir,
Sir actually I know the concept th8 audio file need to be read bitwise rather than txt file...bt still cant implement it....My presentation is on 7th...so pls help me
Sir do we need to instll Basestation in bot the nodes or only in receivor node
@anonyms
i guess you read the line after "download the code from here"
sir I am facing a problem. I have followed all the instructions. At the sender node everything is going fine,we are getting the result "File transfer ended "
we used the command
java FileSender -comm serial@/dev/ttyUSB0:telos
however using the same at the receiver end nothing is happening
java FileReceiver -comm serial@/dev/ttyUSB0:telos
The terminal stays in resynchronization
@Shreyas
I am not sure
Pl run it in two diff machines (if u have not done t like that) and pl use 2 devices.
Just seeking a confirmation, am I correct in assuming that I could use this system to transfer arbitrary binary data *after* suitable encoding (say uuencode/yEnc/base64 etc.)
@ anonims
it could read only text/ascii
Please read the PS part
If you improve this code, please post it back, it will be a great help for others
@Gireesh: Yes, I did get the idea from the "Please fix this code for any (byte) file instead of text files" point in "PS" part. I haven't looked at the code yet, it was just a suggestion from my side.
It's very useful for me.
Thank for sharing!
Sir , Where will the received files be stored?
@nirmala
you can figure it out from the source code
all the best :)
NeaaHi sir,i tried to figure it out but i couldn't get sir.so pls tell me as soon as possible so that i can continue with my work.
@nirmala
I do not know what is so complicated!!!
String fname=msg.getString_message();
fname=fname+".bak";
fpr=new PrintWriter(new FileWriter(fname));
Whatever filename sent will be used and will be stored accordingly
Print the value of fname and you will see
Post a Comment