Difference between revisions of "MansOS PC Emulation"
(→Step 1: Create a virtual "cloud") |
|||
(3 intermediate revisions by the same user not shown) | |||
Line 9: | Line 9: | ||
make |
make |
||
To run it: |
To run it after compilation: |
||
make run |
make run |
||
Line 19: | Line 19: | ||
== Step 2: Connect virtual motes to the cloud == |
== Step 2: Connect virtual motes to the cloud == |
||
Compile your mote application for the pc platform: |
|||
TODO |
|||
make pc |
|||
After compilation run the virtual mote: |
|||
make pc run |
|||
It will automatically connect to the virtual cloud and exchange messages with it, if radio communication is used in the application. |
|||
== Example == |
|||
To see this method in action, try <code>mansos/apps/demo/RadouCountToLeds</code> application, which sends counter over radio periodically and displays received counter on LEDs and serial port (print onto the screen on PC platform). |
Latest revision as of 10:32, 9 January 2012
Before deploying sensor network application on real motes, MansOS allows program debugging on PC platform. Virtual mote network can be simulated.
Two steps are required, described in the following sections
Step 1: Create a virtual "cloud"
To emulate radio communication medium, a virtual "cloud" proxy program is available under mansos/pc/proxy
. To compile it:
cd mansos/pc/proxy make
To run it after compilation:
make run
It acts as a TCP server and opens socket for incoming connections. Administrator permissions may be required for it.
The virtual cloud acts as a hub - it forwards a packet received from a virtual mote to all other virtual motes connected to the cloud.
This proxy program must be running to allow virtual mote communication. It also displays some debug information about traveling packets. It can be terminated by pressing Ctrl+C.
Step 2: Connect virtual motes to the cloud
Compile your mote application for the pc platform:
make pc
After compilation run the virtual mote:
make pc run
It will automatically connect to the virtual cloud and exchange messages with it, if radio communication is used in the application.
Example
To see this method in action, try mansos/apps/demo/RadouCountToLeds
application, which sends counter over radio periodically and displays received counter on LEDs and serial port (print onto the screen on PC platform).