A sensor network for fire detection.
This is a project of a network of nodes to detect a fire in a forest.
- TinyOS 2.1.2: This can be a little tricky to install. It's easier on Ubuntu. But anyway, you have to pollute your OS with a lot of trash. It gets worst if you do not use Ubuntu. For instance, if you use Mac OS or even worst, Windows, you should definitely forget this option and go for Vagrant way
If you choose to use vagrant, there is a Vagrantfile with everything that is needed to work with TinyOs.
So, you only need to boot it:
vagrant up
There is a Makefile in the project's root which will ssh to vagrant environment and run the commands inside the virtual machine without the need of you ssh to the VM first and issue each command.
To build it for TOSSIM, just run:
make tossim
To build for micaz motes you can run:
make micaz
After you are done, you can shutdown the vagrant VM.
vagrant halt
If you choose to not use vagrant and have everything installed on your machine (can be an interesting option if you want to develop for TinyOS using a Raspberry Pi ), you have to go to src directory:
cd src/
And run the make targets available in the Makefile there.
To build it for TOSSIM just run:
make micaz sim
To build for micaz motes run:
make micaz
There is a simulator, written in python, that allow you to simulate any kind of network and a lot of different situations
If you are using vagrant you can use the Makefile in the project's root.
make run
If you were brave enough to have everything installed on your machine you have to go to src directory
cd src/
and run the simulator
python simulator.py
After you start the simulator a command line application will show up and will be waiting for your commands.
To know all available commands you can just type:
help
and press Enter.
To exit from the simulator just type:
exit
and press Enter
load topology <filename>
This file is just a text file where each line is in the format
<src> <dest> <gain>
which means that node can send messages to node with gain
You have topology files examples in topologies directory
load noise <filename>
File with name filename is a text file where each line is the value of the signal's strength. You have an example of a "dummy" noise model in noise directory.
boot
All nodes will become in state ON
print topology
print state
For each node, the state will be ON/OFF
print routing
For each sensor node, it prints which routing node it is using to send its messages
print rank
print server
run <events>
The simulator will run events in the network. The output depends on "dbg" statements in the code
on <node>
It turns on the node with the given id
off <node>
It turns off the node with the given id. This is useful to test the fault-tolerance of the sensor network
var <node> <variable>
debug enable <channel>
Depends on "dbg" statements in the code
debug disable <channel>
Depends on "dbg" statements in the code
debug
script <filename>
The file is just a text file where each line is one of the available commands described so far.
There are examples of script files in scripts directory. If you put your script files in that directory the filename you provide does not need to include the complete path. By default, when the file is not found it will try to find it in scripts directory.
For instance, to execute the script with name "script.txt" inside scripts directory just issue the command:
script script.txt
stop
This command is useful in script files when you want to break the simulation in multiple steps instead of getting all the output at once.