<?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=Deepanker</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=Deepanker"/>
		<link rel="alternate" type="text/html" href="http://anrg.usc.edu/contiki/index.php/Special:Contributions/Deepanker"/>
		<updated>2026-05-08T14:44:52Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.26.2</generator>

	<entry>
		<id>http://anrg.usc.edu/contiki/index.php?title=Contiki_tutorials&amp;diff=414</id>
		<title>Contiki tutorials</title>
		<link rel="alternate" type="text/html" href="http://anrg.usc.edu/contiki/index.php?title=Contiki_tutorials&amp;diff=414"/>
				<updated>2014-05-10T19:26:55Z</updated>
		
		<summary type="html">&lt;p&gt;Deepanker: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Main_Page | Back to Main Page]]&lt;br /&gt;
&lt;br /&gt;
== List of Tutorials ==&lt;br /&gt;
&lt;br /&gt;
Completed&lt;br /&gt;
&lt;br /&gt;
# [[Installation]]&lt;br /&gt;
# [[Hello World]]&lt;br /&gt;
# [[Broadcast Example]]&lt;br /&gt;
# [[Collect View]]&lt;br /&gt;
# [[Contiki build system]]&lt;br /&gt;
# [[Interfacing with Python]]&lt;br /&gt;
&lt;br /&gt;
Need review&lt;br /&gt;
&lt;br /&gt;
# [[Timers]] Tim, Leo&lt;br /&gt;
# [[CFS-Coffee]] Kevin&lt;br /&gt;
&lt;br /&gt;
Starting&lt;br /&gt;
# [[Tutornet]] Pedro, Kwame&lt;br /&gt;
# [[Cooja Simulator]] (Getting started, debugging) Pedro&lt;br /&gt;
# [[Protocols stack]]&lt;br /&gt;
# [[CSMA]] Tim, Leo&lt;br /&gt;
# [[RSS measurement]]&lt;br /&gt;
# [[Sensor acquisition]] (light, temperature) Kwame&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--[[Processes]] Yash --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: red&amp;quot;&amp;gt;Be sure to include references in your tutorials, especially if you quote material from other sites!&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Deepanker</name></author>	</entry>

	<entry>
		<id>http://anrg.usc.edu/contiki/index.php?title=Meeting_Logs&amp;diff=389</id>
		<title>Meeting Logs</title>
		<link rel="alternate" type="text/html" href="http://anrg.usc.edu/contiki/index.php?title=Meeting_Logs&amp;diff=389"/>
				<updated>2014-04-04T19:41:04Z</updated>
		
		<summary type="html">&lt;p&gt;Deepanker: /* Mar/28 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Feb/7 ==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Secretary:&amp;#039;&amp;#039;&amp;#039; Kwame&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Meeting summary:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Professor Bhaskar gave us his wishlist. See a brief outline at [[Wishlist]].&lt;br /&gt;
&lt;br /&gt;
We got the Contiki oscilloscope up and running, and played around with it using two motes.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;For next week:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Suvil is going to investigate options for a mailing list and also get the issue with uploading images to the wiki fixed.&lt;br /&gt;
&lt;br /&gt;
Nikhil will set up a Google Drive share for us to use for prototyping our tutorials when appropriate. It would allow for us to collaboratively edit in real-time and provide us all the conveniences of a modern word processor (spell check, etc.) We should probably discuss this more next time.&lt;br /&gt;
&lt;br /&gt;
Yash will spend the time catching up and going through our existing tutorials.&lt;br /&gt;
&lt;br /&gt;
Lakshmi has graciously volunteered to present Cristian&amp;#039;s algorithm to us.&lt;br /&gt;
&lt;br /&gt;
Nikhil, Bhavana, Rahul, and Deepanker will start a new tutorial for using the Oscilloscope.&lt;br /&gt;
&lt;br /&gt;
Kevin will explore methods for on-board data storage on the sky mote, both volatile and non-volatile.&lt;br /&gt;
&lt;br /&gt;
Pedro, Suvil, and Kwame will work on running Contiki on the testbed and starting a tutorial. Also, thinking about how we can refactor some of our theoretical tutorials to be more activity oriented.&lt;br /&gt;
&lt;br /&gt;
Everyone should update their tutorials to include the primary contributors. Perhaps somewhere at the end.&lt;br /&gt;
&lt;br /&gt;
== Feb/14 ==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Secretary:&amp;#039;&amp;#039;&amp;#039; Pedro&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Meeting summary:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Lakshmi presented the paper [[Probabilistic Clock Synchronization http://kom.aau.dk/~rlo/lectures/algoAndArchIII_2009/ChristiansAlgorithm.pdf]]. We had a very interesting discussion about the terms and concepts behind synchronization and clock in network nodes. We might in the future see how this algorithm can be implemented in a WSN or check whether its main ideas are already implemented in the &amp;quot;Implicit network time synchronization&amp;quot;, present in ContikiOS ([http://contiki.sourceforge.net/docs/2.6/a01741.html])&lt;br /&gt;
&lt;br /&gt;
Everyone gave an updated about what have been done during last week. We have some material for two tutorials: the &amp;#039;&amp;#039;Oscilloscope&amp;#039;&amp;#039; and &amp;#039;&amp;#039;Coffee File System&amp;#039;&amp;#039;. This material is yet in the Google Doc create for prototyping and should be posted in the Wiki soon.&lt;br /&gt;
&lt;br /&gt;
Kwame guided the group in the first 4 sessions of ContikiOS Crash Course [[File:Seniot09cccc-notes.pdf]]. We played with LEDs and push button. This example should give a new tutorial on how to use all the sensors/actuators (light, temperature, push button, etc.) on the motes.&lt;br /&gt;
&lt;br /&gt;
We decided that each week one person will be responsible for creating this meeting log, so everyone can keep track of what has been discussed every week. Below we have the expected date of our next meetings and a tentative assignment.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;For next week:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Kevin will give a brief talk about Coffee file system and show us the material he obtained and the tutorial he started to write.&lt;br /&gt;
&lt;br /&gt;
Yash will start to study and collect material about processes and protothreads. He may give a talk about these topics in two weeks.&lt;br /&gt;
&lt;br /&gt;
Nikhil, Bhavana, Rahul, and Deepanker will keep working on the Oscilloscope tutorial.&lt;br /&gt;
&lt;br /&gt;
Pedro and Kwame will start to work on the Tutornet testbed.&lt;br /&gt;
&lt;br /&gt;
Suvil will fix some issues we are facing in the Wiki with code formatting and help us with account creation/setup of the testbed.&lt;br /&gt;
&lt;br /&gt;
== Feb/21 ==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Secretary:&amp;#039;&amp;#039;&amp;#039; Suvil&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Meeting summary:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Kevin gave a presentation about Coffee File System. He showed the main interface and functions that can be used by Tmote Sky. He also showed an example where a node was programmed to create and write 3 different files on Flash Memory and after reboot output the content of the files reading then from the memory. The presentation slides can be found here:[] and the example code can be found here:[]. He started to create a tutorial on Coffee on the shared Doc file and you may create a tutorial about this topic in our Wiki soon.&lt;br /&gt;
&lt;br /&gt;
We went through the example in: examples/rime/example-neighbors.c, suggested by Bhavana. Basically this example makes all node generate beacons and create a list of neighbors of each node. It prints out the list of neighbors with the corresponding RSSI value.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;For next week:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
We should continue to work on the tutorials, trying to polish and review them for final publication.&lt;br /&gt;
&lt;br /&gt;
== Feb/28 ==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Secretary:&amp;#039;&amp;#039;&amp;#039; Leo&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Meeting summary:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Pedro gave a presentation of a few of the features available in the Cooja simulator. Some of what he covered, which will be put in the Cooja tutorial, includes how to build Cooja from the terminal and automatically start a simulation, locate source files for debugging, and use the single-step and breakpoint debugging tools available for debugging each node. Afterwards, we looked at examples-neighbors.c in more detail, noting the size of the data structures and the way certain values were calculated, such as RSSI. Lastly, we briefly looked over some of the Contiki OS files in the documentation and flipped through a comprehensive Contiki presentation here [http://www.ee.kth.se/~mikaelj/wsn_course/contiki-course-kth-9oct2008-draft.pdf].&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;For next week:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Several more tutorials should be done by our next meeting.&lt;br /&gt;
&lt;br /&gt;
== Mar/07 ==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Secretary:&amp;#039;&amp;#039;&amp;#039; Nikhil&lt;br /&gt;
&lt;br /&gt;
== Mar/14 ==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Secretary:&amp;#039;&amp;#039;&amp;#039; Kwame&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Meeting summary:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Yash gave a presentation on Processes and Protothreads. The group expressed interest in learning more about the hardware behind the Tmote Sky, such as the TI MSP430 microprocessor and the CC2420 radio. We&amp;#039;ll probably include some of those as the topic of future talks.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;For next week:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Enjoy Spring Break!&lt;br /&gt;
&lt;br /&gt;
== Mar/21 ==&lt;br /&gt;
&lt;br /&gt;
Spring Break, no meeting&lt;br /&gt;
&lt;br /&gt;
== Mar/28 ==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Secretary:&amp;#039;&amp;#039;&amp;#039; Deepanker&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Meeting summary:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
We successfully programmed a multi-hop communication between 5 motes. We also discussed the ways in which motes can talk to each other, namely - unicast, multicast and reliable unicast - and discussed the pros and cons of each with respect to our application.&lt;br /&gt;
&lt;br /&gt;
We discussed a little bit about the connections on the mote, specifically the interaction of MSP430 with CC2420.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;For next week:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Yash will give an introduction to MSP430. Completion of tutorials on wiki and proofreading of the already completed will be done by the people who are assigned the task.&lt;br /&gt;
&lt;br /&gt;
== Apr/04 ==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Secretary:&amp;#039;&amp;#039;&amp;#039; Kevin&lt;br /&gt;
&lt;br /&gt;
== Apr/11 ==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Secretary:&amp;#039;&amp;#039;&amp;#039; Timothy&lt;br /&gt;
&lt;br /&gt;
== Apr/18 ==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Secretary:&amp;#039;&amp;#039;&amp;#039; Bhavana&lt;/div&gt;</summary>
		<author><name>Deepanker</name></author>	</entry>

	<entry>
		<id>http://anrg.usc.edu/contiki/index.php?title=Interfacing_with_Python&amp;diff=388</id>
		<title>Interfacing with Python</title>
		<link rel="alternate" type="text/html" href="http://anrg.usc.edu/contiki/index.php?title=Interfacing_with_Python&amp;diff=388"/>
				<updated>2014-04-04T19:29:57Z</updated>
		
		<summary type="html">&lt;p&gt;Deepanker: /* Understanding the Code */&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;
In this tutorial you will learn how to programmatically communicate with the Tmote Sky using the Python programming language. This will enable you to do such things as process data from your mote in real-time. In addition, you can send commands or data back to the mote to impact its operation. The possibilities are endless.&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
This tutorial was written and tested using the following:&lt;br /&gt;
* Contiki 2.7&lt;br /&gt;
* Python 2.7.3 (and [http://pyserial.sourceforge.net/ pySerial])&lt;br /&gt;
* Ubuntu 12.04&lt;br /&gt;
* Tmote Sky&lt;br /&gt;
&lt;br /&gt;
Connect the Tmote Sky to your computer using a USB cable and install the Sky Shell example. See the @Sky Shell@ tutorial for instructions on how to do this. We use this example so that we’ll have data to ensure that we are correctly reading and writing to the mote.&lt;br /&gt;
&lt;br /&gt;
=== Step 1 ===&lt;br /&gt;
&lt;br /&gt;
Create a Python file called serial.py containing the following code:&lt;br /&gt;
 &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;#!/usr/bin/python&lt;br /&gt;
 import serial&lt;br /&gt;
 ser = serial.Serial(&lt;br /&gt;
    port=&amp;#039;/dev/ttyUSB0&amp;#039;,\&lt;br /&gt;
    baudrate=115200,\&lt;br /&gt;
    parity=serial.PARITY_NONE,\&lt;br /&gt;
    stopbits=serial.STOPBITS_ONE,\&lt;br /&gt;
    bytesize=serial.EIGHTBITS,\&lt;br /&gt;
    timeout=0)&lt;br /&gt;
 print(&amp;quot;connected to: &amp;quot; + ser.portstr)&lt;br /&gt;
 ser.write(&amp;quot;help\n&amp;quot;);&lt;br /&gt;
 while True:&lt;br /&gt;
	line = ser.readline();&lt;br /&gt;
	if line:&lt;br /&gt;
		print(line),&lt;br /&gt;
 ser.close()&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: &lt;br /&gt;
This code assumes the mote you are using for this tutorial is connected to &amp;#039;&amp;#039;/dev/ttyUSB0&amp;#039;&amp;#039;. Please check this using the &amp;#039;&amp;#039;make motelist&amp;#039;&amp;#039; command as shown in the figure below. If the mote you are using is connected to a different device file, please modify the Python code accordingly.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Motelist.jpg|center|Sample output of &amp;#039;&amp;#039;make motelist&amp;#039;&amp;#039;]]&lt;br /&gt;
&lt;br /&gt;
=== Step 2 ===&lt;br /&gt;
&lt;br /&gt;
Run the Python code using the command:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;python serial.py&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You should see output similar to the following:&lt;br /&gt;
 &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
 connected to: /dev/ttyUSB0&lt;br /&gt;
 Available commands:&lt;br /&gt;
 ?: shows this help&lt;br /&gt;
 binprint: print binary data in decimal format&lt;br /&gt;
 blink [num]: blink LEDs ([num] times)&lt;br /&gt;
 collect: collect data from the network&lt;br /&gt;
 collect-view-data: sensor data, power consumption, network stats&lt;br /&gt;
 echo &amp;lt;text&amp;gt;: print &amp;lt;text&amp;gt;&lt;br /&gt;
 energy: print energy profile&lt;br /&gt;
 exit: exit shell&lt;br /&gt;
 hd: print binary data in hexadecimal format&lt;br /&gt;
 help: shows this help&lt;br /&gt;
 kill &amp;lt;command&amp;gt;: stop a specific command&lt;br /&gt;
 killall: stop all running commands&lt;br /&gt;
 mac &amp;lt;onoroff&amp;gt;: turn MAC protocol on (1) or off (0)&lt;br /&gt;
 netcmd &amp;lt;command&amp;gt;: run a command on all nodes in the network&lt;br /&gt;
 nodeid: set node ID&lt;br /&gt;
 null: discard input&lt;br /&gt;
 packetize: put data into one packet&lt;br /&gt;
 power: print power profile&lt;br /&gt;
 powerconv: convert power profile to human readable output&lt;br /&gt;
 powertrace [interval]: turn powertracing on or off, with reporting interval &amp;lt;interval&amp;gt;&lt;br /&gt;
 quit: exit shell&lt;br /&gt;
 randwait &amp;lt;maxtime&amp;gt; &amp;lt;command&amp;gt;: wait for a random time before running a command&lt;br /&gt;
 reboot: reboot the system&lt;br /&gt;
 repeat &amp;lt;num&amp;gt; &amp;lt;time&amp;gt; &amp;lt;command&amp;gt;: run a command every &amp;lt;time&amp;gt; seconds&lt;br /&gt;
 rfchannel &amp;lt;channel&amp;gt;: change CC2420 radio channel (11 - 26)&lt;br /&gt;
 routes: dump route list in binary format&lt;br /&gt;
 send &amp;lt;rexmits&amp;gt;: send data to the collector node, with rexmits hop-by-hop retransmissions&lt;br /&gt;
 sense: print out sensor data&lt;br /&gt;
 senseconv: convert &amp;#039;sense&amp;#039; data to human readable format&lt;br /&gt;
 size: print the size of the input&lt;br /&gt;
 time [seconds]: output time in binary format, or set time in seconds since 1970&lt;br /&gt;
 timestamp: prepend a timestamp to data&lt;br /&gt;
 txpower &amp;lt;power&amp;gt;: change CC2420 transmission power (0 - 31)&lt;br /&gt;
 5.0: Contiki&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Understanding the Code ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;import serial&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first line will include the module for the serial port API. This API is provided by pySerial.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;ser = serial.Serial(&lt;br /&gt;
    port=&amp;#039;/dev/ttyUSB0&amp;#039;,\&lt;br /&gt;
    baudrate=115200,\&lt;br /&gt;
    parity=serial.PARITY_NONE,\&lt;br /&gt;
    stopbits=serial.STOPBITS_ONE,\&lt;br /&gt;
    bytesize=serial.EIGHTBITS,\&lt;br /&gt;
    timeout=0)&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This next line instantiates an object with the appropriate serial port configuration for communication with the Sky mote. The necessary settings are shown in the table below.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin: auto;&amp;quot;&lt;br /&gt;
!colspan=&amp;quot;2&amp;quot;|Serial Configuration&lt;br /&gt;
|-&lt;br /&gt;
| Baud rate || 115200&lt;br /&gt;
|-&lt;br /&gt;
| Data bits || 8&lt;br /&gt;
|-&lt;br /&gt;
| Parity || None&lt;br /&gt;
|-&lt;br /&gt;
| Stop bits || 1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;print(&amp;quot;connected to: &amp;quot; + ser.portstr)&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The print statement is simply a sanity check. It just reminds us which port we are connected to.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;ser.write(&amp;quot;help\n&amp;quot;);&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This line demonstrates how data can be written to the serial port. In this example we send the command &amp;quot;help&amp;quot; to the Sky Shell so that it will send back the list of shell commands it supports.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;while True:&lt;br /&gt;
     line = ser.readline();&lt;br /&gt;
     if line:&lt;br /&gt;
	print(line)&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here, we read data from the serial port indefinitely and print it out, one line at a time. Note that in this case, &amp;#039;&amp;#039;line&amp;#039;&amp;#039; will typically end with a newline.&lt;br /&gt;
&lt;br /&gt;
To terminate the program, you can use Ctrl + C to send an interrupt signal.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;ser.close()&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This last line never actually gets executed but it shows how the serial resource can be freed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Contiki_tutorials | Back to Contiki Tutorials]]&lt;/div&gt;</summary>
		<author><name>Deepanker</name></author>	</entry>

	<entry>
		<id>http://anrg.usc.edu/contiki/index.php?title=Interfacing_with_Python&amp;diff=387</id>
		<title>Interfacing with Python</title>
		<link rel="alternate" type="text/html" href="http://anrg.usc.edu/contiki/index.php?title=Interfacing_with_Python&amp;diff=387"/>
				<updated>2014-04-04T19:29:17Z</updated>
		
		<summary type="html">&lt;p&gt;Deepanker: /* Understanding the Code */&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;
In this tutorial you will learn how to programmatically communicate with the Tmote Sky using the Python programming language. This will enable you to do such things as process data from your mote in real-time. In addition, you can send commands or data back to the mote to impact its operation. The possibilities are endless.&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
This tutorial was written and tested using the following:&lt;br /&gt;
* Contiki 2.7&lt;br /&gt;
* Python 2.7.3 (and [http://pyserial.sourceforge.net/ pySerial])&lt;br /&gt;
* Ubuntu 12.04&lt;br /&gt;
* Tmote Sky&lt;br /&gt;
&lt;br /&gt;
Connect the Tmote Sky to your computer using a USB cable and install the Sky Shell example. See the @Sky Shell@ tutorial for instructions on how to do this. We use this example so that we’ll have data to ensure that we are correctly reading and writing to the mote.&lt;br /&gt;
&lt;br /&gt;
=== Step 1 ===&lt;br /&gt;
&lt;br /&gt;
Create a Python file called serial.py containing the following code:&lt;br /&gt;
 &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;#!/usr/bin/python&lt;br /&gt;
 import serial&lt;br /&gt;
 ser = serial.Serial(&lt;br /&gt;
    port=&amp;#039;/dev/ttyUSB0&amp;#039;,\&lt;br /&gt;
    baudrate=115200,\&lt;br /&gt;
    parity=serial.PARITY_NONE,\&lt;br /&gt;
    stopbits=serial.STOPBITS_ONE,\&lt;br /&gt;
    bytesize=serial.EIGHTBITS,\&lt;br /&gt;
    timeout=0)&lt;br /&gt;
 print(&amp;quot;connected to: &amp;quot; + ser.portstr)&lt;br /&gt;
 ser.write(&amp;quot;help\n&amp;quot;);&lt;br /&gt;
 while True:&lt;br /&gt;
	line = ser.readline();&lt;br /&gt;
	if line:&lt;br /&gt;
		print(line),&lt;br /&gt;
 ser.close()&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: &lt;br /&gt;
This code assumes the mote you are using for this tutorial is connected to &amp;#039;&amp;#039;/dev/ttyUSB0&amp;#039;&amp;#039;. Please check this using the &amp;#039;&amp;#039;make motelist&amp;#039;&amp;#039; command as shown in the figure below. If the mote you are using is connected to a different device file, please modify the Python code accordingly.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Motelist.jpg|center|Sample output of &amp;#039;&amp;#039;make motelist&amp;#039;&amp;#039;]]&lt;br /&gt;
&lt;br /&gt;
=== Step 2 ===&lt;br /&gt;
&lt;br /&gt;
Run the Python code using the command:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;python serial.py&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You should see output similar to the following:&lt;br /&gt;
 &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
 connected to: /dev/ttyUSB0&lt;br /&gt;
 Available commands:&lt;br /&gt;
 ?: shows this help&lt;br /&gt;
 binprint: print binary data in decimal format&lt;br /&gt;
 blink [num]: blink LEDs ([num] times)&lt;br /&gt;
 collect: collect data from the network&lt;br /&gt;
 collect-view-data: sensor data, power consumption, network stats&lt;br /&gt;
 echo &amp;lt;text&amp;gt;: print &amp;lt;text&amp;gt;&lt;br /&gt;
 energy: print energy profile&lt;br /&gt;
 exit: exit shell&lt;br /&gt;
 hd: print binary data in hexadecimal format&lt;br /&gt;
 help: shows this help&lt;br /&gt;
 kill &amp;lt;command&amp;gt;: stop a specific command&lt;br /&gt;
 killall: stop all running commands&lt;br /&gt;
 mac &amp;lt;onoroff&amp;gt;: turn MAC protocol on (1) or off (0)&lt;br /&gt;
 netcmd &amp;lt;command&amp;gt;: run a command on all nodes in the network&lt;br /&gt;
 nodeid: set node ID&lt;br /&gt;
 null: discard input&lt;br /&gt;
 packetize: put data into one packet&lt;br /&gt;
 power: print power profile&lt;br /&gt;
 powerconv: convert power profile to human readable output&lt;br /&gt;
 powertrace [interval]: turn powertracing on or off, with reporting interval &amp;lt;interval&amp;gt;&lt;br /&gt;
 quit: exit shell&lt;br /&gt;
 randwait &amp;lt;maxtime&amp;gt; &amp;lt;command&amp;gt;: wait for a random time before running a command&lt;br /&gt;
 reboot: reboot the system&lt;br /&gt;
 repeat &amp;lt;num&amp;gt; &amp;lt;time&amp;gt; &amp;lt;command&amp;gt;: run a command every &amp;lt;time&amp;gt; seconds&lt;br /&gt;
 rfchannel &amp;lt;channel&amp;gt;: change CC2420 radio channel (11 - 26)&lt;br /&gt;
 routes: dump route list in binary format&lt;br /&gt;
 send &amp;lt;rexmits&amp;gt;: send data to the collector node, with rexmits hop-by-hop retransmissions&lt;br /&gt;
 sense: print out sensor data&lt;br /&gt;
 senseconv: convert &amp;#039;sense&amp;#039; data to human readable format&lt;br /&gt;
 size: print the size of the input&lt;br /&gt;
 time [seconds]: output time in binary format, or set time in seconds since 1970&lt;br /&gt;
 timestamp: prepend a timestamp to data&lt;br /&gt;
 txpower &amp;lt;power&amp;gt;: change CC2420 transmission power (0 - 31)&lt;br /&gt;
 5.0: Contiki&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Understanding the Code ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;import serial&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first line will include the module for the serial port API. This API is provided by pySerial.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
 ser = serial.Serial(&lt;br /&gt;
    port=&amp;#039;/dev/ttyUSB0&amp;#039;,\&lt;br /&gt;
    baudrate=115200,\&lt;br /&gt;
    parity=serial.PARITY_NONE,\&lt;br /&gt;
    stopbits=serial.STOPBITS_ONE,\&lt;br /&gt;
    bytesize=serial.EIGHTBITS,\&lt;br /&gt;
    timeout=0)&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This next line instantiates an object with the appropriate serial port configuration for communication with the Sky mote. The necessary settings are shown in the table below.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin: auto;&amp;quot;&lt;br /&gt;
!colspan=&amp;quot;2&amp;quot;|Serial Configuration&lt;br /&gt;
|-&lt;br /&gt;
| Baud rate || 115200&lt;br /&gt;
|-&lt;br /&gt;
| Data bits || 8&lt;br /&gt;
|-&lt;br /&gt;
| Parity || None&lt;br /&gt;
|-&lt;br /&gt;
| Stop bits || 1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;print(&amp;quot;connected to: &amp;quot; + ser.portstr)&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The print statement is simply a sanity check. It just reminds us which port we are connected to.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;ser.write(&amp;quot;help\n&amp;quot;);&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This line demonstrates how data can be written to the serial port. In this example we send the command &amp;quot;help&amp;quot; to the Sky Shell so that it will send back the list of shell commands it supports.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;while True:&lt;br /&gt;
	line = ser.readline();&lt;br /&gt;
	if line:&lt;br /&gt;
		print(line)&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here, we read data from the serial port indefinitely and print it out, one line at a time. Note that in this case, &amp;#039;&amp;#039;line&amp;#039;&amp;#039; will typically end with a newline.&lt;br /&gt;
&lt;br /&gt;
To terminate the program, you can use Ctrl + C to send an interrupt signal.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;ser.close()&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This last line never actually gets executed but it shows how the serial resource can be freed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Contiki_tutorials | Back to Contiki Tutorials]]&lt;/div&gt;</summary>
		<author><name>Deepanker</name></author>	</entry>

	<entry>
		<id>http://anrg.usc.edu/contiki/index.php?title=Interfacing_with_Python&amp;diff=386</id>
		<title>Interfacing with Python</title>
		<link rel="alternate" type="text/html" href="http://anrg.usc.edu/contiki/index.php?title=Interfacing_with_Python&amp;diff=386"/>
				<updated>2014-04-04T19:27:14Z</updated>
		
		<summary type="html">&lt;p&gt;Deepanker: /* Step 2 */&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;
In this tutorial you will learn how to programmatically communicate with the Tmote Sky using the Python programming language. This will enable you to do such things as process data from your mote in real-time. In addition, you can send commands or data back to the mote to impact its operation. The possibilities are endless.&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
This tutorial was written and tested using the following:&lt;br /&gt;
* Contiki 2.7&lt;br /&gt;
* Python 2.7.3 (and [http://pyserial.sourceforge.net/ pySerial])&lt;br /&gt;
* Ubuntu 12.04&lt;br /&gt;
* Tmote Sky&lt;br /&gt;
&lt;br /&gt;
Connect the Tmote Sky to your computer using a USB cable and install the Sky Shell example. See the @Sky Shell@ tutorial for instructions on how to do this. We use this example so that we’ll have data to ensure that we are correctly reading and writing to the mote.&lt;br /&gt;
&lt;br /&gt;
=== Step 1 ===&lt;br /&gt;
&lt;br /&gt;
Create a Python file called serial.py containing the following code:&lt;br /&gt;
 &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;#!/usr/bin/python&lt;br /&gt;
 import serial&lt;br /&gt;
 ser = serial.Serial(&lt;br /&gt;
    port=&amp;#039;/dev/ttyUSB0&amp;#039;,\&lt;br /&gt;
    baudrate=115200,\&lt;br /&gt;
    parity=serial.PARITY_NONE,\&lt;br /&gt;
    stopbits=serial.STOPBITS_ONE,\&lt;br /&gt;
    bytesize=serial.EIGHTBITS,\&lt;br /&gt;
    timeout=0)&lt;br /&gt;
 print(&amp;quot;connected to: &amp;quot; + ser.portstr)&lt;br /&gt;
 ser.write(&amp;quot;help\n&amp;quot;);&lt;br /&gt;
 while True:&lt;br /&gt;
	line = ser.readline();&lt;br /&gt;
	if line:&lt;br /&gt;
		print(line),&lt;br /&gt;
 ser.close()&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: &lt;br /&gt;
This code assumes the mote you are using for this tutorial is connected to &amp;#039;&amp;#039;/dev/ttyUSB0&amp;#039;&amp;#039;. Please check this using the &amp;#039;&amp;#039;make motelist&amp;#039;&amp;#039; command as shown in the figure below. If the mote you are using is connected to a different device file, please modify the Python code accordingly.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Motelist.jpg|center|Sample output of &amp;#039;&amp;#039;make motelist&amp;#039;&amp;#039;]]&lt;br /&gt;
&lt;br /&gt;
=== Step 2 ===&lt;br /&gt;
&lt;br /&gt;
Run the Python code using the command:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;python serial.py&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You should see output similar to the following:&lt;br /&gt;
 &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
 connected to: /dev/ttyUSB0&lt;br /&gt;
 Available commands:&lt;br /&gt;
 ?: shows this help&lt;br /&gt;
 binprint: print binary data in decimal format&lt;br /&gt;
 blink [num]: blink LEDs ([num] times)&lt;br /&gt;
 collect: collect data from the network&lt;br /&gt;
 collect-view-data: sensor data, power consumption, network stats&lt;br /&gt;
 echo &amp;lt;text&amp;gt;: print &amp;lt;text&amp;gt;&lt;br /&gt;
 energy: print energy profile&lt;br /&gt;
 exit: exit shell&lt;br /&gt;
 hd: print binary data in hexadecimal format&lt;br /&gt;
 help: shows this help&lt;br /&gt;
 kill &amp;lt;command&amp;gt;: stop a specific command&lt;br /&gt;
 killall: stop all running commands&lt;br /&gt;
 mac &amp;lt;onoroff&amp;gt;: turn MAC protocol on (1) or off (0)&lt;br /&gt;
 netcmd &amp;lt;command&amp;gt;: run a command on all nodes in the network&lt;br /&gt;
 nodeid: set node ID&lt;br /&gt;
 null: discard input&lt;br /&gt;
 packetize: put data into one packet&lt;br /&gt;
 power: print power profile&lt;br /&gt;
 powerconv: convert power profile to human readable output&lt;br /&gt;
 powertrace [interval]: turn powertracing on or off, with reporting interval &amp;lt;interval&amp;gt;&lt;br /&gt;
 quit: exit shell&lt;br /&gt;
 randwait &amp;lt;maxtime&amp;gt; &amp;lt;command&amp;gt;: wait for a random time before running a command&lt;br /&gt;
 reboot: reboot the system&lt;br /&gt;
 repeat &amp;lt;num&amp;gt; &amp;lt;time&amp;gt; &amp;lt;command&amp;gt;: run a command every &amp;lt;time&amp;gt; seconds&lt;br /&gt;
 rfchannel &amp;lt;channel&amp;gt;: change CC2420 radio channel (11 - 26)&lt;br /&gt;
 routes: dump route list in binary format&lt;br /&gt;
 send &amp;lt;rexmits&amp;gt;: send data to the collector node, with rexmits hop-by-hop retransmissions&lt;br /&gt;
 sense: print out sensor data&lt;br /&gt;
 senseconv: convert &amp;#039;sense&amp;#039; data to human readable format&lt;br /&gt;
 size: print the size of the input&lt;br /&gt;
 time [seconds]: output time in binary format, or set time in seconds since 1970&lt;br /&gt;
 timestamp: prepend a timestamp to data&lt;br /&gt;
 txpower &amp;lt;power&amp;gt;: change CC2420 transmission power (0 - 31)&lt;br /&gt;
 5.0: Contiki&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Understanding the Code ==&lt;br /&gt;
&lt;br /&gt;
 import serial&lt;br /&gt;
&lt;br /&gt;
The first line will include the module for the serial port API. This API is provided by pySerial.&lt;br /&gt;
&lt;br /&gt;
 ser = serial.Serial(&lt;br /&gt;
    port=&amp;#039;/dev/ttyUSB0&amp;#039;,\&lt;br /&gt;
    baudrate=115200,\&lt;br /&gt;
    parity=serial.PARITY_NONE,\&lt;br /&gt;
    stopbits=serial.STOPBITS_ONE,\&lt;br /&gt;
    bytesize=serial.EIGHTBITS,\&lt;br /&gt;
    timeout=0)&lt;br /&gt;
&lt;br /&gt;
This next line instantiates an object with the appropriate serial port configuration for communication with the Sky mote. The necessary settings are shown in the table below.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin: auto;&amp;quot;&lt;br /&gt;
!colspan=&amp;quot;2&amp;quot;|Serial Configuration&lt;br /&gt;
|-&lt;br /&gt;
| Baud rate || 115200&lt;br /&gt;
|-&lt;br /&gt;
| Data bits || 8&lt;br /&gt;
|-&lt;br /&gt;
| Parity || None&lt;br /&gt;
|-&lt;br /&gt;
| Stop bits || 1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
 print(&amp;quot;connected to: &amp;quot; + ser.portstr)&lt;br /&gt;
&lt;br /&gt;
The print statement is simply a sanity check. It just reminds us which port we are connected to.&lt;br /&gt;
&lt;br /&gt;
 ser.write(&amp;quot;help\n&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
This line demonstrates how data can be written to the serial port. In this example we send the command &amp;quot;help&amp;quot; to the Sky Shell so that it will send back the list of shell commands it supports.&lt;br /&gt;
&lt;br /&gt;
 while True:&lt;br /&gt;
	line = ser.readline();&lt;br /&gt;
	if line:&lt;br /&gt;
		print(line),&lt;br /&gt;
&lt;br /&gt;
Here, we read data from the serial port indefinitely and print it out, one line at a time. Note that in this case, &amp;#039;&amp;#039;line&amp;#039;&amp;#039; will typically end with a newline.&lt;br /&gt;
&lt;br /&gt;
To terminate the program, you can use Ctrl + C to send an interrupt signal.&lt;br /&gt;
&lt;br /&gt;
 ser.close()&lt;br /&gt;
&lt;br /&gt;
This last line never actually gets executed but it shows how the serial resource can be freed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Contiki_tutorials | Back to Contiki Tutorials]]&lt;/div&gt;</summary>
		<author><name>Deepanker</name></author>	</entry>

	<entry>
		<id>http://anrg.usc.edu/contiki/index.php?title=Interfacing_with_Python&amp;diff=385</id>
		<title>Interfacing with Python</title>
		<link rel="alternate" type="text/html" href="http://anrg.usc.edu/contiki/index.php?title=Interfacing_with_Python&amp;diff=385"/>
				<updated>2014-04-04T19:26:53Z</updated>
		
		<summary type="html">&lt;p&gt;Deepanker: /* Setup */&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;
In this tutorial you will learn how to programmatically communicate with the Tmote Sky using the Python programming language. This will enable you to do such things as process data from your mote in real-time. In addition, you can send commands or data back to the mote to impact its operation. The possibilities are endless.&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
This tutorial was written and tested using the following:&lt;br /&gt;
* Contiki 2.7&lt;br /&gt;
* Python 2.7.3 (and [http://pyserial.sourceforge.net/ pySerial])&lt;br /&gt;
* Ubuntu 12.04&lt;br /&gt;
* Tmote Sky&lt;br /&gt;
&lt;br /&gt;
Connect the Tmote Sky to your computer using a USB cable and install the Sky Shell example. See the @Sky Shell@ tutorial for instructions on how to do this. We use this example so that we’ll have data to ensure that we are correctly reading and writing to the mote.&lt;br /&gt;
&lt;br /&gt;
=== Step 1 ===&lt;br /&gt;
&lt;br /&gt;
Create a Python file called serial.py containing the following code:&lt;br /&gt;
 &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;#!/usr/bin/python&lt;br /&gt;
 import serial&lt;br /&gt;
 ser = serial.Serial(&lt;br /&gt;
    port=&amp;#039;/dev/ttyUSB0&amp;#039;,\&lt;br /&gt;
    baudrate=115200,\&lt;br /&gt;
    parity=serial.PARITY_NONE,\&lt;br /&gt;
    stopbits=serial.STOPBITS_ONE,\&lt;br /&gt;
    bytesize=serial.EIGHTBITS,\&lt;br /&gt;
    timeout=0)&lt;br /&gt;
 print(&amp;quot;connected to: &amp;quot; + ser.portstr)&lt;br /&gt;
 ser.write(&amp;quot;help\n&amp;quot;);&lt;br /&gt;
 while True:&lt;br /&gt;
	line = ser.readline();&lt;br /&gt;
	if line:&lt;br /&gt;
		print(line),&lt;br /&gt;
 ser.close()&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: &lt;br /&gt;
This code assumes the mote you are using for this tutorial is connected to &amp;#039;&amp;#039;/dev/ttyUSB0&amp;#039;&amp;#039;. Please check this using the &amp;#039;&amp;#039;make motelist&amp;#039;&amp;#039; command as shown in the figure below. If the mote you are using is connected to a different device file, please modify the Python code accordingly.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Motelist.jpg|center|Sample output of &amp;#039;&amp;#039;make motelist&amp;#039;&amp;#039;]]&lt;br /&gt;
&lt;br /&gt;
=== Step 2 ===&lt;br /&gt;
&lt;br /&gt;
Run the Python code using the command:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;python serial.py&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You should see output similar to the following:&lt;br /&gt;
 &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;connected to: /dev/ttyUSB0&lt;br /&gt;
 Available commands:&lt;br /&gt;
 ?: shows this help&lt;br /&gt;
 binprint: print binary data in decimal format&lt;br /&gt;
 blink [num]: blink LEDs ([num] times)&lt;br /&gt;
 collect: collect data from the network&lt;br /&gt;
 collect-view-data: sensor data, power consumption, network stats&lt;br /&gt;
 echo &amp;lt;text&amp;gt;: print &amp;lt;text&amp;gt;&lt;br /&gt;
 energy: print energy profile&lt;br /&gt;
 exit: exit shell&lt;br /&gt;
 hd: print binary data in hexadecimal format&lt;br /&gt;
 help: shows this help&lt;br /&gt;
 kill &amp;lt;command&amp;gt;: stop a specific command&lt;br /&gt;
 killall: stop all running commands&lt;br /&gt;
 mac &amp;lt;onoroff&amp;gt;: turn MAC protocol on (1) or off (0)&lt;br /&gt;
 netcmd &amp;lt;command&amp;gt;: run a command on all nodes in the network&lt;br /&gt;
 nodeid: set node ID&lt;br /&gt;
 null: discard input&lt;br /&gt;
 packetize: put data into one packet&lt;br /&gt;
 power: print power profile&lt;br /&gt;
 powerconv: convert power profile to human readable output&lt;br /&gt;
 powertrace [interval]: turn powertracing on or off, with reporting interval &amp;lt;interval&amp;gt;&lt;br /&gt;
 quit: exit shell&lt;br /&gt;
 randwait &amp;lt;maxtime&amp;gt; &amp;lt;command&amp;gt;: wait for a random time before running a command&lt;br /&gt;
 reboot: reboot the system&lt;br /&gt;
 repeat &amp;lt;num&amp;gt; &amp;lt;time&amp;gt; &amp;lt;command&amp;gt;: run a command every &amp;lt;time&amp;gt; seconds&lt;br /&gt;
 rfchannel &amp;lt;channel&amp;gt;: change CC2420 radio channel (11 - 26)&lt;br /&gt;
 routes: dump route list in binary format&lt;br /&gt;
 send &amp;lt;rexmits&amp;gt;: send data to the collector node, with rexmits hop-by-hop retransmissions&lt;br /&gt;
 sense: print out sensor data&lt;br /&gt;
 senseconv: convert &amp;#039;sense&amp;#039; data to human readable format&lt;br /&gt;
 size: print the size of the input&lt;br /&gt;
 time [seconds]: output time in binary format, or set time in seconds since 1970&lt;br /&gt;
 timestamp: prepend a timestamp to data&lt;br /&gt;
 txpower &amp;lt;power&amp;gt;: change CC2420 transmission power (0 - 31)&lt;br /&gt;
 5.0: Contiki&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Understanding the Code ==&lt;br /&gt;
&lt;br /&gt;
 import serial&lt;br /&gt;
&lt;br /&gt;
The first line will include the module for the serial port API. This API is provided by pySerial.&lt;br /&gt;
&lt;br /&gt;
 ser = serial.Serial(&lt;br /&gt;
    port=&amp;#039;/dev/ttyUSB0&amp;#039;,\&lt;br /&gt;
    baudrate=115200,\&lt;br /&gt;
    parity=serial.PARITY_NONE,\&lt;br /&gt;
    stopbits=serial.STOPBITS_ONE,\&lt;br /&gt;
    bytesize=serial.EIGHTBITS,\&lt;br /&gt;
    timeout=0)&lt;br /&gt;
&lt;br /&gt;
This next line instantiates an object with the appropriate serial port configuration for communication with the Sky mote. The necessary settings are shown in the table below.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin: auto;&amp;quot;&lt;br /&gt;
!colspan=&amp;quot;2&amp;quot;|Serial Configuration&lt;br /&gt;
|-&lt;br /&gt;
| Baud rate || 115200&lt;br /&gt;
|-&lt;br /&gt;
| Data bits || 8&lt;br /&gt;
|-&lt;br /&gt;
| Parity || None&lt;br /&gt;
|-&lt;br /&gt;
| Stop bits || 1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
 print(&amp;quot;connected to: &amp;quot; + ser.portstr)&lt;br /&gt;
&lt;br /&gt;
The print statement is simply a sanity check. It just reminds us which port we are connected to.&lt;br /&gt;
&lt;br /&gt;
 ser.write(&amp;quot;help\n&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
This line demonstrates how data can be written to the serial port. In this example we send the command &amp;quot;help&amp;quot; to the Sky Shell so that it will send back the list of shell commands it supports.&lt;br /&gt;
&lt;br /&gt;
 while True:&lt;br /&gt;
	line = ser.readline();&lt;br /&gt;
	if line:&lt;br /&gt;
		print(line),&lt;br /&gt;
&lt;br /&gt;
Here, we read data from the serial port indefinitely and print it out, one line at a time. Note that in this case, &amp;#039;&amp;#039;line&amp;#039;&amp;#039; will typically end with a newline.&lt;br /&gt;
&lt;br /&gt;
To terminate the program, you can use Ctrl + C to send an interrupt signal.&lt;br /&gt;
&lt;br /&gt;
 ser.close()&lt;br /&gt;
&lt;br /&gt;
This last line never actually gets executed but it shows how the serial resource can be freed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Contiki_tutorials | Back to Contiki Tutorials]]&lt;/div&gt;</summary>
		<author><name>Deepanker</name></author>	</entry>

	<entry>
		<id>http://anrg.usc.edu/contiki/index.php?title=Interfacing_with_Python&amp;diff=384</id>
		<title>Interfacing with Python</title>
		<link rel="alternate" type="text/html" href="http://anrg.usc.edu/contiki/index.php?title=Interfacing_with_Python&amp;diff=384"/>
				<updated>2014-04-04T19:24:33Z</updated>
		
		<summary type="html">&lt;p&gt;Deepanker: /* Setup */&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;
In this tutorial you will learn how to programmatically communicate with the Tmote Sky using the Python programming language. This will enable you to do such things as process data from your mote in real-time. In addition, you can send commands or data back to the mote to impact its operation. The possibilities are endless.&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
This tutorial was written and tested using the following:&lt;br /&gt;
* Contiki 2.7&lt;br /&gt;
* Python 2.7.3 (and [http://pyserial.sourceforge.net/ pySerial])&lt;br /&gt;
* Ubuntu 12.04&lt;br /&gt;
* Tmote Sky&lt;br /&gt;
&lt;br /&gt;
Connect the Tmote Sky to your computer using a USB cable and install the Sky Shell example. See the @Sky Shell@ tutorial for instructions on how to do this. We use this example so that we’ll have data to ensure that we are correctly reading and writing to the mote.&lt;br /&gt;
&lt;br /&gt;
=== Step 1 ===&lt;br /&gt;
&lt;br /&gt;
Create a Python file called serial.py containing the following code:&lt;br /&gt;
 &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;#!/usr/bin/python&lt;br /&gt;
 import serial&lt;br /&gt;
 ser = serial.Serial(&lt;br /&gt;
    port=&amp;#039;/dev/ttyUSB0&amp;#039;,\&lt;br /&gt;
    baudrate=115200,\&lt;br /&gt;
    parity=serial.PARITY_NONE,\&lt;br /&gt;
    stopbits=serial.STOPBITS_ONE,\&lt;br /&gt;
    bytesize=serial.EIGHTBITS,\&lt;br /&gt;
    timeout=0)&lt;br /&gt;
 print(&amp;quot;connected to: &amp;quot; + ser.portstr)&lt;br /&gt;
 ser.write(&amp;quot;help\n&amp;quot;);&lt;br /&gt;
 while True:&lt;br /&gt;
	line = ser.readline();&lt;br /&gt;
	if line:&lt;br /&gt;
		print(line),&lt;br /&gt;
 ser.close()&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: &lt;br /&gt;
This code assumes the mote you are using for this tutorial is connected to &amp;#039;&amp;#039;/dev/ttyUSB0&amp;#039;&amp;#039;. Please check this using the &amp;#039;&amp;#039;make motelist&amp;#039;&amp;#039; command as shown in the figure below. If the mote you are using is connected to a different device file, please modify the Python code accordingly.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Motelist.jpg|center|Sample output of &amp;#039;&amp;#039;make motelist&amp;#039;&amp;#039;]]&lt;br /&gt;
&lt;br /&gt;
=== Step 2 ===&lt;br /&gt;
&lt;br /&gt;
Run the Python code using the command:&lt;br /&gt;
&lt;br /&gt;
 python serial.py&lt;br /&gt;
&lt;br /&gt;
You should see output similar to the following:&lt;br /&gt;
 connected to: /dev/ttyUSB0&lt;br /&gt;
 Available commands:&lt;br /&gt;
 ?: shows this help&lt;br /&gt;
 binprint: print binary data in decimal format&lt;br /&gt;
 blink [num]: blink LEDs ([num] times)&lt;br /&gt;
 collect: collect data from the network&lt;br /&gt;
 collect-view-data: sensor data, power consumption, network stats&lt;br /&gt;
 echo &amp;lt;text&amp;gt;: print &amp;lt;text&amp;gt;&lt;br /&gt;
 energy: print energy profile&lt;br /&gt;
 exit: exit shell&lt;br /&gt;
 hd: print binary data in hexadecimal format&lt;br /&gt;
 help: shows this help&lt;br /&gt;
 kill &amp;lt;command&amp;gt;: stop a specific command&lt;br /&gt;
 killall: stop all running commands&lt;br /&gt;
 mac &amp;lt;onoroff&amp;gt;: turn MAC protocol on (1) or off (0)&lt;br /&gt;
 netcmd &amp;lt;command&amp;gt;: run a command on all nodes in the network&lt;br /&gt;
 nodeid: set node ID&lt;br /&gt;
 null: discard input&lt;br /&gt;
 packetize: put data into one packet&lt;br /&gt;
 power: print power profile&lt;br /&gt;
 powerconv: convert power profile to human readable output&lt;br /&gt;
 powertrace [interval]: turn powertracing on or off, with reporting interval &amp;lt;interval&amp;gt;&lt;br /&gt;
 quit: exit shell&lt;br /&gt;
 randwait &amp;lt;maxtime&amp;gt; &amp;lt;command&amp;gt;: wait for a random time before running a command&lt;br /&gt;
 reboot: reboot the system&lt;br /&gt;
 repeat &amp;lt;num&amp;gt; &amp;lt;time&amp;gt; &amp;lt;command&amp;gt;: run a command every &amp;lt;time&amp;gt; seconds&lt;br /&gt;
 rfchannel &amp;lt;channel&amp;gt;: change CC2420 radio channel (11 - 26)&lt;br /&gt;
 routes: dump route list in binary format&lt;br /&gt;
 send &amp;lt;rexmits&amp;gt;: send data to the collector node, with rexmits hop-by-hop retransmissions&lt;br /&gt;
 sense: print out sensor data&lt;br /&gt;
 senseconv: convert &amp;#039;sense&amp;#039; data to human readable format&lt;br /&gt;
 size: print the size of the input&lt;br /&gt;
 time [seconds]: output time in binary format, or set time in seconds since 1970&lt;br /&gt;
 timestamp: prepend a timestamp to data&lt;br /&gt;
 txpower &amp;lt;power&amp;gt;: change CC2420 transmission power (0 - 31)&lt;br /&gt;
 5.0: Contiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Understanding the Code ==&lt;br /&gt;
&lt;br /&gt;
 import serial&lt;br /&gt;
&lt;br /&gt;
The first line will include the module for the serial port API. This API is provided by pySerial.&lt;br /&gt;
&lt;br /&gt;
 ser = serial.Serial(&lt;br /&gt;
    port=&amp;#039;/dev/ttyUSB0&amp;#039;,\&lt;br /&gt;
    baudrate=115200,\&lt;br /&gt;
    parity=serial.PARITY_NONE,\&lt;br /&gt;
    stopbits=serial.STOPBITS_ONE,\&lt;br /&gt;
    bytesize=serial.EIGHTBITS,\&lt;br /&gt;
    timeout=0)&lt;br /&gt;
&lt;br /&gt;
This next line instantiates an object with the appropriate serial port configuration for communication with the Sky mote. The necessary settings are shown in the table below.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin: auto;&amp;quot;&lt;br /&gt;
!colspan=&amp;quot;2&amp;quot;|Serial Configuration&lt;br /&gt;
|-&lt;br /&gt;
| Baud rate || 115200&lt;br /&gt;
|-&lt;br /&gt;
| Data bits || 8&lt;br /&gt;
|-&lt;br /&gt;
| Parity || None&lt;br /&gt;
|-&lt;br /&gt;
| Stop bits || 1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
 print(&amp;quot;connected to: &amp;quot; + ser.portstr)&lt;br /&gt;
&lt;br /&gt;
The print statement is simply a sanity check. It just reminds us which port we are connected to.&lt;br /&gt;
&lt;br /&gt;
 ser.write(&amp;quot;help\n&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
This line demonstrates how data can be written to the serial port. In this example we send the command &amp;quot;help&amp;quot; to the Sky Shell so that it will send back the list of shell commands it supports.&lt;br /&gt;
&lt;br /&gt;
 while True:&lt;br /&gt;
	line = ser.readline();&lt;br /&gt;
	if line:&lt;br /&gt;
		print(line),&lt;br /&gt;
&lt;br /&gt;
Here, we read data from the serial port indefinitely and print it out, one line at a time. Note that in this case, &amp;#039;&amp;#039;line&amp;#039;&amp;#039; will typically end with a newline.&lt;br /&gt;
&lt;br /&gt;
To terminate the program, you can use Ctrl + C to send an interrupt signal.&lt;br /&gt;
&lt;br /&gt;
 ser.close()&lt;br /&gt;
&lt;br /&gt;
This last line never actually gets executed but it shows how the serial resource can be freed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Contiki_tutorials | Back to Contiki Tutorials]]&lt;/div&gt;</summary>
		<author><name>Deepanker</name></author>	</entry>

	<entry>
		<id>http://anrg.usc.edu/contiki/index.php?title=Interfacing_with_Python&amp;diff=383</id>
		<title>Interfacing with Python</title>
		<link rel="alternate" type="text/html" href="http://anrg.usc.edu/contiki/index.php?title=Interfacing_with_Python&amp;diff=383"/>
				<updated>2014-04-04T19:22:10Z</updated>
		
		<summary type="html">&lt;p&gt;Deepanker: /* Step 2 */&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;
In this tutorial you will learn how to programmatically communicate with the Tmote Sky using the Python programming language. This will enable you to do such things as process data from your mote in real-time. In addition, you can send commands or data back to the mote to impact its operation. The possibilities are endless.&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
This tutorial was written and tested using the following:&lt;br /&gt;
* Contiki 2.7&lt;br /&gt;
* Python 2.7.3 (and pySerial)&lt;br /&gt;
* Ubuntu 12.04&lt;br /&gt;
* Tmote Sky&lt;br /&gt;
&lt;br /&gt;
Connect the Tmote Sky to your computer using a USB cable and install the Sky Shell example. See the @Sky Shell@ tutorial for instructions on how to do this. We use this example so that we’ll have data to ensure that we are correctly reading and writing to the mote.&lt;br /&gt;
&lt;br /&gt;
=== Step 1 ===&lt;br /&gt;
&lt;br /&gt;
Create a Python file called serial.py containing the following code:&lt;br /&gt;
 &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;#!/usr/bin/python&lt;br /&gt;
 import serial&lt;br /&gt;
 ser = serial.Serial(&lt;br /&gt;
    port=&amp;#039;/dev/ttyUSB0&amp;#039;,\&lt;br /&gt;
    baudrate=115200,\&lt;br /&gt;
    parity=serial.PARITY_NONE,\&lt;br /&gt;
    stopbits=serial.STOPBITS_ONE,\&lt;br /&gt;
    bytesize=serial.EIGHTBITS,\&lt;br /&gt;
    timeout=0)&lt;br /&gt;
 print(&amp;quot;connected to: &amp;quot; + ser.portstr)&lt;br /&gt;
 ser.write(&amp;quot;help\n&amp;quot;);&lt;br /&gt;
 while True:&lt;br /&gt;
	line = ser.readline();&lt;br /&gt;
	if line:&lt;br /&gt;
		print(line),&lt;br /&gt;
 ser.close()&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: &lt;br /&gt;
This code assumes the mote you are using for this tutorial is connected to &amp;#039;&amp;#039;/dev/ttyUSB0&amp;#039;&amp;#039;. Please check this using the &amp;#039;&amp;#039;make motelist&amp;#039;&amp;#039; command as shown in the figure below. If the mote you are using is connected to a different device file, please modify the Python code accordingly.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Motelist.jpg|center|Sample output of &amp;#039;&amp;#039;make motelist&amp;#039;&amp;#039;]]&lt;br /&gt;
&lt;br /&gt;
=== Step 2 ===&lt;br /&gt;
&lt;br /&gt;
Run the Python code using the command:&lt;br /&gt;
&lt;br /&gt;
 python serial.py&lt;br /&gt;
&lt;br /&gt;
You should see output similar to the following:&lt;br /&gt;
 connected to: /dev/ttyUSB0&lt;br /&gt;
 Available commands:&lt;br /&gt;
 ?: shows this help&lt;br /&gt;
 binprint: print binary data in decimal format&lt;br /&gt;
 blink [num]: blink LEDs ([num] times)&lt;br /&gt;
 collect: collect data from the network&lt;br /&gt;
 collect-view-data: sensor data, power consumption, network stats&lt;br /&gt;
 echo &amp;lt;text&amp;gt;: print &amp;lt;text&amp;gt;&lt;br /&gt;
 energy: print energy profile&lt;br /&gt;
 exit: exit shell&lt;br /&gt;
 hd: print binary data in hexadecimal format&lt;br /&gt;
 help: shows this help&lt;br /&gt;
 kill &amp;lt;command&amp;gt;: stop a specific command&lt;br /&gt;
 killall: stop all running commands&lt;br /&gt;
 mac &amp;lt;onoroff&amp;gt;: turn MAC protocol on (1) or off (0)&lt;br /&gt;
 netcmd &amp;lt;command&amp;gt;: run a command on all nodes in the network&lt;br /&gt;
 nodeid: set node ID&lt;br /&gt;
 null: discard input&lt;br /&gt;
 packetize: put data into one packet&lt;br /&gt;
 power: print power profile&lt;br /&gt;
 powerconv: convert power profile to human readable output&lt;br /&gt;
 powertrace [interval]: turn powertracing on or off, with reporting interval &amp;lt;interval&amp;gt;&lt;br /&gt;
 quit: exit shell&lt;br /&gt;
 randwait &amp;lt;maxtime&amp;gt; &amp;lt;command&amp;gt;: wait for a random time before running a command&lt;br /&gt;
 reboot: reboot the system&lt;br /&gt;
 repeat &amp;lt;num&amp;gt; &amp;lt;time&amp;gt; &amp;lt;command&amp;gt;: run a command every &amp;lt;time&amp;gt; seconds&lt;br /&gt;
 rfchannel &amp;lt;channel&amp;gt;: change CC2420 radio channel (11 - 26)&lt;br /&gt;
 routes: dump route list in binary format&lt;br /&gt;
 send &amp;lt;rexmits&amp;gt;: send data to the collector node, with rexmits hop-by-hop retransmissions&lt;br /&gt;
 sense: print out sensor data&lt;br /&gt;
 senseconv: convert &amp;#039;sense&amp;#039; data to human readable format&lt;br /&gt;
 size: print the size of the input&lt;br /&gt;
 time [seconds]: output time in binary format, or set time in seconds since 1970&lt;br /&gt;
 timestamp: prepend a timestamp to data&lt;br /&gt;
 txpower &amp;lt;power&amp;gt;: change CC2420 transmission power (0 - 31)&lt;br /&gt;
 5.0: Contiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Understanding the Code ==&lt;br /&gt;
&lt;br /&gt;
 import serial&lt;br /&gt;
&lt;br /&gt;
The first line will include the module for the serial port API. This API is provided by pySerial.&lt;br /&gt;
&lt;br /&gt;
 ser = serial.Serial(&lt;br /&gt;
    port=&amp;#039;/dev/ttyUSB0&amp;#039;,\&lt;br /&gt;
    baudrate=115200,\&lt;br /&gt;
    parity=serial.PARITY_NONE,\&lt;br /&gt;
    stopbits=serial.STOPBITS_ONE,\&lt;br /&gt;
    bytesize=serial.EIGHTBITS,\&lt;br /&gt;
    timeout=0)&lt;br /&gt;
&lt;br /&gt;
This next line instantiates an object with the appropriate serial port configuration for communication with the Sky mote. The necessary settings are shown in the table below.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin: auto;&amp;quot;&lt;br /&gt;
!colspan=&amp;quot;2&amp;quot;|Serial Configuration&lt;br /&gt;
|-&lt;br /&gt;
| Baud rate || 115200&lt;br /&gt;
|-&lt;br /&gt;
| Data bits || 8&lt;br /&gt;
|-&lt;br /&gt;
| Parity || None&lt;br /&gt;
|-&lt;br /&gt;
| Stop bits || 1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
 print(&amp;quot;connected to: &amp;quot; + ser.portstr)&lt;br /&gt;
&lt;br /&gt;
The print statement is simply a sanity check. It just reminds us which port we are connected to.&lt;br /&gt;
&lt;br /&gt;
 ser.write(&amp;quot;help\n&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
This line demonstrates how data can be written to the serial port. In this example we send the command &amp;quot;help&amp;quot; to the Sky Shell so that it will send back the list of shell commands it supports.&lt;br /&gt;
&lt;br /&gt;
 while True:&lt;br /&gt;
	line = ser.readline();&lt;br /&gt;
	if line:&lt;br /&gt;
		print(line),&lt;br /&gt;
&lt;br /&gt;
Here, we read data from the serial port indefinitely and print it out, one line at a time. Note that in this case, &amp;#039;&amp;#039;line&amp;#039;&amp;#039; will typically end with a newline.&lt;br /&gt;
&lt;br /&gt;
To terminate the program, you can use Ctrl + C to send an interrupt signal.&lt;br /&gt;
&lt;br /&gt;
 ser.close()&lt;br /&gt;
&lt;br /&gt;
This last line never actually gets executed but it shows how the serial resource can be freed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Contiki_tutorials | Back to Contiki Tutorials]]&lt;/div&gt;</summary>
		<author><name>Deepanker</name></author>	</entry>

	<entry>
		<id>http://anrg.usc.edu/contiki/index.php?title=Interfacing_with_Python&amp;diff=382</id>
		<title>Interfacing with Python</title>
		<link rel="alternate" type="text/html" href="http://anrg.usc.edu/contiki/index.php?title=Interfacing_with_Python&amp;diff=382"/>
				<updated>2014-04-04T19:21:00Z</updated>
		
		<summary type="html">&lt;p&gt;Deepanker: /* 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;
In this tutorial you will learn how to programmatically communicate with the Tmote Sky using the Python programming language. This will enable you to do such things as process data from your mote in real-time. In addition, you can send commands or data back to the mote to impact its operation. The possibilities are endless.&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
This tutorial was written and tested using the following:&lt;br /&gt;
* Contiki 2.7&lt;br /&gt;
* Python 2.7.3 (and pySerial)&lt;br /&gt;
* Ubuntu 12.04&lt;br /&gt;
* Tmote Sky&lt;br /&gt;
&lt;br /&gt;
Connect the Tmote Sky to your computer using a USB cable and install the Sky Shell example. See the @Sky Shell@ tutorial for instructions on how to do this. We use this example so that we’ll have data to ensure that we are correctly reading and writing to the mote.&lt;br /&gt;
&lt;br /&gt;
=== Step 1 ===&lt;br /&gt;
&lt;br /&gt;
Create a Python file called serial.py containing the following code:&lt;br /&gt;
 &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;#!/usr/bin/python&lt;br /&gt;
 import serial&lt;br /&gt;
 ser = serial.Serial(&lt;br /&gt;
    port=&amp;#039;/dev/ttyUSB0&amp;#039;,\&lt;br /&gt;
    baudrate=115200,\&lt;br /&gt;
    parity=serial.PARITY_NONE,\&lt;br /&gt;
    stopbits=serial.STOPBITS_ONE,\&lt;br /&gt;
    bytesize=serial.EIGHTBITS,\&lt;br /&gt;
    timeout=0)&lt;br /&gt;
 print(&amp;quot;connected to: &amp;quot; + ser.portstr)&lt;br /&gt;
 ser.write(&amp;quot;help\n&amp;quot;);&lt;br /&gt;
 while True:&lt;br /&gt;
	line = ser.readline();&lt;br /&gt;
	if line:&lt;br /&gt;
		print(line),&lt;br /&gt;
 ser.close()&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: &lt;br /&gt;
This code assumes the mote you are using for this tutorial is connected to &amp;#039;&amp;#039;/dev/ttyUSB0&amp;#039;&amp;#039;. Please check this using the &amp;#039;&amp;#039;make motelist&amp;#039;&amp;#039; command as shown in the figure below. If the mote you are using is connected to a different device file, please modify the Python code accordingly.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Motelist.jpg|center|Sample output of &amp;#039;&amp;#039;make motelist&amp;#039;&amp;#039;]]&lt;br /&gt;
&lt;br /&gt;
== Step 2 ==&lt;br /&gt;
&lt;br /&gt;
Run the Python code using the command:&lt;br /&gt;
&lt;br /&gt;
 python serial.py&lt;br /&gt;
&lt;br /&gt;
You should see output similar to the following:&lt;br /&gt;
 connected to: /dev/ttyUSB0&lt;br /&gt;
 Available commands:&lt;br /&gt;
 ?: shows this help&lt;br /&gt;
 binprint: print binary data in decimal format&lt;br /&gt;
 blink [num]: blink LEDs ([num] times)&lt;br /&gt;
 collect: collect data from the network&lt;br /&gt;
 collect-view-data: sensor data, power consumption, network stats&lt;br /&gt;
 echo &amp;lt;text&amp;gt;: print &amp;lt;text&amp;gt;&lt;br /&gt;
 energy: print energy profile&lt;br /&gt;
 exit: exit shell&lt;br /&gt;
 hd: print binary data in hexadecimal format&lt;br /&gt;
 help: shows this help&lt;br /&gt;
 kill &amp;lt;command&amp;gt;: stop a specific command&lt;br /&gt;
 killall: stop all running commands&lt;br /&gt;
 mac &amp;lt;onoroff&amp;gt;: turn MAC protocol on (1) or off (0)&lt;br /&gt;
 netcmd &amp;lt;command&amp;gt;: run a command on all nodes in the network&lt;br /&gt;
 nodeid: set node ID&lt;br /&gt;
 null: discard input&lt;br /&gt;
 packetize: put data into one packet&lt;br /&gt;
 power: print power profile&lt;br /&gt;
 powerconv: convert power profile to human readable output&lt;br /&gt;
 powertrace [interval]: turn powertracing on or off, with reporting interval &amp;lt;interval&amp;gt;&lt;br /&gt;
 quit: exit shell&lt;br /&gt;
 randwait &amp;lt;maxtime&amp;gt; &amp;lt;command&amp;gt;: wait for a random time before running a command&lt;br /&gt;
 reboot: reboot the system&lt;br /&gt;
 repeat &amp;lt;num&amp;gt; &amp;lt;time&amp;gt; &amp;lt;command&amp;gt;: run a command every &amp;lt;time&amp;gt; seconds&lt;br /&gt;
 rfchannel &amp;lt;channel&amp;gt;: change CC2420 radio channel (11 - 26)&lt;br /&gt;
 routes: dump route list in binary format&lt;br /&gt;
 send &amp;lt;rexmits&amp;gt;: send data to the collector node, with rexmits hop-by-hop retransmissions&lt;br /&gt;
 sense: print out sensor data&lt;br /&gt;
 senseconv: convert &amp;#039;sense&amp;#039; data to human readable format&lt;br /&gt;
 size: print the size of the input&lt;br /&gt;
 time [seconds]: output time in binary format, or set time in seconds since 1970&lt;br /&gt;
 timestamp: prepend a timestamp to data&lt;br /&gt;
 txpower &amp;lt;power&amp;gt;: change CC2420 transmission power (0 - 31)&lt;br /&gt;
 5.0: Contiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Understanding the Code ==&lt;br /&gt;
&lt;br /&gt;
 import serial&lt;br /&gt;
&lt;br /&gt;
The first line will include the module for the serial port API. This API is provided by pySerial.&lt;br /&gt;
&lt;br /&gt;
 ser = serial.Serial(&lt;br /&gt;
    port=&amp;#039;/dev/ttyUSB0&amp;#039;,\&lt;br /&gt;
    baudrate=115200,\&lt;br /&gt;
    parity=serial.PARITY_NONE,\&lt;br /&gt;
    stopbits=serial.STOPBITS_ONE,\&lt;br /&gt;
    bytesize=serial.EIGHTBITS,\&lt;br /&gt;
    timeout=0)&lt;br /&gt;
&lt;br /&gt;
This next line instantiates an object with the appropriate serial port configuration for communication with the Sky mote. The necessary settings are shown in the table below.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin: auto;&amp;quot;&lt;br /&gt;
!colspan=&amp;quot;2&amp;quot;|Serial Configuration&lt;br /&gt;
|-&lt;br /&gt;
| Baud rate || 115200&lt;br /&gt;
|-&lt;br /&gt;
| Data bits || 8&lt;br /&gt;
|-&lt;br /&gt;
| Parity || None&lt;br /&gt;
|-&lt;br /&gt;
| Stop bits || 1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
 print(&amp;quot;connected to: &amp;quot; + ser.portstr)&lt;br /&gt;
&lt;br /&gt;
The print statement is simply a sanity check. It just reminds us which port we are connected to.&lt;br /&gt;
&lt;br /&gt;
 ser.write(&amp;quot;help\n&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
This line demonstrates how data can be written to the serial port. In this example we send the command &amp;quot;help&amp;quot; to the Sky Shell so that it will send back the list of shell commands it supports.&lt;br /&gt;
&lt;br /&gt;
 while True:&lt;br /&gt;
	line = ser.readline();&lt;br /&gt;
	if line:&lt;br /&gt;
		print(line),&lt;br /&gt;
&lt;br /&gt;
Here, we read data from the serial port indefinitely and print it out, one line at a time. Note that in this case, &amp;#039;&amp;#039;line&amp;#039;&amp;#039; will typically end with a newline.&lt;br /&gt;
&lt;br /&gt;
To terminate the program, you can use Ctrl + C to send an interrupt signal.&lt;br /&gt;
&lt;br /&gt;
 ser.close()&lt;br /&gt;
&lt;br /&gt;
This last line never actually gets executed but it shows how the serial resource can be freed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Contiki_tutorials | Back to Contiki Tutorials]]&lt;/div&gt;</summary>
		<author><name>Deepanker</name></author>	</entry>

	<entry>
		<id>http://anrg.usc.edu/contiki/index.php?title=Interfacing_with_Python&amp;diff=381</id>
		<title>Interfacing with Python</title>
		<link rel="alternate" type="text/html" href="http://anrg.usc.edu/contiki/index.php?title=Interfacing_with_Python&amp;diff=381"/>
				<updated>2014-04-04T19:19:30Z</updated>
		
		<summary type="html">&lt;p&gt;Deepanker: /* 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;
In this tutorial you will learn how to programmatically communicate with the Tmote Sky using the Python programming language. This will enable you to do such things as process data from your mote in real-time. In addition, you can send commands or data back to the mote to impact its operation. The possibilities are endless.&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
This tutorial was written and tested using the following:&lt;br /&gt;
* Contiki 2.7&lt;br /&gt;
* Python 2.7.3 (and pySerial)&lt;br /&gt;
* Ubuntu 12.04&lt;br /&gt;
* Tmote Sky&lt;br /&gt;
&lt;br /&gt;
Connect the Tmote Sky to your computer using a USB cable and install the Sky Shell example. See the @Sky Shell@ tutorial for instructions on how to do this. We use this example so that we’ll have data to ensure that we are correctly reading and writing to the mote.&lt;br /&gt;
&lt;br /&gt;
=== Step 1 ===&lt;br /&gt;
&lt;br /&gt;
Create a Python file called serial.py containing the following code:&lt;br /&gt;
 #!/usr/bin/python&lt;br /&gt;
 import serial&lt;br /&gt;
 ser = serial.Serial(&lt;br /&gt;
    port=&amp;#039;/dev/ttyUSB0&amp;#039;,\&lt;br /&gt;
    baudrate=115200,\&lt;br /&gt;
    parity=serial.PARITY_NONE,\&lt;br /&gt;
    stopbits=serial.STOPBITS_ONE,\&lt;br /&gt;
    bytesize=serial.EIGHTBITS,\&lt;br /&gt;
    timeout=0)&lt;br /&gt;
 print(&amp;quot;connected to: &amp;quot; + ser.portstr)&lt;br /&gt;
 ser.write(&amp;quot;help\n&amp;quot;);&lt;br /&gt;
 while True:&lt;br /&gt;
	line = ser.readline();&lt;br /&gt;
	if line:&lt;br /&gt;
		print(line),&lt;br /&gt;
 ser.close()&lt;br /&gt;
&lt;br /&gt;
Note: &lt;br /&gt;
This code assumes the mote you are using for this tutorial is connected to &amp;#039;&amp;#039;/dev/ttyUSB0&amp;#039;&amp;#039;. Please check this using the &amp;#039;&amp;#039;make motelist&amp;#039;&amp;#039; command as shown in the figure below. If the mote you are using is connected to a different device file, please modify the Python code accordingly.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Motelist.jpg|center|Sample output of &amp;#039;&amp;#039;make motelist&amp;#039;&amp;#039;]]&lt;br /&gt;
&lt;br /&gt;
== Step 2 ==&lt;br /&gt;
&lt;br /&gt;
Run the Python code using the command:&lt;br /&gt;
&lt;br /&gt;
 python serial.py&lt;br /&gt;
&lt;br /&gt;
You should see output similar to the following:&lt;br /&gt;
 connected to: /dev/ttyUSB0&lt;br /&gt;
 Available commands:&lt;br /&gt;
 ?: shows this help&lt;br /&gt;
 binprint: print binary data in decimal format&lt;br /&gt;
 blink [num]: blink LEDs ([num] times)&lt;br /&gt;
 collect: collect data from the network&lt;br /&gt;
 collect-view-data: sensor data, power consumption, network stats&lt;br /&gt;
 echo &amp;lt;text&amp;gt;: print &amp;lt;text&amp;gt;&lt;br /&gt;
 energy: print energy profile&lt;br /&gt;
 exit: exit shell&lt;br /&gt;
 hd: print binary data in hexadecimal format&lt;br /&gt;
 help: shows this help&lt;br /&gt;
 kill &amp;lt;command&amp;gt;: stop a specific command&lt;br /&gt;
 killall: stop all running commands&lt;br /&gt;
 mac &amp;lt;onoroff&amp;gt;: turn MAC protocol on (1) or off (0)&lt;br /&gt;
 netcmd &amp;lt;command&amp;gt;: run a command on all nodes in the network&lt;br /&gt;
 nodeid: set node ID&lt;br /&gt;
 null: discard input&lt;br /&gt;
 packetize: put data into one packet&lt;br /&gt;
 power: print power profile&lt;br /&gt;
 powerconv: convert power profile to human readable output&lt;br /&gt;
 powertrace [interval]: turn powertracing on or off, with reporting interval &amp;lt;interval&amp;gt;&lt;br /&gt;
 quit: exit shell&lt;br /&gt;
 randwait &amp;lt;maxtime&amp;gt; &amp;lt;command&amp;gt;: wait for a random time before running a command&lt;br /&gt;
 reboot: reboot the system&lt;br /&gt;
 repeat &amp;lt;num&amp;gt; &amp;lt;time&amp;gt; &amp;lt;command&amp;gt;: run a command every &amp;lt;time&amp;gt; seconds&lt;br /&gt;
 rfchannel &amp;lt;channel&amp;gt;: change CC2420 radio channel (11 - 26)&lt;br /&gt;
 routes: dump route list in binary format&lt;br /&gt;
 send &amp;lt;rexmits&amp;gt;: send data to the collector node, with rexmits hop-by-hop retransmissions&lt;br /&gt;
 sense: print out sensor data&lt;br /&gt;
 senseconv: convert &amp;#039;sense&amp;#039; data to human readable format&lt;br /&gt;
 size: print the size of the input&lt;br /&gt;
 time [seconds]: output time in binary format, or set time in seconds since 1970&lt;br /&gt;
 timestamp: prepend a timestamp to data&lt;br /&gt;
 txpower &amp;lt;power&amp;gt;: change CC2420 transmission power (0 - 31)&lt;br /&gt;
 5.0: Contiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Understanding the Code ==&lt;br /&gt;
&lt;br /&gt;
 import serial&lt;br /&gt;
&lt;br /&gt;
The first line will include the module for the serial port API. This API is provided by pySerial.&lt;br /&gt;
&lt;br /&gt;
 ser = serial.Serial(&lt;br /&gt;
    port=&amp;#039;/dev/ttyUSB0&amp;#039;,\&lt;br /&gt;
    baudrate=115200,\&lt;br /&gt;
    parity=serial.PARITY_NONE,\&lt;br /&gt;
    stopbits=serial.STOPBITS_ONE,\&lt;br /&gt;
    bytesize=serial.EIGHTBITS,\&lt;br /&gt;
    timeout=0)&lt;br /&gt;
&lt;br /&gt;
This next line instantiates an object with the appropriate serial port configuration for communication with the Sky mote. The necessary settings are shown in the table below.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin: auto;&amp;quot;&lt;br /&gt;
!colspan=&amp;quot;2&amp;quot;|Serial Configuration&lt;br /&gt;
|-&lt;br /&gt;
| Baud rate || 115200&lt;br /&gt;
|-&lt;br /&gt;
| Data bits || 8&lt;br /&gt;
|-&lt;br /&gt;
| Parity || None&lt;br /&gt;
|-&lt;br /&gt;
| Stop bits || 1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
 print(&amp;quot;connected to: &amp;quot; + ser.portstr)&lt;br /&gt;
&lt;br /&gt;
The print statement is simply a sanity check. It just reminds us which port we are connected to.&lt;br /&gt;
&lt;br /&gt;
 ser.write(&amp;quot;help\n&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
This line demonstrates how data can be written to the serial port. In this example we send the command &amp;quot;help&amp;quot; to the Sky Shell so that it will send back the list of shell commands it supports.&lt;br /&gt;
&lt;br /&gt;
 while True:&lt;br /&gt;
	line = ser.readline();&lt;br /&gt;
	if line:&lt;br /&gt;
		print(line),&lt;br /&gt;
&lt;br /&gt;
Here, we read data from the serial port indefinitely and print it out, one line at a time. Note that in this case, &amp;#039;&amp;#039;line&amp;#039;&amp;#039; will typically end with a newline.&lt;br /&gt;
&lt;br /&gt;
To terminate the program, you can use Ctrl + C to send an interrupt signal.&lt;br /&gt;
&lt;br /&gt;
 ser.close()&lt;br /&gt;
&lt;br /&gt;
This last line never actually gets executed but it shows how the serial resource can be freed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Contiki_tutorials | Back to Contiki Tutorials]]&lt;/div&gt;</summary>
		<author><name>Deepanker</name></author>	</entry>

	<entry>
		<id>http://anrg.usc.edu/contiki/index.php?title=Contiki_Oscilloscope&amp;diff=244</id>
		<title>Contiki Oscilloscope</title>
		<link rel="alternate" type="text/html" href="http://anrg.usc.edu/contiki/index.php?title=Contiki_Oscilloscope&amp;diff=244"/>
				<updated>2014-02-21T23:36:05Z</updated>
		
		<summary type="html">&lt;p&gt;Deepanker: /* Other Tabs */&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 to familiarize the user with the collect view app provided in the Contiki OS source code. It basically involves a sink mote and one or more than one source motes. The source motes send their sensor, network, power and node properties to the sink. A java app presents all this compiled data in a graphical manner.&lt;br /&gt;
&lt;br /&gt;
== You Will Learn ==&lt;br /&gt;
&lt;br /&gt;
* How to upload an introductory code for UDP source and sink.&lt;br /&gt;
* How to program nodes and collect data through the collect-view GUI.&lt;br /&gt;
* Things to see on the collect-view GUI.&lt;br /&gt;
&lt;br /&gt;
== Relevant Directories ==&lt;br /&gt;
&lt;br /&gt;
* /contiki/examples/collect/ - This has the shell code for collect view and the various targets.&lt;br /&gt;
* /contiki/examples/ipv6/rpl-collect/ - This has the codes which are to be uploaded to the source and sink motes for UDP communication.&lt;br /&gt;
* /contiki/tools/collect-view/ - This contains the java file for the collect view GUI.&lt;br /&gt;
* /contiki/apps/collect-view/ - This contains the codes corresponding to the targets mentioned in the examples folder.&lt;br /&gt;
&lt;br /&gt;
== Connect the Tmote Sky ==&lt;br /&gt;
&lt;br /&gt;
Before continuing with the tutorial, plug 2 Tmote Sky into the computer&amp;#039;s USB port, one for the source and the other for the sink.&lt;br /&gt;
&lt;br /&gt;
In order to transfer the ownership of the contiki directories use the following command. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt; sudo chown :user /dev/ttyUSB0 &amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt; sudo chown :user /dev/ttyUSB1 &amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Using the Source Code ==&lt;br /&gt;
&lt;br /&gt;
=== Step 1 ===&lt;br /&gt;
&lt;br /&gt;
Go to /examples/ipv6/rpl-collect/ directory.&lt;br /&gt;
&lt;br /&gt;
=== Step 2 ===&lt;br /&gt;
&lt;br /&gt;
Now we need to program one mote as the sink and the other as source. We will use a predefined target called z1 to upload the code in the motes.&lt;br /&gt;
&lt;br /&gt;
For sink:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt; make TARGET=z1 MOTES=/dev/ttyUSB0 udp-sink.upload &amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For source:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt; make TARGET=z1 MOTES=/dev/ttyUSB1 udp-sender.upload &amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Step 3 ===&lt;br /&gt;
&lt;br /&gt;
Now we would like to see the transfer and depiction of data on the collect-view GUI. For that to happen, go to /tools/collect-view directory and run &amp;quot;ant&amp;quot; to build the collect viewer.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt; ant run &amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note&amp;#039;&amp;#039;&amp;#039; - In order to edit GUI java files go to the /src directory.&lt;br /&gt;
&lt;br /&gt;
=== Step 4 ===&lt;br /&gt;
&lt;br /&gt;
To view the data collected at the sink, go to the generated /tools/collect-view/dist and run - &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt; java -jar collect-view-jar /dev/ttyUSB0 &amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Step 5 ===&lt;br /&gt;
&lt;br /&gt;
In the collect window from the Tools menu, select &amp;quot;Run Init script&amp;quot; and in the &amp;quot;Node Control&amp;quot; tab and click on &amp;quot;Start Collect.&amp;quot; This will enable the communication between the source and the sender and you will be able to see the received statistics in a graphical manner.&lt;br /&gt;
&lt;br /&gt;
== Using the GUI ==&lt;br /&gt;
&lt;br /&gt;
=== Step 1 ===&lt;br /&gt;
&lt;br /&gt;
Once the motes are connected to the USB ports, go to /tools/collect-view directory and run &amp;quot;ant&amp;quot; to build the collect viewer.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt; ant run &amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Step 2 ===&lt;br /&gt;
&lt;br /&gt;
Press the &amp;quot;Program Nodes...&amp;quot; button as seen on the GUI.&lt;br /&gt;
&lt;br /&gt;
=== Step 3 ===&lt;br /&gt;
&lt;br /&gt;
Disconnect all except one node from the USB ports. Press the &amp;quot;Connect to serial&amp;quot; button. The disconnected motes should be connected to independent power sources.&lt;br /&gt;
&lt;br /&gt;
=== Step 3 ===&lt;br /&gt;
&lt;br /&gt;
Now in order to collect various statistics, press &amp;quot;Send Collect&amp;quot; button.&lt;br /&gt;
&lt;br /&gt;
=== Step 4 ===&lt;br /&gt;
&lt;br /&gt;
Set the various &amp;quot;Collect Settings&amp;quot; based on how frequently the data is to be collected and then press &amp;quot;Send command to nodes&amp;quot; button.&lt;br /&gt;
&lt;br /&gt;
=== Step 5 ===&lt;br /&gt;
&lt;br /&gt;
Now go through the other tabs on the GUI to study and analyze the statistics plotted.&lt;br /&gt;
&lt;br /&gt;
== Things to See on the GUI ==&lt;br /&gt;
&lt;br /&gt;
=== Topological graphs ===&lt;br /&gt;
&lt;br /&gt;
* Sensor Map&lt;br /&gt;
* Network Graph&lt;br /&gt;
&lt;br /&gt;
=== Sensor Related Plots ===&lt;br /&gt;
&lt;br /&gt;
These are subject to the availability of a particular type of sensor on the motes.&lt;br /&gt;
&lt;br /&gt;
* Temperature Sensor - Average Temperatue and Temperature.&lt;br /&gt;
* Humidity Sensor - Relative Humidity.&lt;br /&gt;
* Battery Sensor - Battery Indicator and Battery Voltage.&lt;br /&gt;
* Light Sensor - Light 1 and Light 2.&lt;br /&gt;
&lt;br /&gt;
=== Network Metrics Related Plots ===&lt;br /&gt;
&lt;br /&gt;
* Neighbours&lt;br /&gt;
* Beacon Interval&lt;br /&gt;
* Network Hops &lt;br /&gt;
** Over Time&lt;br /&gt;
** Per Node&lt;br /&gt;
* Router Metric (Over Time)&lt;br /&gt;
** Instantaneous&lt;br /&gt;
** Average&lt;br /&gt;
* ETX (Over Time)&lt;br /&gt;
* Next Hop (Over Time)&lt;br /&gt;
* Latency&lt;br /&gt;
* Lost Packets (Over Time)&lt;br /&gt;
* Received Packets&lt;br /&gt;
** Over Time&lt;br /&gt;
** Per Node&lt;br /&gt;
** Every 5 min&lt;br /&gt;
&lt;br /&gt;
=== Power Related Plots ===&lt;br /&gt;
&lt;br /&gt;
* Average Power&lt;br /&gt;
* Instantaneous Power&lt;br /&gt;
* Power History&lt;br /&gt;
* Radio Duty Cycle&lt;br /&gt;
&lt;br /&gt;
=== Other Tabs ===&lt;br /&gt;
&lt;br /&gt;
* Node Info - This gives a summary of all the nodes and their statistics.&lt;br /&gt;
* Serial Console - The user can interact directly with the mote, sending commands to read and transmit data.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Primary contributors:&amp;#039;&amp;#039;&amp;#039; Bhavna, Deepanker, Nikhil, Rahul&lt;br /&gt;
&lt;br /&gt;
[[Contiki_tutorials | Back to Contiki Tutorials]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Edited by: Deepanker&lt;/div&gt;</summary>
		<author><name>Deepanker</name></author>	</entry>

	<entry>
		<id>http://anrg.usc.edu/contiki/index.php?title=Contiki_Oscilloscope&amp;diff=243</id>
		<title>Contiki Oscilloscope</title>
		<link rel="alternate" type="text/html" href="http://anrg.usc.edu/contiki/index.php?title=Contiki_Oscilloscope&amp;diff=243"/>
				<updated>2014-02-21T23:34:11Z</updated>
		
		<summary type="html">&lt;p&gt;Deepanker: &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 to familiarize the user with the collect view app provided in the Contiki OS source code. It basically involves a sink mote and one or more than one source motes. The source motes send their sensor, network, power and node properties to the sink. A java app presents all this compiled data in a graphical manner.&lt;br /&gt;
&lt;br /&gt;
== You Will Learn ==&lt;br /&gt;
&lt;br /&gt;
* How to upload an introductory code for UDP source and sink.&lt;br /&gt;
* How to program nodes and collect data through the collect-view GUI.&lt;br /&gt;
* Things to see on the collect-view GUI.&lt;br /&gt;
&lt;br /&gt;
== Relevant Directories ==&lt;br /&gt;
&lt;br /&gt;
* /contiki/examples/collect/ - This has the shell code for collect view and the various targets.&lt;br /&gt;
* /contiki/examples/ipv6/rpl-collect/ - This has the codes which are to be uploaded to the source and sink motes for UDP communication.&lt;br /&gt;
* /contiki/tools/collect-view/ - This contains the java file for the collect view GUI.&lt;br /&gt;
* /contiki/apps/collect-view/ - This contains the codes corresponding to the targets mentioned in the examples folder.&lt;br /&gt;
&lt;br /&gt;
== Connect the Tmote Sky ==&lt;br /&gt;
&lt;br /&gt;
Before continuing with the tutorial, plug 2 Tmote Sky into the computer&amp;#039;s USB port, one for the source and the other for the sink.&lt;br /&gt;
&lt;br /&gt;
In order to transfer the ownership of the contiki directories use the following command. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt; sudo chown :user /dev/ttyUSB0 &amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt; sudo chown :user /dev/ttyUSB1 &amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Using the Source Code ==&lt;br /&gt;
&lt;br /&gt;
=== Step 1 ===&lt;br /&gt;
&lt;br /&gt;
Go to /examples/ipv6/rpl-collect/ directory.&lt;br /&gt;
&lt;br /&gt;
=== Step 2 ===&lt;br /&gt;
&lt;br /&gt;
Now we need to program one mote as the sink and the other as source. We will use a predefined target called z1 to upload the code in the motes.&lt;br /&gt;
&lt;br /&gt;
For sink:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt; make TARGET=z1 MOTES=/dev/ttyUSB0 udp-sink.upload &amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For source:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt; make TARGET=z1 MOTES=/dev/ttyUSB1 udp-sender.upload &amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Step 3 ===&lt;br /&gt;
&lt;br /&gt;
Now we would like to see the transfer and depiction of data on the collect-view GUI. For that to happen, go to /tools/collect-view directory and run &amp;quot;ant&amp;quot; to build the collect viewer.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt; ant run &amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note&amp;#039;&amp;#039;&amp;#039; - In order to edit GUI java files go to the /src directory.&lt;br /&gt;
&lt;br /&gt;
=== Step 4 ===&lt;br /&gt;
&lt;br /&gt;
To view the data collected at the sink, go to the generated /tools/collect-view/dist and run - &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt; java -jar collect-view-jar /dev/ttyUSB0 &amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Step 5 ===&lt;br /&gt;
&lt;br /&gt;
In the collect window from the Tools menu, select &amp;quot;Run Init script&amp;quot; and in the &amp;quot;Node Control&amp;quot; tab and click on &amp;quot;Start Collect.&amp;quot; This will enable the communication between the source and the sender and you will be able to see the received statistics in a graphical manner.&lt;br /&gt;
&lt;br /&gt;
== Using the GUI ==&lt;br /&gt;
&lt;br /&gt;
=== Step 1 ===&lt;br /&gt;
&lt;br /&gt;
Once the motes are connected to the USB ports, go to /tools/collect-view directory and run &amp;quot;ant&amp;quot; to build the collect viewer.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt; ant run &amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Step 2 ===&lt;br /&gt;
&lt;br /&gt;
Press the &amp;quot;Program Nodes...&amp;quot; button as seen on the GUI.&lt;br /&gt;
&lt;br /&gt;
=== Step 3 ===&lt;br /&gt;
&lt;br /&gt;
Disconnect all except one node from the USB ports. Press the &amp;quot;Connect to serial&amp;quot; button. The disconnected motes should be connected to independent power sources.&lt;br /&gt;
&lt;br /&gt;
=== Step 3 ===&lt;br /&gt;
&lt;br /&gt;
Now in order to collect various statistics, press &amp;quot;Send Collect&amp;quot; button.&lt;br /&gt;
&lt;br /&gt;
=== Step 4 ===&lt;br /&gt;
&lt;br /&gt;
Set the various &amp;quot;Collect Settings&amp;quot; based on how frequently the data is to be collected and then press &amp;quot;Send command to nodes&amp;quot; button.&lt;br /&gt;
&lt;br /&gt;
=== Step 5 ===&lt;br /&gt;
&lt;br /&gt;
Now go through the other tabs on the GUI to study and analyze the statistics plotted.&lt;br /&gt;
&lt;br /&gt;
== Things to See on the GUI ==&lt;br /&gt;
&lt;br /&gt;
=== Topological graphs ===&lt;br /&gt;
&lt;br /&gt;
* Sensor Map&lt;br /&gt;
* Network Graph&lt;br /&gt;
&lt;br /&gt;
=== Sensor Related Plots ===&lt;br /&gt;
&lt;br /&gt;
These are subject to the availability of a particular type of sensor on the motes.&lt;br /&gt;
&lt;br /&gt;
* Temperature Sensor - Average Temperatue and Temperature.&lt;br /&gt;
* Humidity Sensor - Relative Humidity.&lt;br /&gt;
* Battery Sensor - Battery Indicator and Battery Voltage.&lt;br /&gt;
* Light Sensor - Light 1 and Light 2.&lt;br /&gt;
&lt;br /&gt;
=== Network Metrics Related Plots ===&lt;br /&gt;
&lt;br /&gt;
* Neighbours&lt;br /&gt;
* Beacon Interval&lt;br /&gt;
* Network Hops &lt;br /&gt;
** Over Time&lt;br /&gt;
** Per Node&lt;br /&gt;
* Router Metric (Over Time)&lt;br /&gt;
** Instantaneous&lt;br /&gt;
** Average&lt;br /&gt;
* ETX (Over Time)&lt;br /&gt;
* Next Hop (Over Time)&lt;br /&gt;
* Latency&lt;br /&gt;
* Lost Packets (Over Time)&lt;br /&gt;
* Received Packets&lt;br /&gt;
** Over Time&lt;br /&gt;
** Per Node&lt;br /&gt;
** Every 5 min&lt;br /&gt;
&lt;br /&gt;
=== Power Related Plots ===&lt;br /&gt;
&lt;br /&gt;
* Average Power&lt;br /&gt;
* Instantaneous Power&lt;br /&gt;
* Power History&lt;br /&gt;
* Radio Duty Cycle&lt;br /&gt;
&lt;br /&gt;
=== Other Tabs ===&lt;br /&gt;
&lt;br /&gt;
* Node Info&lt;br /&gt;
* Serial Console&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Primary contributors:&amp;#039;&amp;#039;&amp;#039; Bhavna, Deepanker, Nikhil, Rahul&lt;br /&gt;
&lt;br /&gt;
[[Contiki_tutorials | Back to Contiki Tutorials]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Edited by: Deepanker&lt;/div&gt;</summary>
		<author><name>Deepanker</name></author>	</entry>

	<entry>
		<id>http://anrg.usc.edu/contiki/index.php?title=Contiki_Oscilloscope&amp;diff=242</id>
		<title>Contiki Oscilloscope</title>
		<link rel="alternate" type="text/html" href="http://anrg.usc.edu/contiki/index.php?title=Contiki_Oscilloscope&amp;diff=242"/>
				<updated>2014-02-21T23:32:34Z</updated>
		
		<summary type="html">&lt;p&gt;Deepanker: &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 to familiarize the user with the collect view app provided in the Contiki OS source code. It basically involves a sink mote and one or more than one source motes. The source motes send their sensor, network, power and node properties to the sink. A java app presents all this compiled data in a graphical manner.&lt;br /&gt;
&lt;br /&gt;
== You Will Learn ==&lt;br /&gt;
&lt;br /&gt;
* How to upload an introductory code for UDP source and sink.&lt;br /&gt;
* Things to see on the collect view gui.&lt;br /&gt;
&lt;br /&gt;
== Relevant Directories ==&lt;br /&gt;
&lt;br /&gt;
* /contiki/examples/collect/ - This has the shell code for collect view and the various targets.&lt;br /&gt;
* /contiki/examples/ipv6/rpl-collect/ - This has the codes which are to be uploaded to the source and sink motes for UDP communication.&lt;br /&gt;
* /contiki/tools/collect-view/ - This contains the java file for the collect view GUI.&lt;br /&gt;
* /contiki/apps/collect-view/ - This contains the codes corresponding to the targets mentioned in the examples folder.&lt;br /&gt;
&lt;br /&gt;
== Connect the Tmote Sky ==&lt;br /&gt;
&lt;br /&gt;
Before continuing with the tutorial, plug 2 Tmote Sky into the computer&amp;#039;s USB port, one for the source and the other for the sink.&lt;br /&gt;
&lt;br /&gt;
In order to transfer the ownership of the contiki directories use the following command. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt; sudo chown :user /dev/ttyUSB0 &amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt; sudo chown :user /dev/ttyUSB1 &amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Using the Source Code ==&lt;br /&gt;
&lt;br /&gt;
=== Step 1 ===&lt;br /&gt;
&lt;br /&gt;
Go to /examples/ipv6/rpl-collect/ directory.&lt;br /&gt;
&lt;br /&gt;
=== Step 2 ===&lt;br /&gt;
&lt;br /&gt;
Now we need to program one mote as the sink and the other as source. We will use a predefined target called z1 to upload the code in the motes.&lt;br /&gt;
&lt;br /&gt;
For sink:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt; make TARGET=z1 MOTES=/dev/ttyUSB0 udp-sink.upload &amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For source:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt; make TARGET=z1 MOTES=/dev/ttyUSB1 udp-sender.upload &amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Step 3 ===&lt;br /&gt;
&lt;br /&gt;
Now we would like to see the transfer and depiction of data on the collect-view GUI. For that to happen, go to /tools/collect-view directory and run &amp;quot;ant&amp;quot; to build the collect viewer.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt; ant run &amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note&amp;#039;&amp;#039;&amp;#039; - In order to edit GUI java files go to the /src directory.&lt;br /&gt;
&lt;br /&gt;
=== Step 4 ===&lt;br /&gt;
&lt;br /&gt;
To view the data collected at the sink, go to the generated /tools/collect-view/dist and run - &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt; java -jar collect-view-jar /dev/ttyUSB0 &amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Step 5 ===&lt;br /&gt;
&lt;br /&gt;
In the collect window from the Tools menu, select &amp;quot;Run Init script&amp;quot; and in the &amp;quot;Node Control&amp;quot; tab and click on &amp;quot;Start Collect.&amp;quot; This will enable the communication between the source and the sender and you will be able to see the received statistics in a graphical manner.&lt;br /&gt;
&lt;br /&gt;
== Using the GUI ==&lt;br /&gt;
&lt;br /&gt;
=== Step 1 ===&lt;br /&gt;
&lt;br /&gt;
Once the motes are connected to the USB ports, go to /tools/collect-view directory and run &amp;quot;ant&amp;quot; to build the collect viewer.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt; ant run &amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Step 2 ===&lt;br /&gt;
&lt;br /&gt;
Press the &amp;quot;Program Nodes...&amp;quot; button as seen on the GUI.&lt;br /&gt;
&lt;br /&gt;
=== Step 3 ===&lt;br /&gt;
&lt;br /&gt;
Disconnect all except one node from the USB ports. Press the &amp;quot;Connect to serial&amp;quot; button. The disconnected motes should be connected to independent power sources.&lt;br /&gt;
&lt;br /&gt;
=== Step 3 ===&lt;br /&gt;
&lt;br /&gt;
Now in order to collect various statistics, press &amp;quot;Send Collect&amp;quot; button.&lt;br /&gt;
&lt;br /&gt;
=== Step 4 ===&lt;br /&gt;
&lt;br /&gt;
Set the various &amp;quot;Collect Settings&amp;quot; based on how frequently the data is to be collected and then press &amp;quot;Send command to nodes&amp;quot; button.&lt;br /&gt;
&lt;br /&gt;
=== Step 5 ===&lt;br /&gt;
&lt;br /&gt;
Now go through the other tabs on the GUI to study and analyze the statistics plotted.&lt;br /&gt;
&lt;br /&gt;
== Things to See on the GUI ==&lt;br /&gt;
&lt;br /&gt;
=== Topological graphs ===&lt;br /&gt;
&lt;br /&gt;
* Sensor Map&lt;br /&gt;
* Network Graph&lt;br /&gt;
&lt;br /&gt;
=== Sensor Related Plots ===&lt;br /&gt;
&lt;br /&gt;
These are subject to the availability of a particular type of sensor on the motes.&lt;br /&gt;
&lt;br /&gt;
* Temperature Sensor - Average Temperatue and Temperature.&lt;br /&gt;
* Humidity Sensor - Relative Humidity.&lt;br /&gt;
* Battery Sensor - Battery Indicator and Battery Voltage.&lt;br /&gt;
* Light Sensor - Light 1 and Light 2.&lt;br /&gt;
&lt;br /&gt;
=== Network Metrics Related Plots ===&lt;br /&gt;
&lt;br /&gt;
* Neighbours&lt;br /&gt;
* Beacon Interval&lt;br /&gt;
* Network Hops &lt;br /&gt;
** Over Time&lt;br /&gt;
** Per Node&lt;br /&gt;
* Router Metric (Over Time)&lt;br /&gt;
** Instantaneous&lt;br /&gt;
** Average&lt;br /&gt;
* ETX (Over Time)&lt;br /&gt;
* Next Hop (Over Time)&lt;br /&gt;
* Latency&lt;br /&gt;
* Lost Packets (Over Time)&lt;br /&gt;
* Received Packets&lt;br /&gt;
** Over Time&lt;br /&gt;
** Per Node&lt;br /&gt;
** Every 5 min&lt;br /&gt;
&lt;br /&gt;
=== Power Related Plots ===&lt;br /&gt;
&lt;br /&gt;
* Average Power&lt;br /&gt;
* Instantaneous Power&lt;br /&gt;
* Power History&lt;br /&gt;
* Radio Duty Cycle&lt;br /&gt;
&lt;br /&gt;
=== Other Tabs ===&lt;br /&gt;
&lt;br /&gt;
* Node Info&lt;br /&gt;
* Serial Console&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Primary contributors:&amp;#039;&amp;#039;&amp;#039; Bhavna, Deepanker, Nikhil, Rahul&lt;br /&gt;
&lt;br /&gt;
[[Contiki_tutorials | Back to Contiki Tutorials]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Edited by: Deepanker&lt;/div&gt;</summary>
		<author><name>Deepanker</name></author>	</entry>

	<entry>
		<id>http://anrg.usc.edu/contiki/index.php?title=Contiki_Oscilloscope&amp;diff=241</id>
		<title>Contiki Oscilloscope</title>
		<link rel="alternate" type="text/html" href="http://anrg.usc.edu/contiki/index.php?title=Contiki_Oscilloscope&amp;diff=241"/>
				<updated>2014-02-21T23:30:32Z</updated>
		
		<summary type="html">&lt;p&gt;Deepanker: &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 to familiarize the user with the collect view app provided in the Contiki OS source code. It basically involves a sink mote and one or more than one source motes. The source motes send their sensor, network, power and node properties to the sink. A java app presents all this compiled data in a graphical manner.&lt;br /&gt;
&lt;br /&gt;
== You Will Learn ==&lt;br /&gt;
&lt;br /&gt;
* How to upload an introductory code for UDP source and sink.&lt;br /&gt;
* Things to see on the collect view gui.&lt;br /&gt;
&lt;br /&gt;
== Relevant Directories ==&lt;br /&gt;
&lt;br /&gt;
* /contiki/examples/collect/ - This has the shell code for collect view and the various targets.&lt;br /&gt;
* /contiki/examples/ipv6/rpl-collect/ - This has the codes which are to be uploaded to the source and sink motes for UDP communication.&lt;br /&gt;
* /contiki/tools/collect-view/ - This contains the java file for the collect view GUI.&lt;br /&gt;
* /contiki/apps/collect-view/ - This contains the codes corresponding to the targets mentioned in the examples folder.&lt;br /&gt;
&lt;br /&gt;
== Connect the Tmote Sky ==&lt;br /&gt;
&lt;br /&gt;
Before continuing with the tutorial, plug 2 Tmote Sky into the computer&amp;#039;s USB port, one for the source and the other for the sink.&lt;br /&gt;
&lt;br /&gt;
In order to transfer the ownership of the contiki directories use the following command. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt; sudo chown :user /dev/ttyUSB0 &amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt; sudo chown :user /dev/ttyUSB1 &amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Using the Source Code ==&lt;br /&gt;
&lt;br /&gt;
=== Step 1 ===&lt;br /&gt;
&lt;br /&gt;
Go to /examples/ipv6/rpl-collect/ directory.&lt;br /&gt;
&lt;br /&gt;
=== Step 2 ===&lt;br /&gt;
&lt;br /&gt;
Now we need to program one mote as the sink and the other as source. We will use a predefined target called z1 to upload the code in the motes.&lt;br /&gt;
&lt;br /&gt;
For sink:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt; make TARGET=z1 MOTES=/dev/ttyUSB0 udp-sink.upload &amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For source:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt; make TARGET=z1 MOTES=/dev/ttyUSB1 udp-sender.upload &amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Step 3 ===&lt;br /&gt;
&lt;br /&gt;
Now we would like to see the transfer and depiction of data on the collect-view GUI. For that to happen, go to /tools/collect-view directory and run &amp;quot;ant&amp;quot; to build the collect viewer.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt; ant run &amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note&amp;#039;&amp;#039;&amp;#039; - In order to edit GUI java files go to the /src directory.&lt;br /&gt;
&lt;br /&gt;
=== Step 4 ===&lt;br /&gt;
&lt;br /&gt;
To view the data collected at the sink, go to the generated /tools/collect-view/dist and run - &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt; java -jar collect-view-jar /dev/ttyUSB0 &amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Step 5 ===&lt;br /&gt;
&lt;br /&gt;
In the collect window from the Tools menu, select &amp;quot;Run Init script&amp;quot; and in the &amp;quot;Node Control&amp;quot; tab and click on &amp;quot;Start Collect.&amp;quot; This will enable the communication between the source and the sender and you will be able to see the received statistics in a graphical manner.&lt;br /&gt;
&lt;br /&gt;
== Using the GUI ==&lt;br /&gt;
&lt;br /&gt;
=== Step 1 ===&lt;br /&gt;
&lt;br /&gt;
Once the motes are connected to the USB ports, go to /tools/collect-view directory and run &amp;quot;ant&amp;quot; to build the collect viewer.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt; ant run &amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Step 2 ===&lt;br /&gt;
&lt;br /&gt;
Press the &amp;quot;Program Nodes...&amp;quot; button as seen on the GUI.&lt;br /&gt;
&lt;br /&gt;
=== Step 3 ===&lt;br /&gt;
&lt;br /&gt;
Disconnect all except one node from the USB ports. Press the &amp;quot;Connect to serial&amp;quot; button. The disconnected motes should be connected to independent power sources.&lt;br /&gt;
&lt;br /&gt;
=== Step 3 ===&lt;br /&gt;
&lt;br /&gt;
Now in order to collect various statistics, press &amp;quot;Send Collect&amp;quot; button.&lt;br /&gt;
&lt;br /&gt;
=== Step 4 ===&lt;br /&gt;
&lt;br /&gt;
Set the various &amp;quot;Collect Settings&amp;quot; based on how frequently the data is to be collected and then press &amp;quot;Send command to nodes&amp;quot; button.&lt;br /&gt;
&lt;br /&gt;
=== Step 5 ===&lt;br /&gt;
&lt;br /&gt;
Now go through the other tabs on the GUI to study and analyze the statistics plotted.&lt;br /&gt;
&lt;br /&gt;
== Things to See on the GUI ==&lt;br /&gt;
&lt;br /&gt;
=== Topological graphs ===&lt;br /&gt;
&lt;br /&gt;
* Sensor Map&lt;br /&gt;
* Network Graph&lt;br /&gt;
&lt;br /&gt;
=== Sensor Related Plots ===&lt;br /&gt;
&lt;br /&gt;
These are subject to the availability of a particular type of sensor on the motes.&lt;br /&gt;
&lt;br /&gt;
* Temperature Sensor - Average Temperatue and Temperature.&lt;br /&gt;
* Humidity Sensor - Relative Humidity.&lt;br /&gt;
* Battery Sensor - Battery Indicator and Battery Voltage.&lt;br /&gt;
* Light Sensor - Light 1 and Light 2.&lt;br /&gt;
&lt;br /&gt;
=== Network Metrics Related Plots ===&lt;br /&gt;
&lt;br /&gt;
* Neighbours&lt;br /&gt;
* Beacon Interval&lt;br /&gt;
* Network Hops &lt;br /&gt;
** Over Time&lt;br /&gt;
** Per Node&lt;br /&gt;
* Router Metric (Over Time)&lt;br /&gt;
** Instantaneous&lt;br /&gt;
** Average&lt;br /&gt;
* ETX (Over Time)&lt;br /&gt;
* Next Hop (Over Time)&lt;br /&gt;
* Latency&lt;br /&gt;
* Lost Packets (Over Time)&lt;br /&gt;
* Received Packets&lt;br /&gt;
** Over Time&lt;br /&gt;
** Per Node&lt;br /&gt;
** Every 5 min&lt;br /&gt;
&lt;br /&gt;
=== Power Related Plots ===&lt;br /&gt;
&lt;br /&gt;
* Average Power&lt;br /&gt;
* Instantaneous Power&lt;br /&gt;
* Power History&lt;br /&gt;
* Radio Duty Cycle&lt;br /&gt;
&lt;br /&gt;
=== Other Tabs ===&lt;br /&gt;
&lt;br /&gt;
* Node Info&lt;br /&gt;
* Serial Console&lt;br /&gt;
&lt;br /&gt;
[[Contiki_tutorials | Back to Contiki Tutorials]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Edited by: Deepanker&lt;/div&gt;</summary>
		<author><name>Deepanker</name></author>	</entry>

	<entry>
		<id>http://anrg.usc.edu/contiki/index.php?title=Contiki_Oscilloscope&amp;diff=240</id>
		<title>Contiki Oscilloscope</title>
		<link rel="alternate" type="text/html" href="http://anrg.usc.edu/contiki/index.php?title=Contiki_Oscilloscope&amp;diff=240"/>
				<updated>2014-02-21T23:15:04Z</updated>
		
		<summary type="html">&lt;p&gt;Deepanker: &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 to familiarize the user with the collect view app provided in the Contiki OS source code. It basically involves a sink mote and one or more than one source motes. The source motes send their sensor, network, power and node properties to the sink. A java app presents all this compiled data in a graphical manner.&lt;br /&gt;
&lt;br /&gt;
== You Will Learn ==&lt;br /&gt;
&lt;br /&gt;
* How to upload an introductory code for UDP source and sink.&lt;br /&gt;
* Things to see on the collect view gui.&lt;br /&gt;
&lt;br /&gt;
== Relevant Directories ==&lt;br /&gt;
&lt;br /&gt;
* /contiki/examples/collect/ - This has the shell code for collect view and the various targets.&lt;br /&gt;
* /contiki/examples/ipv6/rpl-collect/ - This has the codes which are to be uploaded to the source and sink motes for UDP communication.&lt;br /&gt;
* /contiki/tools/collect-view/ - This contains the java file for the collect view GUI.&lt;br /&gt;
* /contiki/apps/collect-view/ - This contains the codes corresponding to the targets mentioned in the examples folder.&lt;br /&gt;
&lt;br /&gt;
== Connect the Tmote Sky ==&lt;br /&gt;
&lt;br /&gt;
Before continuing with the tutorial, plug 2 Tmote Sky into the computer&amp;#039;s USB port, one for the source and the other for the sink.&lt;br /&gt;
&lt;br /&gt;
In order to transfer the ownership of the contiki directories use the following command. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt; sudo chown :user /dev/ttyUSB0 &amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt; sudo chown :user /dev/ttyUSB1 &amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Using the Source Code ==&lt;br /&gt;
&lt;br /&gt;
=== Step 1 ===&lt;br /&gt;
&lt;br /&gt;
Go to /examples/ipv6/rpl-collect/ directory.&lt;br /&gt;
&lt;br /&gt;
=== Step 2 ===&lt;br /&gt;
&lt;br /&gt;
Now we need to program one mote as the sink and the other as source. We will use a predefined target called z1 to upload the code in the motes.&lt;br /&gt;
&lt;br /&gt;
For sink:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt; make TARGET=z1 MOTES=/dev/ttyUSB0 udp-sink.upload &amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For source:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt; make TARGET=z1 MOTES=/dev/ttyUSB1 udp-sender.upload &amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Step 3 ===&lt;br /&gt;
&lt;br /&gt;
Now we would like to see the transfer and depiction of data on the collect-view GUI. For that to happen, go to /tools/collect-view directory and run &amp;quot;ant&amp;quot; to build the collect viewer.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt; ant run &amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note&amp;#039;&amp;#039;&amp;#039; - In order to edit GUI java files go to the /src directory.&lt;br /&gt;
&lt;br /&gt;
=== Step 4 ===&lt;br /&gt;
&lt;br /&gt;
To view the data collected at the sink, go to the generated /tools/collect-view/dist and run - &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt; java -jar collect-view-jar /dev/ttyUSB0 &amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Step 5 ===&lt;br /&gt;
&lt;br /&gt;
In the collect window from the Tools menu, select &amp;quot;Run Init script&amp;quot; and in the &amp;quot;Node Control&amp;quot; tab and click on &amp;quot;Start Collect.&amp;quot; This will enable the communication between the source and the sender and you will be able to see the received statistics in a graphical manner.&lt;br /&gt;
&lt;br /&gt;
== Using the GUI ==&lt;br /&gt;
&lt;br /&gt;
=== Step 1 ===&lt;br /&gt;
&lt;br /&gt;
Once the motes are connected to the USB ports, go to /tools/collect-view directory and run &amp;quot;ant&amp;quot; to build the collect viewer.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt; ant run &amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Step 2 ===&lt;br /&gt;
&lt;br /&gt;
Press the &amp;quot;Program Nodes...&amp;quot; button as seen on the GUI.&lt;br /&gt;
&lt;br /&gt;
=== Step 3 ===&lt;br /&gt;
&lt;br /&gt;
Disconnect all except one node from the USB ports. Press the &amp;quot;Connect to serial&amp;quot; button. The disconnected motes should be connected to independent power sources.&lt;br /&gt;
&lt;br /&gt;
=== Step 3 ===&lt;br /&gt;
&lt;br /&gt;
Now in order to collect various statistics, press &amp;quot;Send Collect&amp;quot; button.&lt;br /&gt;
&lt;br /&gt;
=== Step 4 ===&lt;br /&gt;
&lt;br /&gt;
Set the various &amp;quot;Collect Settings&amp;quot; based on how frequently the data is to be collected and then press &amp;quot;Send command to nodes&amp;quot; button.&lt;br /&gt;
&lt;br /&gt;
=== Step 5 ===&lt;br /&gt;
&lt;br /&gt;
Now go through the other tabs on the GUI to study and analyze the statistics plotted.&lt;/div&gt;</summary>
		<author><name>Deepanker</name></author>	</entry>

	<entry>
		<id>http://anrg.usc.edu/contiki/index.php?title=Contiki_Oscilloscope&amp;diff=239</id>
		<title>Contiki Oscilloscope</title>
		<link rel="alternate" type="text/html" href="http://anrg.usc.edu/contiki/index.php?title=Contiki_Oscilloscope&amp;diff=239"/>
				<updated>2014-02-21T22:51:18Z</updated>
		
		<summary type="html">&lt;p&gt;Deepanker: /* Connect 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 exercise is to familiarize the user with the collect view app provided in the Contiki OS source code. It basically involves a sink mote and one or more than one source motes. The source motes send their sensor, network, power and node properties to the sink. A java app presents all this compiled data in a graphical manner.&lt;br /&gt;
&lt;br /&gt;
== You Will Learn ==&lt;br /&gt;
&lt;br /&gt;
* How to upload an introductory code for UDP source and sink.&lt;br /&gt;
* Things to see on the collect view gui.&lt;br /&gt;
&lt;br /&gt;
== Relevant Directories ==&lt;br /&gt;
&lt;br /&gt;
* /contiki/examples/collect/ - This has the shell code for collect view and the various targets.&lt;br /&gt;
* /contiki/examples/ipv6/rpl-collect/ - This has the codes which are to be uploaded to the source and sink motes for UDP communication.&lt;br /&gt;
* /contiki/tools/collect-view/ - This contains the java file for the collect view GUI.&lt;br /&gt;
* /contiki/apps/collect-view/ - This contains the codes corresponding to the targets mentioned in the examples folder.&lt;br /&gt;
&lt;br /&gt;
== Connect the Tmote Sky ==&lt;br /&gt;
&lt;br /&gt;
Before continuing with the tutorial, plug 2 Tmote Sky into the computer&amp;#039;s USB port, one for the source and the other for the sink.&lt;br /&gt;
&lt;br /&gt;
In order to transfer the ownership of the contiki directories use the following command. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt; sudo chown :user /dev/ttyUSB0 &amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt; sudo chown :user /dev/ttyUSB1 &amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;/div&gt;</summary>
		<author><name>Deepanker</name></author>	</entry>

	<entry>
		<id>http://anrg.usc.edu/contiki/index.php?title=Contiki_Oscilloscope&amp;diff=238</id>
		<title>Contiki Oscilloscope</title>
		<link rel="alternate" type="text/html" href="http://anrg.usc.edu/contiki/index.php?title=Contiki_Oscilloscope&amp;diff=238"/>
				<updated>2014-02-21T22:49:02Z</updated>
		
		<summary type="html">&lt;p&gt;Deepanker: &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 to familiarize the user with the collect view app provided in the Contiki OS source code. It basically involves a sink mote and one or more than one source motes. The source motes send their sensor, network, power and node properties to the sink. A java app presents all this compiled data in a graphical manner.&lt;br /&gt;
&lt;br /&gt;
== You Will Learn ==&lt;br /&gt;
&lt;br /&gt;
* How to upload an introductory code for UDP source and sink.&lt;br /&gt;
* Things to see on the collect view gui.&lt;br /&gt;
&lt;br /&gt;
== Relevant Directories ==&lt;br /&gt;
&lt;br /&gt;
* /contiki/examples/collect/ - This has the shell code for collect view and the various targets.&lt;br /&gt;
* /contiki/examples/ipv6/rpl-collect/ - This has the codes which are to be uploaded to the source and sink motes for UDP communication.&lt;br /&gt;
* /contiki/tools/collect-view/ - This contains the java file for the collect view GUI.&lt;br /&gt;
* /contiki/apps/collect-view/ - This contains the codes corresponding to the targets mentioned in the examples folder.&lt;br /&gt;
&lt;br /&gt;
== Connect the Tmote Sky ==&lt;br /&gt;
&lt;br /&gt;
Before continuing with the tutorial, plug 2 Tmote Sky into the computer&amp;#039;s USB port, one for the source and the other for the sink.&lt;br /&gt;
&lt;br /&gt;
In order to transfer the ownership of the contiki directories use the following command. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt; sudo chown :user /dev/ttyUSB0 &amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt; sudo chown :user /dev/ttyUSB1 &amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;/div&gt;</summary>
		<author><name>Deepanker</name></author>	</entry>

	<entry>
		<id>http://anrg.usc.edu/contiki/index.php?title=Contiki_Oscilloscope&amp;diff=237</id>
		<title>Contiki Oscilloscope</title>
		<link rel="alternate" type="text/html" href="http://anrg.usc.edu/contiki/index.php?title=Contiki_Oscilloscope&amp;diff=237"/>
				<updated>2014-02-21T22:06:27Z</updated>
		
		<summary type="html">&lt;p&gt;Deepanker: &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 to familiarize the user with the collect view app provided in the Contiki OS source code. It basically involves a sink mote and one or more than one source motes. The source motes send their sensor, network, power and node properties to the sink. A java app presents all this compiled data in a graphical manner.&lt;br /&gt;
&lt;br /&gt;
== You Will Learn ==&lt;br /&gt;
&lt;br /&gt;
* How to upload an introductory code for UDP source and sink.&lt;br /&gt;
* Things to see on the collect view gui.&lt;br /&gt;
&lt;br /&gt;
== Relevant Directories ==&lt;br /&gt;
&lt;br /&gt;
* /contiki/examples/collect/ - This has the shell code for collect view and the various targets.&lt;br /&gt;
* /contiki/examples/ipv6/rpl-collect/ - This has the codes which are to be uploaded to the source and sink motes for UDP communication.&lt;br /&gt;
* /contiki/tools/collect-view/ - This contains the java file for the collect view GUI.&lt;br /&gt;
* /contiki/apps/collect-view - This contains the codes corresponding to the targets mentioned in the examples folder.&lt;/div&gt;</summary>
		<author><name>Deepanker</name></author>	</entry>

	<entry>
		<id>http://anrg.usc.edu/contiki/index.php?title=Contiki_Oscilloscope&amp;diff=236</id>
		<title>Contiki Oscilloscope</title>
		<link rel="alternate" type="text/html" href="http://anrg.usc.edu/contiki/index.php?title=Contiki_Oscilloscope&amp;diff=236"/>
				<updated>2014-02-21T21:33:22Z</updated>
		
		<summary type="html">&lt;p&gt;Deepanker: Created page with &amp;quot; Back to Contiki Tutorials  __TOC__  == Introduction ==  This exercise is to familiarize the user with the collect view app provided in the Contiki OS s...&amp;quot;&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 to familiarize the user with the collect view app provided in the Contiki OS source code. It basically involves a sink mote and one or more than one source motes. The source motes send their sensor, network, power and node properties to the sink. A java app presents all this compiled data in a graphical manner.&lt;/div&gt;</summary>
		<author><name>Deepanker</name></author>	</entry>

	<entry>
		<id>http://anrg.usc.edu/contiki/index.php?title=Hello_World&amp;diff=32</id>
		<title>Hello World</title>
		<link rel="alternate" type="text/html" href="http://anrg.usc.edu/contiki/index.php?title=Hello_World&amp;diff=32"/>
				<updated>2014-02-01T02:47:53Z</updated>
		
		<summary type="html">&lt;p&gt;Deepanker: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Introduction=&lt;br /&gt;
This tutorial teaches you how to compile a program on Contiki OS. This is a simple Hello World program which is used to show the compilation and upload steps on a Tmote Sky.&lt;br /&gt;
&lt;br /&gt;
*Step 1 - Open the terminal window.&lt;br /&gt;
*Step 2 - In the terminal window, go to the hello world example folder.	&lt;br /&gt;
:: &amp;lt;code&amp;gt;.cd /examples/hello-world&amp;lt;/code&amp;gt;&lt;br /&gt;
*Step 3 - Compile the code for the native platform (to be used when no mote is connected to the laptop.)&lt;br /&gt;
:: &amp;lt;code&amp;gt;make TARGET=native&amp;lt;/code&amp;gt;&lt;br /&gt;
*Step 4 - Once the compilation is over, run the Hello World program. &lt;br /&gt;
:: &amp;lt;code&amp;gt;./hello-world.native&amp;lt;/code&amp;gt;&lt;br /&gt;
*Step 5 - 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;
&amp;#039;&amp;#039;&amp;#039;Hello World on the Tmote Sky!&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*Step 1 - Using the opened terminal window compile and upload the Hello World program on the Tmote Sky.&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;
*Step 2 - Press the reset button on the Tmote Sky. The following message will appear on the terminal window - &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;
: 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;
*Step 3 - Press Ctrl-C to quit.&lt;/div&gt;</summary>
		<author><name>Deepanker</name></author>	</entry>

	<entry>
		<id>http://anrg.usc.edu/contiki/index.php?title=Hello_World&amp;diff=30</id>
		<title>Hello World</title>
		<link rel="alternate" type="text/html" href="http://anrg.usc.edu/contiki/index.php?title=Hello_World&amp;diff=30"/>
				<updated>2014-02-01T02:41:12Z</updated>
		
		<summary type="html">&lt;p&gt;Deepanker: Created page with &amp;quot;&amp;#039;&amp;#039;&amp;#039;Hello World!&amp;#039;&amp;#039;&amp;#039; *Step 1 - Open the terminal window. *Step 2 - In the terminal window, go to the hello world example folder.	 :: &amp;lt;code&amp;gt;.cd /examples/hello-world&amp;lt;/code&amp;gt; *Step...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;#039;&amp;#039;&amp;#039;Hello World!&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*Step 1 - Open the terminal window.&lt;br /&gt;
*Step 2 - In the terminal window, go to the hello world example folder.	&lt;br /&gt;
:: &amp;lt;code&amp;gt;.cd /examples/hello-world&amp;lt;/code&amp;gt;&lt;br /&gt;
*Step 3 - Compile the code for the native platform (to be used when no mote is connected to the laptop.)&lt;br /&gt;
:: &amp;lt;code&amp;gt;make TARGET=native&amp;lt;/code&amp;gt;&lt;br /&gt;
*Step 4 - Once the compilation is over, run the Hello World program. &lt;br /&gt;
:: &amp;lt;code&amp;gt;./hello-world.native&amp;lt;/code&amp;gt;&lt;br /&gt;
*Step 5 - 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;
&amp;#039;&amp;#039;&amp;#039;Hello World on the Tmote Sky!&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*Step 1 - Using the opened terminal window compile and upload the Hello World program on the Tmote Sky.&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;
*Step 2 - Press the reset button on the Tmote Sky. The following message will appear on the terminal window - &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;
: 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;
*Step 3 - Press Ctrl-C to quit.&lt;/div&gt;</summary>
		<author><name>Deepanker</name></author>	</entry>

	</feed>