SADUM Installation
Project files
Download the project files Sadum Zip
Sensor Network
First make sure you have the TinyOS installed on your system.
After unzipping the Project file, you will find inside TinyOS/apps folder, two folders: SadumSinkNode and SadumNetworkNode.
Inside this folder your can find all the files correspondent to the sink node. The sink node must be connected to the Gateway. To compile this use the following commands:
make <Platform>
or if you installed through the installation found here tinyosmake <platform>
then to install it on the node type this:make <Platform> reinstall,<Node_ID> <programmer>,<communication_port>
or
tinyosmote <Platform> <node_ID> <USB_Port>
The <Node_ID> field for the sink node must always be 0, the <programmer> can be mib510 or mib520, and the <communication_port> must be the communication path in which the programmer is connected to, ex: /dev/ttyUSB0 , ... .
Inside this folder you have all the files for the network nodes.
For this nodes use the commands applied for the sink node.
The <Node_ID> field for this nodes must always be different that 0 and different from each other.
Inside this folder you have a script called sadumgen.sh, that helps you generate a file to be compiled and installed in a node (excluding the sink node).
Run the script, inside the SadumNetworkNode folder, like this:
./sadumgen.sh <file>
The <file> field is a file that contains commands to generate the program to be compiled.
Inside this file you insert the commands to add components to the nodes.
Components are functionalities that the nodes will have, and will be available in the interface. This functionalities are for example Leds, Radio, Sensor or Constants.
The file should have one command per line. like this:
RadioReceive
int8
RedLed
GreenLed
YellowLed
timermilli
Int16
Next are the available commands:
NodeJS and NPM installation
The Gateway and the Server both use NodeJS JavaScript framework and the NPM package manager for NodeJS, so first you have to install it.
It can be installed in two ways.
If the Gateway/Server will run on an UDOO or a Raspberry Pi platform, go to the UDOO folder inside the Project folder and run the installudoo.sh or the installudooprecompiled.sh
The first script will take longer to install.
If the Gateway/Server will run on a computer, go inside the Project file and type:
make installNodeAndNPM
Gateway
To install go inside the Project folder and type:
make all
Go inside the Gateway folder and change the file: gateway.json
Inside this file you can configure a few parameters related to the Gateway.
In most cases, you just have to change the serveraddress and the deviceport parameters. The first is the IP is the Server IP to which the Gateway will connect. For the second parameter put the full pass to the serial port like: "/dev/ttyUSB1"
Inside the Gateway folder you can also change the gateway_info.json file.
In this file you can change the title and the Gateway description that will be displayed in the interface.
To run go inside the Gateway folder and type:
node gateways.js
After the Gateway initialization you should see the Sink Node blinking, if this does not happen it means that you do not have the Serial communication ports permission.
To change the permission type:
sudo chmod 666 <Serial_Port_Path>
or if you are using the USB type:
tinyosusbpermission
Server
To install go inside the Project folder and type:
make all
and then go Inside the Server folder and type:
gulp deploy
Go inside the Server/public/javascript folder and change the file: client_to_server_connection.json, and change:
The server_ip is the IP of the Server, to which the Interface will connect.
Note: each time you change this run gulp all
command.
After the server is initialized go to a browser and in the link insert your Server IP.
If everything is correct you will see something like this:

Adding New Components
To add new components is not difficult, but its a process some how long. Its a process of trail and error.
New components must be added to TinyOS/apps/SadumNetworkNode/lib folder. Add a new folder in with a lower case name. Then go to the Makefile in TinyOS/apps/SadumNetworkNode/ folder, open it and add a new line of PFLAGS with the new created folder name, like:
PFLAGS += -Ilib/<Name_of_the_new_folder>
After this inside the new folder, create two files named with the new component type with the suffix C and P. You can see examples of other components inside TinyOS/apps/SadumNetworkNode/lib folder.
After the new name is defined, go and add a new switch case in the sadumgen.sh file inside the folder TinyOS/apps/SadumNetworkNode/, to the casePrint function, like this:
@@"Demultiplexer"|"demultiplexer"|"DEMULTIPLEXER") echo "Demultiplexer component found"
echo " ${COMPONENTSPREFIX}Demultiplexer${COMPONENTSUFFIX}${COMPONENT}$2;" >> SadumNodeApp.nc COMPONENTNAME="${COMPONENT}$2" printwiring $COMPONENTNAME ;;@@
Change the highlighted words with the new name. After this, the new component can be added in a file, and be generated with the sadumgen.sh script.
After understanding how a component works (check examples inside TinyOS/apps/SadumNetworkNode/lib), its time to define the new component enum type, and add it to the ComponentType enum, in the file SadumGenericComponent.h inside the TinyOS/apps/SadumNetworkNode/lib/sadumgenericcomponent folder. If the new component has more than four ports, a new enum type must be added to the NumOFPorts, inside the same file.