Several examples can be found in ~/run/examples. This is a symbolic link to the example directory. To run these examples, please copy all files to your own experiment directory. The list below gives a high level introduction to each of the examples.
Manually sets all channels to 70 dB of loss. All nodes should be able to communicate with each other in this case.
Manually sets all channels to infinite attenuation. No wireless communication is possible.
Shows how to manually control channels in the configuration file. No GUI is used in this example.
Defines a simple route for node movement.
Demonstrates replay of a recorded node movement and RSSI trace.
A simple script that spawns remote a process on a remote node.
Hello World for the emulator's programmatic interface. This code executes entirely on the control node.
A simple program that spawns remote a process on a remote node.
Shows how to programatically control channels in conjunction with running remote applications. This is useful for setting the channel conditions for a variety of configurations, and running a test for each.
Demonstrates listening to waypoint events generated when a node navigates a route.
Demonstrates listening to position events generated when a node moves.
Demonstrates how to use a directional antenna
We can emulate directional antennas on the Emulator. You can specify the default type of antenna to use in the xml file (currently we only support Yagi antennas with a beamwidth of about 60 degrees):
1. In the xml file, specify the type of antenna you want to use for each node. For Yagi antennas, using "Yagi", and "isotropic" for omnidirectional antannas:
<node name="nodew1" color="darkRed"> <nic> <antenna> <type>Yagi</type> <txAmpGain>0</txAmpGain> </antenna> </nic> </node> <node name="nodew2" color="darkGreen"> <nic> <antenna> <type>isotropic</type> <txAmpGain>0</txAmpGain> </antenna> </nic> </node>
2. You are allowed to switch between isotropic antenna and yagi antenna in the run time. This can be achieved by using the changeAntenna() method for individual emuNode:
Here is one example experiment that uses a Yagi Antenna xml file and corresponding java code. More details on how to manipulate the orientation of the antenna/node can be found on the Orientation page with more examples.
Includes scripts and user codes for all experiments introduced in the Tutorial.