<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://wsn.cse.wustl.edu/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Guillaume</id>
	<title>Cyber-Physical Systems Laboratory - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="http://wsn.cse.wustl.edu/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Guillaume"/>
	<link rel="alternate" type="text/html" href="http://wsn.cse.wustl.edu/index.php?title=Special:Contributions/Guillaume"/>
	<updated>2026-11-16T03:00:42Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.34.4</generator>
	<entry>
		<id>http://wsn.cse.wustl.edu/index.php?title=File:Gv_ms_report.pdf&amp;diff=4067</id>
		<title>File:Gv ms report.pdf</title>
		<link rel="alternate" type="text/html" href="http://wsn.cse.wustl.edu/index.php?title=File:Gv_ms_report.pdf&amp;diff=4067"/>
		<updated>2017-05-03T16:27:16Z</updated>

		<summary type="html">&lt;p&gt;Guillaume: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Guillaume</name></author>
		
	</entry>
	<entry>
		<id>http://wsn.cse.wustl.edu/index.php?title=Contikios&amp;diff=4066</id>
		<title>Contikios</title>
		<link rel="alternate" type="text/html" href="http://wsn.cse.wustl.edu/index.php?title=Contikios&amp;diff=4066"/>
		<updated>2017-05-03T16:26:24Z</updated>

		<summary type="html">&lt;p&gt;Guillaume: /* Download */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Tutorials ==&lt;br /&gt;
&lt;br /&gt;
* [[Working environment setup for Contiki OS]]&lt;br /&gt;
* [[Contiki first project]]&lt;br /&gt;
* [[Contiki - Understanding the code]]&lt;br /&gt;
* Contiki - Cooja emulator: The official website of ContikiOS offers a complete step by step tutorial for the Cooja emulator: [http://www.contiki-os.org/start.html#start-cooja Cooja]&lt;br /&gt;
* [[Contiki - 6TiSCH - RPL code HOWTO]]&lt;br /&gt;
&lt;br /&gt;
== Download ==&lt;br /&gt;
&lt;br /&gt;
Complete example of 6TiSCH communication between nodes (tested on TelosB, the Testbed and Cooja)&lt;br /&gt;
* [[File:6TiSCH_-_RPL_-_UDP_Transmitter_and_Receiver.tar.gz]]&lt;br /&gt;
&lt;br /&gt;
App you will need to replace printf. Add the lprintsky folder into the apps of ContikiOS.&lt;br /&gt;
* [[file:lprintsky.tar.gz]]&lt;br /&gt;
&lt;br /&gt;
This is the contiki version I used in case you have issues compiling the 6TiSCH code:&lt;br /&gt;
* [[file:contiki.tar.gz]]&lt;br /&gt;
&lt;br /&gt;
Guillaume VALENTIS MS Report:&lt;br /&gt;
* [[file:gv_ms_report.pdf]]&lt;/div&gt;</summary>
		<author><name>Guillaume</name></author>
		
	</entry>
	<entry>
		<id>http://wsn.cse.wustl.edu/index.php?title=Contikios&amp;diff=4065</id>
		<title>Contikios</title>
		<link rel="alternate" type="text/html" href="http://wsn.cse.wustl.edu/index.php?title=Contikios&amp;diff=4065"/>
		<updated>2017-05-03T15:28:18Z</updated>

		<summary type="html">&lt;p&gt;Guillaume: Created page with &amp;quot;== Tutorials ==  * Working environment setup for Contiki OS * Contiki first project * Contiki - Understanding the code * Contiki - Cooja emulator: The official web...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Tutorials ==&lt;br /&gt;
&lt;br /&gt;
* [[Working environment setup for Contiki OS]]&lt;br /&gt;
* [[Contiki first project]]&lt;br /&gt;
* [[Contiki - Understanding the code]]&lt;br /&gt;
* Contiki - Cooja emulator: The official website of ContikiOS offers a complete step by step tutorial for the Cooja emulator: [http://www.contiki-os.org/start.html#start-cooja Cooja]&lt;br /&gt;
* [[Contiki - 6TiSCH - RPL code HOWTO]]&lt;br /&gt;
&lt;br /&gt;
== Download ==&lt;br /&gt;
&lt;br /&gt;
Complete example of 6TiSCH communication between nodes (tested on TelosB, the Testbed and Cooja)&lt;br /&gt;
* [[File:6TiSCH_-_RPL_-_UDP_Transmitter_and_Receiver.tar.gz]]&lt;br /&gt;
&lt;br /&gt;
App you will need to replace printf. Add the lprintsky folder into the apps of ContikiOS.&lt;br /&gt;
* [[file:lprintsky.tar.gz]]&lt;br /&gt;
&lt;br /&gt;
This is the contiki version I used in case you have issues compiling the 6TiSCH code:&lt;br /&gt;
* [[file:contiki.tar.gz]]&lt;/div&gt;</summary>
		<author><name>Guillaume</name></author>
		
	</entry>
	<entry>
		<id>http://wsn.cse.wustl.edu/index.php?title=Contiki_-_Understanding_the_code&amp;diff=4062</id>
		<title>Contiki - Understanding the code</title>
		<link rel="alternate" type="text/html" href="http://wsn.cse.wustl.edu/index.php?title=Contiki_-_Understanding_the_code&amp;diff=4062"/>
		<updated>2017-05-03T03:54:48Z</updated>

		<summary type="html">&lt;p&gt;Guillaume: /* Create a protothread */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Contiki description =&lt;br /&gt;
&lt;br /&gt;
The Contiki folder contains various directories. Here are the ones you will be interested in if you want to develop your Contiki app:&lt;br /&gt;
&lt;br /&gt;
* app: contains apps you can include to you project and use in your code&lt;br /&gt;
* core: contains the code part of ContikiOS (net stack, serial, radio, process, timers...)&lt;br /&gt;
* cpu: contains the code related to each unique CPU&lt;br /&gt;
* platform: contains the code related to the platform you use (2 different platforms can share the same CPU)&lt;br /&gt;
* lib: some extra libraries&lt;br /&gt;
* examples: a list of interesting examples of how to use most of the functionalities and apps available on ContikiOS&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Contiki code =&lt;br /&gt;
&lt;br /&gt;
== Protothreads ==&lt;br /&gt;
&lt;br /&gt;
ContikiOS runs with protothreads, an event based system with non blocking functions. Indeed if a function comes to block the system a watchdog will force the reset of the platform.&lt;br /&gt;
&lt;br /&gt;
== Create a protothread ==&lt;br /&gt;
&lt;br /&gt;
To create a protothread it's easy:&lt;br /&gt;
&lt;br /&gt;
* Create the variable:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
PROCESS(MyProcess, &amp;quot;Optional name that can be ignored at compilation time (saves ROM memory)&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Create the thread:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
PROCESS_THREAD(MyProcess, ev, data)&lt;br /&gt;
{&lt;br /&gt;
    PROCESS_BEGIN();&lt;br /&gt;
&lt;br /&gt;
    // Your code&lt;br /&gt;
&lt;br /&gt;
    PROCESS_END();&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Additionally you can add it to a header file for external access&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
PROCESS_NAME(MyProcess);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some rules must be known: do not use switch into a protothread; some times you can have unexpected results.&lt;br /&gt;
&lt;br /&gt;
Do not block a protothread more than a few milliseconds (check the documentation for more details).&lt;br /&gt;
&lt;br /&gt;
== Working with a protothread ==&lt;br /&gt;
&lt;br /&gt;
Now that we have the skeleton of our protothread we need to be able to work with it.&lt;br /&gt;
&lt;br /&gt;
You must know that a protothread is a function that exits at some point to continue working later. If you want to save variables from one event to another you must declare static variables:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
PROCESS_THREAD(MyProcess, ev, data)&lt;br /&gt;
{&lt;br /&gt;
    // Declare your static variables&lt;br /&gt;
    static int a;&lt;br /&gt;
&lt;br /&gt;
    PROCESS_BEGIN();&lt;br /&gt;
    // Initialize them AFTER PROCESS_BEGIN();&lt;br /&gt;
    // (you can also declare them static here)&lt;br /&gt;
    a = 0; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    PROCESS_END();&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next step is to continue using this PROCESS as long as we need it. For that, usually, the PROCESS contains a while(1) loop.&lt;br /&gt;
&lt;br /&gt;
But in order not to block the PROCESS we need to add one of the following functions:&lt;br /&gt;
&lt;br /&gt;
* PROCESS_WAIT_EVENT(): waits until ANY event occurs, you can then manually sort which event it was with the ev variable.&lt;br /&gt;
* PROCESS_WAIT_EVENT_UNTIL(condition): waits until THIS condition is true.&lt;br /&gt;
* PROCESS_PAUSE(): pauses the process and emits a PAUSE event to continue at this point after the execution of other processes.&lt;br /&gt;
* PROCESS_WAIT_UNTIL(event): wait until event is triggered.&lt;br /&gt;
* PROCESS_WAIT_WHILE(event): wait while event is triggered.&lt;br /&gt;
&lt;br /&gt;
There are some other functions you might want to use such as:&lt;br /&gt;
&lt;br /&gt;
* PROCESS_EXIT() to exit the current running process&lt;br /&gt;
* process_post(struct process *p, process_event_t ev, process_data_t data): to post a asynchronous event (the process will wait its turn)&lt;br /&gt;
* process_post_synch(struct process *p, process_event_t ev, process_data_t data): to post a synchronous event (the process will be immediately called)&lt;br /&gt;
&lt;br /&gt;
Simply speaking our code looks like this now:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
PROCESS_THREAD(MyProcess, ev, data)&lt;br /&gt;
{&lt;br /&gt;
    // Declare your static variables&lt;br /&gt;
    static int a;&lt;br /&gt;
&lt;br /&gt;
    PROCESS_BEGIN();&lt;br /&gt;
    // Initialize them AFTER PROCESS_BEGIN();&lt;br /&gt;
    // (you can also declare them static here)&lt;br /&gt;
    a = 0; &lt;br /&gt;
&lt;br /&gt;
    while(1)&lt;br /&gt;
    {&lt;br /&gt;
        PROCESS_WAIT_EVENT();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    PROCESS_END();&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now to go further we want to create a hello world PROCESS that will print &amp;quot;Hello world %d!&amp;quot; with %d being the variable a incremented each second.&lt;br /&gt;
&lt;br /&gt;
We will create an event timer that will trigger our function.&lt;br /&gt;
&lt;br /&gt;
To wait for the timer we have two choices (only if we use 1 timer):&lt;br /&gt;
&lt;br /&gt;
* PROCESS_WAIT_UNTIL(PROCESS_EVENT_TIMER) we wait until a timer event is triggered.&lt;br /&gt;
* PROCESS_WAIT_EVENT_UNTIL(etimer_expired(&amp;amp;periodic_timer)) we wait until this timer has expired.&lt;br /&gt;
&lt;br /&gt;
Let's choose the second option as it is the best one in case you manipulate multiple etimers in the same PROCESS.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
PROCESS(MyProcess);&lt;br /&gt;
&lt;br /&gt;
PROCESS_THREAD(MyProcess, ev, data)&lt;br /&gt;
{&lt;br /&gt;
    // Declare your static variables&lt;br /&gt;
    static int a;&lt;br /&gt;
    static struct etimer periodic_timer;&lt;br /&gt;
&lt;br /&gt;
    PROCESS_BEGIN();&lt;br /&gt;
    // Initialize them AFTER PROCESS_BEGIN();&lt;br /&gt;
    // (you can also declare them static here)&lt;br /&gt;
    a = 0;&lt;br /&gt;
&lt;br /&gt;
    // CLOCK_SECONDS gives the number of counts to get to 1s. THOSE ARE NOT MILLISECONDS (e.g. some are 128 tics / second)&lt;br /&gt;
    etimer_set(&amp;amp;periodic_timer, CLOCK_SECOND*1);&lt;br /&gt;
&lt;br /&gt;
    while(1)&lt;br /&gt;
    {&lt;br /&gt;
        PROCESS_WAIT_EVENT_UNTIL(etimer_expired(&amp;amp;periodic_timer));&lt;br /&gt;
        // And we don't forget to reset the timer:&lt;br /&gt;
        etimer_reset(&amp;amp;periodic_timer);&lt;br /&gt;
&lt;br /&gt;
        printf(&amp;quot;Hello world %d!&amp;quot;, a++);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    PROCESS_END();&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Advanced use ==&lt;br /&gt;
&lt;br /&gt;
Many more functions and possibilities are available. For that you may want to take a look at:&lt;br /&gt;
* The documentating (you should generate your own doxygen documentation using the contiki folder)&lt;br /&gt;
* Taking a look at the files in core/sys (process.h for the protothreads)&lt;/div&gt;</summary>
		<author><name>Guillaume</name></author>
		
	</entry>
	<entry>
		<id>http://wsn.cse.wustl.edu/index.php?title=User:Guillaume&amp;diff=4061</id>
		<title>User:Guillaume</title>
		<link rel="alternate" type="text/html" href="http://wsn.cse.wustl.edu/index.php?title=User:Guillaume&amp;diff=4061"/>
		<updated>2017-05-03T03:53:34Z</updated>

		<summary type="html">&lt;p&gt;Guillaume: /* Tutorials */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Tutorials ==&lt;br /&gt;
&lt;br /&gt;
* [[Working environment setup for Contiki OS]]&lt;br /&gt;
* [[Contiki first project]]&lt;br /&gt;
* [[Contiki - Understanding the code]]&lt;br /&gt;
* Contiki - Cooja emulator: The official website of ContikiOS offers a complete step by step tutorial for the Cooja emulator: [http://www.contiki-os.org/start.html#start-cooja Cooja]&lt;br /&gt;
* [[Contiki - 6TiSCH - RPL code HOWTO]]&lt;br /&gt;
&lt;br /&gt;
== Download ==&lt;br /&gt;
&lt;br /&gt;
Complete example of 6TiSCH communication between nodes (tested on TelosB, the Testbed and Cooja)&lt;br /&gt;
* [[File:6TiSCH_-_RPL_-_UDP_Transmitter_and_Receiver.tar.gz]]&lt;br /&gt;
&lt;br /&gt;
App you will need to replace printf. Add the lprintsky folder into the apps of ContikiOS.&lt;br /&gt;
* [[file:lprintsky.tar.gz]]&lt;br /&gt;
&lt;br /&gt;
This is the contiki version I used in case you have issues compiling the 6TiSCH code:&lt;br /&gt;
* [[file:contiki.tar.gz]]&lt;/div&gt;</summary>
		<author><name>Guillaume</name></author>
		
	</entry>
	<entry>
		<id>http://wsn.cse.wustl.edu/index.php?title=File:Contiki.tar.gz&amp;diff=4060</id>
		<title>File:Contiki.tar.gz</title>
		<link rel="alternate" type="text/html" href="http://wsn.cse.wustl.edu/index.php?title=File:Contiki.tar.gz&amp;diff=4060"/>
		<updated>2017-05-03T03:49:40Z</updated>

		<summary type="html">&lt;p&gt;Guillaume: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Guillaume</name></author>
		
	</entry>
	<entry>
		<id>http://wsn.cse.wustl.edu/index.php?title=User:Guillaume&amp;diff=4059</id>
		<title>User:Guillaume</title>
		<link rel="alternate" type="text/html" href="http://wsn.cse.wustl.edu/index.php?title=User:Guillaume&amp;diff=4059"/>
		<updated>2017-05-03T03:40:03Z</updated>

		<summary type="html">&lt;p&gt;Guillaume: /* Download */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Tutorials ==&lt;br /&gt;
&lt;br /&gt;
* [[Working environment setup for Contiki OS]]&lt;br /&gt;
* [[Contiki first project]]&lt;br /&gt;
* [[Contiki - Understanding the code]]&lt;br /&gt;
* Contiki - Cooja emulator&lt;br /&gt;
The official website of ContikiOS offers a complete step by step tutorial for the Cooja emulator: [http://www.contiki-os.org/start.html#start-cooja Cooja]&lt;br /&gt;
* [[Contiki - 6TiSCH - RPL code HOWTO]]&lt;br /&gt;
&lt;br /&gt;
== Download ==&lt;br /&gt;
&lt;br /&gt;
Complete example of 6TiSCH communication between nodes (tested on TelosB, the Testbed and Cooja)&lt;br /&gt;
* [[File:6TiSCH_-_RPL_-_UDP_Transmitter_and_Receiver.tar.gz]]&lt;br /&gt;
&lt;br /&gt;
App you will need to replace printf. Add the lprintsky folder into the apps of ContikiOS.&lt;br /&gt;
* [[file:lprintsky.tar.gz]]&lt;br /&gt;
&lt;br /&gt;
This is the contiki version I used in case you have issues compiling the 6TiSCH code:&lt;br /&gt;
* [[file:contiki.tar.gz]]&lt;/div&gt;</summary>
		<author><name>Guillaume</name></author>
		
	</entry>
	<entry>
		<id>http://wsn.cse.wustl.edu/index.php?title=Contiki_-_Understanding_the_code&amp;diff=4050</id>
		<title>Contiki - Understanding the code</title>
		<link rel="alternate" type="text/html" href="http://wsn.cse.wustl.edu/index.php?title=Contiki_-_Understanding_the_code&amp;diff=4050"/>
		<updated>2017-04-25T21:28:20Z</updated>

		<summary type="html">&lt;p&gt;Guillaume: /* Working with a protothread */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Contiki description =&lt;br /&gt;
&lt;br /&gt;
The Contiki folder contains various directories. Here are the ones you will be interested in if you want to develop your Contiki app:&lt;br /&gt;
&lt;br /&gt;
* app: contains apps you can include to you project and use in your code&lt;br /&gt;
* core: contains the code part of ContikiOS (net stack, serial, radio, process, timers...)&lt;br /&gt;
* cpu: contains the code related to each unique CPU&lt;br /&gt;
* platform: contains the code related to the platform you use (2 different platforms can share the same CPU)&lt;br /&gt;
* lib: some extra libraries&lt;br /&gt;
* examples: a list of interesting examples of how to use most of the functionalities and apps available on ContikiOS&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Contiki code =&lt;br /&gt;
&lt;br /&gt;
== Protothreads ==&lt;br /&gt;
&lt;br /&gt;
ContikiOS runs with protothreads, an event based system with non blocking functions. Indeed if a function comes to block the system a watchdog will force the reset of the platform.&lt;br /&gt;
&lt;br /&gt;
== Create a protothread ==&lt;br /&gt;
&lt;br /&gt;
To create a protothread it's easy:&lt;br /&gt;
&lt;br /&gt;
* Create the variable:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
PROCESS(MyProcess, &amp;quot;Optional name that can be ignored at compilation time (saves ROM memory)&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Create the thread:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
PROCESS_THREAD(MyProcess, ev, data)&lt;br /&gt;
{&lt;br /&gt;
    PROCESS_BEGIN();&lt;br /&gt;
&lt;br /&gt;
    // Your code&lt;br /&gt;
&lt;br /&gt;
    PROCESS_END();&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Additionally you can add it to a header file for external access&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
PROCESS_NAME(MyProcess);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some rules must be known: do not use switch into a protothread; some times you can have unexpected results.&lt;br /&gt;
&lt;br /&gt;
Do not block a protothread more than some ms (check the documentation for more details).&lt;br /&gt;
&lt;br /&gt;
== Working with a protothread ==&lt;br /&gt;
&lt;br /&gt;
Now that we have the skeleton of our protothread we need to be able to work with it.&lt;br /&gt;
&lt;br /&gt;
You must know that a protothread is a function that exits at some point to continue working later. If you want to save variables from one event to another you must declare static variables:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
PROCESS_THREAD(MyProcess, ev, data)&lt;br /&gt;
{&lt;br /&gt;
    // Declare your static variables&lt;br /&gt;
    static int a;&lt;br /&gt;
&lt;br /&gt;
    PROCESS_BEGIN();&lt;br /&gt;
    // Initialize them AFTER PROCESS_BEGIN();&lt;br /&gt;
    // (you can also declare them static here)&lt;br /&gt;
    a = 0; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    PROCESS_END();&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next step is to continue using this PROCESS as long as we need it. For that, usually, the PROCESS contains a while(1) loop.&lt;br /&gt;
&lt;br /&gt;
But in order not to block the PROCESS we need to add one of the following functions:&lt;br /&gt;
&lt;br /&gt;
* PROCESS_WAIT_EVENT(): waits until ANY event occurs, you can then manually sort which event it was with the ev variable.&lt;br /&gt;
* PROCESS_WAIT_EVENT_UNTIL(condition): waits until THIS condition is true.&lt;br /&gt;
* PROCESS_PAUSE(): pauses the process and emits a PAUSE event to continue at this point after the execution of other processes.&lt;br /&gt;
* PROCESS_WAIT_UNTIL(event): wait until event is triggered.&lt;br /&gt;
* PROCESS_WAIT_WHILE(event): wait while event is triggered.&lt;br /&gt;
&lt;br /&gt;
There are some other functions you might want to use such as:&lt;br /&gt;
&lt;br /&gt;
* PROCESS_EXIT() to exit the current running process&lt;br /&gt;
* process_post(struct process *p, process_event_t ev, process_data_t data): to post a asynchronous event (the process will wait its turn)&lt;br /&gt;
* process_post_synch(struct process *p, process_event_t ev, process_data_t data): to post a synchronous event (the process will be immediately called)&lt;br /&gt;
&lt;br /&gt;
Simply speaking our code looks like this now:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
PROCESS_THREAD(MyProcess, ev, data)&lt;br /&gt;
{&lt;br /&gt;
    // Declare your static variables&lt;br /&gt;
    static int a;&lt;br /&gt;
&lt;br /&gt;
    PROCESS_BEGIN();&lt;br /&gt;
    // Initialize them AFTER PROCESS_BEGIN();&lt;br /&gt;
    // (you can also declare them static here)&lt;br /&gt;
    a = 0; &lt;br /&gt;
&lt;br /&gt;
    while(1)&lt;br /&gt;
    {&lt;br /&gt;
        PROCESS_WAIT_EVENT();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    PROCESS_END();&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now to go further we want to create a hello world PROCESS that will print &amp;quot;Hello world %d!&amp;quot; with %d being the variable a incremented each second.&lt;br /&gt;
&lt;br /&gt;
We will create an event timer that will trigger our function.&lt;br /&gt;
&lt;br /&gt;
To wait for the timer we have two choices (only if we use 1 timer):&lt;br /&gt;
&lt;br /&gt;
* PROCESS_WAIT_UNTIL(PROCESS_EVENT_TIMER) we wait until a timer event is triggered.&lt;br /&gt;
* PROCESS_WAIT_EVENT_UNTIL(etimer_expired(&amp;amp;periodic_timer)) we wait until this timer has expired.&lt;br /&gt;
&lt;br /&gt;
Let's choose the second option as it is the best one in case you manipulate multiple etimers in the same PROCESS.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
PROCESS(MyProcess);&lt;br /&gt;
&lt;br /&gt;
PROCESS_THREAD(MyProcess, ev, data)&lt;br /&gt;
{&lt;br /&gt;
    // Declare your static variables&lt;br /&gt;
    static int a;&lt;br /&gt;
    static struct etimer periodic_timer;&lt;br /&gt;
&lt;br /&gt;
    PROCESS_BEGIN();&lt;br /&gt;
    // Initialize them AFTER PROCESS_BEGIN();&lt;br /&gt;
    // (you can also declare them static here)&lt;br /&gt;
    a = 0;&lt;br /&gt;
&lt;br /&gt;
    // CLOCK_SECONDS gives the number of counts to get to 1s. THOSE ARE NOT MILLISECONDS (e.g. some are 128 tics / second)&lt;br /&gt;
    etimer_set(&amp;amp;periodic_timer, CLOCK_SECOND*1);&lt;br /&gt;
&lt;br /&gt;
    while(1)&lt;br /&gt;
    {&lt;br /&gt;
        PROCESS_WAIT_EVENT_UNTIL(etimer_expired(&amp;amp;periodic_timer));&lt;br /&gt;
        // And we don't forget to reset the timer:&lt;br /&gt;
        etimer_reset(&amp;amp;periodic_timer);&lt;br /&gt;
&lt;br /&gt;
        printf(&amp;quot;Hello world %d!&amp;quot;, a++);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    PROCESS_END();&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Advanced use ==&lt;br /&gt;
&lt;br /&gt;
Many more functions and possibilities are available. For that you may want to take a look at:&lt;br /&gt;
* The documentating (you should generate your own doxygen documentation using the contiki folder)&lt;br /&gt;
* Taking a look at the files in core/sys (process.h for the protothreads)&lt;/div&gt;</summary>
		<author><name>Guillaume</name></author>
		
	</entry>
	<entry>
		<id>http://wsn.cse.wustl.edu/index.php?title=Contiki_-_Understanding_the_code&amp;diff=4049</id>
		<title>Contiki - Understanding the code</title>
		<link rel="alternate" type="text/html" href="http://wsn.cse.wustl.edu/index.php?title=Contiki_-_Understanding_the_code&amp;diff=4049"/>
		<updated>2017-04-25T21:25:46Z</updated>

		<summary type="html">&lt;p&gt;Guillaume: Created page with &amp;quot;= Contiki description =  The Contiki folder contains various directories. Here are the ones you will be interested in if you want to develop your Contiki app:  * app: contains...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Contiki description =&lt;br /&gt;
&lt;br /&gt;
The Contiki folder contains various directories. Here are the ones you will be interested in if you want to develop your Contiki app:&lt;br /&gt;
&lt;br /&gt;
* app: contains apps you can include to you project and use in your code&lt;br /&gt;
* core: contains the code part of ContikiOS (net stack, serial, radio, process, timers...)&lt;br /&gt;
* cpu: contains the code related to each unique CPU&lt;br /&gt;
* platform: contains the code related to the platform you use (2 different platforms can share the same CPU)&lt;br /&gt;
* lib: some extra libraries&lt;br /&gt;
* examples: a list of interesting examples of how to use most of the functionalities and apps available on ContikiOS&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Contiki code =&lt;br /&gt;
&lt;br /&gt;
== Protothreads ==&lt;br /&gt;
&lt;br /&gt;
ContikiOS runs with protothreads, an event based system with non blocking functions. Indeed if a function comes to block the system a watchdog will force the reset of the platform.&lt;br /&gt;
&lt;br /&gt;
== Create a protothread ==&lt;br /&gt;
&lt;br /&gt;
To create a protothread it's easy:&lt;br /&gt;
&lt;br /&gt;
* Create the variable:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
PROCESS(MyProcess, &amp;quot;Optional name that can be ignored at compilation time (saves ROM memory)&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Create the thread:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
PROCESS_THREAD(MyProcess, ev, data)&lt;br /&gt;
{&lt;br /&gt;
    PROCESS_BEGIN();&lt;br /&gt;
&lt;br /&gt;
    // Your code&lt;br /&gt;
&lt;br /&gt;
    PROCESS_END();&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Additionally you can add it to a header file for external access&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
PROCESS_NAME(MyProcess);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some rules must be known: do not use switch into a protothread; some times you can have unexpected results.&lt;br /&gt;
&lt;br /&gt;
Do not block a protothread more than some ms (check the documentation for more details).&lt;br /&gt;
&lt;br /&gt;
== Working with a protothread ==&lt;br /&gt;
&lt;br /&gt;
Now that we have the skeleton of our protothread we need to be able to work with it.&lt;br /&gt;
&lt;br /&gt;
You must know that a protothread is a function that exits at some point to continue working later. If you want to save variables from one event to another you must declare static variables:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
PROCESS_THREAD(MyProcess, ev, data)&lt;br /&gt;
{&lt;br /&gt;
    // Declare your static variables&lt;br /&gt;
    static int a;&lt;br /&gt;
&lt;br /&gt;
    PROCESS_BEGIN();&lt;br /&gt;
    // Initialize them AFTER PROCESS_BEGIN();&lt;br /&gt;
    // (you can also declare them static here)&lt;br /&gt;
    a = 0; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    PROCESS_END();&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next step is to continue using this PROCESS as long as we need it. For that, usually, the PROCESS contains a while(1) loop.&lt;br /&gt;
&lt;br /&gt;
But in order not to block the PROCESS we need to add one of the following functions:&lt;br /&gt;
&lt;br /&gt;
* PROCESS_WAIT_EVENT(): waits until ANY event occurs, you can then manually sort which event it was with the ev variable.&lt;br /&gt;
* PROCESS_WAIT_EVENT_UNTIL(condition): waits until THIS condition is true.&lt;br /&gt;
* PROCESS_PAUSE(): pauses the process and emits a PAUSE event to continue at this point after the execution of other processes.&lt;br /&gt;
* PROCESS_WAIT_UNTIL(event): wait until event is triggered.&lt;br /&gt;
* PROCESS_WAIT_WHILE(event): wait while event is triggered.&lt;br /&gt;
&lt;br /&gt;
There are some other functions you might want to use such as:&lt;br /&gt;
&lt;br /&gt;
* PROCESS_EXIT() to exit the current running process&lt;br /&gt;
* process_post(struct process *p, process_event_t ev, process_data_t data): to post a asynchronous event (the process will wait its turn)&lt;br /&gt;
* process_post_synch(struct process *p, process_event_t ev, process_data_t data): to post a synchronous event (the process will be immediately called)&lt;br /&gt;
&lt;br /&gt;
Simply speaking our code looks like this now:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
PROCESS_THREAD(MyProcess, ev, data)&lt;br /&gt;
{&lt;br /&gt;
    // Declare your static variables&lt;br /&gt;
    static int a;&lt;br /&gt;
&lt;br /&gt;
    PROCESS_BEGIN();&lt;br /&gt;
    // Initialize them AFTER PROCESS_BEGIN();&lt;br /&gt;
    // (you can also declare them static here)&lt;br /&gt;
    a = 0; &lt;br /&gt;
&lt;br /&gt;
    while(1)&lt;br /&gt;
    {&lt;br /&gt;
        PROCESS_WAIT_EVENT();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    PROCESS_END();&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now to go further we want to create a hello world PROCESS that will print &amp;quot;Hello world %d!&amp;quot; with %d being the variable a incremented each second.&lt;br /&gt;
&lt;br /&gt;
We will create an event timer that will trigger our function.&lt;br /&gt;
&lt;br /&gt;
To wait for the timer we have two choices (only if we use only 1 timer)&lt;br /&gt;
&lt;br /&gt;
* PROCESS_WAIT_UNTIL(PROCESS_EVENT_TIMER) we wait until an timer event is triggered.&lt;br /&gt;
* PROCESS_WAIT_EVENT_UNTIL(etimer_expired(&amp;amp;periodic_timer)) we wait until this timer has expired.&lt;br /&gt;
&lt;br /&gt;
Let's choose the second option as it is the best one in case you manipulate multiple etimers in the same PROCESS.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
PROCESS_THREAD(MyProcess, ev, data)&lt;br /&gt;
{&lt;br /&gt;
    // Declare your static variables&lt;br /&gt;
    static int a;&lt;br /&gt;
    static struct etimer periodic_timer;&lt;br /&gt;
&lt;br /&gt;
    PROCESS_BEGIN();&lt;br /&gt;
    // Initialize them AFTER PROCESS_BEGIN();&lt;br /&gt;
    // (you can also declare them static here)&lt;br /&gt;
    a = 0;&lt;br /&gt;
&lt;br /&gt;
    // CLOCK_SECONDS gives the number of counts to get to 1s. THOSE ARE NOT MILLISECONDS (e.g. some are 128 tics / second)&lt;br /&gt;
    etimer_set(&amp;amp;periodic_timer, CLOCK_SECOND*1);&lt;br /&gt;
&lt;br /&gt;
    while(1)&lt;br /&gt;
    {&lt;br /&gt;
        PROCESS_WAIT_EVENT_UNTIL(etimer_expired(&amp;amp;periodic_timer));&lt;br /&gt;
        // And we don't forget to reset the timer:&lt;br /&gt;
        etimer_reset(&amp;amp;periodic_timer);&lt;br /&gt;
&lt;br /&gt;
        printf(&amp;quot;Hello world %d!&amp;quot;, a++);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    PROCESS_END();&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Advanced use ==&lt;br /&gt;
&lt;br /&gt;
Many more functions and possibilities are available. For that you may want to take a look at:&lt;br /&gt;
* The documentating (you should generate your own doxygen documentation using the contiki folder)&lt;br /&gt;
* Taking a look at the files in core/sys (process.h for the protothreads)&lt;/div&gt;</summary>
		<author><name>Guillaume</name></author>
		
	</entry>
	<entry>
		<id>http://wsn.cse.wustl.edu/index.php?title=Contiki_-_6TiSCH_-_RPL_code_HOWTO&amp;diff=4048</id>
		<title>Contiki - 6TiSCH - RPL code HOWTO</title>
		<link rel="alternate" type="text/html" href="http://wsn.cse.wustl.edu/index.php?title=Contiki_-_6TiSCH_-_RPL_code_HOWTO&amp;diff=4048"/>
		<updated>2017-04-25T20:37:56Z</updated>

		<summary type="html">&lt;p&gt;Guillaume: /* Makefile */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Files explanation =&lt;br /&gt;
&lt;br /&gt;
There are two things to consider for compiling the example available here: [[File:6TiSCH_-_RPL_-_UDP_Transmitter_and_Receiver.tar.gz]]&lt;br /&gt;
&lt;br /&gt;
* You need the app: [[file:lprintsky.tar.gz]]&lt;br /&gt;
* You might want to edit the Makefile&lt;br /&gt;
&lt;br /&gt;
== lprintfsky app ==&lt;br /&gt;
&lt;br /&gt;
This app contains simple output functions for the sky target (TelosB).&lt;br /&gt;
&lt;br /&gt;
* lprint: outputs the given string&lt;br /&gt;
* lprinti: outputs the given integer (unsigned)&lt;br /&gt;
&lt;br /&gt;
For it to work you need to copy the lprintsky folder into the apps folder of contiki.&lt;br /&gt;
&lt;br /&gt;
== Makefile ==&lt;br /&gt;
&lt;br /&gt;
Without going to much into the details you might want to change 3 things:&lt;br /&gt;
&lt;br /&gt;
* CONTIKI variable that points to the ContikiOS root directory&lt;br /&gt;
* TARGET (if none is specified the default target is sky)&lt;br /&gt;
* WITH_TSCH_CONF (if none is specified the default is 1)&lt;/div&gt;</summary>
		<author><name>Guillaume</name></author>
		
	</entry>
	<entry>
		<id>http://wsn.cse.wustl.edu/index.php?title=Contiki_-_6TiSCH_-_RPL_code_HOWTO&amp;diff=4047</id>
		<title>Contiki - 6TiSCH - RPL code HOWTO</title>
		<link rel="alternate" type="text/html" href="http://wsn.cse.wustl.edu/index.php?title=Contiki_-_6TiSCH_-_RPL_code_HOWTO&amp;diff=4047"/>
		<updated>2017-04-25T20:37:08Z</updated>

		<summary type="html">&lt;p&gt;Guillaume: Created page with &amp;quot;= Files explanation =  There are two things to consider for compiling the example available here: File:6TiSCH_-_RPL_-_UDP_Transmitter_and_Receiver.tar.gz  * You need the a...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Files explanation =&lt;br /&gt;
&lt;br /&gt;
There are two things to consider for compiling the example available here: [[File:6TiSCH_-_RPL_-_UDP_Transmitter_and_Receiver.tar.gz]]&lt;br /&gt;
&lt;br /&gt;
* You need the app: [[file:lprintsky.tar.gz]]&lt;br /&gt;
* You might want to edit the Makefile&lt;br /&gt;
&lt;br /&gt;
== lprintfsky app ==&lt;br /&gt;
&lt;br /&gt;
This app contains simple output functions for the sky target (TelosB).&lt;br /&gt;
&lt;br /&gt;
* lprint: outputs the given string&lt;br /&gt;
* lprinti: outputs the given integer (unsigned)&lt;br /&gt;
&lt;br /&gt;
For it to work you need to copy the lprintsky folder into the apps folder of contiki.&lt;br /&gt;
&lt;br /&gt;
== Makefile ==&lt;br /&gt;
&lt;br /&gt;
Without going to much into the details you might want to change 2 things:&lt;br /&gt;
&lt;br /&gt;
* CONTIKI variable that points to the ContikiOS root directory&lt;br /&gt;
* TARGET (if none is specified the default target is sky)&lt;br /&gt;
* WITH_TSCH_CONF (if none is specified the default is 1)&lt;/div&gt;</summary>
		<author><name>Guillaume</name></author>
		
	</entry>
	<entry>
		<id>http://wsn.cse.wustl.edu/index.php?title=User:Guillaume&amp;diff=4046</id>
		<title>User:Guillaume</title>
		<link rel="alternate" type="text/html" href="http://wsn.cse.wustl.edu/index.php?title=User:Guillaume&amp;diff=4046"/>
		<updated>2017-04-24T17:27:51Z</updated>

		<summary type="html">&lt;p&gt;Guillaume: /* Tutorials */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Tutorials ==&lt;br /&gt;
&lt;br /&gt;
* [[Working environment setup for Contiki OS]]&lt;br /&gt;
* [[Contiki first project]]&lt;br /&gt;
* [[Contiki - Understanding the code]]&lt;br /&gt;
* Contiki - Cooja emulator&lt;br /&gt;
The official website of ContikiOS offers a complete step by step tutorial for the Cooja emulator: [http://www.contiki-os.org/start.html#start-cooja Cooja]&lt;br /&gt;
* [[Contiki - 6TiSCH - RPL code HOWTO]]&lt;br /&gt;
&lt;br /&gt;
== Download ==&lt;br /&gt;
&lt;br /&gt;
Complete example of 6TiSCH communication between nodes (tested on TelosB, the Testbed and Cooja)&lt;br /&gt;
* [[File:6TiSCH_-_RPL_-_UDP_Transmitter_and_Receiver.tar.gz]]&lt;br /&gt;
&lt;br /&gt;
App you will need to replace printf. Add the lprintsky folder into the apps of ContikiOS.&lt;br /&gt;
* [[file:lprintsky.tar.gz]]&lt;/div&gt;</summary>
		<author><name>Guillaume</name></author>
		
	</entry>
	<entry>
		<id>http://wsn.cse.wustl.edu/index.php?title=File:6TiSCH_-_RPL_-_UDP_Transmitter_and_Receiver.tar.gz&amp;diff=4045</id>
		<title>File:6TiSCH - RPL - UDP Transmitter and Receiver.tar.gz</title>
		<link rel="alternate" type="text/html" href="http://wsn.cse.wustl.edu/index.php?title=File:6TiSCH_-_RPL_-_UDP_Transmitter_and_Receiver.tar.gz&amp;diff=4045"/>
		<updated>2017-04-22T17:37:12Z</updated>

		<summary type="html">&lt;p&gt;Guillaume: uploaded a new version of &amp;amp;quot;File:6TiSCH - RPL - UDP Transmitter and Receiver.tar.gz&amp;amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Guillaume</name></author>
		
	</entry>
	<entry>
		<id>http://wsn.cse.wustl.edu/index.php?title=File:6TiSCH_-_RPL_-_UDP_Transmitter_and_Receiver.tar.gz&amp;diff=4044</id>
		<title>File:6TiSCH - RPL - UDP Transmitter and Receiver.tar.gz</title>
		<link rel="alternate" type="text/html" href="http://wsn.cse.wustl.edu/index.php?title=File:6TiSCH_-_RPL_-_UDP_Transmitter_and_Receiver.tar.gz&amp;diff=4044"/>
		<updated>2017-04-22T17:33:56Z</updated>

		<summary type="html">&lt;p&gt;Guillaume: uploaded a new version of &amp;amp;quot;File:6TiSCH - RPL - UDP Transmitter and Receiver.tar.gz&amp;amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Guillaume</name></author>
		
	</entry>
	<entry>
		<id>http://wsn.cse.wustl.edu/index.php?title=User:Guillaume&amp;diff=4043</id>
		<title>User:Guillaume</title>
		<link rel="alternate" type="text/html" href="http://wsn.cse.wustl.edu/index.php?title=User:Guillaume&amp;diff=4043"/>
		<updated>2017-04-22T17:19:05Z</updated>

		<summary type="html">&lt;p&gt;Guillaume: /* Download */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Tutorials ==&lt;br /&gt;
&lt;br /&gt;
* [[Working environment setup for Contiki OS]]&lt;br /&gt;
* [[Contiki first project]]&lt;br /&gt;
* [[Contiki - Understanding the code]]&lt;br /&gt;
* Contiki - Cooja emulator&lt;br /&gt;
The official website of ContikiOS offers a complete step by step tutorial for the Cooja emulator: [http://www.contiki-os.org/start.html#start-cooja Cooja]&lt;br /&gt;
&lt;br /&gt;
== Download ==&lt;br /&gt;
&lt;br /&gt;
Complete example of 6TiSCH communication between nodes (tested on TelosB, the Testbed and Cooja)&lt;br /&gt;
* [[File:6TiSCH_-_RPL_-_UDP_Transmitter_and_Receiver.tar.gz]]&lt;br /&gt;
&lt;br /&gt;
App you will need to replace printf. Add the lprintsky folder into the apps of ContikiOS.&lt;br /&gt;
* [[file:lprintsky.tar.gz]]&lt;/div&gt;</summary>
		<author><name>Guillaume</name></author>
		
	</entry>
	<entry>
		<id>http://wsn.cse.wustl.edu/index.php?title=File:Lprintsky.tar.gz&amp;diff=4042</id>
		<title>File:Lprintsky.tar.gz</title>
		<link rel="alternate" type="text/html" href="http://wsn.cse.wustl.edu/index.php?title=File:Lprintsky.tar.gz&amp;diff=4042"/>
		<updated>2017-04-22T17:18:17Z</updated>

		<summary type="html">&lt;p&gt;Guillaume: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Guillaume</name></author>
		
	</entry>
	<entry>
		<id>http://wsn.cse.wustl.edu/index.php?title=User:Guillaume&amp;diff=4041</id>
		<title>User:Guillaume</title>
		<link rel="alternate" type="text/html" href="http://wsn.cse.wustl.edu/index.php?title=User:Guillaume&amp;diff=4041"/>
		<updated>2017-04-22T17:18:06Z</updated>

		<summary type="html">&lt;p&gt;Guillaume: /* Download */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Tutorials ==&lt;br /&gt;
&lt;br /&gt;
* [[Working environment setup for Contiki OS]]&lt;br /&gt;
* [[Contiki first project]]&lt;br /&gt;
* [[Contiki - Understanding the code]]&lt;br /&gt;
* Contiki - Cooja emulator&lt;br /&gt;
The official website of ContikiOS offers a complete step by step tutorial for the Cooja emulator: [http://www.contiki-os.org/start.html#start-cooja Cooja]&lt;br /&gt;
&lt;br /&gt;
== Download ==&lt;br /&gt;
&lt;br /&gt;
Complete example of 6TiSCH communication between nodes (tested on TelosB, the Testbed and Cooja)&lt;br /&gt;
* [[File:6TiSCH_-_RPL_-_UDP_Transmitter_and_Receiver.tar.gz]]&lt;br /&gt;
&lt;br /&gt;
App you will need to replace printf:&lt;br /&gt;
Add the lprintsky into the apps folder of ContikiOS.&lt;br /&gt;
* [[file:lprintsky.tar.gz]]&lt;/div&gt;</summary>
		<author><name>Guillaume</name></author>
		
	</entry>
	<entry>
		<id>http://wsn.cse.wustl.edu/index.php?title=User:Guillaume&amp;diff=4040</id>
		<title>User:Guillaume</title>
		<link rel="alternate" type="text/html" href="http://wsn.cse.wustl.edu/index.php?title=User:Guillaume&amp;diff=4040"/>
		<updated>2017-04-22T17:17:22Z</updated>

		<summary type="html">&lt;p&gt;Guillaume: /* Download */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Tutorials ==&lt;br /&gt;
&lt;br /&gt;
* [[Working environment setup for Contiki OS]]&lt;br /&gt;
* [[Contiki first project]]&lt;br /&gt;
* [[Contiki - Understanding the code]]&lt;br /&gt;
* Contiki - Cooja emulator&lt;br /&gt;
The official website of ContikiOS offers a complete step by step tutorial for the Cooja emulator: [http://www.contiki-os.org/start.html#start-cooja Cooja]&lt;br /&gt;
&lt;br /&gt;
== Download ==&lt;br /&gt;
&lt;br /&gt;
Complete example of 6TiSCH communication between nodes (tested on TelosB, the Testbed and Cooja)&lt;br /&gt;
* [[File:6TiSCH_-_RPL_-_UDP_Transmitter_and_Receiver.tar.gz]]&lt;br /&gt;
&lt;br /&gt;
App you will need to replace printf&lt;br /&gt;
* [[file://contiki/apps/lprintsky.tar.gz]]&lt;/div&gt;</summary>
		<author><name>Guillaume</name></author>
		
	</entry>
	<entry>
		<id>http://wsn.cse.wustl.edu/index.php?title=User:Guillaume&amp;diff=4039</id>
		<title>User:Guillaume</title>
		<link rel="alternate" type="text/html" href="http://wsn.cse.wustl.edu/index.php?title=User:Guillaume&amp;diff=4039"/>
		<updated>2017-04-22T17:16:09Z</updated>

		<summary type="html">&lt;p&gt;Guillaume: /* Download */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Tutorials ==&lt;br /&gt;
&lt;br /&gt;
* [[Working environment setup for Contiki OS]]&lt;br /&gt;
* [[Contiki first project]]&lt;br /&gt;
* [[Contiki - Understanding the code]]&lt;br /&gt;
* Contiki - Cooja emulator&lt;br /&gt;
The official website of ContikiOS offers a complete step by step tutorial for the Cooja emulator: [http://www.contiki-os.org/start.html#start-cooja Cooja]&lt;br /&gt;
&lt;br /&gt;
== Download ==&lt;br /&gt;
&lt;br /&gt;
Complete example of 6TiSCH communication between nodes (tested on TelosB, the Testbed and Cooja)&lt;br /&gt;
* [[http://cps.cse.wustl.edu/index.php/File:6TiSCH_-_RPL_-_UDP_Transmitter_and_Receiver.tar.gz 6TiSCH.tar.gz]]&lt;br /&gt;
&lt;br /&gt;
App you will need to replace printf&lt;br /&gt;
* [[file://contiki/apps/lprintsky.tar.gz]]&lt;/div&gt;</summary>
		<author><name>Guillaume</name></author>
		
	</entry>
	<entry>
		<id>http://wsn.cse.wustl.edu/index.php?title=User:Guillaume&amp;diff=4038</id>
		<title>User:Guillaume</title>
		<link rel="alternate" type="text/html" href="http://wsn.cse.wustl.edu/index.php?title=User:Guillaume&amp;diff=4038"/>
		<updated>2017-04-22T17:15:49Z</updated>

		<summary type="html">&lt;p&gt;Guillaume: /* Download */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Tutorials ==&lt;br /&gt;
&lt;br /&gt;
* [[Working environment setup for Contiki OS]]&lt;br /&gt;
* [[Contiki first project]]&lt;br /&gt;
* [[Contiki - Understanding the code]]&lt;br /&gt;
* Contiki - Cooja emulator&lt;br /&gt;
The official website of ContikiOS offers a complete step by step tutorial for the Cooja emulator: [http://www.contiki-os.org/start.html#start-cooja Cooja]&lt;br /&gt;
&lt;br /&gt;
== Download ==&lt;br /&gt;
&lt;br /&gt;
Complete example of 6TiSCH communication between nodes (tested on TelosB, the Testbed and Cooja)&lt;br /&gt;
* [[http://cps.cse.wustl.edu/index.php/File:6TiSCH_-_RPL_-_UDP_Transmitter_and_Receiver.tar.gz]]&lt;br /&gt;
&lt;br /&gt;
App you will need to replace printf&lt;br /&gt;
* [[file://contiki/apps/lprintsky.tar.gz]]&lt;/div&gt;</summary>
		<author><name>Guillaume</name></author>
		
	</entry>
	<entry>
		<id>http://wsn.cse.wustl.edu/index.php?title=User:Guillaume&amp;diff=4037</id>
		<title>User:Guillaume</title>
		<link rel="alternate" type="text/html" href="http://wsn.cse.wustl.edu/index.php?title=User:Guillaume&amp;diff=4037"/>
		<updated>2017-04-22T17:15:08Z</updated>

		<summary type="html">&lt;p&gt;Guillaume: /* Download */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Tutorials ==&lt;br /&gt;
&lt;br /&gt;
* [[Working environment setup for Contiki OS]]&lt;br /&gt;
* [[Contiki first project]]&lt;br /&gt;
* [[Contiki - Understanding the code]]&lt;br /&gt;
* Contiki - Cooja emulator&lt;br /&gt;
The official website of ContikiOS offers a complete step by step tutorial for the Cooja emulator: [http://www.contiki-os.org/start.html#start-cooja Cooja]&lt;br /&gt;
&lt;br /&gt;
== Download ==&lt;br /&gt;
&lt;br /&gt;
Complete example of 6TiSCH communication between nodes (tested on TelosB, the Testbed and Cooja)&lt;br /&gt;
* [[file://6TiSCH_-_RPL_-_UDP_Transmitter_and_Receiver.tar.gz]]&lt;br /&gt;
&lt;br /&gt;
App you will need to replace printf&lt;br /&gt;
* [[file://contiki/apps/lprintsky.tar.gz]]&lt;/div&gt;</summary>
		<author><name>Guillaume</name></author>
		
	</entry>
	<entry>
		<id>http://wsn.cse.wustl.edu/index.php?title=File:6TiSCH_-_RPL_-_UDP_Transmitter_and_Receiver.tar.gz&amp;diff=4036</id>
		<title>File:6TiSCH - RPL - UDP Transmitter and Receiver.tar.gz</title>
		<link rel="alternate" type="text/html" href="http://wsn.cse.wustl.edu/index.php?title=File:6TiSCH_-_RPL_-_UDP_Transmitter_and_Receiver.tar.gz&amp;diff=4036"/>
		<updated>2017-04-22T17:14:44Z</updated>

		<summary type="html">&lt;p&gt;Guillaume: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Guillaume</name></author>
		
	</entry>
	<entry>
		<id>http://wsn.cse.wustl.edu/index.php?title=User:Guillaume&amp;diff=4035</id>
		<title>User:Guillaume</title>
		<link rel="alternate" type="text/html" href="http://wsn.cse.wustl.edu/index.php?title=User:Guillaume&amp;diff=4035"/>
		<updated>2017-04-22T17:13:30Z</updated>

		<summary type="html">&lt;p&gt;Guillaume: /* Download */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Tutorials ==&lt;br /&gt;
&lt;br /&gt;
* [[Working environment setup for Contiki OS]]&lt;br /&gt;
* [[Contiki first project]]&lt;br /&gt;
* [[Contiki - Understanding the code]]&lt;br /&gt;
* Contiki - Cooja emulator&lt;br /&gt;
The official website of ContikiOS offers a complete step by step tutorial for the Cooja emulator: [http://www.contiki-os.org/start.html#start-cooja Cooja]&lt;br /&gt;
&lt;br /&gt;
== Download ==&lt;br /&gt;
&lt;br /&gt;
Complete example of 6TiSCH communication between nodes (tested on TelosB, the Testbed and Cooja)&lt;br /&gt;
* [[file://6TiSCH - RPL - UDP Transmitter and Receiver.tar.gz]]&lt;br /&gt;
&lt;br /&gt;
App you will need to replace printf&lt;br /&gt;
* [[file://contiki/apps/lprintsky.tar.gz]]&lt;/div&gt;</summary>
		<author><name>Guillaume</name></author>
		
	</entry>
	<entry>
		<id>http://wsn.cse.wustl.edu/index.php?title=File:6TiSCH_-_RPL_-_UDP_Transmitter_and_Receiver.gz&amp;diff=4034</id>
		<title>File:6TiSCH - RPL - UDP Transmitter and Receiver.gz</title>
		<link rel="alternate" type="text/html" href="http://wsn.cse.wustl.edu/index.php?title=File:6TiSCH_-_RPL_-_UDP_Transmitter_and_Receiver.gz&amp;diff=4034"/>
		<updated>2017-04-22T17:12:10Z</updated>

		<summary type="html">&lt;p&gt;Guillaume: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Guillaume</name></author>
		
	</entry>
	<entry>
		<id>http://wsn.cse.wustl.edu/index.php?title=User:Guillaume&amp;diff=4033</id>
		<title>User:Guillaume</title>
		<link rel="alternate" type="text/html" href="http://wsn.cse.wustl.edu/index.php?title=User:Guillaume&amp;diff=4033"/>
		<updated>2017-04-22T17:11:17Z</updated>

		<summary type="html">&lt;p&gt;Guillaume: /* Download */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Tutorials ==&lt;br /&gt;
&lt;br /&gt;
* [[Working environment setup for Contiki OS]]&lt;br /&gt;
* [[Contiki first project]]&lt;br /&gt;
* [[Contiki - Understanding the code]]&lt;br /&gt;
* Contiki - Cooja emulator&lt;br /&gt;
The official website of ContikiOS offers a complete step by step tutorial for the Cooja emulator: [http://www.contiki-os.org/start.html#start-cooja Cooja]&lt;br /&gt;
&lt;br /&gt;
== Download ==&lt;br /&gt;
&lt;br /&gt;
Complete example of 6TiSCH communication between nodes (tested on TelosB, the Testbed and Cooja)&lt;br /&gt;
* [[file://6TiSCH - RPL - UDP Transmitter and Receiver]]&lt;br /&gt;
&lt;br /&gt;
App you will need to replace printf&lt;br /&gt;
* [[file://contiki/apps/lprintsky]]&lt;/div&gt;</summary>
		<author><name>Guillaume</name></author>
		
	</entry>
	<entry>
		<id>http://wsn.cse.wustl.edu/index.php?title=User:Guillaume&amp;diff=4032</id>
		<title>User:Guillaume</title>
		<link rel="alternate" type="text/html" href="http://wsn.cse.wustl.edu/index.php?title=User:Guillaume&amp;diff=4032"/>
		<updated>2017-04-22T17:06:11Z</updated>

		<summary type="html">&lt;p&gt;Guillaume: /* Tutorials */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Tutorials ==&lt;br /&gt;
&lt;br /&gt;
* [[Working environment setup for Contiki OS]]&lt;br /&gt;
* [[Contiki first project]]&lt;br /&gt;
* [[Contiki - Understanding the code]]&lt;br /&gt;
* Contiki - Cooja emulator&lt;br /&gt;
The official website of ContikiOS offers a complete step by step tutorial for the Cooja emulator: [http://www.contiki-os.org/start.html#start-cooja Cooja]&lt;br /&gt;
&lt;br /&gt;
== Download ==&lt;br /&gt;
* [[file://6TiSCH - RPL - UDP Transmitter and Receiver]]&lt;/div&gt;</summary>
		<author><name>Guillaume</name></author>
		
	</entry>
	<entry>
		<id>http://wsn.cse.wustl.edu/index.php?title=User:Guillaume&amp;diff=4031</id>
		<title>User:Guillaume</title>
		<link rel="alternate" type="text/html" href="http://wsn.cse.wustl.edu/index.php?title=User:Guillaume&amp;diff=4031"/>
		<updated>2017-04-22T17:02:46Z</updated>

		<summary type="html">&lt;p&gt;Guillaume: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Tutorials ==&lt;br /&gt;
&lt;br /&gt;
* [[Working environment setup for Contiki OS]]&lt;br /&gt;
* [[Contiki first project]]&lt;br /&gt;
* [[Contiki - Understanding the code]]&lt;br /&gt;
* Contiki - Cooja emulator&lt;br /&gt;
** [http://www.contiki-os.org/start.html#start-cooja Cooja]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Download ==&lt;br /&gt;
* [[file://6TiSCH - RPL - UDP Transmitter and Receiver]]&lt;/div&gt;</summary>
		<author><name>Guillaume</name></author>
		
	</entry>
	<entry>
		<id>http://wsn.cse.wustl.edu/index.php?title=User:Guillaume&amp;diff=4030</id>
		<title>User:Guillaume</title>
		<link rel="alternate" type="text/html" href="http://wsn.cse.wustl.edu/index.php?title=User:Guillaume&amp;diff=4030"/>
		<updated>2017-04-22T17:02:04Z</updated>

		<summary type="html">&lt;p&gt;Guillaume: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Tutorials ==&lt;br /&gt;
&lt;br /&gt;
* [[Working environment setup for Contiki OS]]&lt;br /&gt;
* [[Contiki first project]]&lt;br /&gt;
* [[Contiki - Understanding the code]]&lt;br /&gt;
* Contiki - Cooja emulator&lt;br /&gt;
** [http://www.contiki-os.org/start.html#start-cooja Cooja]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Download ==&lt;br /&gt;
* [[file://6tisch_rpl_udp 6TiSCH - RPL - UDP Transmitter and Reveiver]]&lt;/div&gt;</summary>
		<author><name>Guillaume</name></author>
		
	</entry>
	<entry>
		<id>http://wsn.cse.wustl.edu/index.php?title=User:Guillaume&amp;diff=4029</id>
		<title>User:Guillaume</title>
		<link rel="alternate" type="text/html" href="http://wsn.cse.wustl.edu/index.php?title=User:Guillaume&amp;diff=4029"/>
		<updated>2017-04-22T16:58:05Z</updated>

		<summary type="html">&lt;p&gt;Guillaume: /* Tutoriels */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Tutorials ==&lt;br /&gt;
&lt;br /&gt;
* [[Working environment setup for Contiki OS]]&lt;br /&gt;
* [[Contiki first project]]&lt;br /&gt;
* [[Contiki - Understanding the code]]&lt;br /&gt;
* Contiki - Cooja emulator&lt;br /&gt;
** [http://www.contiki-os.org/start.html#start-cooja Cooja]&lt;/div&gt;</summary>
		<author><name>Guillaume</name></author>
		
	</entry>
	<entry>
		<id>http://wsn.cse.wustl.edu/index.php?title=User:Guillaume&amp;diff=4028</id>
		<title>User:Guillaume</title>
		<link rel="alternate" type="text/html" href="http://wsn.cse.wustl.edu/index.php?title=User:Guillaume&amp;diff=4028"/>
		<updated>2017-04-22T16:56:17Z</updated>

		<summary type="html">&lt;p&gt;Guillaume: /* Tutoriels */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Tutoriels ==&lt;br /&gt;
&lt;br /&gt;
* [[Working environment setup for Contiki OS]]&lt;br /&gt;
* [[Contiki first project]]&lt;br /&gt;
* [[Contiki - Understanding the code]]&lt;br /&gt;
* Contiki - Cooja emulator&lt;br /&gt;
** [http://www.contiki-os.org/start.html#start-cooja Cooja]&lt;/div&gt;</summary>
		<author><name>Guillaume</name></author>
		
	</entry>
	<entry>
		<id>http://wsn.cse.wustl.edu/index.php?title=The_WUSTL_Wireless_Sensor_Network_Testbed&amp;diff=4014</id>
		<title>The WUSTL Wireless Sensor Network Testbed</title>
		<link rel="alternate" type="text/html" href="http://wsn.cse.wustl.edu/index.php?title=The_WUSTL_Wireless_Sensor_Network_Testbed&amp;diff=4014"/>
		<updated>2017-04-05T16:10:01Z</updated>

		<summary type="html">&lt;p&gt;Guillaume: /* Status */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| align = &amp;quot;center&amp;quot;&lt;br /&gt;
 | [[Image:wsn-wustl-logo.png]]&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
{| align = &amp;quot;center&amp;quot;&lt;br /&gt;
 | Contact: [mailto:msha@wustl.edu Mo Sha]&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
{| align=&amp;quot;right&amp;quot;&lt;br /&gt;
 | __TOC__&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
To facilitate advanced research in wireless sensor network technology, we are currently in the process of deploying a wireless sensor network testbed at Washington University in St. Louis.  The testbed currently consists of 79 wireless sensor nodes (motes) placed throughout several office areas in Jolley and Bryan Hall -- i.e., several grad student offices, the graduate student lounge, several labs, and the two conference rooms.&lt;br /&gt;
&lt;br /&gt;
This document serves as an overview of the testbed setup and its current deployment.  It is a living document in the sense that it will be updated as changes to the testbed continue to be made.  In the end it will serve as a source of reference for anyone using the testbed to run sensornet related experiments. &lt;br /&gt;
&lt;br /&gt;
Having a testbed of this size is important for a number of reasons:&lt;br /&gt;
&lt;br /&gt;
* '''Only a handful of testbeds of this size exist in the world today.'''  By being one of the first to have such a testbed, we will be able to conduct experiments that others have previously been unable to run.  Our eventual goal is to make the testbed accessible through a simple web interface, opening it to users across the globe.&lt;br /&gt;
* '''Running large scale wireless sensor network experiments is hard.'''  Programming a single mote can take up to five minutes depending on the size of the binary it is being programmed with.  Without a testbed to streamline the process of programming a large number of motes, programming each mote individually can quickly become a significant bottleneck.  Furthermore, as programming typically takes place by physically attaching a mote to your local machine, deploying them afterwards also takes a significant amount of time.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font size=&amp;quot;+1&amp;quot;&amp;gt;'''IMPORTANT:'''&amp;lt;/font&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Please keep in mind that the motes deployed in the testbed only contain sensors for light, radiation, temperature, and humidity.  There are no microphones or cameras, and there is no plan to EVER include such sensors in the future. The purpose of the testbed is primarily for measuring communication characteristics of the motes and not evaluating the sensitivity or accuracy of its sensors. If you have any privacy concerns about including the testbed in your office please direct any questions to [mailto:wsn@cse.wustl.edu wsn@cse.wustl.edu].&lt;br /&gt;
&lt;br /&gt;
==Testbed Setup==&lt;br /&gt;
Our testbed deployment is based on the [http://www.tkn.tu-berlin.de/publications/papers/real04f-handziski.pdf TWIST architecture] originally developed by the telecommunications group ([http://www.tkn.tu-berlin.de/ TKN]) at the Technical University of Berlin.  The acronmym TWIST stands for &amp;quot;TKN Wireless Indoor Sensor network Testbed&amp;quot;.  It is hierarchical in nature, consisting of three different levels of deployment: sensor nodes, microservers, and a desktop class host/server machine.  A high level view of this three tiered architecture can be seen in the figure below.&lt;br /&gt;
At the lowest tier, sensor nodes are placed throughout the physical environment in order to take sensor readings and/or perform actuation.  They are connected to microservers at the second tier through a USB infrastructure consisting of USB 2.0 compliant hubs and a set of active/passive USB cables.  Messages can be exchanged between sensor nodes and microservers over this interface in both directions.  At the third and final tier exists a dedicated server which connects to all of the microservers over an Ethernet backbone.  The server machine is used to host, among other things, a database containing information about the different sensor nodes and the microservers they are connected to.  This database minimally contains information about the connections that have been established between the sensor nodes and microservers, as well as their current locations.  The server machine is also used to provide a workable interface between the testbed and any end-users.  Users may log onto the server to gain access to the information contained in the testbed database, as well as exchange messages with nodes contained in the testbed.  The entire TWIST architecture is based on cheap, off-the-shelf hardware and uses open-source software at every tier of its deployment.&lt;br /&gt;
&lt;br /&gt;
[[Image:wsn-architecture.jpg|thumb|left|300px|TWIST architecture]]&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both;&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Having such an architecture enables one to perform tasks not feasible in other WSN deployments. For example, debug messages from individual sensor nodes can be sent to the control station over the USB interface without interfering with a WSN application running in the network.  The USB infrastructure essentially provides an out of band means for collecting important information from each node without clogging up the wireless channel and adversely affecting any experiments being run.  This debug information can also be time stamped by the micorservers using NTP (Network Time Protocol) in order to gather statistics about what is going on at each individual point in the network at any given time.&lt;br /&gt;
&lt;br /&gt;
Programming of sensor nodes in the testbed is also made easier using the three tiered architecture, as a user simply tells the control station which sensor nodes it would like to program, and the control station does the work of distributing this request to the proper microserver.  Information about which sensor node is attached to which microserver can be obtained from the testbed database, and each request can be sent to the proper microserver using a dedicated thread of control.  These requests can then be processed by each microserver in parallel, speeding up the time required to program the entire testbed significantly.&lt;br /&gt;
&lt;br /&gt;
Individual sensor nodes in the testbed can also be disabled or enabled the USB interface.  This capability allows node failures to be simulated in the testbed environment, as well as fine tune the density of the network itself when running certain types of experiments.  The introduction of new nodes into the network can also be simulated by enabling nodes at specific times during the run of an experiment.&lt;br /&gt;
&lt;br /&gt;
All of the features described above really boil down to just one thing.  It is possible to run sophisticated experiments in the WSN testbed without ever having to physically change the layout of the testbed or interact with the individual sensor nodes that make it up.  Everything is controllable from the central server, and scripts can be written to perform countless numbers of operations involving each of the capabilites described above.&lt;br /&gt;
&lt;br /&gt;
==Existing Deployment==&lt;br /&gt;
Currently the testbed consists of 79 [http://www.xbow.com/Products/productdetails.aspx?sid=252 TelosB] motes placed throughout Bryan (48 nodes) and Jolley Hall (31 nodes).  The figure below shows the placement of these motes in the testbed.  Two motes are connected to each microserver, typically with one microserver per room.&lt;br /&gt;
&lt;br /&gt;
[[Image:wsn-deployment.png|thumb|left|600px|Existing deployment]]&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both;&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Testbed Software==&lt;br /&gt;
&lt;br /&gt;
The testbed software has a client/server architecture, plus a set of user applications that interact with the wireless testbed.  The client runs on the microservers and manages finding, programming, and communicating with the attached motes.  The server coordinates the clients and the user applications.  The user applications help the user to program, list, and communicate with motes in the system.&lt;br /&gt;
&lt;br /&gt;
The client, server, and user application software has been written mostly in Python, with some performance-critical sections written in C.  In addition, the server application interacts with a PostgreSQL database which lists the active microservers and motes.  The PostgreSQL backend is also available for user applications to store experimental data.&lt;br /&gt;
&lt;br /&gt;
===Startup===&lt;br /&gt;
The server software is automatically started as a Linux service on the testbed server machine.  The client software is also installed as a service on the microservers but is not automatically started.  A script is provided to the user which connects to the server and requests that the client be started on one or more microservers.&lt;br /&gt;
&lt;br /&gt;
When the client service is brought up, it sends a status message to the server, which marks the microserver as &amp;quot;up&amp;quot; in the database.  The microserver will also send messages listing the motes attached to its USB ports, which are likewise stored in the database.&lt;br /&gt;
&lt;br /&gt;
===Programming===&lt;br /&gt;
To program a set of motes, the user runs the &amp;quot;program.py&amp;quot; script, passing it the program binary and a description of the motes to program.  The user can select to program specific motes, all the motes attached to specific microservers, or the entire testbed.  &lt;br /&gt;
The server converts this request into a list of targeted motes.&lt;br /&gt;
&lt;br /&gt;
Once the set of motes has been determined, the server creates a binary file for each mote.  The server copies the original binary, imprints it with the mote's network address (stored in the database), and moves the new binary to the home directory of the microserver the mote is attached to.  The server then passes a request to the microserver to flash the binary onto the mote.&lt;br /&gt;
&lt;br /&gt;
When the programming completes, the microserver informs the server whether it was successful or not.  The server collects this status for every mote in the programming set, and informs the &amp;quot;program.py&amp;quot; script when the job is complete.&lt;br /&gt;
&lt;br /&gt;
The slowest part of programming a mote is flashing the binary onto the mote.  Because the flashing takes place on the microserver, we can program motes on different microservers in parallel, allowing us to program the entire testbed in the time it takes to program the motes on a single microserver.&lt;br /&gt;
&lt;br /&gt;
===Serial Communication===&lt;br /&gt;
The testbed software allows the user to send and receive serial packets through the motes' USB ports.  When a microserver discovers a new mote attached to one of its USB ports, it opens a connection to the mote's serial port.  Whenever a new serial packet is ready, the microserver reads the packet and sends it to the testbed server over the Ethernet backbone.  The testbed server forwards each packet to end-user applications which subscribe to this data.  Conversely, users may send the server requests to write a serial packet to a specific mote, which the server will forward to the corresponding microserver.&lt;br /&gt;
&lt;br /&gt;
The TinyOS SDK normally provides a &amp;quot;Serial Forwarder&amp;quot; component that allows PC applications to collect data from a locally-attached mote.  To interact with the testbed instead, the user runs the provided &amp;quot;forwarder.py&amp;quot; script, which acts as a drop-in replacement for the Serial Forwarder.  Thus, existing applications developed using the standard TinyOS SDK can be used on the testbed without modifications.&lt;br /&gt;
&lt;br /&gt;
Users may optionally use a testbed-specific Python API in place of the &amp;quot;forwarder.py&amp;quot; script.  This Python API offers new features which are not provided by the standard TinyOS SDK, such as the ability to remotely reboot motes.&lt;br /&gt;
&lt;br /&gt;
==Current Services==&lt;br /&gt;
&lt;br /&gt;
===Localization===&lt;br /&gt;
We currently have a localization service implemented in which all of the motes in the testbed act as anchor nodes in order to help localize a beacon node roaming throughout the network.  Below is a snapshot of a GUI application we have developed to visualize this localization service in action.  With the denser deployment of motes in the proposed testbed, we hope to become extremely accurate in determining the location of these beacon nodes in the network.&lt;br /&gt;
&lt;br /&gt;
[[Image:wsn-localization.png|thumb|left|300px|WSN localization application]]&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both;&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this figure we see two beacon nodes (102 and 103) being localized to rooms (519 and 534) respectively.  The purple dots represent anchor nodes deployed in the testbed and the green lines depict which anchors have heard a message sent by one of the beacons.  The localization algorithm used is based on particle filters -- a well understood method of localization used in robotics.  We have expanded the use of the particle filter to the wireless sensor network domain.  &lt;br /&gt;
&lt;br /&gt;
==Status==&lt;br /&gt;
&lt;br /&gt;
USED Guillaume&lt;br /&gt;
&lt;br /&gt;
==Acknowledgments==&lt;br /&gt;
This work is supported by the NSF under a CRI grant (CNS-0708460) and an ITR grant (CCR-0325529).&lt;br /&gt;
&lt;br /&gt;
* [[Equipment for course projects]]&lt;/div&gt;</summary>
		<author><name>Guillaume</name></author>
		
	</entry>
	<entry>
		<id>http://wsn.cse.wustl.edu/index.php?title=User:Guillaume&amp;diff=4000</id>
		<title>User:Guillaume</title>
		<link rel="alternate" type="text/html" href="http://wsn.cse.wustl.edu/index.php?title=User:Guillaume&amp;diff=4000"/>
		<updated>2017-03-20T15:13:30Z</updated>

		<summary type="html">&lt;p&gt;Guillaume: /* Tutoriels */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Tutoriels ==&lt;br /&gt;
&lt;br /&gt;
* [[Working environment setup for Contiki OS]]&lt;br /&gt;
* [[Contiki first project]]&lt;/div&gt;</summary>
		<author><name>Guillaume</name></author>
		
	</entry>
	<entry>
		<id>http://wsn.cse.wustl.edu/index.php?title=Contiki_first_project&amp;diff=3999</id>
		<title>Contiki first project</title>
		<link rel="alternate" type="text/html" href="http://wsn.cse.wustl.edu/index.php?title=Contiki_first_project&amp;diff=3999"/>
		<updated>2017-03-16T17:48:35Z</updated>

		<summary type="html">&lt;p&gt;Guillaume: /* Program the target device */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Contiki first Project =&lt;br /&gt;
&lt;br /&gt;
Now that you have an empty project with QtCreator (if you are using it), create 2 files:&lt;br /&gt;
&lt;br /&gt;
# General Text file named: '''Makefile'''&lt;br /&gt;
# C++ Source file: '''hello-world.c''' (you can't choose a C source file so make sure to change the '''cpp''' extension to '''c''')&lt;br /&gt;
&lt;br /&gt;
== Configuring the .pro file ==&lt;br /&gt;
&lt;br /&gt;
This file is used by QtCreator to configure your project:&lt;br /&gt;
&lt;br /&gt;
# Auto-complete&lt;br /&gt;
# Source and headers files&lt;br /&gt;
# Other files: Makefile &lt;br /&gt;
&lt;br /&gt;
Here a sample .pro file for the TelosB:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Apps included to the ContikiOS project (same value as the APP in your Makefile)&lt;br /&gt;
APPS=&lt;br /&gt;
&lt;br /&gt;
# Adding apps folders to project PATH for the auto complete&lt;br /&gt;
INC_VAR=join(APPS, &amp;quot; /home/user/contiki/apps/&amp;quot;, /home/user/contiki/apps/)&lt;br /&gt;
for(a, APPS):INCLUDEPATH+=/home/user/contiki/apps/$${a}&lt;br /&gt;
&lt;br /&gt;
# Other PATHs to be added: core cpu/[cpu] /platform/[platform]&lt;br /&gt;
INCLUDEPATH+=/home/user/contiki/core&lt;br /&gt;
INCLUDEPATH+=/home/user/contiki/cpu/msp430&lt;br /&gt;
INCLUDEPATH+=/home/user/contiki/platform/sky&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Define for Autocomplete for the TelosB mote&lt;br /&gt;
# Can be foundin: contiki/platform/[your platform: here sky]/Makefile.common&lt;br /&gt;
# Line with the CFLAGS:&lt;br /&gt;
# CFLAGS += -D__MSP430F1611__=1 -e --vla -Ohz --multiplier=16s --core=430 --double=32&lt;br /&gt;
DEFINES+=__MSP430F1611__=1&lt;br /&gt;
# other DEFINES you might need to include for the auto complete.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Added by QtCreator on adding files to the project.&lt;br /&gt;
&lt;br /&gt;
SOURCES += \&lt;br /&gt;
    hello-world.c&lt;br /&gt;
&lt;br /&gt;
HEADERS += \&lt;br /&gt;
&lt;br /&gt;
OTHER_FILES += \&lt;br /&gt;
    Makefile&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Creating the Makefile ==&lt;br /&gt;
&lt;br /&gt;
The Contiki Makefile is very easy to create:&lt;br /&gt;
# CONTIKI: relative path to contiki folder&lt;br /&gt;
# APPS: apps included in your project (those apps can be found in contiki/apps folder)&lt;br /&gt;
# CFLAGS: you can add flags here&lt;br /&gt;
# MODULES: for example if you need to include the tsch module: &amp;lt;code&amp;gt;MODULES += core/net/mac/tsch&amp;lt;/code&amp;gt;&lt;br /&gt;
# all: command to make the project&lt;br /&gt;
&lt;br /&gt;
Here the Makefile for the hello-world project made with QtCreator:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
CONTIKI_PROJECT = hello-world&lt;br /&gt;
all: $(CONTIKI_PROJECT)&lt;br /&gt;
&lt;br /&gt;
APPS +=&lt;br /&gt;
MODULES += &lt;br /&gt;
CFLAGS +=&lt;br /&gt;
&lt;br /&gt;
CONTIKI = ../../contiki&lt;br /&gt;
include $(CONTIKI)/Makefile.include&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
My folder tree looks like that:&lt;br /&gt;
&lt;br /&gt;
* contiki/&lt;br /&gt;
* workspace/&lt;br /&gt;
** hello-world/&lt;br /&gt;
*** hello-world.c&lt;br /&gt;
*** Makefile&lt;br /&gt;
&lt;br /&gt;
== Build and program ==&lt;br /&gt;
&lt;br /&gt;
=== Build ===&lt;br /&gt;
&lt;br /&gt;
==== QtCreator ====&lt;br /&gt;
Last step before compiling your code if you want to compile it directly using QtCreator:&lt;br /&gt;
&lt;br /&gt;
On the lest toolbar go to &lt;br /&gt;
# '''Projects'''&lt;br /&gt;
# Choose the build directory: &amp;lt;code&amp;gt;/home/user/workspace/hello-world&amp;lt;/code&amp;gt;&lt;br /&gt;
# Remove all the build and clean steps&lt;br /&gt;
# Create a new '''Make step''' for the Build &lt;br /&gt;
# Add the '''Make arguments''': &amp;lt;code&amp;gt;all TARGET=sky&amp;lt;/code&amp;gt;&lt;br /&gt;
# Do the same thing for Clean steps&lt;br /&gt;
&lt;br /&gt;
QtCreator is ready to Build the project.&lt;br /&gt;
&lt;br /&gt;
==== Manual Build ====&lt;br /&gt;
&lt;br /&gt;
# Open a terminal&lt;br /&gt;
# Go to your project directory&lt;br /&gt;
# Compile using make and the corresponding TARGET: &amp;lt;code&amp;gt;TARGET:=sky&amp;lt;/code&amp;gt; (for TelosB)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd ~/workspace/hello-world&lt;br /&gt;
make all TARGET=sky&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Program the target device ===&lt;br /&gt;
&lt;br /&gt;
First step is to create the '''.ihex''' file from your '''.sky''' file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;msp430-objcopy hello-world.sky -O ihex hello-world.ihex&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And last program you TelosB:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo tos-bsl --telosb -c /dev/ttyUSB0 -r -e -I -p hello-world.ihex&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now if you want to see what the hello-world project does:&lt;br /&gt;
# Open Putty&lt;br /&gt;
# Open the Serial terminal&lt;br /&gt;
# Reset your TelosB&lt;/div&gt;</summary>
		<author><name>Guillaume</name></author>
		
	</entry>
	<entry>
		<id>http://wsn.cse.wustl.edu/index.php?title=Contiki_first_project&amp;diff=3998</id>
		<title>Contiki first project</title>
		<link rel="alternate" type="text/html" href="http://wsn.cse.wustl.edu/index.php?title=Contiki_first_project&amp;diff=3998"/>
		<updated>2017-03-16T17:48:09Z</updated>

		<summary type="html">&lt;p&gt;Guillaume: /* QtCreator */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Contiki first Project =&lt;br /&gt;
&lt;br /&gt;
Now that you have an empty project with QtCreator (if you are using it), create 2 files:&lt;br /&gt;
&lt;br /&gt;
# General Text file named: '''Makefile'''&lt;br /&gt;
# C++ Source file: '''hello-world.c''' (you can't choose a C source file so make sure to change the '''cpp''' extension to '''c''')&lt;br /&gt;
&lt;br /&gt;
== Configuring the .pro file ==&lt;br /&gt;
&lt;br /&gt;
This file is used by QtCreator to configure your project:&lt;br /&gt;
&lt;br /&gt;
# Auto-complete&lt;br /&gt;
# Source and headers files&lt;br /&gt;
# Other files: Makefile &lt;br /&gt;
&lt;br /&gt;
Here a sample .pro file for the TelosB:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Apps included to the ContikiOS project (same value as the APP in your Makefile)&lt;br /&gt;
APPS=&lt;br /&gt;
&lt;br /&gt;
# Adding apps folders to project PATH for the auto complete&lt;br /&gt;
INC_VAR=join(APPS, &amp;quot; /home/user/contiki/apps/&amp;quot;, /home/user/contiki/apps/)&lt;br /&gt;
for(a, APPS):INCLUDEPATH+=/home/user/contiki/apps/$${a}&lt;br /&gt;
&lt;br /&gt;
# Other PATHs to be added: core cpu/[cpu] /platform/[platform]&lt;br /&gt;
INCLUDEPATH+=/home/user/contiki/core&lt;br /&gt;
INCLUDEPATH+=/home/user/contiki/cpu/msp430&lt;br /&gt;
INCLUDEPATH+=/home/user/contiki/platform/sky&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Define for Autocomplete for the TelosB mote&lt;br /&gt;
# Can be foundin: contiki/platform/[your platform: here sky]/Makefile.common&lt;br /&gt;
# Line with the CFLAGS:&lt;br /&gt;
# CFLAGS += -D__MSP430F1611__=1 -e --vla -Ohz --multiplier=16s --core=430 --double=32&lt;br /&gt;
DEFINES+=__MSP430F1611__=1&lt;br /&gt;
# other DEFINES you might need to include for the auto complete.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Added by QtCreator on adding files to the project.&lt;br /&gt;
&lt;br /&gt;
SOURCES += \&lt;br /&gt;
    hello-world.c&lt;br /&gt;
&lt;br /&gt;
HEADERS += \&lt;br /&gt;
&lt;br /&gt;
OTHER_FILES += \&lt;br /&gt;
    Makefile&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Creating the Makefile ==&lt;br /&gt;
&lt;br /&gt;
The Contiki Makefile is very easy to create:&lt;br /&gt;
# CONTIKI: relative path to contiki folder&lt;br /&gt;
# APPS: apps included in your project (those apps can be found in contiki/apps folder)&lt;br /&gt;
# CFLAGS: you can add flags here&lt;br /&gt;
# MODULES: for example if you need to include the tsch module: &amp;lt;code&amp;gt;MODULES += core/net/mac/tsch&amp;lt;/code&amp;gt;&lt;br /&gt;
# all: command to make the project&lt;br /&gt;
&lt;br /&gt;
Here the Makefile for the hello-world project made with QtCreator:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
CONTIKI_PROJECT = hello-world&lt;br /&gt;
all: $(CONTIKI_PROJECT)&lt;br /&gt;
&lt;br /&gt;
APPS +=&lt;br /&gt;
MODULES += &lt;br /&gt;
CFLAGS +=&lt;br /&gt;
&lt;br /&gt;
CONTIKI = ../../contiki&lt;br /&gt;
include $(CONTIKI)/Makefile.include&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
My folder tree looks like that:&lt;br /&gt;
&lt;br /&gt;
* contiki/&lt;br /&gt;
* workspace/&lt;br /&gt;
** hello-world/&lt;br /&gt;
*** hello-world.c&lt;br /&gt;
*** Makefile&lt;br /&gt;
&lt;br /&gt;
== Build and program ==&lt;br /&gt;
&lt;br /&gt;
=== Build ===&lt;br /&gt;
&lt;br /&gt;
==== QtCreator ====&lt;br /&gt;
Last step before compiling your code if you want to compile it directly using QtCreator:&lt;br /&gt;
&lt;br /&gt;
On the lest toolbar go to &lt;br /&gt;
# '''Projects'''&lt;br /&gt;
# Choose the build directory: &amp;lt;code&amp;gt;/home/user/workspace/hello-world&amp;lt;/code&amp;gt;&lt;br /&gt;
# Remove all the build and clean steps&lt;br /&gt;
# Create a new '''Make step''' for the Build &lt;br /&gt;
# Add the '''Make arguments''': &amp;lt;code&amp;gt;all TARGET=sky&amp;lt;/code&amp;gt;&lt;br /&gt;
# Do the same thing for Clean steps&lt;br /&gt;
&lt;br /&gt;
QtCreator is ready to Build the project.&lt;br /&gt;
&lt;br /&gt;
==== Manual Build ====&lt;br /&gt;
&lt;br /&gt;
# Open a terminal&lt;br /&gt;
# Go to your project directory&lt;br /&gt;
# Compile using make and the corresponding TARGET: &amp;lt;code&amp;gt;TARGET:=sky&amp;lt;/code&amp;gt; (for TelosB)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd ~/workspace/hello-world&lt;br /&gt;
make all TARGET=sky&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Program the target device ===&lt;br /&gt;
&lt;br /&gt;
First step is to create the '''.ihex''' file from your '''.sky''' file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;msp430-objcopy hello-world.sky -O ihex hello-world.ihex&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And last program you TelosB:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo tos-bsl --telosb -c /dev/ttyUSB0 -r -e -I -p application-name.ihex&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now if you want to see what the hello-world project does:&lt;br /&gt;
# Open Putty&lt;br /&gt;
# Open the Serial terminal&lt;br /&gt;
# Reset your TelosB&lt;/div&gt;</summary>
		<author><name>Guillaume</name></author>
		
	</entry>
	<entry>
		<id>http://wsn.cse.wustl.edu/index.php?title=Contiki_first_project&amp;diff=3997</id>
		<title>Contiki first project</title>
		<link rel="alternate" type="text/html" href="http://wsn.cse.wustl.edu/index.php?title=Contiki_first_project&amp;diff=3997"/>
		<updated>2017-03-16T17:47:38Z</updated>

		<summary type="html">&lt;p&gt;Guillaume: /* QtCreator */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Contiki first Project =&lt;br /&gt;
&lt;br /&gt;
Now that you have an empty project with QtCreator (if you are using it), create 2 files:&lt;br /&gt;
&lt;br /&gt;
# General Text file named: '''Makefile'''&lt;br /&gt;
# C++ Source file: '''hello-world.c''' (you can't choose a C source file so make sure to change the '''cpp''' extension to '''c''')&lt;br /&gt;
&lt;br /&gt;
== Configuring the .pro file ==&lt;br /&gt;
&lt;br /&gt;
This file is used by QtCreator to configure your project:&lt;br /&gt;
&lt;br /&gt;
# Auto-complete&lt;br /&gt;
# Source and headers files&lt;br /&gt;
# Other files: Makefile &lt;br /&gt;
&lt;br /&gt;
Here a sample .pro file for the TelosB:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Apps included to the ContikiOS project (same value as the APP in your Makefile)&lt;br /&gt;
APPS=&lt;br /&gt;
&lt;br /&gt;
# Adding apps folders to project PATH for the auto complete&lt;br /&gt;
INC_VAR=join(APPS, &amp;quot; /home/user/contiki/apps/&amp;quot;, /home/user/contiki/apps/)&lt;br /&gt;
for(a, APPS):INCLUDEPATH+=/home/user/contiki/apps/$${a}&lt;br /&gt;
&lt;br /&gt;
# Other PATHs to be added: core cpu/[cpu] /platform/[platform]&lt;br /&gt;
INCLUDEPATH+=/home/user/contiki/core&lt;br /&gt;
INCLUDEPATH+=/home/user/contiki/cpu/msp430&lt;br /&gt;
INCLUDEPATH+=/home/user/contiki/platform/sky&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Define for Autocomplete for the TelosB mote&lt;br /&gt;
# Can be foundin: contiki/platform/[your platform: here sky]/Makefile.common&lt;br /&gt;
# Line with the CFLAGS:&lt;br /&gt;
# CFLAGS += -D__MSP430F1611__=1 -e --vla -Ohz --multiplier=16s --core=430 --double=32&lt;br /&gt;
DEFINES+=__MSP430F1611__=1&lt;br /&gt;
# other DEFINES you might need to include for the auto complete.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Added by QtCreator on adding files to the project.&lt;br /&gt;
&lt;br /&gt;
SOURCES += \&lt;br /&gt;
    hello-world.c&lt;br /&gt;
&lt;br /&gt;
HEADERS += \&lt;br /&gt;
&lt;br /&gt;
OTHER_FILES += \&lt;br /&gt;
    Makefile&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Creating the Makefile ==&lt;br /&gt;
&lt;br /&gt;
The Contiki Makefile is very easy to create:&lt;br /&gt;
# CONTIKI: relative path to contiki folder&lt;br /&gt;
# APPS: apps included in your project (those apps can be found in contiki/apps folder)&lt;br /&gt;
# CFLAGS: you can add flags here&lt;br /&gt;
# MODULES: for example if you need to include the tsch module: &amp;lt;code&amp;gt;MODULES += core/net/mac/tsch&amp;lt;/code&amp;gt;&lt;br /&gt;
# all: command to make the project&lt;br /&gt;
&lt;br /&gt;
Here the Makefile for the hello-world project made with QtCreator:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
CONTIKI_PROJECT = hello-world&lt;br /&gt;
all: $(CONTIKI_PROJECT)&lt;br /&gt;
&lt;br /&gt;
APPS +=&lt;br /&gt;
MODULES += &lt;br /&gt;
CFLAGS +=&lt;br /&gt;
&lt;br /&gt;
CONTIKI = ../../contiki&lt;br /&gt;
include $(CONTIKI)/Makefile.include&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
My folder tree looks like that:&lt;br /&gt;
&lt;br /&gt;
* contiki/&lt;br /&gt;
* workspace/&lt;br /&gt;
** hello-world/&lt;br /&gt;
*** hello-world.c&lt;br /&gt;
*** Makefile&lt;br /&gt;
&lt;br /&gt;
== Build and program ==&lt;br /&gt;
&lt;br /&gt;
=== Build ===&lt;br /&gt;
&lt;br /&gt;
==== QtCreator ====&lt;br /&gt;
Last step before compiling your code if you want to compile it directly using QtCreator:&lt;br /&gt;
&lt;br /&gt;
On the lest toolbar go to &lt;br /&gt;
# '''Projects'''&lt;br /&gt;
# Choose the build directory: &amp;lt;code&amp;gt;/home/user/workspace/hello-world&amp;lt;/code&amp;gt;&lt;br /&gt;
# Remove all the build and clean steps&lt;br /&gt;
# Create a new '''Make step''' for the Build &lt;br /&gt;
# Add the '''Make arguments''': &amp;lt;code&amp;gt;all TARGET=sky&amp;lt;/code&amp;gt;&lt;br /&gt;
# Do the same thing for Clean steps&lt;br /&gt;
&lt;br /&gt;
QtCreator is ready to Build the project.&lt;br /&gt;
&lt;br /&gt;
Last you need to program the TelosB.&lt;br /&gt;
&lt;br /&gt;
See next section [[#Program the target device]].&lt;br /&gt;
&lt;br /&gt;
==== Manual Build ====&lt;br /&gt;
&lt;br /&gt;
# Open a terminal&lt;br /&gt;
# Go to your project directory&lt;br /&gt;
# Compile using make and the corresponding TARGET: &amp;lt;code&amp;gt;TARGET:=sky&amp;lt;/code&amp;gt; (for TelosB)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd ~/workspace/hello-world&lt;br /&gt;
make all TARGET=sky&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Program the target device ===&lt;br /&gt;
&lt;br /&gt;
First step is to create the '''.ihex''' file from your '''.sky''' file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;msp430-objcopy hello-world.sky -O ihex hello-world.ihex&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And last program you TelosB:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo tos-bsl --telosb -c /dev/ttyUSB0 -r -e -I -p application-name.ihex&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now if you want to see what the hello-world project does:&lt;br /&gt;
# Open Putty&lt;br /&gt;
# Open the Serial terminal&lt;br /&gt;
# Reset your TelosB&lt;/div&gt;</summary>
		<author><name>Guillaume</name></author>
		
	</entry>
	<entry>
		<id>http://wsn.cse.wustl.edu/index.php?title=Contiki_first_project&amp;diff=3996</id>
		<title>Contiki first project</title>
		<link rel="alternate" type="text/html" href="http://wsn.cse.wustl.edu/index.php?title=Contiki_first_project&amp;diff=3996"/>
		<updated>2017-03-16T17:47:11Z</updated>

		<summary type="html">&lt;p&gt;Guillaume: /* QtCreator */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Contiki first Project =&lt;br /&gt;
&lt;br /&gt;
Now that you have an empty project with QtCreator (if you are using it), create 2 files:&lt;br /&gt;
&lt;br /&gt;
# General Text file named: '''Makefile'''&lt;br /&gt;
# C++ Source file: '''hello-world.c''' (you can't choose a C source file so make sure to change the '''cpp''' extension to '''c''')&lt;br /&gt;
&lt;br /&gt;
== Configuring the .pro file ==&lt;br /&gt;
&lt;br /&gt;
This file is used by QtCreator to configure your project:&lt;br /&gt;
&lt;br /&gt;
# Auto-complete&lt;br /&gt;
# Source and headers files&lt;br /&gt;
# Other files: Makefile &lt;br /&gt;
&lt;br /&gt;
Here a sample .pro file for the TelosB:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Apps included to the ContikiOS project (same value as the APP in your Makefile)&lt;br /&gt;
APPS=&lt;br /&gt;
&lt;br /&gt;
# Adding apps folders to project PATH for the auto complete&lt;br /&gt;
INC_VAR=join(APPS, &amp;quot; /home/user/contiki/apps/&amp;quot;, /home/user/contiki/apps/)&lt;br /&gt;
for(a, APPS):INCLUDEPATH+=/home/user/contiki/apps/$${a}&lt;br /&gt;
&lt;br /&gt;
# Other PATHs to be added: core cpu/[cpu] /platform/[platform]&lt;br /&gt;
INCLUDEPATH+=/home/user/contiki/core&lt;br /&gt;
INCLUDEPATH+=/home/user/contiki/cpu/msp430&lt;br /&gt;
INCLUDEPATH+=/home/user/contiki/platform/sky&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Define for Autocomplete for the TelosB mote&lt;br /&gt;
# Can be foundin: contiki/platform/[your platform: here sky]/Makefile.common&lt;br /&gt;
# Line with the CFLAGS:&lt;br /&gt;
# CFLAGS += -D__MSP430F1611__=1 -e --vla -Ohz --multiplier=16s --core=430 --double=32&lt;br /&gt;
DEFINES+=__MSP430F1611__=1&lt;br /&gt;
# other DEFINES you might need to include for the auto complete.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Added by QtCreator on adding files to the project.&lt;br /&gt;
&lt;br /&gt;
SOURCES += \&lt;br /&gt;
    hello-world.c&lt;br /&gt;
&lt;br /&gt;
HEADERS += \&lt;br /&gt;
&lt;br /&gt;
OTHER_FILES += \&lt;br /&gt;
    Makefile&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Creating the Makefile ==&lt;br /&gt;
&lt;br /&gt;
The Contiki Makefile is very easy to create:&lt;br /&gt;
# CONTIKI: relative path to contiki folder&lt;br /&gt;
# APPS: apps included in your project (those apps can be found in contiki/apps folder)&lt;br /&gt;
# CFLAGS: you can add flags here&lt;br /&gt;
# MODULES: for example if you need to include the tsch module: &amp;lt;code&amp;gt;MODULES += core/net/mac/tsch&amp;lt;/code&amp;gt;&lt;br /&gt;
# all: command to make the project&lt;br /&gt;
&lt;br /&gt;
Here the Makefile for the hello-world project made with QtCreator:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
CONTIKI_PROJECT = hello-world&lt;br /&gt;
all: $(CONTIKI_PROJECT)&lt;br /&gt;
&lt;br /&gt;
APPS +=&lt;br /&gt;
MODULES += &lt;br /&gt;
CFLAGS +=&lt;br /&gt;
&lt;br /&gt;
CONTIKI = ../../contiki&lt;br /&gt;
include $(CONTIKI)/Makefile.include&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
My folder tree looks like that:&lt;br /&gt;
&lt;br /&gt;
* contiki/&lt;br /&gt;
* workspace/&lt;br /&gt;
** hello-world/&lt;br /&gt;
*** hello-world.c&lt;br /&gt;
*** Makefile&lt;br /&gt;
&lt;br /&gt;
== Build and program ==&lt;br /&gt;
&lt;br /&gt;
=== Build ===&lt;br /&gt;
&lt;br /&gt;
==== QtCreator ====&lt;br /&gt;
Last step before compiling your code if you want to compile it directly using QtCreator:&lt;br /&gt;
&lt;br /&gt;
On the lest toolbar go to &lt;br /&gt;
# '''Projects'''&lt;br /&gt;
# Choose the build directory: &amp;lt;code&amp;gt;/home/user/workspace/hello-world&amp;lt;/code&amp;gt;&lt;br /&gt;
# Remove all the build and clean steps&lt;br /&gt;
# Create a new '''Make step''' for the Build &lt;br /&gt;
# Add the '''Make arguments''': &amp;lt;code&amp;gt;all TARGET=sky&amp;lt;/code&amp;gt;&lt;br /&gt;
# Do the same thing for Clean steps&lt;br /&gt;
&lt;br /&gt;
QtCreator is ready to Build the project.&lt;br /&gt;
&lt;br /&gt;
Last you need to program the TelosB.&lt;br /&gt;
&lt;br /&gt;
See next section [#Program the target device].&lt;br /&gt;
&lt;br /&gt;
==== Manual Build ====&lt;br /&gt;
&lt;br /&gt;
# Open a terminal&lt;br /&gt;
# Go to your project directory&lt;br /&gt;
# Compile using make and the corresponding TARGET: &amp;lt;code&amp;gt;TARGET:=sky&amp;lt;/code&amp;gt; (for TelosB)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd ~/workspace/hello-world&lt;br /&gt;
make all TARGET=sky&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Program the target device ===&lt;br /&gt;
&lt;br /&gt;
First step is to create the '''.ihex''' file from your '''.sky''' file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;msp430-objcopy hello-world.sky -O ihex hello-world.ihex&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And last program you TelosB:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo tos-bsl --telosb -c /dev/ttyUSB0 -r -e -I -p application-name.ihex&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now if you want to see what the hello-world project does:&lt;br /&gt;
# Open Putty&lt;br /&gt;
# Open the Serial terminal&lt;br /&gt;
# Reset your TelosB&lt;/div&gt;</summary>
		<author><name>Guillaume</name></author>
		
	</entry>
	<entry>
		<id>http://wsn.cse.wustl.edu/index.php?title=Working_environment_setup_for_Contiki_OS&amp;diff=3995</id>
		<title>Working environment setup for Contiki OS</title>
		<link rel="alternate" type="text/html" href="http://wsn.cse.wustl.edu/index.php?title=Working_environment_setup_for_Contiki_OS&amp;diff=3995"/>
		<updated>2017-03-16T16:52:11Z</updated>

		<summary type="html">&lt;p&gt;Guillaume: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
= Preparing your working Environment =&lt;br /&gt;
&lt;br /&gt;
Cross compilation for Contiki-OS is easier using Ubuntu OS.&lt;br /&gt;
&lt;br /&gt;
You have two possible ways:&lt;br /&gt;
* Installing all the packages you need on your Linux distribution&lt;br /&gt;
* Downloading [http://www.contiki-os.org/download.html Instant Contiki] you will need to install [[#GCC for TelosB]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== GCC for TelosB ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install gcc-msp430&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Tools to program the TelosB ==&lt;br /&gt;
We will use the tos-bsl to upload the ihex file from the computer to the TelosB&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo apt-get install tinyos-utils&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Putty ==&lt;br /&gt;
&lt;br /&gt;
=== Putty Installation ===&lt;br /&gt;
Putty will be used to communicate with the TelosB using its Serial communication.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
wget &amp;lt;nowiki&amp;gt;https://the.earth.li/~sgtatham/putty/latest/putty-0.68.tar.gz&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
tar xzf putty-0.68.tar.gz&lt;br /&gt;
&lt;br /&gt;
cd putty-0.68&lt;br /&gt;
&lt;br /&gt;
./configure&lt;br /&gt;
&lt;br /&gt;
make -j4 all&lt;br /&gt;
&lt;br /&gt;
sudo make install&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Putty Configuration ===&lt;br /&gt;
Default &amp;lt;code&amp;gt;printf&amp;lt;/code&amp;gt; function used in Contiki-OS for TelosB outputs the data on the usb port with a Serial baud rate of 115200.&lt;br /&gt;
&lt;br /&gt;
# '''Connection type''': Serial&lt;br /&gt;
# Find the /dev/ttyUSB* of your board and enter it in the '''Serial line'''&lt;br /&gt;
ls /dev/ttyUSB*&lt;br /&gt;
# Default '''baud rate''' (if unchanged for default printf function): 115200&lt;br /&gt;
# Into '''Terminal''' Category: Check &amp;quot;'''Implicit CR in every LF'''&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#f00&amp;quot;&amp;gt;'''Don't forget to run Putty as a root user! Or give general permissions to access your tty to all users.'''&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Download Contiki-OS sources ==&lt;br /&gt;
&lt;br /&gt;
To get the latest sources download them from github:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;git clone https://github.com/contiki-os/contiki.git&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you downloaded Instant Contiki don't forget to pull the latest release:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd ~&lt;br /&gt;
&lt;br /&gt;
cd contiki&lt;br /&gt;
&lt;br /&gt;
git pull origin master&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== QtCreator ==&lt;br /&gt;
&lt;br /&gt;
I prefer QtCreator over other IDE because it is lighter and faster than Eclipse and easier to configure.&lt;br /&gt;
&lt;br /&gt;
'''The choice is yours as you will be working with it.'''&lt;br /&gt;
&lt;br /&gt;
Here how to configure it to work with Contiki-OS projects:&lt;br /&gt;
&lt;br /&gt;
=== Install QtCreator ===&lt;br /&gt;
&lt;br /&gt;
Easiest part:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo apt-get install qtcreator&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Creating a new project ===&lt;br /&gt;
&lt;br /&gt;
You need to create a new empty qt project.&lt;br /&gt;
&lt;br /&gt;
I did mine in a folder named workspace in my home directory.&lt;br /&gt;
&lt;br /&gt;
* Kit: choose Desktop (this part doesn't matters but is mandatory)&lt;br /&gt;
* Choose either Debug or Release (doesn't matter either as you will be using your own Makefile)&lt;br /&gt;
&lt;br /&gt;
Now you have your empty project. Next step [[Contiki first project]].&lt;/div&gt;</summary>
		<author><name>Guillaume</name></author>
		
	</entry>
	<entry>
		<id>http://wsn.cse.wustl.edu/index.php?title=Working_environment_setup_for_Contiki_OS&amp;diff=3994</id>
		<title>Working environment setup for Contiki OS</title>
		<link rel="alternate" type="text/html" href="http://wsn.cse.wustl.edu/index.php?title=Working_environment_setup_for_Contiki_OS&amp;diff=3994"/>
		<updated>2017-03-16T16:51:46Z</updated>

		<summary type="html">&lt;p&gt;Guillaume: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
= Preparing your working Environment =&lt;br /&gt;
&lt;br /&gt;
Cross compilation for Contiki-OS is easier using Ubuntu OS.&lt;br /&gt;
&lt;br /&gt;
You have two possible ways:&lt;br /&gt;
* Installing all the packages you need on your Linux distribution&lt;br /&gt;
* Downloading [http://www.contiki-os.org/download.html Instant Contiki] you will need to install [[#GCC for TelosB]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== GCC for TelosB ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install gcc-msp430&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Tools to program the TelosB ==&lt;br /&gt;
We will use the tos-bsl to upload the ihex file from the computer to the TelosB&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo apt-get install tinyos-utils&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Putty ==&lt;br /&gt;
&lt;br /&gt;
=== Putty Installation ===&lt;br /&gt;
Putty will be used to communicate with the TelosB using its Serial communication.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
wget &amp;lt;nowiki&amp;gt;https://the.earth.li/~sgtatham/putty/latest/putty-0.68.tar.gz&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
tar xzf putty-0.68.tar.gz&lt;br /&gt;
&lt;br /&gt;
cd putty-0.68&lt;br /&gt;
&lt;br /&gt;
./configure&lt;br /&gt;
&lt;br /&gt;
make -j4 all&lt;br /&gt;
&lt;br /&gt;
sudo make install&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Putty Configuration ===&lt;br /&gt;
Default &amp;lt;code&amp;gt;printf&amp;lt;/code&amp;gt; function used in Contiki-OS for TelosB outputs the data on the usb port with a Serial baud rate of 115200.&lt;br /&gt;
&lt;br /&gt;
# '''Connection type''': Serial&lt;br /&gt;
# Find the /dev/ttyUSB* of your board and enter it in the '''Serial line'''&lt;br /&gt;
ls /dev/ttyUSB*&lt;br /&gt;
# Default '''baud rate''' (if unchanged for default printf function): 115200&lt;br /&gt;
# Into '''Terminal''' Category: Check &amp;quot;'''Implicit CR in every LF'''&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#f00&amp;quot;&amp;gt;'''Don't forget to run Putty as a root user! Or give general permissions to access your tty to all users.'''&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Download Contiki-OS sources ==&lt;br /&gt;
&lt;br /&gt;
To get the latest sources download them from github:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;git clone https://github.com/contiki-os/contiki.git&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you downloaded Instant Contiki don't forget to pull the latest release:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd ~&lt;br /&gt;
&lt;br /&gt;
cd contiki&lt;br /&gt;
&lt;br /&gt;
git pull origin master&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== QtCreator ==&lt;br /&gt;
&lt;br /&gt;
I prefer QtCreator over other IDE because it is lighter and faster than Eclipse and easier to configure.&lt;br /&gt;
&lt;br /&gt;
'''The choice is yours as you will be working with it.'''&lt;br /&gt;
&lt;br /&gt;
Here how to configure it to work with Contiki-OS projects:&lt;br /&gt;
&lt;br /&gt;
=== Install QtCreator ===&lt;br /&gt;
&lt;br /&gt;
Easiest part:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;sudo apt-get install qtcreator&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Creating a new project ===&lt;br /&gt;
&lt;br /&gt;
You need to create a new empty qt project.&lt;br /&gt;
&lt;br /&gt;
I did mine in a folder named workspace in my home directory.&lt;br /&gt;
&lt;br /&gt;
* Kit: choose Desktop (this part doesn't matters but is mandatory)&lt;br /&gt;
* Choose either Debug or Release (doesn't matter either as you will be using your own Makefile)&lt;br /&gt;
&lt;br /&gt;
Now you have your empty project. Next step [[Contiki first project]].&lt;/div&gt;</summary>
		<author><name>Guillaume</name></author>
		
	</entry>
	<entry>
		<id>http://wsn.cse.wustl.edu/index.php?title=Contiki_first_project&amp;diff=3993</id>
		<title>Contiki first project</title>
		<link rel="alternate" type="text/html" href="http://wsn.cse.wustl.edu/index.php?title=Contiki_first_project&amp;diff=3993"/>
		<updated>2017-03-16T16:50:38Z</updated>

		<summary type="html">&lt;p&gt;Guillaume: Created page with &amp;quot;= Contiki first Project =  Now that you have an empty project with QtCreator (if you are using it), create 2 files:  # General Text file named: '''Makefile''' # C++ Source fil...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Contiki first Project =&lt;br /&gt;
&lt;br /&gt;
Now that you have an empty project with QtCreator (if you are using it), create 2 files:&lt;br /&gt;
&lt;br /&gt;
# General Text file named: '''Makefile'''&lt;br /&gt;
# C++ Source file: '''hello-world.c''' (you can't choose a C source file so make sure to change the '''cpp''' extension to '''c''')&lt;br /&gt;
&lt;br /&gt;
== Configuring the .pro file ==&lt;br /&gt;
&lt;br /&gt;
This file is used by QtCreator to configure your project:&lt;br /&gt;
&lt;br /&gt;
# Auto-complete&lt;br /&gt;
# Source and headers files&lt;br /&gt;
# Other files: Makefile &lt;br /&gt;
&lt;br /&gt;
Here a sample .pro file for the TelosB:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Apps included to the ContikiOS project (same value as the APP in your Makefile)&lt;br /&gt;
APPS=&lt;br /&gt;
&lt;br /&gt;
# Adding apps folders to project PATH for the auto complete&lt;br /&gt;
INC_VAR=join(APPS, &amp;quot; /home/user/contiki/apps/&amp;quot;, /home/user/contiki/apps/)&lt;br /&gt;
for(a, APPS):INCLUDEPATH+=/home/user/contiki/apps/$${a}&lt;br /&gt;
&lt;br /&gt;
# Other PATHs to be added: core cpu/[cpu] /platform/[platform]&lt;br /&gt;
INCLUDEPATH+=/home/user/contiki/core&lt;br /&gt;
INCLUDEPATH+=/home/user/contiki/cpu/msp430&lt;br /&gt;
INCLUDEPATH+=/home/user/contiki/platform/sky&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Define for Autocomplete for the TelosB mote&lt;br /&gt;
# Can be foundin: contiki/platform/[your platform: here sky]/Makefile.common&lt;br /&gt;
# Line with the CFLAGS:&lt;br /&gt;
# CFLAGS += -D__MSP430F1611__=1 -e --vla -Ohz --multiplier=16s --core=430 --double=32&lt;br /&gt;
DEFINES+=__MSP430F1611__=1&lt;br /&gt;
# other DEFINES you might need to include for the auto complete.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Added by QtCreator on adding files to the project.&lt;br /&gt;
&lt;br /&gt;
SOURCES += \&lt;br /&gt;
    hello-world.c&lt;br /&gt;
&lt;br /&gt;
HEADERS += \&lt;br /&gt;
&lt;br /&gt;
OTHER_FILES += \&lt;br /&gt;
    Makefile&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Creating the Makefile ==&lt;br /&gt;
&lt;br /&gt;
The Contiki Makefile is very easy to create:&lt;br /&gt;
# CONTIKI: relative path to contiki folder&lt;br /&gt;
# APPS: apps included in your project (those apps can be found in contiki/apps folder)&lt;br /&gt;
# CFLAGS: you can add flags here&lt;br /&gt;
# MODULES: for example if you need to include the tsch module: &amp;lt;code&amp;gt;MODULES += core/net/mac/tsch&amp;lt;/code&amp;gt;&lt;br /&gt;
# all: command to make the project&lt;br /&gt;
&lt;br /&gt;
Here the Makefile for the hello-world project made with QtCreator:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
CONTIKI_PROJECT = hello-world&lt;br /&gt;
all: $(CONTIKI_PROJECT)&lt;br /&gt;
&lt;br /&gt;
APPS +=&lt;br /&gt;
MODULES += &lt;br /&gt;
CFLAGS +=&lt;br /&gt;
&lt;br /&gt;
CONTIKI = ../../contiki&lt;br /&gt;
include $(CONTIKI)/Makefile.include&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
My folder tree looks like that:&lt;br /&gt;
&lt;br /&gt;
* contiki/&lt;br /&gt;
* workspace/&lt;br /&gt;
** hello-world/&lt;br /&gt;
*** hello-world.c&lt;br /&gt;
*** Makefile&lt;br /&gt;
&lt;br /&gt;
== Build and program ==&lt;br /&gt;
&lt;br /&gt;
=== Build ===&lt;br /&gt;
&lt;br /&gt;
==== QtCreator ====&lt;br /&gt;
Last step before compiling your code if you want to compile it directly using QtCreator:&lt;br /&gt;
&lt;br /&gt;
On the lest toolbar go to &lt;br /&gt;
# '''Projects'''&lt;br /&gt;
# Choose the build directory: &amp;lt;code&amp;gt;/home/user/workspace/hello-world&amp;lt;/code&amp;gt;&lt;br /&gt;
# Remove all the build and clean steps&lt;br /&gt;
# Create a new '''Make step''' for the Build &lt;br /&gt;
# Add the '''Make arguments''': &amp;lt;code&amp;gt;all TARGET=sky&amp;lt;/code&amp;gt;&lt;br /&gt;
# Do the same thing for Clean steps&lt;br /&gt;
&lt;br /&gt;
QtCreator is ready to Build the project.&lt;br /&gt;
&lt;br /&gt;
==== Manual Build ====&lt;br /&gt;
&lt;br /&gt;
# Open a terminal&lt;br /&gt;
# Go to your project directory&lt;br /&gt;
# Compile using make and the corresponding TARGET: &amp;lt;code&amp;gt;TARGET:=sky&amp;lt;/code&amp;gt; (for TelosB)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd ~/workspace/hello-world&lt;br /&gt;
make all TARGET=sky&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Program the target device ===&lt;br /&gt;
&lt;br /&gt;
First step is to create the '''.ihex''' file from your '''.sky''' file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;msp430-objcopy hello-world.sky -O ihex hello-world.ihex&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And last program you TelosB:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo tos-bsl --telosb -c /dev/ttyUSB0 -r -e -I -p application-name.ihex&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now if you want to see what the hello-world project does:&lt;br /&gt;
# Open Putty&lt;br /&gt;
# Open the Serial terminal&lt;br /&gt;
# Reset your TelosB&lt;/div&gt;</summary>
		<author><name>Guillaume</name></author>
		
	</entry>
	<entry>
		<id>http://wsn.cse.wustl.edu/index.php?title=Working_environment_setup_for_Contiki_OS&amp;diff=3992</id>
		<title>Working environment setup for Contiki OS</title>
		<link rel="alternate" type="text/html" href="http://wsn.cse.wustl.edu/index.php?title=Working_environment_setup_for_Contiki_OS&amp;diff=3992"/>
		<updated>2017-03-16T16:16:06Z</updated>

		<summary type="html">&lt;p&gt;Guillaume: Created page with &amp;quot; = Preparing your working Environment =  Cross compilation for Contiki-OS is easier using Ubuntu OS.  You have two possible ways: * Installing all the packages you need on you...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
= Preparing your working Environment =&lt;br /&gt;
&lt;br /&gt;
Cross compilation for Contiki-OS is easier using Ubuntu OS.&lt;br /&gt;
&lt;br /&gt;
You have two possible ways:&lt;br /&gt;
* Installing all the packages you need on your Linux distribution&lt;br /&gt;
* Downloading [http://www.contiki-os.org/download.html Instant Contiki] you will need to install [[#GCC for TelosB]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== GCC for TelosB ==&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
sudo apt-get install gcc-msp430&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Tools to program the TelosB ==&lt;br /&gt;
We will use the tos-bsl to upload the ihex file from the computer to the TelosB&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;sudo apt-get install tinyos-utils&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Putty ==&lt;br /&gt;
&lt;br /&gt;
=== Putty Installation ===&lt;br /&gt;
Putty will be used to communicate with the TelosB using its Serial communication.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
wget &amp;lt;nowiki&amp;gt;https://the.earth.li/~sgtatham/putty/latest/putty-0.68.tar.gz&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
tar xzf putty-0.68.tar.gz&lt;br /&gt;
&lt;br /&gt;
cd putty-0.68&lt;br /&gt;
&lt;br /&gt;
./configure&lt;br /&gt;
&lt;br /&gt;
make -j4 all&lt;br /&gt;
&lt;br /&gt;
sudo make install&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Putty Configuration ===&lt;br /&gt;
Default &amp;lt;code&amp;gt;printf&amp;lt;/code&amp;gt; function used in Contiki-OS for TelosB outputs the data on the usb port with a Serial baud rate of 115200.&lt;br /&gt;
&lt;br /&gt;
# '''Connection type''': Serial&lt;br /&gt;
# Find the /dev/ttyUSB* of your board and enter it in the '''Serial line'''&lt;br /&gt;
ls /dev/ttyUSB*&lt;br /&gt;
# Default '''baud rate''' (if unchanged for default printf function): 115200&lt;br /&gt;
# Into '''Terminal''' Category: Check &amp;quot;'''Implicit CR in every LF'''&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#f00&amp;quot;&amp;gt;'''Don't forget to run Putty as a root user! Or give general permissions to access your tty to all users.'''&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Download Contiki-OS sources ==&lt;br /&gt;
&lt;br /&gt;
To get the latest sources download them from github:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;git clone &amp;lt;nowiki&amp;gt;https://github.com/contiki-os/contiki.git&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you downloaded Instant Contiki don't forget to pull the latest release:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
cd ~&lt;br /&gt;
&lt;br /&gt;
cd contiki&lt;br /&gt;
&lt;br /&gt;
git pull origin master&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== QtCreator ==&lt;br /&gt;
&lt;br /&gt;
I prefer QtCreator over other IDE because it is lighter and faster than Eclipse and easier to configure.&lt;br /&gt;
&lt;br /&gt;
'''The choice is yours as you will be working with it.'''&lt;br /&gt;
&lt;br /&gt;
Here how to configure it to work with Contiki-OS projects:&lt;br /&gt;
&lt;br /&gt;
=== Install QtCreator ===&lt;br /&gt;
&lt;br /&gt;
Easiest part:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;sudo apt-get install qtcreator&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Creating a new project ===&lt;br /&gt;
&lt;br /&gt;
You need to create a new empty qt project.&lt;br /&gt;
&lt;br /&gt;
I did mine in a folder named workspace in my home directory.&lt;br /&gt;
&lt;br /&gt;
* Kit: choose Desktop (this part doesn't matters but is mandatory)&lt;br /&gt;
* Choose either Debug or Release (doesn't matter either as you will be using your own Makefile)&lt;br /&gt;
&lt;br /&gt;
Now you have your empty project. Next step [[Contiki first project]].&lt;/div&gt;</summary>
		<author><name>Guillaume</name></author>
		
	</entry>
	<entry>
		<id>http://wsn.cse.wustl.edu/index.php?title=User:Guillaume&amp;diff=3991</id>
		<title>User:Guillaume</title>
		<link rel="alternate" type="text/html" href="http://wsn.cse.wustl.edu/index.php?title=User:Guillaume&amp;diff=3991"/>
		<updated>2017-03-16T15:33:14Z</updated>

		<summary type="html">&lt;p&gt;Guillaume: Created page with &amp;quot; == Tutoriels ==  * Working environment setup for Contiki OS * First compilation&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Tutoriels ==&lt;br /&gt;
&lt;br /&gt;
* [[Working environment setup for Contiki OS]]&lt;br /&gt;
* [[First compilation]]&lt;/div&gt;</summary>
		<author><name>Guillaume</name></author>
		
	</entry>
</feed>