Java程序辅导

C C++ Java Python Processing编程在线培训 程序编写 软件开发 视频讲解

客服在线QQ:2653320439 微信:ittutor Email:itutor@qq.com
wx: cjtutor
QQ: 2653320439
Hardware Lab-1: TinyOS Setup – Duration  2 weeks 
 
TinyOS is the operating environment that you will be using for your project and details on how to 
install TinyOS can be found at www.tinyos.net .The operating environment is compatible with 
both windows & Linux. 
 
Basic Setup 
 
1)      Install Hardware Drivers: The drivers for the hardware must be 
installed before using the hardware.  I was able to install them using a 
Quick Start Guide located on the provided Moteview CD.  The drivers are 
located on this CD and you should install these manually when prompted by Windows 
rather than allowing Windows to search for them. 
 
2)      Program Motes: The motes will not be programmed when you receive 
them.  The guide for programming the motes is located here: 
http://www.xbow.com/Support/Support_pdf_files/Mote_Program_Guide.pdf 
You will need the Moteview Software for this step.  This software can be 
installed from the Moteview CD or from 
http://www.xbow.com/Support/Support_files/MoteView_2.0.F_Setup.zip 
 
3)      Install TinyOS 1.1 Package: There is a full package that can be 
installed that will contain Cygwin, TinyOS and Graphviz.  This installation 
is on a separate Crossbow TinyOS Support CD, or you can install it from here: 
http://www.tinyos.net/dist-1.1.0/tinyos/windows/tinyos-1.1.11-3is.exe 
 
4)      Modify Motelist Code: One problem exist 
with the Motelist command inside of TinyOS giving an error and not 
finding the motes with PID 6001.  This is because the PID's are actually 
6010 and this number is hard coded into the command.  After installing the 
TinyOS package, navigate to \cygwin\opt\tinyos-1.x\tools\src\motelist, where the default 
 is C:\Program Files\UCB\.  Inside of this folder 
you will find motelist-win32.cpp.  Do a find a replace in this code, 
replacing 6001 with 6010.  After saving this file, open up Cygwin and 
navigate to this directory using cd commands.  Once inside this directory, 
type "make install."  This should rebuild the motelist command.  Attempt 
typing "motelist" after this process.  The motes should be listed in the 
table if all configurations are correct. 
 
Additional Troubleshooting and Setup Options 
 
 
1. Read the attached PDF files for a general background on Tinyos and Mica 2 motes 
 
2. Go to http://www.tinyos.net/download.html, Install TinyOS on your computer 
 
3. Verify that your System & Hardware are working using the link below 
http://www.tinyos.net/tinyos-.x/doc/tutorial/verifyhw.html 
 
4. The following web page has excellent tutorials to give you an overview of TinyOS and 
the NesC compiler with which you program the motes 
http://www.tinyos.net/tinyos-1.x/doc/tutorial/ 
 
5. Please go through all of these tutorial carefully and try to test some of the sample 
lessons that are provided such as Blink and Communication between a pair of nodes 
 
 
 
Helpful Hints on TinyOS– Please Read before proceeding! 
 
o Start from www.tinyos.net 
o Steps: 
o Install Cygwin if you are using Windows 
o Download & setup TinyOS 1.1.14 
 Rpm 
 Java SDK & javacomm 
o Go to $TOSROOT/apps/Blink and try: make pc OR make mica2dot (note: 
you may need to change “mica2dot” to “mica2” since we use mica2 
motes; below the same). 
o Attach mote & programming board 
o Try: make mica2dot install mib510:/dev/ttyS0 
o Use www.google.com for more references 
o $TOSROOT/apps: Toy/Real applications 
o HelloWorld: $TOSROOT/apps/Blink 
o Useful to assignment: $TOSROOT/apps/TestTimeStamping 
o $TOSROOT/tos: Main directory of TinyOS 
o $TOSROOT/tos/interface: definition of interfaces 
 Timer, TimeStamping, SendMsg, ReceiveMsg, GenericComm 
o $TOSROOT/tos/platform: hardware specific components Ex: Radio 
o $TOSROOT/tos/system: Standard components Ex: TimerC, LedsC 
 Look in to this first when looking for components and then in to 
platform 
o $TOSROOT/tos/types: data structures, Ex: TOS_Msg 
o $TOSROOT/tos/lib: MulthihopRouting, Filesystem … 
o $TOSROOT/tools: external interface and tools like matlab, java, c 
o Communication between pc & mote 
o $TOSROOT/contrib: third party projects  
 
 
----------------------------------    
More hints on TinyOS installation: 
 
Note: The entire process is lengthy, so be patient. If there are other TinyOS or Cygwin 
installations present, they must be removed prior to continuing, as problems will arise 
otherwise. The below instructions assume that you have installed TinyOS using default 
options. While the installation takes place take a moment to browse the Crossbow 
directory and familiarize yourself with the documentation present there. 
 
1.  In order for the operating environment to properly interact with some of the 
applications provided by Crossbow, an update of TinyOS must be performed. Browse to 
the TinyOS Updates directory and copy the file named tinyos-1.1.7July2004cvs-
1.cygwin.noarch.rpm to the TinyOS directory of your choice (example 
C:\tinyos\cygwin\opt\tinyos-1.x). 
 
2  Using the Cygwin window browse to the directory where the above file was copied to 
and install the update by utilizing the following command 
 
rpm -–force -–ignoreos –Uvh tinyos-1.1.7July2004cvs-1.cygwin.noarch.rpm 
 
Note: TinyOS documentation can be accessed by opening the below file. Try to 
familiarize yourself with the information presented there. 
 
C:\tinyos\cygwin\opt\tinyos-1.x\doc\index.html 
 
3. The TinyOS Update directory also contains an archive file named Xbow.tgz.  Copy 
that file to  C:\tinyos\cygwin\opt\tinyos-1.x\contrib , unzip and untar it.  
This operation should yield a new directory named xbow/ . Within this directory reside 
applications developed and thoroughly tested by the hardware manufacturer Crossbow, 
some additional documentation is also present.  
 
Hint: If you are unfamiliar with how to unzip and untar files in the Linux environment, 
the same result can be achieved with WinZip. 
 
4. To verify that all tools needed by the TinyOS development environment have 
installed properly using Cygwin change to the /opt/tinyos-1.x/tools/scripts directory 
and execute the below command: 
 
toscheck 
 
Upon successful completion the final line of this script should read: 
 
toscheck completed without error 
 
Note: If there are any errors reported they must be resolved before proceeding. Try the 
TinyOS documentation or the internet for more help. 
 
5. To aid in the process of navigating between commonly used directories it is 
recommended that you setup the following aliases: 
 
alias cdtinyos=”cd c:/tinyos/cygwin/opt/tinyos-1.x “ 
alias cdjava=”cd c:/tinyos/cygwin/opt/tinyos-1.x/tools/java “ 
alias cdxbow=” cd c:/tinyos/cygwin/opt/tinyos-1.x/contrib/xbow “ 
 
The profile settings can be altered by including the above lines 
at the bottom of the below file: 
 
/etc/profile 
 
Hint: Use Wordpad instead of vi for quicker editing. 
 
6. If all the above steps have been successfully completed you should now be ready for 
the remainder of this course. Feel free to explore and familiarize yourself with the 
environment. The internet is an excellent recourse for gaining additional information 
about sensor networks; http://www.tinyos.net/  and http://www.xbow.com/  are two of 
the best places to start. 
 
  
Hardware Lab 1 – TinyOS Setup 
Laboratory Report requirements 
Instructions 
The questions are to be answered based on your lab experience and are due 1 
week after the scheduled lab time. The report questions must be accurately 
answered, typed, diagrams computer generated and this template used. Include 
the questions on your report. 
 
1. What is the IEEE standard that defines the MAC and physical layer for wireless 
sensor networks? 
 
2. What is the manufacturer, model number and operating frequency of the 
equipment that will be used through this course? (list all) 
 
3. What sort of information can one obtain when accessing the following file? 
 
C:\tinyos\cygwin\opt\tinyos-1.x\doc\index.html 
 
Obtain a screenshot of the above and paste it in your report. 
 
 4. What is the purpose of the toscheck command? Provide a screenshot of the  
results of the executing this action. 
 
 
5. Were there any errors reported when the above command was executed? If 
so, what were they and what did you do to resolve them? 
 
 
6. While the above procedure provides one kind of check of the operating 
environment, what other check(s) can one perform to ensure proper operation 
and what applications are associated with these? 
 
 
 
7. Find a command that will display the version of Cygwin you are using and 
provide both the command and the result below.  
 
 
8. What is the Windows directory that corresponds to the root directory of 
Cygwin?