- Computer 1: Has 2 motes connected. We’ll program one mote as the beacon and the other as a receiver.
- Computer 2: Has 1 mote (receiver).
- Computer 3: Has 1 mote (receiver).
-
Connect the motes to the computer.
Run:
motelist
to see the list of connected motes and note their device names (for example:
/dev/ttyUSB0,/dev/ttyUSB1, etc.). -
Set permissions on the serial devices (if needed):
For each device you plan to use, run:
sudo chmod 777 /dev/ttyUSB0
(Replace
/dev/ttyUSB0with the appropriate device file for that computer.)
-
Change into the beacon project directory:
(Assuming you’ve created a folder called
RBSBeaconwith the following files:RBS.h,RBSBeaconAppC.nc,RBSBeaconC.nc, and aMakefile.)cd /path/to/RBSBeacon -
Compile the beacon application for the TelosB platform:
make telosb
-
Install (flash) the beacon application to the mote on, say,
/dev/ttyUSB0:make telosb install,ttyUSB0
Note: If you have more than one mote connected, verify the device name with
motelist.
-
Change into the receiver project directory:
(Assuming you have a folder called
RBSReceiverwith the files:RBS.h,RBSReceiverAppC.nc,RBSReceiverC.nc, and aMakefile.)cd /path/to/RBSReceiver -
Compile the receiver application for TelosB:
make telosb
-
Install the receiver application to the other mote on, for example,
/dev/ttyUSB1:make telosb install,ttyUSB1
- Change into the receiver project directory:
cd /path/to/RBSReceiver - Compile the receiver application:
make telosb
- Install the receiver application to the mote (typically on
/dev/ttyUSB0on this computer):make telosb install,ttyUSB0
- Change into the receiver project directory:
cd /path/to/RBSReceiver - Compile the receiver application:
make telosb
- Install the receiver application to the mote (again, likely
/dev/ttyUSB0on this computer):make telosb install,ttyUSB0
-
Use a Serial Debug Tool:
Open a serial monitor (for example, moseria) on the receiver motes’ ports to see debug output.
The receiver application uses the
dbg()function (via the dbg.h interface) to print the calculated offset. You should see output similar to:RBSReceiver: Offset: 15 mswhich indicates the difference between the local time and the beacon’s broadcast time.
-
Verify Synchronization:
When the beacon mote’s timer fires (every 1 second in our example), it broadcasts its current time. Each receiver then reads its own clock and calculates the offset. Adjust your setup if you want to see different timing behavior.
- The build system automatically creates a
build/telosbfolder (with files likemain.exe,main.ihex, andtos_image.xml) when you run themakecommand. You do not need to create these manually.