<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://anrg.usc.edu/contiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Shashwath</id>
		<title>Contiki - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="http://anrg.usc.edu/contiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Shashwath"/>
		<link rel="alternate" type="text/html" href="http://anrg.usc.edu/contiki/index.php/Special:Contributions/Shashwath"/>
		<updated>2026-07-26T02:26:55Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.26.2</generator>

	<entry>
		<id>http://anrg.usc.edu/contiki/index.php?title=Hello_World&amp;diff=1703</id>
		<title>Hello World</title>
		<link rel="alternate" type="text/html" href="http://anrg.usc.edu/contiki/index.php?title=Hello_World&amp;diff=1703"/>
				<updated>2016-05-20T00:51:50Z</updated>
		
		<summary type="html">&lt;p&gt;Shashwath: /* Step 1 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Contiki_tutorials | Back to Contiki Tutorials]]&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
This article is about the Hello World program, which is used to show the compilation and upload steps of a simple program on a Tmote Sky.&lt;br /&gt;
&lt;br /&gt;
== You will learn ==&lt;br /&gt;
&lt;br /&gt;
This tutorial teaches you how to compile a program on Contiki OS and also the most basic syntax of programming in ContikiOS.&lt;br /&gt;
&lt;br /&gt;
=== Step 1 ===&lt;br /&gt;
&lt;br /&gt;
Open the terminal window.&lt;br /&gt;
&lt;br /&gt;
=== Step 2 ===  &lt;br /&gt;
&lt;br /&gt;
In the terminal window, go to the hello world example folder.	&lt;br /&gt;
&lt;br /&gt;
:: &amp;lt;code&amp;gt;.cd /examples/hello-world&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Step 3=== &lt;br /&gt;
&lt;br /&gt;
Compile the code for the native platform (to be used when no mote is connected to the laptop.)&lt;br /&gt;
&lt;br /&gt;
:: &amp;lt;code&amp;gt;make TARGET=native&amp;lt;/code&amp;gt;&lt;br /&gt;
If there is any bug during compilation which says &amp;quot;#include&amp;lt;curses.h&amp;gt; : No such file or directory&amp;quot; you need to do the following on Ubuntu. &lt;br /&gt;
&lt;br /&gt;
If you are currently in the terminal, type &amp;quot;sudo apt-get install libncurses5-dev&amp;quot;(for which you should have installed the &amp;quot;apt&amp;quot; for 32-bit using &amp;quot;sudo dpkg -i apt_0.8.16~exp12ubuntu10.10_i386.deb&amp;quot; and for 64-bit using sudo dpkg -i apt_0.8.16~exp12ubuntu10.10_amd64.deb&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
You need to also install a version of javac compiler using the command &amp;quot;sudo apt-get install openjdk-7-jdk&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== Step 4 ===&lt;br /&gt;
&lt;br /&gt;
Once the compilation is over, run the Hello World program. &lt;br /&gt;
&lt;br /&gt;
:: &amp;lt;code&amp;gt;./hello-world.native&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Step 5 ===&lt;br /&gt;
You should be seeing the following on the terminal:&lt;br /&gt;
&lt;br /&gt;
:: &amp;lt;code&amp;gt;Contiki 3.0 started with IPV6, RPL&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;Rime started with address 1.2.3.4.5.6.7.8&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;MAC nullmac RDC nullrdc NETWORK sicslowpan&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;Tentative link-local IPv6 address fe80:0000:0000:0000:0302:0304:0506:0708&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;Hello, world&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The code will appear to hang, however, it is still running on Contiki, but not producing any output as the Hello World program is finished. &lt;br /&gt;
Press Ctrl-C to quit.&lt;br /&gt;
&lt;br /&gt;
== Hello World on the Tmote Sky! ==&lt;br /&gt;
&lt;br /&gt;
=== Step 1 ===&lt;br /&gt;
&lt;br /&gt;
Using the opened terminal window, compile and upload the Hello World program on the Tmote Sky.&lt;br /&gt;
&lt;br /&gt;
:: &amp;lt;code&amp;gt;make TARGET=sky savetarget&amp;lt;/code&amp;gt;    (This to save the target for any future compilations)&lt;br /&gt;
:: &amp;lt;code&amp;gt;make hello-world.upload&amp;lt;/code&amp;gt;    (This will upload the code on the Tmote Sky)&lt;br /&gt;
:: &amp;lt;code&amp;gt;make login&amp;lt;/code&amp;gt;    (This will enable us to view the output. If permission error occurs, use sudo command at the beginning)&lt;br /&gt;
&lt;br /&gt;
- If you are getting errors after running the command &amp;lt;code&amp;gt;make TARGET=sky savetarget&amp;lt;/code&amp;gt; , please make sure you run the following to install a package:&lt;br /&gt;
&lt;br /&gt;
:: &amp;lt;code&amp;gt;apt-get install gcc-msp430&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
- If you get Permission Denied message as below:&lt;br /&gt;
&lt;br /&gt;
:: &amp;lt;code&amp;gt;could not open port: [Errno 13] Permission denied: &amp;#039;/dev/ttyUSB0&amp;#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;make[2]: *** [sky-r._dev_ttyUSB0] Error 1&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;make[2]: Target `sky-reset-sequence&amp;#039; not remade because of errors.&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;make[2]: Leaving directory `/home/user/contiki-2.7/examples/hello-world&amp;#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;make[1]: *** [sky-reset] Error 2&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;make[1]: Leaving directory `/home/user/contiki-2.7/examples/hello-world&amp;#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;make: *** [hello-world.upload] Error 2&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please make sure you are running as root by typing the following:&lt;br /&gt;
:: &amp;lt;code&amp;gt;sudo -s&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
- If you are getting the following error after running the &amp;lt;code&amp;gt;make login&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
:: &amp;lt;code&amp;gt;using saved target &amp;#039;sky&amp;#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;../../tools/sky/serialdump-linux -b115200 /dev/ttyUSB0&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;../../tools/sky/serialdump-linux: 1: ../../tools/sky/serialdump-linux: Syntax error: Unterminated quoted string&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;make: *** [login] Error 2&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please follow the below steps:&lt;br /&gt;
&lt;br /&gt;
1. Download the new serialdump-linux file from the web page:&lt;br /&gt;
   https://github.com/cmorty/contiki/blob/pull/serialdump/tools/sky/serialdump-linux&lt;br /&gt;
2. Rename the current serialdump-linux file with the name serialdump-linux.bck in the &amp;lt;code&amp;gt;/contiki/tools/sky&amp;lt;/code&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
3. Copy the new serialdump-linux file in the directory &amp;lt;code&amp;gt;contiki/tools/sky&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. Change the permissions of the new serialdump-linux file with the command&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;code&amp;gt;chmod  775 serialdump-linux&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Step 2 ===&lt;br /&gt;
&lt;br /&gt;
Press the reset button on the Tmote Sky. The following message will appear on the terminal window &lt;br /&gt;
&lt;br /&gt;
:: &amp;lt;code&amp;gt;Contiki 2.7 started. Node id is set to 3.&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;Rime started with address 3.0&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;MAC 00:12:ff:11:65:23:52:ed&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;Starting &amp;#039;Hello world process&amp;#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;Hello, world&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
: The boot up code of Contiki-OS prints the first four lines whereas the last line is printed by the Hello World program.&lt;br /&gt;
&lt;br /&gt;
=== Step 3 ===&lt;br /&gt;
&lt;br /&gt;
Press Ctrl-C to quit.&lt;br /&gt;
&lt;br /&gt;
=== Try This ===&lt;br /&gt;
&lt;br /&gt;
You can upload and login with one line. You can also point the upload and/or login to a specific device path (use `dmesg` to find the device path of a mote after inserting it to your computer). Try the following command:&lt;br /&gt;
&lt;br /&gt;
:: &amp;lt;code&amp;gt;make TARGET=sky MOTES=/dev/ttyUSB0 hello-world.upload login&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Contiki_tutorials | Back to Contiki Tutorials]]&lt;/div&gt;</summary>
		<author><name>Shashwath</name></author>	</entry>

	<entry>
		<id>http://anrg.usc.edu/contiki/index.php?title=Hello_World&amp;diff=1702</id>
		<title>Hello World</title>
		<link rel="alternate" type="text/html" href="http://anrg.usc.edu/contiki/index.php?title=Hello_World&amp;diff=1702"/>
				<updated>2016-05-20T00:51:00Z</updated>
		
		<summary type="html">&lt;p&gt;Shashwath: /* Step 1 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Contiki_tutorials | Back to Contiki Tutorials]]&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
This article is about the Hello World program, which is used to show the compilation and upload steps of a simple program on a Tmote Sky.&lt;br /&gt;
&lt;br /&gt;
== You will learn ==&lt;br /&gt;
&lt;br /&gt;
This tutorial teaches you how to compile a program on Contiki OS and also the most basic syntax of programming in ContikiOS.&lt;br /&gt;
&lt;br /&gt;
=== Step 1 ===&lt;br /&gt;
&lt;br /&gt;
Open the terminal window.&lt;br /&gt;
&lt;br /&gt;
=== Step 2 ===  &lt;br /&gt;
&lt;br /&gt;
In the terminal window, go to the hello world example folder.	&lt;br /&gt;
&lt;br /&gt;
:: &amp;lt;code&amp;gt;.cd /examples/hello-world&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Step 3=== &lt;br /&gt;
&lt;br /&gt;
Compile the code for the native platform (to be used when no mote is connected to the laptop.)&lt;br /&gt;
&lt;br /&gt;
:: &amp;lt;code&amp;gt;make TARGET=native&amp;lt;/code&amp;gt;&lt;br /&gt;
If there is any bug during compilation which says &amp;quot;#include&amp;lt;curses.h&amp;gt; : No such file or directory&amp;quot; you need to do the following on Ubuntu. &lt;br /&gt;
&lt;br /&gt;
If you are currently in the terminal, type &amp;quot;sudo apt-get install libncurses5-dev&amp;quot;(for which you should have installed the &amp;quot;apt&amp;quot; for 32-bit using &amp;quot;sudo dpkg -i apt_0.8.16~exp12ubuntu10.10_i386.deb&amp;quot; and for 64-bit using sudo dpkg -i apt_0.8.16~exp12ubuntu10.10_amd64.deb&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
You need to also install a version of javac compiler using the command &amp;quot;sudo apt-get install openjdk-7-jdk&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== Step 4 ===&lt;br /&gt;
&lt;br /&gt;
Once the compilation is over, run the Hello World program. &lt;br /&gt;
&lt;br /&gt;
:: &amp;lt;code&amp;gt;./hello-world.native&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Step 5 ===&lt;br /&gt;
You should be seeing the following on the terminal:&lt;br /&gt;
&lt;br /&gt;
:: &amp;lt;code&amp;gt;Contiki 3.0 started with IPV6, RPL&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;Rime started with address 1.2.3.4.5.6.7.8&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;MAC nullmac RDC nullrdc NETWORK sicslowpan&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;Tentative link-local IPv6 address fe80:0000:0000:0000:0302:0304:0506:0708&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;Hello, world&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The code will appear to hang, however, it is still running on Contiki, but not producing any output as the Hello World program is finished. &lt;br /&gt;
Press Ctrl-C to quit.&lt;br /&gt;
&lt;br /&gt;
== Hello World on the Tmote Sky! ==&lt;br /&gt;
&lt;br /&gt;
=== Step 1 ===&lt;br /&gt;
&lt;br /&gt;
Using the opened terminal window, compile and upload the Hello World program on the Tmote Sky.&lt;br /&gt;
&lt;br /&gt;
:: &amp;lt;code&amp;gt;make TARGET=sky savetarget&amp;lt;/code&amp;gt;    (This to save the target for any future compilations)&lt;br /&gt;
:: &amp;lt;code&amp;gt;make hello-world.upload&amp;lt;/code&amp;gt;    (This will upload the code on the Tmote Sky)&lt;br /&gt;
:: &amp;lt;code&amp;gt;make login&amp;lt;/code&amp;gt;    (This will enable us to view the output. If permission error occurs, use sudo command at the beginning)&lt;br /&gt;
&lt;br /&gt;
- If you are getting errors after running the command &amp;lt;code&amp;gt;make TARGET=sky savetarget&amp;lt;/code&amp;gt; , please make sure you run the following to install a package:&lt;br /&gt;
&lt;br /&gt;
:: &amp;lt;code&amp;gt;apt-get install gcc-msp430&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
- If you get Permission Denied message as below:&lt;br /&gt;
&lt;br /&gt;
:: &amp;lt;code&amp;gt;could not open port: [Errno 13] Permission denied: &amp;#039;/dev/ttyUSB0&amp;#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;make[2]: *** [sky-r._dev_ttyUSB0] Error 1&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;make[2]: Target `sky-reset-sequence&amp;#039; not remade because of errors.&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;make[2]: Leaving directory `/home/user/contiki-2.7/examples/hello-world&amp;#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;make[1]: *** [sky-reset] Error 2&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;make[1]: Leaving directory `/home/user/contiki-2.7/examples/hello-world&amp;#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;make: *** [hello-world.upload] Error 2&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please make sure you are running as root by typing the following:&lt;br /&gt;
:: &amp;lt;code&amp;gt;sudo -s&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
- If you are getting the following error after running the &amp;lt;code&amp;gt;make login&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
:: &amp;lt;code&amp;gt;using saved target &amp;#039;sky&amp;#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;../../tools/sky/serialdump-linux -b115200 /dev/ttyUSB0&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;../../tools/sky/serialdump-linux: 1: ../../tools/sky/serialdump-linux: Syntax error: Unterminated quoted string&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;make: *** [login] Error 2&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please follow the below steps:&lt;br /&gt;
&lt;br /&gt;
1. Download the new serialdump-linux file from the web page:&lt;br /&gt;
   https://github.com/cmorty/contiki/blob/pull/serialdump/tools/sky/serialdump-linux&lt;br /&gt;
2. Rename the current serialdump-linux file with the name serialdump-linux.bck in the &amp;lt;code&amp;gt;/contiki/tools/sky&amp;lt;/code&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
3. Copy the new serialdump-linux file in the directory contiki/tools/sky&lt;br /&gt;
&lt;br /&gt;
4. Change the permissions of the new serialdump-linux file with the command&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;code&amp;gt;chmod  775 serialdump-linux&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Step 2 ===&lt;br /&gt;
&lt;br /&gt;
Press the reset button on the Tmote Sky. The following message will appear on the terminal window &lt;br /&gt;
&lt;br /&gt;
:: &amp;lt;code&amp;gt;Contiki 2.7 started. Node id is set to 3.&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;Rime started with address 3.0&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;MAC 00:12:ff:11:65:23:52:ed&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;Starting &amp;#039;Hello world process&amp;#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;Hello, world&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
: The boot up code of Contiki-OS prints the first four lines whereas the last line is printed by the Hello World program.&lt;br /&gt;
&lt;br /&gt;
=== Step 3 ===&lt;br /&gt;
&lt;br /&gt;
Press Ctrl-C to quit.&lt;br /&gt;
&lt;br /&gt;
=== Try This ===&lt;br /&gt;
&lt;br /&gt;
You can upload and login with one line. You can also point the upload and/or login to a specific device path (use `dmesg` to find the device path of a mote after inserting it to your computer). Try the following command:&lt;br /&gt;
&lt;br /&gt;
:: &amp;lt;code&amp;gt;make TARGET=sky MOTES=/dev/ttyUSB0 hello-world.upload login&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Contiki_tutorials | Back to Contiki Tutorials]]&lt;/div&gt;</summary>
		<author><name>Shashwath</name></author>	</entry>

	<entry>
		<id>http://anrg.usc.edu/contiki/index.php?title=Hello_World&amp;diff=1701</id>
		<title>Hello World</title>
		<link rel="alternate" type="text/html" href="http://anrg.usc.edu/contiki/index.php?title=Hello_World&amp;diff=1701"/>
				<updated>2016-05-20T00:50:25Z</updated>
		
		<summary type="html">&lt;p&gt;Shashwath: /* Hello World on the Tmote Sky! */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Contiki_tutorials | Back to Contiki Tutorials]]&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
This article is about the Hello World program, which is used to show the compilation and upload steps of a simple program on a Tmote Sky.&lt;br /&gt;
&lt;br /&gt;
== You will learn ==&lt;br /&gt;
&lt;br /&gt;
This tutorial teaches you how to compile a program on Contiki OS and also the most basic syntax of programming in ContikiOS.&lt;br /&gt;
&lt;br /&gt;
=== Step 1 ===&lt;br /&gt;
&lt;br /&gt;
Open the terminal window.&lt;br /&gt;
&lt;br /&gt;
=== Step 2 ===  &lt;br /&gt;
&lt;br /&gt;
In the terminal window, go to the hello world example folder.	&lt;br /&gt;
&lt;br /&gt;
:: &amp;lt;code&amp;gt;.cd /examples/hello-world&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Step 3=== &lt;br /&gt;
&lt;br /&gt;
Compile the code for the native platform (to be used when no mote is connected to the laptop.)&lt;br /&gt;
&lt;br /&gt;
:: &amp;lt;code&amp;gt;make TARGET=native&amp;lt;/code&amp;gt;&lt;br /&gt;
If there is any bug during compilation which says &amp;quot;#include&amp;lt;curses.h&amp;gt; : No such file or directory&amp;quot; you need to do the following on Ubuntu. &lt;br /&gt;
&lt;br /&gt;
If you are currently in the terminal, type &amp;quot;sudo apt-get install libncurses5-dev&amp;quot;(for which you should have installed the &amp;quot;apt&amp;quot; for 32-bit using &amp;quot;sudo dpkg -i apt_0.8.16~exp12ubuntu10.10_i386.deb&amp;quot; and for 64-bit using sudo dpkg -i apt_0.8.16~exp12ubuntu10.10_amd64.deb&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
You need to also install a version of javac compiler using the command &amp;quot;sudo apt-get install openjdk-7-jdk&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== Step 4 ===&lt;br /&gt;
&lt;br /&gt;
Once the compilation is over, run the Hello World program. &lt;br /&gt;
&lt;br /&gt;
:: &amp;lt;code&amp;gt;./hello-world.native&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Step 5 ===&lt;br /&gt;
You should be seeing the following on the terminal:&lt;br /&gt;
&lt;br /&gt;
:: &amp;lt;code&amp;gt;Contiki 3.0 started with IPV6, RPL&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;Rime started with address 1.2.3.4.5.6.7.8&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;MAC nullmac RDC nullrdc NETWORK sicslowpan&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;Tentative link-local IPv6 address fe80:0000:0000:0000:0302:0304:0506:0708&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;Hello, world&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The code will appear to hang, however, it is still running on Contiki, but not producing any output as the Hello World program is finished. &lt;br /&gt;
Press Ctrl-C to quit.&lt;br /&gt;
&lt;br /&gt;
== Hello World on the Tmote Sky! ==&lt;br /&gt;
&lt;br /&gt;
=== Step 1 ===&lt;br /&gt;
&lt;br /&gt;
Using the opened terminal window, compile and upload the Hello World program on the Tmote Sky.&lt;br /&gt;
&lt;br /&gt;
:: &amp;lt;code&amp;gt;make TARGET=sky savetarget&amp;lt;/code&amp;gt;    (This to save the target for any future compilations)&lt;br /&gt;
:: &amp;lt;code&amp;gt;make hello-world.upload&amp;lt;/code&amp;gt;    (This will upload the code on the Tmote Sky)&lt;br /&gt;
:: &amp;lt;code&amp;gt;make login&amp;lt;/code&amp;gt;    (This will enable us to view the output. If permission error occurs, use sudo command at the beginning)&lt;br /&gt;
&lt;br /&gt;
- If you are getting errors after running the command &amp;lt;code&amp;gt;make TARGET=sky savetarget&amp;lt;/code&amp;gt; , please make sure you run the following to install a package:&lt;br /&gt;
&lt;br /&gt;
:: &amp;lt;code&amp;gt;apt-get install gcc-msp430&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
- If you get Permission Denied message as below:&lt;br /&gt;
&lt;br /&gt;
:: &amp;lt;code&amp;gt;could not open port: [Errno 13] Permission denied: &amp;#039;/dev/ttyUSB0&amp;#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;make[2]: *** [sky-r._dev_ttyUSB0] Error 1&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;make[2]: Target `sky-reset-sequence&amp;#039; not remade because of errors.&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;make[2]: Leaving directory `/home/user/contiki-2.7/examples/hello-world&amp;#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;make[1]: *** [sky-reset] Error 2&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;make[1]: Leaving directory `/home/user/contiki-2.7/examples/hello-world&amp;#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;make: *** [hello-world.upload] Error 2&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please make sure you are running as root by typing the following:&lt;br /&gt;
:: &amp;lt;code&amp;gt;sudo -s&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
- If you are getting the following error after running the &amp;lt;code&amp;gt;make login&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
:: &amp;lt;code&amp;gt;using saved target &amp;#039;sky&amp;#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;../../tools/sky/serialdump-linux -b115200 /dev/ttyUSB0&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;../../tools/sky/serialdump-linux: 1: ../../tools/sky/serialdump-linux: Syntax error: Unterminated quoted string&amp;lt;/code&amp;gt;&lt;br /&gt;
make: *** [login] Error 2&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please follow the below steps:&lt;br /&gt;
&lt;br /&gt;
1. Download the new serialdump-linux file from the web page:&lt;br /&gt;
   https://github.com/cmorty/contiki/blob/pull/serialdump/tools/sky/serialdump-linux&lt;br /&gt;
2. Rename the current serialdump-linux file with the name serialdump-linux.bck in the &amp;lt;code&amp;gt;/contiki/tools/sky&amp;lt;/code&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
3. Copy the new serialdump-linux file in the directory contiki/tools/sky&lt;br /&gt;
&lt;br /&gt;
4. Change the permissions of the new serialdump-linux file with the command&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;code&amp;gt;chmod  775 serialdump-linux&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Step 2 ===&lt;br /&gt;
&lt;br /&gt;
Press the reset button on the Tmote Sky. The following message will appear on the terminal window &lt;br /&gt;
&lt;br /&gt;
:: &amp;lt;code&amp;gt;Contiki 2.7 started. Node id is set to 3.&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;Rime started with address 3.0&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;MAC 00:12:ff:11:65:23:52:ed&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;Starting &amp;#039;Hello world process&amp;#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;Hello, world&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
: The boot up code of Contiki-OS prints the first four lines whereas the last line is printed by the Hello World program.&lt;br /&gt;
&lt;br /&gt;
=== Step 3 ===&lt;br /&gt;
&lt;br /&gt;
Press Ctrl-C to quit.&lt;br /&gt;
&lt;br /&gt;
=== Try This ===&lt;br /&gt;
&lt;br /&gt;
You can upload and login with one line. You can also point the upload and/or login to a specific device path (use `dmesg` to find the device path of a mote after inserting it to your computer). Try the following command:&lt;br /&gt;
&lt;br /&gt;
:: &amp;lt;code&amp;gt;make TARGET=sky MOTES=/dev/ttyUSB0 hello-world.upload login&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Contiki_tutorials | Back to Contiki Tutorials]]&lt;/div&gt;</summary>
		<author><name>Shashwath</name></author>	</entry>

	<entry>
		<id>http://anrg.usc.edu/contiki/index.php?title=Hello_World&amp;diff=1700</id>
		<title>Hello World</title>
		<link rel="alternate" type="text/html" href="http://anrg.usc.edu/contiki/index.php?title=Hello_World&amp;diff=1700"/>
				<updated>2016-05-20T00:49:22Z</updated>
		
		<summary type="html">&lt;p&gt;Shashwath: /* Step 1 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Contiki_tutorials | Back to Contiki Tutorials]]&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
This article is about the Hello World program, which is used to show the compilation and upload steps of a simple program on a Tmote Sky.&lt;br /&gt;
&lt;br /&gt;
== You will learn ==&lt;br /&gt;
&lt;br /&gt;
This tutorial teaches you how to compile a program on Contiki OS and also the most basic syntax of programming in ContikiOS.&lt;br /&gt;
&lt;br /&gt;
=== Step 1 ===&lt;br /&gt;
&lt;br /&gt;
Open the terminal window.&lt;br /&gt;
&lt;br /&gt;
=== Step 2 ===  &lt;br /&gt;
&lt;br /&gt;
In the terminal window, go to the hello world example folder.	&lt;br /&gt;
&lt;br /&gt;
:: &amp;lt;code&amp;gt;.cd /examples/hello-world&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Step 3=== &lt;br /&gt;
&lt;br /&gt;
Compile the code for the native platform (to be used when no mote is connected to the laptop.)&lt;br /&gt;
&lt;br /&gt;
:: &amp;lt;code&amp;gt;make TARGET=native&amp;lt;/code&amp;gt;&lt;br /&gt;
If there is any bug during compilation which says &amp;quot;#include&amp;lt;curses.h&amp;gt; : No such file or directory&amp;quot; you need to do the following on Ubuntu. &lt;br /&gt;
&lt;br /&gt;
If you are currently in the terminal, type &amp;quot;sudo apt-get install libncurses5-dev&amp;quot;(for which you should have installed the &amp;quot;apt&amp;quot; for 32-bit using &amp;quot;sudo dpkg -i apt_0.8.16~exp12ubuntu10.10_i386.deb&amp;quot; and for 64-bit using sudo dpkg -i apt_0.8.16~exp12ubuntu10.10_amd64.deb&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
You need to also install a version of javac compiler using the command &amp;quot;sudo apt-get install openjdk-7-jdk&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== Step 4 ===&lt;br /&gt;
&lt;br /&gt;
Once the compilation is over, run the Hello World program. &lt;br /&gt;
&lt;br /&gt;
:: &amp;lt;code&amp;gt;./hello-world.native&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Step 5 ===&lt;br /&gt;
You should be seeing the following on the terminal:&lt;br /&gt;
&lt;br /&gt;
:: &amp;lt;code&amp;gt;Contiki 3.0 started with IPV6, RPL&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;Rime started with address 1.2.3.4.5.6.7.8&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;MAC nullmac RDC nullrdc NETWORK sicslowpan&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;Tentative link-local IPv6 address fe80:0000:0000:0000:0302:0304:0506:0708&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;Hello, world&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The code will appear to hang, however, it is still running on Contiki, but not producing any output as the Hello World program is finished. &lt;br /&gt;
Press Ctrl-C to quit.&lt;br /&gt;
&lt;br /&gt;
== Hello World on the Tmote Sky! ==&lt;br /&gt;
&lt;br /&gt;
=== Step 1 ===&lt;br /&gt;
&lt;br /&gt;
Using the opened terminal window, compile and upload the Hello World program on the Tmote Sky.&lt;br /&gt;
&lt;br /&gt;
:: &amp;lt;code&amp;gt;make TARGET=sky savetarget&amp;lt;/code&amp;gt;    (This to save the target for any future compilations)&lt;br /&gt;
:: &amp;lt;code&amp;gt;make hello-world.upload&amp;lt;/code&amp;gt;    (This will upload the code on the Tmote Sky)&lt;br /&gt;
:: &amp;lt;code&amp;gt;make login&amp;lt;/code&amp;gt;    (This will enable us to view the output. If permission error occurs, use sudo command at the beginning)&lt;br /&gt;
&lt;br /&gt;
- If you are getting errors after running the command &amp;lt;code&amp;gt;make TARGET=sky savetarget&amp;lt;/code&amp;gt; , please make sure you run the following to install a package:&lt;br /&gt;
&lt;br /&gt;
:: &amp;lt;code&amp;gt;apt-get install gcc-msp430&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
- If you get Permission Denied message as below:&lt;br /&gt;
&lt;br /&gt;
:: &amp;lt;code&amp;gt;could not open port: [Errno 13] Permission denied: &amp;#039;/dev/ttyUSB0&amp;#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;make[2]: *** [sky-r._dev_ttyUSB0] Error 1&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;make[2]: Target `sky-reset-sequence&amp;#039; not remade because of errors.&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;make[2]: Leaving directory `/home/user/contiki-2.7/examples/hello-world&amp;#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;make[1]: *** [sky-reset] Error 2&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;make[1]: Leaving directory `/home/user/contiki-2.7/examples/hello-world&amp;#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;make: *** [hello-world.upload] Error 2&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please make sure you are running as root by typing the following:&lt;br /&gt;
:: &amp;lt;code&amp;gt;sudo -s&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
- If you are getting the following error after running the &amp;lt;code&amp;gt;make login&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
using saved target &amp;#039;sky&amp;#039;&lt;br /&gt;
../../tools/sky/serialdump-linux -b115200 /dev/ttyUSB0&lt;br /&gt;
../../tools/sky/serialdump-linux: 1: ../../tools/sky/serialdump-linux: Syntax error: Unterminated quoted string&lt;br /&gt;
make: *** [login] Error 2&lt;br /&gt;
&lt;br /&gt;
Please follow the below steps:&lt;br /&gt;
&lt;br /&gt;
1. Download the new serialdump-linux file from the web page:&lt;br /&gt;
   https://github.com/cmorty/contiki/blob/pull/serialdump/tools/sky/serialdump-linux&lt;br /&gt;
2. Rename the current serialdump-linux file with the name serialdump-linux.bck in the &amp;lt;code&amp;gt;/contiki/tools/sky&amp;lt;/code&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
3. Copy the new serialdump-linux file in the directory contiki/tools/sky&lt;br /&gt;
&lt;br /&gt;
4. Change the permissions of the new serialdump-linux file with the command&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;code&amp;gt;chmod  775 serialdump-linux&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Step 2 ===&lt;br /&gt;
&lt;br /&gt;
Press the reset button on the Tmote Sky. The following message will appear on the terminal window &lt;br /&gt;
&lt;br /&gt;
:: &amp;lt;code&amp;gt;Contiki 2.7 started. Node id is set to 3.&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;Rime started with address 3.0&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;MAC 00:12:ff:11:65:23:52:ed&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;Starting &amp;#039;Hello world process&amp;#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;Hello, world&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
: The boot up code of Contiki-OS prints the first four lines whereas the last line is printed by the Hello World program.&lt;br /&gt;
&lt;br /&gt;
=== Step 3 ===&lt;br /&gt;
&lt;br /&gt;
Press Ctrl-C to quit.&lt;br /&gt;
&lt;br /&gt;
=== Try This ===&lt;br /&gt;
&lt;br /&gt;
You can upload and login with one line. You can also point the upload and/or login to a specific device path (use `dmesg` to find the device path of a mote after inserting it to your computer). Try the following command:&lt;br /&gt;
&lt;br /&gt;
:: &amp;lt;code&amp;gt;make TARGET=sky MOTES=/dev/ttyUSB0 hello-world.upload login&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Contiki_tutorials | Back to Contiki Tutorials]]&lt;/div&gt;</summary>
		<author><name>Shashwath</name></author>	</entry>

	<entry>
		<id>http://anrg.usc.edu/contiki/index.php?title=Hello_World&amp;diff=1699</id>
		<title>Hello World</title>
		<link rel="alternate" type="text/html" href="http://anrg.usc.edu/contiki/index.php?title=Hello_World&amp;diff=1699"/>
				<updated>2016-05-20T00:48:27Z</updated>
		
		<summary type="html">&lt;p&gt;Shashwath: /* Step 1 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Contiki_tutorials | Back to Contiki Tutorials]]&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
This article is about the Hello World program, which is used to show the compilation and upload steps of a simple program on a Tmote Sky.&lt;br /&gt;
&lt;br /&gt;
== You will learn ==&lt;br /&gt;
&lt;br /&gt;
This tutorial teaches you how to compile a program on Contiki OS and also the most basic syntax of programming in ContikiOS.&lt;br /&gt;
&lt;br /&gt;
=== Step 1 ===&lt;br /&gt;
&lt;br /&gt;
Open the terminal window.&lt;br /&gt;
&lt;br /&gt;
=== Step 2 ===  &lt;br /&gt;
&lt;br /&gt;
In the terminal window, go to the hello world example folder.	&lt;br /&gt;
&lt;br /&gt;
:: &amp;lt;code&amp;gt;.cd /examples/hello-world&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Step 3=== &lt;br /&gt;
&lt;br /&gt;
Compile the code for the native platform (to be used when no mote is connected to the laptop.)&lt;br /&gt;
&lt;br /&gt;
:: &amp;lt;code&amp;gt;make TARGET=native&amp;lt;/code&amp;gt;&lt;br /&gt;
If there is any bug during compilation which says &amp;quot;#include&amp;lt;curses.h&amp;gt; : No such file or directory&amp;quot; you need to do the following on Ubuntu. &lt;br /&gt;
&lt;br /&gt;
If you are currently in the terminal, type &amp;quot;sudo apt-get install libncurses5-dev&amp;quot;(for which you should have installed the &amp;quot;apt&amp;quot; for 32-bit using &amp;quot;sudo dpkg -i apt_0.8.16~exp12ubuntu10.10_i386.deb&amp;quot; and for 64-bit using sudo dpkg -i apt_0.8.16~exp12ubuntu10.10_amd64.deb&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
You need to also install a version of javac compiler using the command &amp;quot;sudo apt-get install openjdk-7-jdk&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== Step 4 ===&lt;br /&gt;
&lt;br /&gt;
Once the compilation is over, run the Hello World program. &lt;br /&gt;
&lt;br /&gt;
:: &amp;lt;code&amp;gt;./hello-world.native&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Step 5 ===&lt;br /&gt;
You should be seeing the following on the terminal:&lt;br /&gt;
&lt;br /&gt;
:: &amp;lt;code&amp;gt;Contiki 3.0 started with IPV6, RPL&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;Rime started with address 1.2.3.4.5.6.7.8&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;MAC nullmac RDC nullrdc NETWORK sicslowpan&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;Tentative link-local IPv6 address fe80:0000:0000:0000:0302:0304:0506:0708&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;Hello, world&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The code will appear to hang, however, it is still running on Contiki, but not producing any output as the Hello World program is finished. &lt;br /&gt;
Press Ctrl-C to quit.&lt;br /&gt;
&lt;br /&gt;
== Hello World on the Tmote Sky! ==&lt;br /&gt;
&lt;br /&gt;
=== Step 1 ===&lt;br /&gt;
&lt;br /&gt;
Using the opened terminal window, compile and upload the Hello World program on the Tmote Sky.&lt;br /&gt;
&lt;br /&gt;
:: &amp;lt;code&amp;gt;make TARGET=sky savetarget&amp;lt;/code&amp;gt;    (This to save the target for any future compilations)&lt;br /&gt;
:: &amp;lt;code&amp;gt;make hello-world.upload&amp;lt;/code&amp;gt;    (This will upload the code on the Tmote Sky)&lt;br /&gt;
:: &amp;lt;code&amp;gt;make login&amp;lt;/code&amp;gt;    (This will enable us to view the output. If permission error occurs, use sudo command at the beginning)&lt;br /&gt;
&lt;br /&gt;
- If you are getting errors after running the command &amp;lt;code&amp;gt;make TARGET=sky savetarget&amp;lt;/code&amp;gt; , please make sure you run the following to install a package:&lt;br /&gt;
&lt;br /&gt;
:: &amp;lt;code&amp;gt;apt-get install gcc-msp430&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
- If you get Permission Denied message as below:&lt;br /&gt;
&lt;br /&gt;
:: &amp;lt;code&amp;gt;could not open port: [Errno 13] Permission denied: &amp;#039;/dev/ttyUSB0&amp;#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;make[2]: *** [sky-r._dev_ttyUSB0] Error 1&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;make[2]: Target `sky-reset-sequence&amp;#039; not remade because of errors.&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;make[2]: Leaving directory `/home/user/contiki-2.7/examples/hello-world&amp;#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;make[1]: *** [sky-reset] Error 2&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;make[1]: Leaving directory `/home/user/contiki-2.7/examples/hello-world&amp;#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;make: *** [hello-world.upload] Error 2&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please make sure you are running as root by typing the following:&lt;br /&gt;
:: &amp;lt;code&amp;gt;sudo -s&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
- If you are getting the following error after running the &amp;lt;code&amp;gt;make login&amp;lt;/code&amp;gt;, as below:&lt;br /&gt;
&lt;br /&gt;
using saved target &amp;#039;sky&amp;#039;&lt;br /&gt;
../../tools/sky/serialdump-linux -b115200 /dev/ttyUSB0&lt;br /&gt;
../../tools/sky/serialdump-linux: 1: ../../tools/sky/serialdump-linux: Syntax error: Unterminated quoted string&lt;br /&gt;
make: *** [login] Error 2&lt;br /&gt;
&lt;br /&gt;
Please follow the steps:&lt;br /&gt;
&lt;br /&gt;
1. Download the new serialdump-linux file from the web page:&lt;br /&gt;
   https://github.com/cmorty/contiki/blob/pull/serialdump/tools/sky/serialdump-linux&lt;br /&gt;
2. Rename the current serialdump-linux file with the name serialdump-linux.bck in the &amp;lt;code&amp;gt;/contiki/tools/sky&amp;lt;/code&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
3. Copy the new serialdump-linux file in the directory contiki/tools/sky&lt;br /&gt;
&lt;br /&gt;
4. Change the permissions of the new serialdump-linux file with the command&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;code&amp;gt;chmod  775 serialdump-linux&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Step 2 ===&lt;br /&gt;
&lt;br /&gt;
Press the reset button on the Tmote Sky. The following message will appear on the terminal window &lt;br /&gt;
&lt;br /&gt;
:: &amp;lt;code&amp;gt;Contiki 2.7 started. Node id is set to 3.&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;Rime started with address 3.0&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;MAC 00:12:ff:11:65:23:52:ed&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;Starting &amp;#039;Hello world process&amp;#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;Hello, world&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
: The boot up code of Contiki-OS prints the first four lines whereas the last line is printed by the Hello World program.&lt;br /&gt;
&lt;br /&gt;
=== Step 3 ===&lt;br /&gt;
&lt;br /&gt;
Press Ctrl-C to quit.&lt;br /&gt;
&lt;br /&gt;
=== Try This ===&lt;br /&gt;
&lt;br /&gt;
You can upload and login with one line. You can also point the upload and/or login to a specific device path (use `dmesg` to find the device path of a mote after inserting it to your computer). Try the following command:&lt;br /&gt;
&lt;br /&gt;
:: &amp;lt;code&amp;gt;make TARGET=sky MOTES=/dev/ttyUSB0 hello-world.upload login&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Contiki_tutorials | Back to Contiki Tutorials]]&lt;/div&gt;</summary>
		<author><name>Shashwath</name></author>	</entry>

	<entry>
		<id>http://anrg.usc.edu/contiki/index.php?title=Hello_World&amp;diff=1698</id>
		<title>Hello World</title>
		<link rel="alternate" type="text/html" href="http://anrg.usc.edu/contiki/index.php?title=Hello_World&amp;diff=1698"/>
				<updated>2016-05-20T00:46:33Z</updated>
		
		<summary type="html">&lt;p&gt;Shashwath: /* Step 1 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Contiki_tutorials | Back to Contiki Tutorials]]&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
This article is about the Hello World program, which is used to show the compilation and upload steps of a simple program on a Tmote Sky.&lt;br /&gt;
&lt;br /&gt;
== You will learn ==&lt;br /&gt;
&lt;br /&gt;
This tutorial teaches you how to compile a program on Contiki OS and also the most basic syntax of programming in ContikiOS.&lt;br /&gt;
&lt;br /&gt;
=== Step 1 ===&lt;br /&gt;
&lt;br /&gt;
Open the terminal window.&lt;br /&gt;
&lt;br /&gt;
=== Step 2 ===  &lt;br /&gt;
&lt;br /&gt;
In the terminal window, go to the hello world example folder.	&lt;br /&gt;
&lt;br /&gt;
:: &amp;lt;code&amp;gt;.cd /examples/hello-world&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Step 3=== &lt;br /&gt;
&lt;br /&gt;
Compile the code for the native platform (to be used when no mote is connected to the laptop.)&lt;br /&gt;
&lt;br /&gt;
:: &amp;lt;code&amp;gt;make TARGET=native&amp;lt;/code&amp;gt;&lt;br /&gt;
If there is any bug during compilation which says &amp;quot;#include&amp;lt;curses.h&amp;gt; : No such file or directory&amp;quot; you need to do the following on Ubuntu. &lt;br /&gt;
&lt;br /&gt;
If you are currently in the terminal, type &amp;quot;sudo apt-get install libncurses5-dev&amp;quot;(for which you should have installed the &amp;quot;apt&amp;quot; for 32-bit using &amp;quot;sudo dpkg -i apt_0.8.16~exp12ubuntu10.10_i386.deb&amp;quot; and for 64-bit using sudo dpkg -i apt_0.8.16~exp12ubuntu10.10_amd64.deb&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
You need to also install a version of javac compiler using the command &amp;quot;sudo apt-get install openjdk-7-jdk&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== Step 4 ===&lt;br /&gt;
&lt;br /&gt;
Once the compilation is over, run the Hello World program. &lt;br /&gt;
&lt;br /&gt;
:: &amp;lt;code&amp;gt;./hello-world.native&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Step 5 ===&lt;br /&gt;
You should be seeing the following on the terminal:&lt;br /&gt;
&lt;br /&gt;
:: &amp;lt;code&amp;gt;Contiki 3.0 started with IPV6, RPL&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;Rime started with address 1.2.3.4.5.6.7.8&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;MAC nullmac RDC nullrdc NETWORK sicslowpan&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;Tentative link-local IPv6 address fe80:0000:0000:0000:0302:0304:0506:0708&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;Hello, world&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The code will appear to hang, however, it is still running on Contiki, but not producing any output as the Hello World program is finished. &lt;br /&gt;
Press Ctrl-C to quit.&lt;br /&gt;
&lt;br /&gt;
== Hello World on the Tmote Sky! ==&lt;br /&gt;
&lt;br /&gt;
=== Step 1 ===&lt;br /&gt;
&lt;br /&gt;
Using the opened terminal window, compile and upload the Hello World program on the Tmote Sky.&lt;br /&gt;
&lt;br /&gt;
:: &amp;lt;code&amp;gt;make TARGET=sky savetarget&amp;lt;/code&amp;gt;    (This to save the target for any future compilations)&lt;br /&gt;
:: &amp;lt;code&amp;gt;make hello-world.upload&amp;lt;/code&amp;gt;    (This will upload the code on the Tmote Sky)&lt;br /&gt;
:: &amp;lt;code&amp;gt;make login&amp;lt;/code&amp;gt;    (This will enable us to view the output. If permission error occurs, use sudo command at the beginning)&lt;br /&gt;
&lt;br /&gt;
- If you are getting errors after running the command &amp;lt;code&amp;gt;make TARGET=sky savetarget&amp;lt;/code&amp;gt; , please make sure you run the following to install a package:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;apt-get install gcc-msp430&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
- If you get Permission Denied message as below:&lt;br /&gt;
&lt;br /&gt;
:: &amp;lt;code&amp;gt;&amp;gt; could not open port: [Errno 13] Permission denied: &amp;#039;/dev/ttyUSB0&amp;#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;&amp;gt; make[2]: *** [sky-r._dev_ttyUSB0] Error 1&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;&amp;gt; make[2]: Target `sky-reset-sequence&amp;#039; not remade because of errors.&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;&amp;gt; make[2]: Leaving directory `/home/user/contiki-2.7/examples/hello-world&amp;#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;&amp;gt; make[1]: *** [sky-reset] Error 2&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;&amp;gt; make[1]: Leaving directory `/home/user/contiki-2.7/examples/hello-world&amp;#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;&amp;gt; make: *** [hello-world.upload] Error 2&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please make sure you are running with the root command.&lt;br /&gt;
&lt;br /&gt;
- If you are getting the following error after running the &amp;lt;code&amp;gt;make login&amp;lt;/code&amp;gt;, as below:&lt;br /&gt;
&lt;br /&gt;
using saved target &amp;#039;sky&amp;#039;&lt;br /&gt;
../../tools/sky/serialdump-linux -b115200 /dev/ttyUSB0&lt;br /&gt;
../../tools/sky/serialdump-linux: 1: ../../tools/sky/serialdump-linux: Syntax error: Unterminated quoted string&lt;br /&gt;
make: *** [login] Error 2&lt;br /&gt;
&lt;br /&gt;
Please follow the steps:&lt;br /&gt;
&lt;br /&gt;
1. Download the new serialdump-linux file from the web page:&lt;br /&gt;
   https://github.com/cmorty/contiki/blob/pull/serialdump/tools/sky/serialdump-linux&lt;br /&gt;
2. Rename the current serialdump-linux file with the name serialdump-linux.bck in the &amp;lt;code&amp;gt;/contiki/tools/sky&amp;lt;/code&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
3. Copy the new serialdump-linux file in the directory contiki/tools/sky&lt;br /&gt;
&lt;br /&gt;
4. Change the permissions of the new serialdump-linux file with the command&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;code&amp;gt;chmod  775 serialdump-linux&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Step 2 ===&lt;br /&gt;
&lt;br /&gt;
Press the reset button on the Tmote Sky. The following message will appear on the terminal window &lt;br /&gt;
&lt;br /&gt;
:: &amp;lt;code&amp;gt;Contiki 2.7 started. Node id is set to 3.&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;Rime started with address 3.0&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;MAC 00:12:ff:11:65:23:52:ed&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;Starting &amp;#039;Hello world process&amp;#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;Hello, world&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
: The boot up code of Contiki-OS prints the first four lines whereas the last line is printed by the Hello World program.&lt;br /&gt;
&lt;br /&gt;
=== Step 3 ===&lt;br /&gt;
&lt;br /&gt;
Press Ctrl-C to quit.&lt;br /&gt;
&lt;br /&gt;
=== Try This ===&lt;br /&gt;
&lt;br /&gt;
You can upload and login with one line. You can also point the upload and/or login to a specific device path (use `dmesg` to find the device path of a mote after inserting it to your computer). Try the following command:&lt;br /&gt;
&lt;br /&gt;
:: &amp;lt;code&amp;gt;make TARGET=sky MOTES=/dev/ttyUSB0 hello-world.upload login&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Contiki_tutorials | Back to Contiki Tutorials]]&lt;/div&gt;</summary>
		<author><name>Shashwath</name></author>	</entry>

	<entry>
		<id>http://anrg.usc.edu/contiki/index.php?title=Hello_World&amp;diff=1697</id>
		<title>Hello World</title>
		<link rel="alternate" type="text/html" href="http://anrg.usc.edu/contiki/index.php?title=Hello_World&amp;diff=1697"/>
				<updated>2016-05-20T00:45:39Z</updated>
		
		<summary type="html">&lt;p&gt;Shashwath: /* Hello World on the Tmote Sky! */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Contiki_tutorials | Back to Contiki Tutorials]]&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
This article is about the Hello World program, which is used to show the compilation and upload steps of a simple program on a Tmote Sky.&lt;br /&gt;
&lt;br /&gt;
== You will learn ==&lt;br /&gt;
&lt;br /&gt;
This tutorial teaches you how to compile a program on Contiki OS and also the most basic syntax of programming in ContikiOS.&lt;br /&gt;
&lt;br /&gt;
=== Step 1 ===&lt;br /&gt;
&lt;br /&gt;
Open the terminal window.&lt;br /&gt;
&lt;br /&gt;
=== Step 2 ===  &lt;br /&gt;
&lt;br /&gt;
In the terminal window, go to the hello world example folder.	&lt;br /&gt;
&lt;br /&gt;
:: &amp;lt;code&amp;gt;.cd /examples/hello-world&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Step 3=== &lt;br /&gt;
&lt;br /&gt;
Compile the code for the native platform (to be used when no mote is connected to the laptop.)&lt;br /&gt;
&lt;br /&gt;
:: &amp;lt;code&amp;gt;make TARGET=native&amp;lt;/code&amp;gt;&lt;br /&gt;
If there is any bug during compilation which says &amp;quot;#include&amp;lt;curses.h&amp;gt; : No such file or directory&amp;quot; you need to do the following on Ubuntu. &lt;br /&gt;
&lt;br /&gt;
If you are currently in the terminal, type &amp;quot;sudo apt-get install libncurses5-dev&amp;quot;(for which you should have installed the &amp;quot;apt&amp;quot; for 32-bit using &amp;quot;sudo dpkg -i apt_0.8.16~exp12ubuntu10.10_i386.deb&amp;quot; and for 64-bit using sudo dpkg -i apt_0.8.16~exp12ubuntu10.10_amd64.deb&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
You need to also install a version of javac compiler using the command &amp;quot;sudo apt-get install openjdk-7-jdk&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== Step 4 ===&lt;br /&gt;
&lt;br /&gt;
Once the compilation is over, run the Hello World program. &lt;br /&gt;
&lt;br /&gt;
:: &amp;lt;code&amp;gt;./hello-world.native&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Step 5 ===&lt;br /&gt;
You should be seeing the following on the terminal:&lt;br /&gt;
&lt;br /&gt;
:: &amp;lt;code&amp;gt;Contiki 3.0 started with IPV6, RPL&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;Rime started with address 1.2.3.4.5.6.7.8&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;MAC nullmac RDC nullrdc NETWORK sicslowpan&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;Tentative link-local IPv6 address fe80:0000:0000:0000:0302:0304:0506:0708&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;Hello, world&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The code will appear to hang, however, it is still running on Contiki, but not producing any output as the Hello World program is finished. &lt;br /&gt;
Press Ctrl-C to quit.&lt;br /&gt;
&lt;br /&gt;
== Hello World on the Tmote Sky! ==&lt;br /&gt;
&lt;br /&gt;
=== Step 1 ===&lt;br /&gt;
&lt;br /&gt;
Using the opened terminal window, compile and upload the Hello World program on the Tmote Sky.&lt;br /&gt;
&lt;br /&gt;
:: &amp;lt;code&amp;gt;make TARGET=sky savetarget&amp;lt;/code&amp;gt;    (This to save the target for any future compilations)&lt;br /&gt;
:: &amp;lt;code&amp;gt;make hello-world.upload&amp;lt;/code&amp;gt;    (This will upload the code on the Tmote Sky)&lt;br /&gt;
:: &amp;lt;code&amp;gt;make login&amp;lt;/code&amp;gt;    (This will enable us to view the output. If permission error occurs, use sudo command at the beginning)&lt;br /&gt;
&lt;br /&gt;
- If you are getting errors after running the command &amp;lt;code&amp;gt;make TARGET=sky savetarget&amp;lt;/code&amp;gt; , please make sure you run the following to install a package:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;apt-get install gcc-msp430&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
- If you get Permission Denied message as below:&lt;br /&gt;
&lt;br /&gt;
&amp;gt; could not open port: [Errno 13] Permission denied: &amp;#039;/dev/ttyUSB0&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;gt; make[2]: *** [sky-r._dev_ttyUSB0] Error 1&lt;br /&gt;
&lt;br /&gt;
&amp;gt; make[2]: Target `sky-reset-sequence&amp;#039; not remade because of errors.&lt;br /&gt;
&lt;br /&gt;
&amp;gt; make[2]: Leaving directory `/home/user/contiki-2.7/examples/hello-world&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;gt; make[1]: *** [sky-reset] Error 2&lt;br /&gt;
&lt;br /&gt;
&amp;gt; make[1]: Leaving directory `/home/user/contiki-2.7/examples/hello-world&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;gt; make: *** [hello-world.upload] Error 2&lt;br /&gt;
&lt;br /&gt;
Please make sure you are running with the root command.&lt;br /&gt;
&lt;br /&gt;
- If you are getting the following error after running the &amp;lt;code&amp;gt;make login&amp;lt;/code&amp;gt;, as below:&lt;br /&gt;
&lt;br /&gt;
using saved target &amp;#039;sky&amp;#039;&lt;br /&gt;
../../tools/sky/serialdump-linux -b115200 /dev/ttyUSB0&lt;br /&gt;
../../tools/sky/serialdump-linux: 1: ../../tools/sky/serialdump-linux: Syntax error: Unterminated quoted string&lt;br /&gt;
make: *** [login] Error 2&lt;br /&gt;
&lt;br /&gt;
Please follow the steps:&lt;br /&gt;
&lt;br /&gt;
1. Download the new serialdump-linux file from the web page:&lt;br /&gt;
   https://github.com/cmorty/contiki/blob/pull/serialdump/tools/sky/serialdump-linux&lt;br /&gt;
2. Rename the current serialdump-linux file with the name serialdump-linux.bck in the &amp;lt;code&amp;gt;/contiki/tools/sky&amp;lt;/code&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
3. Copy the new serialdump-linux file in the directory contiki/tools/sky&lt;br /&gt;
&lt;br /&gt;
4. Change the permissions of the new serialdump-linux file with the command&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;code&amp;gt;chmod  775 serialdump-linux&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Step 2 ===&lt;br /&gt;
&lt;br /&gt;
Press the reset button on the Tmote Sky. The following message will appear on the terminal window &lt;br /&gt;
&lt;br /&gt;
:: &amp;lt;code&amp;gt;Contiki 2.7 started. Node id is set to 3.&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;Rime started with address 3.0&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;MAC 00:12:ff:11:65:23:52:ed&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;Starting &amp;#039;Hello world process&amp;#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;Hello, world&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
: The boot up code of Contiki-OS prints the first four lines whereas the last line is printed by the Hello World program.&lt;br /&gt;
&lt;br /&gt;
=== Step 3 ===&lt;br /&gt;
&lt;br /&gt;
Press Ctrl-C to quit.&lt;br /&gt;
&lt;br /&gt;
=== Try This ===&lt;br /&gt;
&lt;br /&gt;
You can upload and login with one line. You can also point the upload and/or login to a specific device path (use `dmesg` to find the device path of a mote after inserting it to your computer). Try the following command:&lt;br /&gt;
&lt;br /&gt;
:: &amp;lt;code&amp;gt;make TARGET=sky MOTES=/dev/ttyUSB0 hello-world.upload login&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Contiki_tutorials | Back to Contiki Tutorials]]&lt;/div&gt;</summary>
		<author><name>Shashwath</name></author>	</entry>

	<entry>
		<id>http://anrg.usc.edu/contiki/index.php?title=Hello_World&amp;diff=1696</id>
		<title>Hello World</title>
		<link rel="alternate" type="text/html" href="http://anrg.usc.edu/contiki/index.php?title=Hello_World&amp;diff=1696"/>
				<updated>2016-05-20T00:45:07Z</updated>
		
		<summary type="html">&lt;p&gt;Shashwath: /* Step 1 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Contiki_tutorials | Back to Contiki Tutorials]]&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
This article is about the Hello World program, which is used to show the compilation and upload steps of a simple program on a Tmote Sky.&lt;br /&gt;
&lt;br /&gt;
== You will learn ==&lt;br /&gt;
&lt;br /&gt;
This tutorial teaches you how to compile a program on Contiki OS and also the most basic syntax of programming in ContikiOS.&lt;br /&gt;
&lt;br /&gt;
=== Step 1 ===&lt;br /&gt;
&lt;br /&gt;
Open the terminal window.&lt;br /&gt;
&lt;br /&gt;
=== Step 2 ===  &lt;br /&gt;
&lt;br /&gt;
In the terminal window, go to the hello world example folder.	&lt;br /&gt;
&lt;br /&gt;
:: &amp;lt;code&amp;gt;.cd /examples/hello-world&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Step 3=== &lt;br /&gt;
&lt;br /&gt;
Compile the code for the native platform (to be used when no mote is connected to the laptop.)&lt;br /&gt;
&lt;br /&gt;
:: &amp;lt;code&amp;gt;make TARGET=native&amp;lt;/code&amp;gt;&lt;br /&gt;
If there is any bug during compilation which says &amp;quot;#include&amp;lt;curses.h&amp;gt; : No such file or directory&amp;quot; you need to do the following on Ubuntu. &lt;br /&gt;
&lt;br /&gt;
If you are currently in the terminal, type &amp;quot;sudo apt-get install libncurses5-dev&amp;quot;(for which you should have installed the &amp;quot;apt&amp;quot; for 32-bit using &amp;quot;sudo dpkg -i apt_0.8.16~exp12ubuntu10.10_i386.deb&amp;quot; and for 64-bit using sudo dpkg -i apt_0.8.16~exp12ubuntu10.10_amd64.deb&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
You need to also install a version of javac compiler using the command &amp;quot;sudo apt-get install openjdk-7-jdk&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== Step 4 ===&lt;br /&gt;
&lt;br /&gt;
Once the compilation is over, run the Hello World program. &lt;br /&gt;
&lt;br /&gt;
:: &amp;lt;code&amp;gt;./hello-world.native&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Step 5 ===&lt;br /&gt;
You should be seeing the following on the terminal:&lt;br /&gt;
&lt;br /&gt;
:: &amp;lt;code&amp;gt;Contiki 3.0 started with IPV6, RPL&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;Rime started with address 1.2.3.4.5.6.7.8&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;MAC nullmac RDC nullrdc NETWORK sicslowpan&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;Tentative link-local IPv6 address fe80:0000:0000:0000:0302:0304:0506:0708&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;Hello, world&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The code will appear to hang, however, it is still running on Contiki, but not producing any output as the Hello World program is finished. &lt;br /&gt;
Press Ctrl-C to quit.&lt;br /&gt;
&lt;br /&gt;
== Hello World on the Tmote Sky! ==&lt;br /&gt;
&lt;br /&gt;
=== Step 1 ===&lt;br /&gt;
&lt;br /&gt;
Using the opened terminal window, compile and upload the Hello World program on the Tmote Sky.&lt;br /&gt;
&lt;br /&gt;
:: &amp;lt;code&amp;gt;make TARGET=sky savetarget&amp;lt;/code&amp;gt;    (This to save the target for any future compilations)&lt;br /&gt;
:: &amp;lt;code&amp;gt;make hello-world.upload&amp;lt;/code&amp;gt;    (This will upload the code on the Tmote Sky)&lt;br /&gt;
:: &amp;lt;code&amp;gt;make login&amp;lt;/code&amp;gt;    (This will enable us to view the output. If permission error occurs, use sudo command at the beginning)&lt;br /&gt;
&lt;br /&gt;
- If you are getting errors after running the command &amp;lt;code&amp;gt;make TARGET=sky savetarget&amp;lt;/code&amp;gt; , please make sure you run the following to install a package:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;apt-get install gcc-msp430&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
- If you get Permission Denied message as below:&lt;br /&gt;
&lt;br /&gt;
&amp;gt; could not open port: [Errno 13] Permission denied: &amp;#039;/dev/ttyUSB0&amp;#039;&lt;br /&gt;
&amp;gt; make[2]: *** [sky-r._dev_ttyUSB0] Error 1&lt;br /&gt;
&amp;gt; make[2]: Target `sky-reset-sequence&amp;#039; not remade because of errors.&lt;br /&gt;
&amp;gt; make[2]: Leaving directory `/home/user/contiki-2.7/examples/hello-world&amp;#039;&lt;br /&gt;
&amp;gt; make[1]: *** [sky-reset] Error 2&lt;br /&gt;
&amp;gt; make[1]: Leaving directory `/home/user/contiki-2.7/examples/hello-world&amp;#039;&lt;br /&gt;
&amp;gt; make: *** [hello-world.upload] Error 2&lt;br /&gt;
&lt;br /&gt;
Please make sure you are running with the root command.&lt;br /&gt;
&lt;br /&gt;
- If you are getting the following error after running the &amp;lt;code&amp;gt;make login&amp;lt;/code&amp;gt;, as below:&lt;br /&gt;
&lt;br /&gt;
using saved target &amp;#039;sky&amp;#039;&lt;br /&gt;
../../tools/sky/serialdump-linux -b115200 /dev/ttyUSB0&lt;br /&gt;
../../tools/sky/serialdump-linux: 1: ../../tools/sky/serialdump-linux: Syntax error: Unterminated quoted string&lt;br /&gt;
make: *** [login] Error 2&lt;br /&gt;
&lt;br /&gt;
Please follow the steps:&lt;br /&gt;
&lt;br /&gt;
1. Download the new serialdump-linux file from the web page:&lt;br /&gt;
   https://github.com/cmorty/contiki/blob/pull/serialdump/tools/sky/serialdump-linux&lt;br /&gt;
2. Rename the current serialdump-linux file with the name serialdump-linux.bck in the &amp;lt;code&amp;gt;/contiki/tools/sky&amp;lt;/code&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
3. Copy the new serialdump-linux file in the directory contiki/tools/sky&lt;br /&gt;
&lt;br /&gt;
4. Change the permissions of the new serialdump-linux file with the command&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;code&amp;gt;chmod  775 serialdump-linux&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Step 2 ===&lt;br /&gt;
&lt;br /&gt;
Press the reset button on the Tmote Sky. The following message will appear on the terminal window &lt;br /&gt;
&lt;br /&gt;
:: &amp;lt;code&amp;gt;Contiki 2.7 started. Node id is set to 3.&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;Rime started with address 3.0&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;MAC 00:12:ff:11:65:23:52:ed&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;Starting &amp;#039;Hello world process&amp;#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;Hello, world&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
: The boot up code of Contiki-OS prints the first four lines whereas the last line is printed by the Hello World program.&lt;br /&gt;
&lt;br /&gt;
=== Step 3 ===&lt;br /&gt;
&lt;br /&gt;
Press Ctrl-C to quit.&lt;br /&gt;
&lt;br /&gt;
=== Try This ===&lt;br /&gt;
&lt;br /&gt;
You can upload and login with one line. You can also point the upload and/or login to a specific device path (use `dmesg` to find the device path of a mote after inserting it to your computer). Try the following command:&lt;br /&gt;
&lt;br /&gt;
:: &amp;lt;code&amp;gt;make TARGET=sky MOTES=/dev/ttyUSB0 hello-world.upload login&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Contiki_tutorials | Back to Contiki Tutorials]]&lt;/div&gt;</summary>
		<author><name>Shashwath</name></author>	</entry>

	<entry>
		<id>http://anrg.usc.edu/contiki/index.php?title=Hello_World&amp;diff=1695</id>
		<title>Hello World</title>
		<link rel="alternate" type="text/html" href="http://anrg.usc.edu/contiki/index.php?title=Hello_World&amp;diff=1695"/>
				<updated>2016-05-20T00:43:13Z</updated>
		
		<summary type="html">&lt;p&gt;Shashwath: /* Step 1 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Contiki_tutorials | Back to Contiki Tutorials]]&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
This article is about the Hello World program, which is used to show the compilation and upload steps of a simple program on a Tmote Sky.&lt;br /&gt;
&lt;br /&gt;
== You will learn ==&lt;br /&gt;
&lt;br /&gt;
This tutorial teaches you how to compile a program on Contiki OS and also the most basic syntax of programming in ContikiOS.&lt;br /&gt;
&lt;br /&gt;
=== Step 1 ===&lt;br /&gt;
&lt;br /&gt;
Open the terminal window.&lt;br /&gt;
&lt;br /&gt;
=== Step 2 ===  &lt;br /&gt;
&lt;br /&gt;
In the terminal window, go to the hello world example folder.	&lt;br /&gt;
&lt;br /&gt;
:: &amp;lt;code&amp;gt;.cd /examples/hello-world&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Step 3=== &lt;br /&gt;
&lt;br /&gt;
Compile the code for the native platform (to be used when no mote is connected to the laptop.)&lt;br /&gt;
&lt;br /&gt;
:: &amp;lt;code&amp;gt;make TARGET=native&amp;lt;/code&amp;gt;&lt;br /&gt;
If there is any bug during compilation which says &amp;quot;#include&amp;lt;curses.h&amp;gt; : No such file or directory&amp;quot; you need to do the following on Ubuntu. &lt;br /&gt;
&lt;br /&gt;
If you are currently in the terminal, type &amp;quot;sudo apt-get install libncurses5-dev&amp;quot;(for which you should have installed the &amp;quot;apt&amp;quot; for 32-bit using &amp;quot;sudo dpkg -i apt_0.8.16~exp12ubuntu10.10_i386.deb&amp;quot; and for 64-bit using sudo dpkg -i apt_0.8.16~exp12ubuntu10.10_amd64.deb&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
You need to also install a version of javac compiler using the command &amp;quot;sudo apt-get install openjdk-7-jdk&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== Step 4 ===&lt;br /&gt;
&lt;br /&gt;
Once the compilation is over, run the Hello World program. &lt;br /&gt;
&lt;br /&gt;
:: &amp;lt;code&amp;gt;./hello-world.native&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Step 5 ===&lt;br /&gt;
You should be seeing the following on the terminal:&lt;br /&gt;
&lt;br /&gt;
:: &amp;lt;code&amp;gt;Contiki 3.0 started with IPV6, RPL&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;Rime started with address 1.2.3.4.5.6.7.8&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;MAC nullmac RDC nullrdc NETWORK sicslowpan&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;Tentative link-local IPv6 address fe80:0000:0000:0000:0302:0304:0506:0708&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;Hello, world&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The code will appear to hang, however, it is still running on Contiki, but not producing any output as the Hello World program is finished. &lt;br /&gt;
Press Ctrl-C to quit.&lt;br /&gt;
&lt;br /&gt;
== Hello World on the Tmote Sky! ==&lt;br /&gt;
&lt;br /&gt;
=== Step 1 ===&lt;br /&gt;
&lt;br /&gt;
Using the opened terminal window, compile and upload the Hello World program on the Tmote Sky.&lt;br /&gt;
&lt;br /&gt;
:: &amp;lt;code&amp;gt;make TARGET=sky savetarget&amp;lt;/code&amp;gt;    (This to save the target for any future compilations)&lt;br /&gt;
:: &amp;lt;code&amp;gt;make hello-world.upload&amp;lt;/code&amp;gt;    (This will upload the code on the Tmote Sky)&lt;br /&gt;
:: &amp;lt;code&amp;gt;make login&amp;lt;/code&amp;gt;    (This will enable us to view the output. If permission error occurs, use sudo command at the beginning)&lt;br /&gt;
&lt;br /&gt;
- If you are getting errors after running the command &amp;lt;code&amp;gt;make TARGET=sky savetarget&amp;lt;/code&amp;gt; , please make sure you run the following to install a package:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;apt-get install gcc-msp430&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
- If you get Permission Denied message as below:&lt;br /&gt;
&lt;br /&gt;
&amp;gt; could not open port: [Errno 13] Permission denied: &amp;#039;/dev/ttyUSB0&amp;#039;&lt;br /&gt;
&amp;gt; make[2]: *** [sky-r._dev_ttyUSB0] Error 1&lt;br /&gt;
&amp;gt; make[2]: Target `sky-reset-sequence&amp;#039; not remade because of errors.&lt;br /&gt;
&amp;gt; make[2]: Leaving directory `/home/user/contiki-2.7/examples/hello-world&amp;#039;&lt;br /&gt;
&amp;gt; make[1]: *** [sky-reset] Error 2&lt;br /&gt;
&amp;gt; make[1]: Leaving directory `/home/user/contiki-2.7/examples/hello-world&amp;#039;&lt;br /&gt;
&amp;gt; make: *** [hello-world.upload] Error 2&lt;br /&gt;
&lt;br /&gt;
Please make sure you are running with the root command.&lt;br /&gt;
&lt;br /&gt;
- If you are getting the following error after running the &amp;lt;code&amp;gt;make login&amp;lt;/code&amp;gt;, as below:&lt;br /&gt;
&lt;br /&gt;
using saved target &amp;#039;sky&amp;#039;&lt;br /&gt;
../../tools/sky/serialdump-linux -b115200 /dev/ttyUSB0&lt;br /&gt;
../../tools/sky/serialdump-linux: 1: ../../tools/sky/serialdump-linux: Syntax error: Unterminated quoted string&lt;br /&gt;
make: *** [login] Error 2&lt;br /&gt;
&lt;br /&gt;
Please follow the steps:&lt;br /&gt;
&lt;br /&gt;
1. Download the new serialdump-linux file from the web page:&lt;br /&gt;
   https://github.com/cmorty/contiki/blob/pull/serialdump/tools/sky/serialdump-linux&lt;br /&gt;
2. Rename the current serialdump-linux file with the name serialdump-linux.bck in the &amp;lt;code&amp;gt;/contiki/tools/sky&amp;lt;/code&amp;gt; directory.&lt;br /&gt;
3. Copy the new serialdump-linux file in the directory contiki/tools/sky&lt;br /&gt;
4. Change the permissions of the new serialdump-linux file with the command&lt;br /&gt;
   &amp;lt;code&amp;gt;chmod  775 serialdump-linux&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Step 2 ===&lt;br /&gt;
&lt;br /&gt;
Press the reset button on the Tmote Sky. The following message will appear on the terminal window &lt;br /&gt;
&lt;br /&gt;
:: &amp;lt;code&amp;gt;Contiki 2.7 started. Node id is set to 3.&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;Rime started with address 3.0&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;MAC 00:12:ff:11:65:23:52:ed&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;Starting &amp;#039;Hello world process&amp;#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;Hello, world&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
: The boot up code of Contiki-OS prints the first four lines whereas the last line is printed by the Hello World program.&lt;br /&gt;
&lt;br /&gt;
=== Step 3 ===&lt;br /&gt;
&lt;br /&gt;
Press Ctrl-C to quit.&lt;br /&gt;
&lt;br /&gt;
=== Try This ===&lt;br /&gt;
&lt;br /&gt;
You can upload and login with one line. You can also point the upload and/or login to a specific device path (use `dmesg` to find the device path of a mote after inserting it to your computer). Try the following command:&lt;br /&gt;
&lt;br /&gt;
:: &amp;lt;code&amp;gt;make TARGET=sky MOTES=/dev/ttyUSB0 hello-world.upload login&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Contiki_tutorials | Back to Contiki Tutorials]]&lt;/div&gt;</summary>
		<author><name>Shashwath</name></author>	</entry>

	<entry>
		<id>http://anrg.usc.edu/contiki/index.php?title=Hello_World&amp;diff=1694</id>
		<title>Hello World</title>
		<link rel="alternate" type="text/html" href="http://anrg.usc.edu/contiki/index.php?title=Hello_World&amp;diff=1694"/>
				<updated>2016-05-18T07:23:07Z</updated>
		
		<summary type="html">&lt;p&gt;Shashwath: /* Step 5 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Contiki_tutorials | Back to Contiki Tutorials]]&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
This article is about the Hello World program, which is used to show the compilation and upload steps of a simple program on a Tmote Sky.&lt;br /&gt;
&lt;br /&gt;
== You will learn ==&lt;br /&gt;
&lt;br /&gt;
This tutorial teaches you how to compile a program on Contiki OS and also the most basic syntax of programming in ContikiOS.&lt;br /&gt;
&lt;br /&gt;
=== Step 1 ===&lt;br /&gt;
&lt;br /&gt;
Open the terminal window.&lt;br /&gt;
&lt;br /&gt;
=== Step 2 ===  &lt;br /&gt;
&lt;br /&gt;
In the terminal window, go to the hello world example folder.	&lt;br /&gt;
&lt;br /&gt;
:: &amp;lt;code&amp;gt;.cd /examples/hello-world&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Step 3=== &lt;br /&gt;
&lt;br /&gt;
Compile the code for the native platform (to be used when no mote is connected to the laptop.)&lt;br /&gt;
&lt;br /&gt;
:: &amp;lt;code&amp;gt;make TARGET=native&amp;lt;/code&amp;gt;&lt;br /&gt;
If there is any bug during compilation which says &amp;quot;#include&amp;lt;curses.h&amp;gt; : No such file or directory&amp;quot; you need to do the following on Ubuntu. &lt;br /&gt;
&lt;br /&gt;
If you are currently in the terminal, type &amp;quot;sudo apt-get install libncurses5-dev&amp;quot;(for which you should have installed the &amp;quot;apt&amp;quot; for 32-bit using &amp;quot;sudo dpkg -i apt_0.8.16~exp12ubuntu10.10_i386.deb&amp;quot; and for 64-bit using sudo dpkg -i apt_0.8.16~exp12ubuntu10.10_amd64.deb&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
You need to also install a version of javac compiler using the command &amp;quot;sudo apt-get install openjdk-7-jdk&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== Step 4 ===&lt;br /&gt;
&lt;br /&gt;
Once the compilation is over, run the Hello World program. &lt;br /&gt;
&lt;br /&gt;
:: &amp;lt;code&amp;gt;./hello-world.native&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Step 5 ===&lt;br /&gt;
You should be seeing the following on the terminal:&lt;br /&gt;
&lt;br /&gt;
:: &amp;lt;code&amp;gt;Contiki 3.0 started with IPV6, RPL&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;Rime started with address 1.2.3.4.5.6.7.8&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;MAC nullmac RDC nullrdc NETWORK sicslowpan&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;Tentative link-local IPv6 address fe80:0000:0000:0000:0302:0304:0506:0708&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;Hello, world&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The code will appear to hang, however, it is still running on Contiki, but not producing any output as the Hello World program is finished. &lt;br /&gt;
Press Ctrl-C to quit.&lt;br /&gt;
&lt;br /&gt;
== Hello World on the Tmote Sky! ==&lt;br /&gt;
&lt;br /&gt;
=== Step 1 ===&lt;br /&gt;
&lt;br /&gt;
Using the opened terminal window, compile and upload the Hello World program on the Tmote Sky.&lt;br /&gt;
&lt;br /&gt;
:: &amp;lt;code&amp;gt;make TARGET=sky savetarget&amp;lt;/code&amp;gt;    (This to save the target for any future compilations)&lt;br /&gt;
:: &amp;lt;code&amp;gt;make hello-world.upload&amp;lt;/code&amp;gt;    (This will upload the code on the Tmote Sky)&lt;br /&gt;
:: &amp;lt;code&amp;gt;make login&amp;lt;/code&amp;gt;    (This will enable us to view the output. If permission error occurs, use sudo command at the beginning)&lt;br /&gt;
&lt;br /&gt;
=== Step 2 ===&lt;br /&gt;
&lt;br /&gt;
Press the reset button on the Tmote Sky. The following message will appear on the terminal window &lt;br /&gt;
&lt;br /&gt;
:: &amp;lt;code&amp;gt;Contiki 2.7 started. Node id is set to 3.&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;Rime started with address 3.0&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;MAC 00:12:ff:11:65:23:52:ed&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;Starting &amp;#039;Hello world process&amp;#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;Hello, world&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
: The boot up code of Contiki-OS prints the first four lines whereas the last line is printed by the Hello World program.&lt;br /&gt;
&lt;br /&gt;
=== Step 3 ===&lt;br /&gt;
&lt;br /&gt;
Press Ctrl-C to quit.&lt;br /&gt;
&lt;br /&gt;
=== Try This ===&lt;br /&gt;
&lt;br /&gt;
You can upload and login with one line. You can also point the upload and/or login to a specific device path (use `dmesg` to find the device path of a mote after inserting it to your computer). Try the following command:&lt;br /&gt;
&lt;br /&gt;
:: &amp;lt;code&amp;gt;make TARGET=sky MOTES=/dev/ttyUSB0 hello-world.upload login&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Contiki_tutorials | Back to Contiki Tutorials]]&lt;/div&gt;</summary>
		<author><name>Shashwath</name></author>	</entry>

	<entry>
		<id>http://anrg.usc.edu/contiki/index.php?title=Hello_World&amp;diff=1693</id>
		<title>Hello World</title>
		<link rel="alternate" type="text/html" href="http://anrg.usc.edu/contiki/index.php?title=Hello_World&amp;diff=1693"/>
				<updated>2016-05-18T07:20:58Z</updated>
		
		<summary type="html">&lt;p&gt;Shashwath: /* Step 5 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Contiki_tutorials | Back to Contiki Tutorials]]&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
This article is about the Hello World program, which is used to show the compilation and upload steps of a simple program on a Tmote Sky.&lt;br /&gt;
&lt;br /&gt;
== You will learn ==&lt;br /&gt;
&lt;br /&gt;
This tutorial teaches you how to compile a program on Contiki OS and also the most basic syntax of programming in ContikiOS.&lt;br /&gt;
&lt;br /&gt;
=== Step 1 ===&lt;br /&gt;
&lt;br /&gt;
Open the terminal window.&lt;br /&gt;
&lt;br /&gt;
=== Step 2 ===  &lt;br /&gt;
&lt;br /&gt;
In the terminal window, go to the hello world example folder.	&lt;br /&gt;
&lt;br /&gt;
:: &amp;lt;code&amp;gt;.cd /examples/hello-world&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Step 3=== &lt;br /&gt;
&lt;br /&gt;
Compile the code for the native platform (to be used when no mote is connected to the laptop.)&lt;br /&gt;
&lt;br /&gt;
:: &amp;lt;code&amp;gt;make TARGET=native&amp;lt;/code&amp;gt;&lt;br /&gt;
If there is any bug during compilation which says &amp;quot;#include&amp;lt;curses.h&amp;gt; : No such file or directory&amp;quot; you need to do the following on Ubuntu. &lt;br /&gt;
&lt;br /&gt;
If you are currently in the terminal, type &amp;quot;sudo apt-get install libncurses5-dev&amp;quot;(for which you should have installed the &amp;quot;apt&amp;quot; for 32-bit using &amp;quot;sudo dpkg -i apt_0.8.16~exp12ubuntu10.10_i386.deb&amp;quot; and for 64-bit using sudo dpkg -i apt_0.8.16~exp12ubuntu10.10_amd64.deb&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
You need to also install a version of javac compiler using the command &amp;quot;sudo apt-get install openjdk-7-jdk&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== Step 4 ===&lt;br /&gt;
&lt;br /&gt;
Once the compilation is over, run the Hello World program. &lt;br /&gt;
&lt;br /&gt;
:: &amp;lt;code&amp;gt;./hello-world.native&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Step 5 ===&lt;br /&gt;
&lt;br /&gt;
This will print the following on the terminal window:&lt;br /&gt;
&lt;br /&gt;
:: &amp;lt;code&amp;gt;Contiki 3.0 started with IPV6, RPL&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;Rime started with address 1.2.3.4.5.6.7.8&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;MAC nullmac RDC nullrdc NETWORK sicslowpan&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;Tentative link-local IPv6 address fe80:0000:0000:0000:0302:0304:0506:0708&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;Hello, world&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The code will appear to hang, however, it is still running on Contiki, but not producing any output as the Hello World program is finished. &lt;br /&gt;
Press Ctrl-C to quit.&lt;br /&gt;
&lt;br /&gt;
== Hello World on the Tmote Sky! ==&lt;br /&gt;
&lt;br /&gt;
=== Step 1 ===&lt;br /&gt;
&lt;br /&gt;
Using the opened terminal window, compile and upload the Hello World program on the Tmote Sky.&lt;br /&gt;
&lt;br /&gt;
:: &amp;lt;code&amp;gt;make TARGET=sky savetarget&amp;lt;/code&amp;gt;    (This to save the target for any future compilations)&lt;br /&gt;
:: &amp;lt;code&amp;gt;make hello-world.upload&amp;lt;/code&amp;gt;    (This will upload the code on the Tmote Sky)&lt;br /&gt;
:: &amp;lt;code&amp;gt;make login&amp;lt;/code&amp;gt;    (This will enable us to view the output. If permission error occurs, use sudo command at the beginning)&lt;br /&gt;
&lt;br /&gt;
=== Step 2 ===&lt;br /&gt;
&lt;br /&gt;
Press the reset button on the Tmote Sky. The following message will appear on the terminal window &lt;br /&gt;
&lt;br /&gt;
:: &amp;lt;code&amp;gt;Contiki 2.7 started. Node id is set to 3.&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;Rime started with address 3.0&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;MAC 00:12:ff:11:65:23:52:ed&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;Starting &amp;#039;Hello world process&amp;#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;Hello, world&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
: The boot up code of Contiki-OS prints the first four lines whereas the last line is printed by the Hello World program.&lt;br /&gt;
&lt;br /&gt;
=== Step 3 ===&lt;br /&gt;
&lt;br /&gt;
Press Ctrl-C to quit.&lt;br /&gt;
&lt;br /&gt;
=== Try This ===&lt;br /&gt;
&lt;br /&gt;
You can upload and login with one line. You can also point the upload and/or login to a specific device path (use `dmesg` to find the device path of a mote after inserting it to your computer). Try the following command:&lt;br /&gt;
&lt;br /&gt;
:: &amp;lt;code&amp;gt;make TARGET=sky MOTES=/dev/ttyUSB0 hello-world.upload login&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Contiki_tutorials | Back to Contiki Tutorials]]&lt;/div&gt;</summary>
		<author><name>Shashwath</name></author>	</entry>

	<entry>
		<id>http://anrg.usc.edu/contiki/index.php?title=Hello_World&amp;diff=1692</id>
		<title>Hello World</title>
		<link rel="alternate" type="text/html" href="http://anrg.usc.edu/contiki/index.php?title=Hello_World&amp;diff=1692"/>
				<updated>2016-05-18T07:20:38Z</updated>
		
		<summary type="html">&lt;p&gt;Shashwath: /* Step 5 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Contiki_tutorials | Back to Contiki Tutorials]]&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
This article is about the Hello World program, which is used to show the compilation and upload steps of a simple program on a Tmote Sky.&lt;br /&gt;
&lt;br /&gt;
== You will learn ==&lt;br /&gt;
&lt;br /&gt;
This tutorial teaches you how to compile a program on Contiki OS and also the most basic syntax of programming in ContikiOS.&lt;br /&gt;
&lt;br /&gt;
=== Step 1 ===&lt;br /&gt;
&lt;br /&gt;
Open the terminal window.&lt;br /&gt;
&lt;br /&gt;
=== Step 2 ===  &lt;br /&gt;
&lt;br /&gt;
In the terminal window, go to the hello world example folder.	&lt;br /&gt;
&lt;br /&gt;
:: &amp;lt;code&amp;gt;.cd /examples/hello-world&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Step 3=== &lt;br /&gt;
&lt;br /&gt;
Compile the code for the native platform (to be used when no mote is connected to the laptop.)&lt;br /&gt;
&lt;br /&gt;
:: &amp;lt;code&amp;gt;make TARGET=native&amp;lt;/code&amp;gt;&lt;br /&gt;
If there is any bug during compilation which says &amp;quot;#include&amp;lt;curses.h&amp;gt; : No such file or directory&amp;quot; you need to do the following on Ubuntu. &lt;br /&gt;
&lt;br /&gt;
If you are currently in the terminal, type &amp;quot;sudo apt-get install libncurses5-dev&amp;quot;(for which you should have installed the &amp;quot;apt&amp;quot; for 32-bit using &amp;quot;sudo dpkg -i apt_0.8.16~exp12ubuntu10.10_i386.deb&amp;quot; and for 64-bit using sudo dpkg -i apt_0.8.16~exp12ubuntu10.10_amd64.deb&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
You need to also install a version of javac compiler using the command &amp;quot;sudo apt-get install openjdk-7-jdk&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== Step 4 ===&lt;br /&gt;
&lt;br /&gt;
Once the compilation is over, run the Hello World program. &lt;br /&gt;
&lt;br /&gt;
:: &amp;lt;code&amp;gt;./hello-world.native&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Step 5 ===&lt;br /&gt;
&lt;br /&gt;
This will print the following on the terminal window:&lt;br /&gt;
&lt;br /&gt;
:: &amp;lt;code&amp;gt;Contiki 3.0 started with IPV6, RPL&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;Rime started with address 1.2.3.4.5.6.7.8&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;MAC nullmac RDC nullrdc NETWORK sicslowpan&lt;br /&gt;
:: &amp;lt;code&amp;gt;Tentative link-local IPv6 address fe80:0000:0000:0000:0302:0304:0506:0708&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;Hello, world&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The code will appear to hang, however, it is still running on Contiki, but not producing any output as the Hello World program is finished. &lt;br /&gt;
Press Ctrl-C to quit.&lt;br /&gt;
&lt;br /&gt;
== Hello World on the Tmote Sky! ==&lt;br /&gt;
&lt;br /&gt;
=== Step 1 ===&lt;br /&gt;
&lt;br /&gt;
Using the opened terminal window, compile and upload the Hello World program on the Tmote Sky.&lt;br /&gt;
&lt;br /&gt;
:: &amp;lt;code&amp;gt;make TARGET=sky savetarget&amp;lt;/code&amp;gt;    (This to save the target for any future compilations)&lt;br /&gt;
:: &amp;lt;code&amp;gt;make hello-world.upload&amp;lt;/code&amp;gt;    (This will upload the code on the Tmote Sky)&lt;br /&gt;
:: &amp;lt;code&amp;gt;make login&amp;lt;/code&amp;gt;    (This will enable us to view the output. If permission error occurs, use sudo command at the beginning)&lt;br /&gt;
&lt;br /&gt;
=== Step 2 ===&lt;br /&gt;
&lt;br /&gt;
Press the reset button on the Tmote Sky. The following message will appear on the terminal window &lt;br /&gt;
&lt;br /&gt;
:: &amp;lt;code&amp;gt;Contiki 2.7 started. Node id is set to 3.&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;Rime started with address 3.0&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;MAC 00:12:ff:11:65:23:52:ed&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;Starting &amp;#039;Hello world process&amp;#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;Hello, world&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
: The boot up code of Contiki-OS prints the first four lines whereas the last line is printed by the Hello World program.&lt;br /&gt;
&lt;br /&gt;
=== Step 3 ===&lt;br /&gt;
&lt;br /&gt;
Press Ctrl-C to quit.&lt;br /&gt;
&lt;br /&gt;
=== Try This ===&lt;br /&gt;
&lt;br /&gt;
You can upload and login with one line. You can also point the upload and/or login to a specific device path (use `dmesg` to find the device path of a mote after inserting it to your computer). Try the following command:&lt;br /&gt;
&lt;br /&gt;
:: &amp;lt;code&amp;gt;make TARGET=sky MOTES=/dev/ttyUSB0 hello-world.upload login&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Contiki_tutorials | Back to Contiki Tutorials]]&lt;/div&gt;</summary>
		<author><name>Shashwath</name></author>	</entry>

	<entry>
		<id>http://anrg.usc.edu/contiki/index.php?title=Hello_World&amp;diff=1691</id>
		<title>Hello World</title>
		<link rel="alternate" type="text/html" href="http://anrg.usc.edu/contiki/index.php?title=Hello_World&amp;diff=1691"/>
				<updated>2016-05-18T07:17:39Z</updated>
		
		<summary type="html">&lt;p&gt;Shashwath: /* Step 5 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Contiki_tutorials | Back to Contiki Tutorials]]&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
This article is about the Hello World program, which is used to show the compilation and upload steps of a simple program on a Tmote Sky.&lt;br /&gt;
&lt;br /&gt;
== You will learn ==&lt;br /&gt;
&lt;br /&gt;
This tutorial teaches you how to compile a program on Contiki OS and also the most basic syntax of programming in ContikiOS.&lt;br /&gt;
&lt;br /&gt;
=== Step 1 ===&lt;br /&gt;
&lt;br /&gt;
Open the terminal window.&lt;br /&gt;
&lt;br /&gt;
=== Step 2 ===  &lt;br /&gt;
&lt;br /&gt;
In the terminal window, go to the hello world example folder.	&lt;br /&gt;
&lt;br /&gt;
:: &amp;lt;code&amp;gt;.cd /examples/hello-world&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Step 3=== &lt;br /&gt;
&lt;br /&gt;
Compile the code for the native platform (to be used when no mote is connected to the laptop.)&lt;br /&gt;
&lt;br /&gt;
:: &amp;lt;code&amp;gt;make TARGET=native&amp;lt;/code&amp;gt;&lt;br /&gt;
If there is any bug during compilation which says &amp;quot;#include&amp;lt;curses.h&amp;gt; : No such file or directory&amp;quot; you need to do the following on Ubuntu. &lt;br /&gt;
&lt;br /&gt;
If you are currently in the terminal, type &amp;quot;sudo apt-get install libncurses5-dev&amp;quot;(for which you should have installed the &amp;quot;apt&amp;quot; for 32-bit using &amp;quot;sudo dpkg -i apt_0.8.16~exp12ubuntu10.10_i386.deb&amp;quot; and for 64-bit using sudo dpkg -i apt_0.8.16~exp12ubuntu10.10_amd64.deb&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
You need to also install a version of javac compiler using the command &amp;quot;sudo apt-get install openjdk-7-jdk&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== Step 4 ===&lt;br /&gt;
&lt;br /&gt;
Once the compilation is over, run the Hello World program. &lt;br /&gt;
&lt;br /&gt;
:: &amp;lt;code&amp;gt;./hello-world.native&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Step 5 ===&lt;br /&gt;
&lt;br /&gt;
This will print the following on the terminal window:&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The code will appear to hang, however, it is still running on Contiki, but not producing any output as the Hello World program is finished. Press Ctrl-C to quit.&lt;br /&gt;
&lt;br /&gt;
== Hello World on the Tmote Sky! ==&lt;br /&gt;
&lt;br /&gt;
=== Step 1 ===&lt;br /&gt;
&lt;br /&gt;
Using the opened terminal window, compile and upload the Hello World program on the Tmote Sky.&lt;br /&gt;
&lt;br /&gt;
:: &amp;lt;code&amp;gt;make TARGET=sky savetarget&amp;lt;/code&amp;gt;    (This to save the target for any future compilations)&lt;br /&gt;
:: &amp;lt;code&amp;gt;make hello-world.upload&amp;lt;/code&amp;gt;    (This will upload the code on the Tmote Sky)&lt;br /&gt;
:: &amp;lt;code&amp;gt;make login&amp;lt;/code&amp;gt;    (This will enable us to view the output. If permission error occurs, use sudo command at the beginning)&lt;br /&gt;
&lt;br /&gt;
=== Step 2 ===&lt;br /&gt;
&lt;br /&gt;
Press the reset button on the Tmote Sky. The following message will appear on the terminal window &lt;br /&gt;
&lt;br /&gt;
:: &amp;lt;code&amp;gt;Contiki 2.7 started. Node id is set to 3.&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;Rime started with address 3.0&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;MAC 00:12:ff:11:65:23:52:ed&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;Starting &amp;#039;Hello world process&amp;#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;Hello, world&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
: The boot up code of Contiki-OS prints the first four lines whereas the last line is printed by the Hello World program.&lt;br /&gt;
&lt;br /&gt;
=== Step 3 ===&lt;br /&gt;
&lt;br /&gt;
Press Ctrl-C to quit.&lt;br /&gt;
&lt;br /&gt;
=== Try This ===&lt;br /&gt;
&lt;br /&gt;
You can upload and login with one line. You can also point the upload and/or login to a specific device path (use `dmesg` to find the device path of a mote after inserting it to your computer). Try the following command:&lt;br /&gt;
&lt;br /&gt;
:: &amp;lt;code&amp;gt;make TARGET=sky MOTES=/dev/ttyUSB0 hello-world.upload login&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Contiki_tutorials | Back to Contiki Tutorials]]&lt;/div&gt;</summary>
		<author><name>Shashwath</name></author>	</entry>

	<entry>
		<id>http://anrg.usc.edu/contiki/index.php?title=Broadcast_Example&amp;diff=1690</id>
		<title>Broadcast Example</title>
		<link rel="alternate" type="text/html" href="http://anrg.usc.edu/contiki/index.php?title=Broadcast_Example&amp;diff=1690"/>
				<updated>2016-05-18T00:43:58Z</updated>
		
		<summary type="html">&lt;p&gt;Shashwath: /* Step 3 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Contiki_tutorials | Back to Contiki Tutorials]]&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
This exercise is an introduction into programming the [http://www.capsil.org/capsilwiki/index.php/TELOSB/TMote_Sky Tmote Sky]. It uses the Rime stack to communicate with other Contiki nodes over the radio. You will run the broadcast example already found in the Contiki core folders to send your name from a base station via broadcast packets. The exercise sends broadcast packets at random intervals between 4 and 8 seconds such that all Tmote Sky boards nearby will receive the packet.&lt;br /&gt;
&lt;br /&gt;
== You will learn ==&lt;br /&gt;
&lt;br /&gt;
* How to program the Broadcast communication found within the Rime stack&lt;br /&gt;
* How to encapsulate data in packets&lt;br /&gt;
&lt;br /&gt;
== Connect the Tmote Sky ==&lt;br /&gt;
Before continuing with the tutorial, plug a Tmote Sky into the computer’s USB port. The LEDs on the skymote will start blinking to indicate that the mote is connected.&lt;br /&gt;
&lt;br /&gt;
=== Step 1 ===&lt;br /&gt;
&lt;br /&gt;
The first step is to change directories. At this point you should be familiar with the Contiki 2.7 core folders. The Rime stack is located within the examples folder, so type &lt;br /&gt;
&lt;br /&gt;
 &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt; cd contiki-2.7/examples/rime &amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
directly into terminal. Once inside the rime folder, use the ls command to view all the files within it. We will be working specifically with example-broadcast.c.&lt;br /&gt;
&lt;br /&gt;
=== Step 2 ===&lt;br /&gt;
&lt;br /&gt;
Next, we will edit the data in the example-broadcast.c file. In order to do this, you will need to open the file with your text editor. In this exercise, we use gedit, but feel free to use whichever text editor you are most comfortable with. Type the following into the terminal:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt; gedit example-broadcast.c &amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will open your text editor, allowing you to edit the code inside the broadcast packet.&lt;br /&gt;
&lt;br /&gt;
=== Step 3 ===&lt;br /&gt;
&lt;br /&gt;
To edit the actual data that your Tmote Sky will broadcast, scroll down to the line that contains: &lt;br /&gt;
&lt;br /&gt;
 &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt; packetbuf_copyfrom(“Hello”,  6) &amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Change the character string to your name. Then change the number of characters accordingly. Remember to account for the &amp;quot;null character&amp;quot; associated with character strings in C when changing the number of characters. The line should now read&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt; packetbuf_copyfrom(“yourName”,  9) &amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Save and exit the text editor.&lt;br /&gt;
&lt;br /&gt;
=== Step 4 ===&lt;br /&gt;
&lt;br /&gt;
In the next step we configure Tmote Sky. Connect your mote to your computer via USB. If you are using VirtualBox or Parallels, assure that the mote actually connects to your virtual machine and not the host computer. The LEDs on the mote will temporarily blink when connected to the laptop.  &lt;br /&gt;
&lt;br /&gt;
=== Step 5 ===&lt;br /&gt;
&lt;br /&gt;
In this step, we will compile and upload the Broadcast packet to your Tmote Sky. In the terminal window, type&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt; make TARGET=sky example-broadcast.upload login &amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will notice that instead of typing example-broadcast.sky, we use example-broadcast.upload. The .upload tells Contiki to install the binary onto the attached mote. Additionally, we add login to use the terminal to communicate with the mote over the serial interface referred to by /dev/ttyUSB0. Note that login can be specified later in another call to make, i.e. make login.&lt;br /&gt;
&lt;br /&gt;
This should compile and upload the example-broadcast.c packet such that your mote will be able to broadcast your name. After the compilation is complete, the text broadcast message sent...  should appear in terminal every 2 to 4 seconds, indicating that your name (which we added within the text editor) is being broadcast to all other motes in the area.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Congratulations! You have successfully programmed the Tmote Sky! &amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; If at any point, you would like to exit the compilation/broadcast stage, press CTRL-C&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Tip:&amp;#039;&amp;#039;&amp;#039; You can save the TARGET by typing make TARGET=sky savetarget into terminal to avoid compiling the target repeatedly.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Understanding the code ==&lt;br /&gt;
The purpose of this example is to test the broadcast layer in Rime. A glance at core/net/rime/broadcast.h and core/net/rime/broadcast.c helps in the understanding underlying concepts of this example.&lt;br /&gt;
In the code, a process called example_broadcast_process is  kicked off by AUTOSTART_PROCESSES.&lt;br /&gt;
&lt;br /&gt;
==== Macros and Structures ====&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt; PROCESS(name,strname) &amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Every [http://anrg.usc.edu/contiki/index.php?title=Process process] should be defined via the PROCESS macro.&lt;br /&gt;
PROCESS has two arguments: the variable of the process structure, and a human readable string name, which is used when debugging.&lt;br /&gt;
&lt;br /&gt;
*name: The variable name of the process structure.&lt;br /&gt;
*strname: The string representation of the process name.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt; AUTOSTART_PROCESS(struct process &amp;amp;) &amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
AUTOSTART_PROCESSES automatically starts the process(es) given in the argument(s) when the module boots.&lt;br /&gt;
&lt;br /&gt;
*&amp;amp;name: Reference to the process name&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt; broadcast_recv(struct broadcast_conn *, const rimeaddr_t *) &amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This function parses an incoming packet and displays the message and the address of the sender.&lt;br /&gt;
By setting it as the broadcast&amp;#039;s designated callback function, broadcast_recv is automatically called when a packet is received.&lt;br /&gt;
&lt;br /&gt;
*broadcast_conn *:  This structure which has 2 structures : abc_conn, broadcast_callbacks *. The abc_conn is basic type of connection over which the broadcast connection is developed. And, the broadcast_callbacks point to recv and sent functions (in this example, just recv).&lt;br /&gt;
&lt;br /&gt;
*rimeaddr_t *: This is a union which has a character array u8[RIMEADDR_SIZE].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt; PROCESS_THREAD(name, process_event_t, process_data_t) &amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A process in Contiki consists of a single reference to a &amp;quot;[http://anrg.usc.edu/contiki/index.php?title=Protothreads protothread]&amp;quot;. This function is used to define the protothread of a process. The process is called whenever an event occurs in the system. &lt;br /&gt;
Each process in the module requires an event handler under the PROCESS_THREAD macro.&lt;br /&gt;
&lt;br /&gt;
*name: The variable name of the process structure.&lt;br /&gt;
*process_event_t: The variable of type character.If this variable is same as PROCESS_EVENT_EXIT then PROCESS_EXITHANDLER is invoked.&lt;br /&gt;
&lt;br /&gt;
Within the body of PROCESS_THREAD there are 3 major tasks:&lt;br /&gt;
* Initialization&lt;br /&gt;
** allocate resources&lt;br /&gt;
** define variables&lt;br /&gt;
** begin process&lt;br /&gt;
* Infinite Loop&lt;br /&gt;
** while(1) is used to create an infinite loop in which the actual event-handling response takes place&lt;br /&gt;
* Deallocation&lt;br /&gt;
** end process&lt;br /&gt;
** deallocate resources&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;PROCESS_EXITHANDLER(handler) &amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Specifies an action when a process exits.&lt;br /&gt;
NOTE: This declaration must come immediately before the PROCESS_BEGIN() macro.&lt;br /&gt;
&lt;br /&gt;
* handler: The action to be performed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;PROCESS_BEGIN() &amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This macro defines the beginning of a process, and must always appear in a PROCESS_THREAD() definition.This macro initiates PT_BEGIN(), which is declared at the starting point of a protothread. All C statements above the PT_BEGIN() invokation will be executed each time the protothread is scheduled.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;broadcast_close(struct broadcast_conn *) &amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This function closes a broadcast connection that has previously been opened with broadcast_open().This function typically is called as an exit handler.&lt;br /&gt;
&lt;br /&gt;
*broadcast_conn :  This is same as the variable from boradcast_recv().&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt; PROCESS_END() &amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This macro defines the end of a process. It must appear in a PROCESS_THREAD() definition and must always be included. The process exits when the PROCESS_END() macro is reached. This macro initiates PT_END().It must always be used together with a matching PT_BEGIN() macro.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt; broadcast_open(struct broadcast_conn *, uint16_t ,const struct broadcast_callbacks *) &amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets up an identified best-effort broadcast connection. The caller will allocate the memory for the struct broadcast_conn, usually by declaring it as a static variable. The struct broadcast_callbacks pointer  points to a structure containing a pointer to a function that will be called when a packet arrives on the channel. This function opens a connection of type abc_conn and sets the callbacks to structure passed. Also, this points to channel_set_attributes() function.&lt;br /&gt;
&lt;br /&gt;
*broadcast_conn : A pointer to a struct broadcast_conn&lt;br /&gt;
*uint16_t:  The channel on which the connection will operate&lt;br /&gt;
*broadcast_callbacks :  A struct broadcast_callbacks with function pointers to functions that will be called when a packet has been received&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt; etimer_set(struct etimer *, clock_time_t) &amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This function is used to set an event timer for a time sometime in the future. When the event timer expires, the event PROCESS_EVENT_TIMER will be posted to the process that called the etimer_set() function.&lt;br /&gt;
&lt;br /&gt;
*etimer : A pointer to the event timer&lt;br /&gt;
*clock_time_t : The interval before the timer expires.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt; static struct broadcast_conn &amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The broadcast module sends a packet to all local area neighbors with a header that identifies the sender. It also adds a single-hop address as a packet attribute to out going packets. &lt;br /&gt;
broadcast_conn structure consists of two structures&lt;br /&gt;
*abc_conn struct: the abc(Anonymous best effort local area Broadcast) module sends packets to all local area neighbors. It uses one channel.&lt;br /&gt;
*broadcast_callbacks struct: this is called when a packet has been received by the broadcast module. The struct broadcast_callbacks pointer is used in broadcast_open to point  to a function that will be called when a packet arrives on the channel.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Contiki_tutorials | Back to Contiki Tutorials]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Edited by: Rahul, Nikhil, Bhavana, Lakshmi&lt;/div&gt;</summary>
		<author><name>Shashwath</name></author>	</entry>

	<entry>
		<id>http://anrg.usc.edu/contiki/index.php?title=Hello_World&amp;diff=1689</id>
		<title>Hello World</title>
		<link rel="alternate" type="text/html" href="http://anrg.usc.edu/contiki/index.php?title=Hello_World&amp;diff=1689"/>
				<updated>2016-05-18T00:34:41Z</updated>
		
		<summary type="html">&lt;p&gt;Shashwath: /* Step 1 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Contiki_tutorials | Back to Contiki Tutorials]]&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
This article is about the Hello World program, which is used to show the compilation and upload steps of a simple program on a Tmote Sky.&lt;br /&gt;
&lt;br /&gt;
== You will learn ==&lt;br /&gt;
&lt;br /&gt;
This tutorial teaches you how to compile a program on Contiki OS and also the most basic syntax of programming in ContikiOS.&lt;br /&gt;
&lt;br /&gt;
=== Step 1 ===&lt;br /&gt;
&lt;br /&gt;
Open the terminal window.&lt;br /&gt;
&lt;br /&gt;
=== Step 2 ===  &lt;br /&gt;
&lt;br /&gt;
In the terminal window, go to the hello world example folder.	&lt;br /&gt;
&lt;br /&gt;
:: &amp;lt;code&amp;gt;.cd /examples/hello-world&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Step 3=== &lt;br /&gt;
&lt;br /&gt;
Compile the code for the native platform (to be used when no mote is connected to the laptop.)&lt;br /&gt;
&lt;br /&gt;
:: &amp;lt;code&amp;gt;make TARGET=native&amp;lt;/code&amp;gt;&lt;br /&gt;
If there is any bug during compilation which says &amp;quot;#include&amp;lt;curses.h&amp;gt; : No such file or directory&amp;quot; you need to do the following on Ubuntu. &lt;br /&gt;
&lt;br /&gt;
If you are currently in the terminal, type &amp;quot;sudo apt-get install libncurses5-dev&amp;quot;(for which you should have installed the &amp;quot;apt&amp;quot; for 32-bit using &amp;quot;sudo dpkg -i apt_0.8.16~exp12ubuntu10.10_i386.deb&amp;quot; and for 64-bit using sudo dpkg -i apt_0.8.16~exp12ubuntu10.10_amd64.deb&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
You need to also install a version of javac compiler using the command &amp;quot;sudo apt-get install openjdk-7-jdk&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== Step 4 ===&lt;br /&gt;
&lt;br /&gt;
Once the compilation is over, run the Hello World program. &lt;br /&gt;
&lt;br /&gt;
:: &amp;lt;code&amp;gt;./hello-world.native&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Step 5 ===&lt;br /&gt;
&lt;br /&gt;
This will print the words &amp;quot;Hello, world&amp;quot; on the terminal window. The code will appear to hang, however, it is still running on Contiki, but not producing any output as the Hello World program is finished. Press Ctrl-C to quit.&lt;br /&gt;
&lt;br /&gt;
== Hello World on the Tmote Sky! ==&lt;br /&gt;
&lt;br /&gt;
=== Step 1 ===&lt;br /&gt;
&lt;br /&gt;
Using the opened terminal window, compile and upload the Hello World program on the Tmote Sky.&lt;br /&gt;
&lt;br /&gt;
:: &amp;lt;code&amp;gt;make TARGET=sky savetarget&amp;lt;/code&amp;gt;    (This to save the target for any future compilations)&lt;br /&gt;
:: &amp;lt;code&amp;gt;make hello-world.upload&amp;lt;/code&amp;gt;    (This will upload the code on the Tmote Sky)&lt;br /&gt;
:: &amp;lt;code&amp;gt;make login&amp;lt;/code&amp;gt;    (This will enable us to view the output. If permission error occurs, use sudo command at the beginning)&lt;br /&gt;
&lt;br /&gt;
=== Step 2 ===&lt;br /&gt;
&lt;br /&gt;
Press the reset button on the Tmote Sky. The following message will appear on the terminal window &lt;br /&gt;
&lt;br /&gt;
:: &amp;lt;code&amp;gt;Contiki 2.7 started. Node id is set to 3.&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;Rime started with address 3.0&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;MAC 00:12:ff:11:65:23:52:ed&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;Starting &amp;#039;Hello world process&amp;#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;Hello, world&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
: The boot up code of Contiki-OS prints the first four lines whereas the last line is printed by the Hello World program.&lt;br /&gt;
&lt;br /&gt;
=== Step 3 ===&lt;br /&gt;
&lt;br /&gt;
Press Ctrl-C to quit.&lt;br /&gt;
&lt;br /&gt;
=== Try This ===&lt;br /&gt;
&lt;br /&gt;
You can upload and login with one line. You can also point the upload and/or login to a specific device path (use `dmesg` to find the device path of a mote after inserting it to your computer). Try the following command:&lt;br /&gt;
&lt;br /&gt;
:: &amp;lt;code&amp;gt;make TARGET=sky MOTES=/dev/ttyUSB0 hello-world.upload login&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Contiki_tutorials | Back to Contiki Tutorials]]&lt;/div&gt;</summary>
		<author><name>Shashwath</name></author>	</entry>

	<entry>
		<id>http://anrg.usc.edu/contiki/index.php?title=Hello_World&amp;diff=1688</id>
		<title>Hello World</title>
		<link rel="alternate" type="text/html" href="http://anrg.usc.edu/contiki/index.php?title=Hello_World&amp;diff=1688"/>
				<updated>2016-05-18T00:34:01Z</updated>
		
		<summary type="html">&lt;p&gt;Shashwath: /* Step 1 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Contiki_tutorials | Back to Contiki Tutorials]]&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
This article is about the Hello World program, which is used to show the compilation and upload steps of a simple program on a Tmote Sky.&lt;br /&gt;
&lt;br /&gt;
== You will learn ==&lt;br /&gt;
&lt;br /&gt;
This tutorial teaches you how to compile a program on Contiki OS and also the most basic syntax of programming in ContikiOS.&lt;br /&gt;
&lt;br /&gt;
=== Step 1 ===&lt;br /&gt;
&lt;br /&gt;
Open the terminal window.&lt;br /&gt;
&lt;br /&gt;
=== Step 2 ===  &lt;br /&gt;
&lt;br /&gt;
In the terminal window, go to the hello world example folder.	&lt;br /&gt;
&lt;br /&gt;
:: &amp;lt;code&amp;gt;.cd /examples/hello-world&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Step 3=== &lt;br /&gt;
&lt;br /&gt;
Compile the code for the native platform (to be used when no mote is connected to the laptop.)&lt;br /&gt;
&lt;br /&gt;
:: &amp;lt;code&amp;gt;make TARGET=native&amp;lt;/code&amp;gt;&lt;br /&gt;
If there is any bug during compilation which says &amp;quot;#include&amp;lt;curses.h&amp;gt; : No such file or directory&amp;quot; you need to do the following on Ubuntu. &lt;br /&gt;
&lt;br /&gt;
If you are currently in the terminal, type &amp;quot;sudo apt-get install libncurses5-dev&amp;quot;(for which you should have installed the &amp;quot;apt&amp;quot; for 32-bit using &amp;quot;sudo dpkg -i apt_0.8.16~exp12ubuntu10.10_i386.deb&amp;quot; and for 64-bit using sudo dpkg -i apt_0.8.16~exp12ubuntu10.10_amd64.deb&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
You need to also install a version of javac compiler using the command &amp;quot;sudo apt-get install openjdk-7-jdk&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== Step 4 ===&lt;br /&gt;
&lt;br /&gt;
Once the compilation is over, run the Hello World program. &lt;br /&gt;
&lt;br /&gt;
:: &amp;lt;code&amp;gt;./hello-world.native&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Step 5 ===&lt;br /&gt;
&lt;br /&gt;
This will print the words &amp;quot;Hello, world&amp;quot; on the terminal window. The code will appear to hang, however, it is still running on Contiki, but not producing any output as the Hello World program is finished. Press Ctrl-C to quit.&lt;br /&gt;
&lt;br /&gt;
== Hello World on the Tmote Sky! ==&lt;br /&gt;
&lt;br /&gt;
=== Step 1 ===&lt;br /&gt;
&lt;br /&gt;
Using the opened terminal window, compile and upload the Hello World program on the Tmote Sky.&lt;br /&gt;
&lt;br /&gt;
:: &amp;lt;code&amp;gt;make TARGET=sky savetarget&amp;lt;/code&amp;gt;    (This save the target for any future compilations)&lt;br /&gt;
:: &amp;lt;code&amp;gt;make hello-world.upload&amp;lt;/code&amp;gt;    (This will upload the code on the Tmote Sky)&lt;br /&gt;
:: &amp;lt;code&amp;gt;make login&amp;lt;/code&amp;gt;    (This will enable us to view the output. If permission error occurs, use sudo command at the beginning)&lt;br /&gt;
&lt;br /&gt;
=== Step 2 ===&lt;br /&gt;
&lt;br /&gt;
Press the reset button on the Tmote Sky. The following message will appear on the terminal window &lt;br /&gt;
&lt;br /&gt;
:: &amp;lt;code&amp;gt;Contiki 2.7 started. Node id is set to 3.&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;Rime started with address 3.0&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;MAC 00:12:ff:11:65:23:52:ed&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;Starting &amp;#039;Hello world process&amp;#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
:: &amp;lt;code&amp;gt;Hello, world&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
: The boot up code of Contiki-OS prints the first four lines whereas the last line is printed by the Hello World program.&lt;br /&gt;
&lt;br /&gt;
=== Step 3 ===&lt;br /&gt;
&lt;br /&gt;
Press Ctrl-C to quit.&lt;br /&gt;
&lt;br /&gt;
=== Try This ===&lt;br /&gt;
&lt;br /&gt;
You can upload and login with one line. You can also point the upload and/or login to a specific device path (use `dmesg` to find the device path of a mote after inserting it to your computer). Try the following command:&lt;br /&gt;
&lt;br /&gt;
:: &amp;lt;code&amp;gt;make TARGET=sky MOTES=/dev/ttyUSB0 hello-world.upload login&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Contiki_tutorials | Back to Contiki Tutorials]]&lt;/div&gt;</summary>
		<author><name>Shashwath</name></author>	</entry>

	<entry>
		<id>http://anrg.usc.edu/contiki/index.php?title=Cooja_Simulator&amp;diff=1687</id>
		<title>Cooja Simulator</title>
		<link rel="alternate" type="text/html" href="http://anrg.usc.edu/contiki/index.php?title=Cooja_Simulator&amp;diff=1687"/>
				<updated>2016-05-17T17:33:39Z</updated>
		
		<summary type="html">&lt;p&gt;Shashwath: /* Running Cooja Simulator */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Contiki_tutorials | Back to Contiki Tutorials]]&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
This tutorial aims at introducing the Cooja Simulator and guiding the reader in a simple debugging exercise. We are going to work with Hello World example for the debugging process. You can also study the [[Hello_World]] tutorial to get familiar with its source code.&lt;br /&gt;
&lt;br /&gt;
== You Will Learn ==&lt;br /&gt;
&lt;br /&gt;
* How to run Cooja Simulator.&lt;br /&gt;
* How to debug an application using Cooja Simulator.&lt;br /&gt;
&lt;br /&gt;
== Relevant Directories ==&lt;br /&gt;
&lt;br /&gt;
* /contiki/tools/cooja/ - This folder has Cooja Simulator source code. You can run Cooja inside this directory.&lt;br /&gt;
* /contiki/examples/hello-world/ - This has the source code of Hello World example.&lt;br /&gt;
&lt;br /&gt;
== Running Cooja Simulator ==&lt;br /&gt;
&lt;br /&gt;
Cooja Simulator is a network simulator specifically designed for Wireless Sensor Networks. A summary of how Cooja executes binaries of different platforms (different types of nodes) and a few details about its structure can be found here:[https://github.com/contiki-os/contiki/wiki/An-Introduction-to-Cooja#Create_a_Hello_World_simulation].&lt;br /&gt;
&lt;br /&gt;
The simple way of running Cooja is executing it inside its own directory (we will see later how to execute Cooja from any working directory):&lt;br /&gt;
&lt;br /&gt;
 cd contiki/tools/cooja&lt;br /&gt;
 ant run&lt;br /&gt;
&lt;br /&gt;
We you execute Cooja the following window pops up.&lt;br /&gt;
&lt;br /&gt;
[[File:cooja-1.png|center|450px]]&lt;br /&gt;
&lt;br /&gt;
=== Creating a new simulation ===&lt;br /&gt;
&lt;br /&gt;
In the File menu you can start a new simulation or open an existing one. At this moment we will start a new one. You should select: File &amp;gt; New simulation... The following window should show up.&lt;br /&gt;
&lt;br /&gt;
[[File:cooja-2.png|center|350px]]&lt;br /&gt;
&lt;br /&gt;
In the &amp;#039;&amp;#039;Simulation name&amp;#039;&amp;#039; box you should enter an identifier for the new simulation, and in &amp;#039;&amp;#039;Advanced settings&amp;#039;&amp;#039; you can choose parameters of the simulation such as Radio medium, node startup delay and random seed generation. We are going to create a simulation called &amp;quot;First Cooja Sim&amp;quot;, as shown above.&lt;br /&gt;
&lt;br /&gt;
After creating a new simulation, Cooja&amp;#039;s window is filled with the main simulating tools, as shown in the next image.&lt;br /&gt;
&lt;br /&gt;
[[File:cooja-3.png|center|650px]]&lt;br /&gt;
&lt;br /&gt;
Here we briefly describe the functionalities of each tool:&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Network&amp;#039;&amp;#039;&amp;#039; - Shows the location of each node in the network. Can be used to visualize the status of each node, including LEDs, mote IDs, addresses, lof outputs, etc. Initially this window is empty and we need to populate it with our sensors.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Simulation Control&amp;#039;&amp;#039;&amp;#039; - This panel is used to Start, Pause, Reload or execute Steps of the simulation. It shows the time of execution and the speed of simulation. It means that we can run the events several times faster than it would take in real-time execution.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Notes&amp;#039;&amp;#039;&amp;#039; - This is a simple notepad for taking notes about the simulation.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Mote output&amp;#039;&amp;#039;&amp;#039; - Shows all output of serial interface of the nodes. It is possible to enable one window of Mote output for each node in the simulation.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Timeline&amp;#039;&amp;#039;&amp;#039; - Simulation timeline where messages and events such as channel change, LEDs change, log outputs, etc are shown.&lt;br /&gt;
&lt;br /&gt;
In addition to the default tools, it is possible to exhibit other tools such as &amp;#039;&amp;#039;&amp;#039;Breakpoints&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;Radio messages&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;Script editor&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;Buffer view&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;Mote duty cycle&amp;#039;&amp;#039;&amp;#039;, which can be enable in the &amp;#039;&amp;#039;Tools&amp;#039;&amp;#039; menu.&lt;br /&gt;
&lt;br /&gt;
=== Creating a new mote type ===&lt;br /&gt;
&lt;br /&gt;
You need to create a new mote type before starting any simulation. You can do this in the menu &amp;#039;&amp;#039;&amp;#039;Motes&amp;#039;&amp;#039;&amp;#039; &amp;gt; &amp;#039;&amp;#039;&amp;#039;Add motes&amp;#039;&amp;#039;&amp;#039; &amp;gt; &amp;#039;&amp;#039;&amp;#039;Create new motes type&amp;#039;&amp;#039;&amp;#039;. Let&amp;#039;s select &amp;#039;&amp;#039;&amp;#039;Sky mote&amp;#039;&amp;#039;&amp;#039; in order to create a mote of the same type as the used Tmote Sky.&lt;br /&gt;
&lt;br /&gt;
The window that shows up (see below) asks for the &amp;#039;&amp;#039;&amp;#039;Description&amp;#039;&amp;#039;&amp;#039; of the new mote type and the &amp;#039;&amp;#039;&amp;#039;Contiki process / Firmware&amp;#039;&amp;#039;&amp;#039;. You can name your mote type as &amp;#039;&amp;#039;First mote type&amp;#039;&amp;#039; and you can select the firmware that will be used during the simulation using the &amp;#039;&amp;#039;Browse&amp;#039;&amp;#039; button. After selecting the desired firmware you can test the compilation click the &amp;#039;&amp;#039;Compile&amp;#039;&amp;#039; button. In this example we will use the Hello World fimware, typically located at &amp;#039;&amp;#039;/contiki/examples/hello-world/hello-world.c&amp;#039;&amp;#039;. If the compiling process is successed, you will see a final message: &amp;#039;&amp;#039;LD hello-world.sky&amp;#039;&amp;#039; in the Compilation output tab.&lt;br /&gt;
&lt;br /&gt;
[[File:cooja-4.png|center|500px]]&lt;br /&gt;
&lt;br /&gt;
=== Adding motes and running the simulation ===&lt;br /&gt;
&lt;br /&gt;
After successfully compiling the firmware in the last step you should click on &amp;#039;&amp;#039;Create&amp;#039;&amp;#039; button (see figure above). A new mote type will be created and you will be able to add a few nodes of that same type in your simulation. You will see the window shown below, where you will be able to set the number of nodes that will be created and specify their positioning. In this example we are going to create 3 new nodes and they will have random positioning.&lt;br /&gt;
&lt;br /&gt;
[[File:cooja-5.png|center|350px]]&lt;br /&gt;
&lt;br /&gt;
=== Saving simulation file ===&lt;br /&gt;
&lt;br /&gt;
The simulation configuration and parameters such as number of nodes, type of nodes, firmware used, location of nodes, etc. can be stored in a file for future simulations. You can save your simulation configuration in &amp;#039;&amp;#039;File&amp;#039;&amp;#039; &amp;gt; &amp;#039;&amp;#039;Save simulation as...&amp;#039;&amp;#039;. The generated file has extension &amp;quot;.csc&amp;quot;. In the case of Hello World firmware there already exist a .csc file inside &amp;#039;&amp;#039;contiki/examples/hello-world&amp;#039;&amp;#039;, called hello-world-example.csc, which contains 2 nodes. We are going to use this pre-existing Cooja file to show how to debug an application.&lt;br /&gt;
&lt;br /&gt;
== Debugging with Cooja Simulator ==&lt;br /&gt;
&lt;br /&gt;
The easiest way to debug an application is to initially create a proper .csc simulation file, as described above. Then, inside the folder with the simulation file and all firmware source code (.c and .h files), you need to execute the following command.&lt;br /&gt;
&lt;br /&gt;
 make TARGET=cooja &amp;lt;simulation_file&amp;gt;.csc&lt;br /&gt;
&lt;br /&gt;
The command above will initialize Cooja Simulator loaded with the desired simulation file and will make Cooja recognized the source code of the application we intend to debug. In our case we are going to simulate and debug the Hello Worls application, so we need to go into /contiki/examples/hello-world folder and execute the command &amp;#039;&amp;#039;make TARGET=cooja hello-world-example.csc&amp;#039;&amp;#039;. The window shown below should be displayed.&lt;br /&gt;
&lt;br /&gt;
[[File:cooja-6.png|center|400px]]&lt;br /&gt;
&lt;br /&gt;
If we click on &amp;#039;&amp;#039;Start&amp;#039;&amp;#039; button the simulation begins and we can see both nodes printing out log messages on the &amp;#039;&amp;#039;&amp;#039;Mote output&amp;#039;&amp;#039;&amp;#039; window.&lt;br /&gt;
&lt;br /&gt;
All debugging tools can be accessed by right-clicking on a node and selecting &amp;#039;&amp;#039;Mote tools for Sky&amp;#039;&amp;#039; in the pop-up menu. The two main debugging tools that we are going to use are: &amp;#039;&amp;#039;Msp Code Watcher&amp;#039;&amp;#039; and &amp;#039;&amp;#039;Msp Stack Watcher&amp;#039;&amp;#039;. The first one can be used for analysing the source code of the application in a step-by-step fashion, with the possibility of setting breakpoints. The second tool is used to read and write the variables used throughout the execution.&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;Msp Code Watcher&amp;#039;&amp;#039; tool can be seen below. &lt;br /&gt;
&lt;br /&gt;
[[Contiki_tutorials | Back to Contiki Tutorials]]&lt;br /&gt;
&lt;br /&gt;
Edited by: Pedro&lt;/div&gt;</summary>
		<author><name>Shashwath</name></author>	</entry>

	</feed>