Download presentation
Presentation is loading. Please wait.
Published byMarcia Nichols Modified over 9 years ago
1
1 Lab1 Objectives Get familiar w/ hardware Mote interface board Mote Mote sensor board Get familiar w/ software MoteWorks Programmer’s notepad Setting up environment
2
2 Crossbow classroom kit Hardware Mote interface board (MIB) a.k.a. programmer, gateway, programming board, PC interface board Mote processor/radio board a.k.a. mote tiny computer w/ radio communication Mote sensor board a.k.a. Data acquisition board (DAQ board) Temperature, light, humidity, … Software MoteWorks
3
3 Crossbow hardware Mote Interface Board (“MIB”) MIB510 MIB520 MIB600 Mote 433MHz Mica2 868/916MHz Mica2 (MPR400CB) 2.4GHz MicaZ Sensor board MTS/MDA series MDA100CB PC
4
4 Hardware we’ll use MIB520 Mote Interface Board (“MIB”) 868/916MHz Mica2 Sensor MDA100CB PC
5
Feb 2007WSN Training: MW Orientation and Configuration 5 MoteWorks Orientation Objectives: Review directory structure MakeXbowlocal and environment customization Lab Blink make command Compiling using Programmer’s Notepad
6
6 What SW Packages Are Provided by MoteWorks? Development Environment Cygwin -- Alternative UI to view and compile code; Programmers Notepad is the main UI MoteConfig 2.0 and OTAP XSniffer Programmer’s Notepad 2 GraphViz 2.6 PuTTY Utilities WinMerge 2.4.6.0 Compilers nesC 1.2 AVR-GCC compiler for Atmel Atmega128 microcontroller GDB debugger and AVR Insight
7
7 Directory Structures Typical default directory: C:\Crossbow\cygwin\opt\MoteWorks doc folder is not there initially. You will create this later.
8
8 Directory Structures C:\Crossbow\cygwin\opt\MoteWorks\apps
9
9 Directory Structures C:\Crossbow\cygwin\opt\MoteWorks\tools
10
10 Directory Structures C:\Crossbow\cygwin\opt\MoteWorks\tos
11
Feb 2007WSN Training: MW Orientation and Configuration 11 MoteWorks Orientation Objectives Review directory structure MakeXbowlocal and environment customization Lab Blink make command Compiling using Cygwin or Programmer’s Notepad
12
12 Customization: MakeXbowlocal What is MakeXbowlocal? A file that contains common settings to minimize keyboard entry and typos during compiling and downloading What will be used to edit the MakeXbowlocal file? Programmers Notepad 2 Where is it? :\Crossbow\cygwin\opt\MoteWorks\apps Open a Programmers Notepad 2 window now
13
13 Customization: MakeXbowlocal What can be defined in MakeXbowlocal? 1.Programming board settings COM port (MIB510 or MIB520) or IP address (MIB600) of the programming board 2.Radio settings Frequency band AND channel Radio transmit (TX) output power 3.Group ID Nodes must share a common group ID in order to network with each other
14
14 Review: What MIB Board Do I Have? MIB520 MIB600 MIB510
15
15 MakeXbowlocal: Programming Board 1.Uncomment one of the following lines Line 14 if using a MIB510 Line 15 if using a MIB520 Line 16 if using a MIB600 (a.k.a., eprb ) 2.Uncomment and edit for COM port of the MIB510/MIB520 or IP address of the MIB600
16
16 MakeXbowlocal: MIB520 configuration Must install the MIB520’s USB driver prior to use FTDI will install 4 different drivers…be patient Run FTClean prior to driver’s installation (see next slide) Example definition (in the MakeXbowlocal file) for MIB520 #DEFAULT_PROGRAM=mib510 DEFAULT_PROGRAM=mib520 #DEFAULT_PROGRAM=eprb #MIB510=COM1 MIB520=com6 #EPRB=10.1.1.238 Lines 14 through 19 of Makexbowlocal NOTE: you should write com6 (instead of COM6) 15 18 This number is the lower of the two COM ports assigned to the MIB520
17
17 MIB520 Notes (Review) USB port drivers (from FTDI) are in the MoteWorks CD The MIB520 USB drivers creates two sequentially numbered virtual COM ports COM is for programming and downloading code in the Mote COM is for PC to MIB520 data communications such as when running MoteView If the USB driver installed virtual COM port drivers greater than 16, you should uninstall and clean the COM port registries Use the FTClean utility on the MoteWorks CD
18
18 Group ID versus Node ID? 915 MICA2 Channel 00 Group ID = 12 915 MICA2 Channel 00 Group ID = 13 1 2 3 4 5 5 4 3 2 1 Node ID
19
19 MakeXbowlocal: Group and Node IDs Nodes communicate only within a common group ID Values can be in either decimal or hexadecimal Default value is 0x7D (that is, decimal 125) Nodes can be assigned almost any 2-byte number (that is, from 0 to 65535) Exceptions: Don’t use the reserved broadcast or node addresses Broadcast: 0xFFFF (65535) UART Channel: 0x007E (126)
20
20 MakeXbowlocal: Group ID Editing Example: Line 30 shown uncommented and edited with group ID = 12
21
21 What RF Band is My Mote? Look at the number on the label with units in “MHZ” or “GHZ” 433 MHz Mica2 868/916 MHz Mica2 2.4 GHz MicaZ
22
22 Editing the Makexbowlocal File (2 of 2) For MICA2 users, check three settings 1.RADIO_CLASS and RADIO_CHANNEL Uncomment one of 55, 93, 110, or 128 2.RADIO_CHANNEL Uncomment one of the RADIO_CHANNEL lines in the appropriate RADIO_CLASS section 3.Radio TX Power Uncomment one line between 153 and 158
23
23 Example: Note lines 55 and 57 Setting the Channel for the MICA2 in the 902 MHz to 928 MHz band
24
24 MakeXbowlocal: MICA2, RF Transmit Power Example: MICA2 set to transmit at RADIO_POWER=0x02 or -20 dBm TX output power options for 868/916 MHz band MICA2 TX output power options for 433 MHz band MICA2
25
25 Before We Go On Make sure that the changes in the MakeXbowlocal file are based on your Group ID Type of Mote Interface Board (MIB510, MIB520, or MIB600) COM port Mote (Mica2 or MicaZ). RADIO CLASS, RF CHANNEL, TX POWER All other lines else should be comment out with a # symbol
26
Feb 2007WSN Training: MW Orientation and Configuration 26 MoteWorks Orientation Objectives Review directory structure MakeXbowlocal and environment customization Lab Blink make command Compiling using Programmer’s Notepad 2 (PN2 on your desktop)
27
Feb 2007WSN Training: MW Orientation and Configuration 27 Lab 1: Compile and Installing Firmware to a Mote Objectives Build and install your first MoteWorks application Verify your MoteWorks compiler tools and programming environment Get a little more familiar with the hardware
28
28 Lab 1 – Materials Needed Mote (“MPR4x0” or “MPR2400”) One MICA2, MICAz with batteries installed Mote Interface Board (“MIB”) One of MIB510, MIB520, or MIB600 All associated cabling for data and power IP or COM port settings determined Appropriate drivers installed (if needed) Your PC with MoteWorks installed
29
29 Lab 1: Setup Gateway and Mote 1.Connect your MIB to your PC with the appropriate cabling. Check that the MIB is powered. 2. When using a MIB520, power is supplied from PC USB port. Turn the power switch on mote to OFF.
30
30 Step 2b: Attaching Mote to MIB520 Board MICA2/z Mote USB cable – power and communication NOTE: mote should be firmly seated in MIB520.
31
31 Lab: Compile and Download with Programmers Notepad 3.Open a Programmers Notepad window and navigate to the Blink directory: /opt/MoteWorks/apps/general/Blink 4.Click on the Blink.nc or BlinkM.nc file 5. If MICA2: Select tools > make mica2 6.To install, click on tools > shell. In the dialog box type make reinstall is either mica2 or micaz
32
32 2. View compiler output 1. Choose shell then type in make command then hit “Enter” Programmers Notepad 2 Interface After compile, click on Tools > shell then type in the appropriate make command (see previous slide)
33
33 TinyOS make Command (1 of 3) To build an TinyOS application we use make to Configure top-level nesC application with user specific options To find options and their syntax, look under the C:\Crossbow\cygwin\opt\MoteWorks\make\avr subdirectory Run the nesC precompiler to convert nesC configurations and modules to C. Compile C code to executable binary for target platform Install code into Mote The make command can be typed or issued from Programmers Notepad 2 Can also be issued from the same location within a Cygwin window
34
34 TinyOS make Command (2 of 3) Makefile in MoteWorks\make\scripts Makerules in MoteWorks\make\scripts MakeXbowlocal ncc nesC precompiler avr-gcc C cross compiler-linker UISP upload code to Mote TinyOS code image in Mote TinyOS application source files make install … Makedefaults
35
35 TinyOS make Command (3 of 3) make command summary make re|install,, mica2, or micaz, or mica2dot mib510, or mib520, or eprb (= mib600) com# where # = COM port where your MIB510 is attached or the lower of the two virtual COM ports assigned by the MIB520 USB driver IP address as determined or assigned by using the Lantronix’s DeviceInstaller software reinstall, = Download code that is already compiled with node ID = n install, = compile then download code to the Mote with node ID = n Example: make mica2 install,1 mib520,com6
36
36 Lab Step 3: Compile for nescdoc In PN2 click on Tools > shell Type make docs Open a Web UI (Internet Explorer, Mozilla Firefox) Browse to the folder in C:\crossbow\cygwin\opt\MoteWorks\docs\nesdoc\ Open allfiles_f.html. Select Components. Click on the Blink hyperlink
37
37 GraphViz Help A requires interface I, B provides I, and A and B are wired together. C and D both require or both provide J. The direction of the arrow indicates that the original wiring is "C = D". E requires function f, and F provides function
38
38 What you need to do Familiarize yourself with hardware Review directory structure of MoteWorks Familiarize yourself with Programmers Notepad Using Programmer’s Notepad to Customize MakeXbowlocal (use the same PC for the rest of the semester) Compile & download Blink Make sure Blink works Finish lab1 report
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.