Presentation is loading. Please wait.

Presentation is loading. Please wait.

Contiki OS Sharvil Patel, Michael Ray, Emily Rowland 1.

Similar presentations


Presentation on theme: "Contiki OS Sharvil Patel, Michael Ray, Emily Rowland 1."— Presentation transcript:

1 Contiki OS Sharvil Patel, Michael Ray, Emily Rowland 1

2 Agenda ●Introduction to Contiki with History ●Components ●Applications ●Conclusion 2

3 Introduction ●Real-time operating system ●Specializes in Internet of Things (IoT) ●Low power oriented ●Open-source (github.com/contiki-os) ○Free in commercial and noncommercial applications ●Easy/Fast rapid development ○Developed in C ●16 supported hardware platforms 3 https://github.com/lab11/atum http://www.ofrei.com/images/multi-draincell.jpg

4 Specifications ●Extremely lightweight ○10 kB of RAM ○30 kB of ROM ○Fully functional system including GUI requires 30 kB of RAM ■Linux uses 1 MB! 4

5 History ●Created in 2002 by Adam Dunkels Ph.D. ○Author of the uIP stack, Rime, protothreads ○Founder of Thingsquare ●Now developed by a worldwide team ○TI, Atmel, Cisco, Oxford University, SAP, etc, & you! 5

6 Applications ●City sound monitoring ●Street lights ●Networked electrical power meters ●Industrial monitoring ●Remote house monitoring ●Radiation monitoring ●ATUM 6

7 OS components ●Processes ●Protothreads ●Communication stacks ●Full IP networking ●Memory allocation ●Timers ●Power awareness ●Sleepy routers ●Cooja networking simulator ●Coffee - flash file system ●Rime stack ●Watchdog 7

8 Processes All programs in Contiki are processes There are cooperative and preemptive contexts https://github.com/contiki-os/contiki/wiki/Processes#The_Process_Thread 8

9 Protothreads ●Mix of event-driven and multithreaded programming mechanisms ○Kernel invokes a process’ protothread in response to an event ●Non-preemptive ○Blocking event-handlers ○Context switches only available on blocking operations ●Stackless ○Global variables are required for preserving variables across context switches ●http://dunkels.com/adam/pt/expansion.html 9 http://dunkels.com/adam/pt/

10 Protothreads (continued) ●Extremely lightweight ○Overhead: 2 bytes (plus no stack) ●Portable ○Can be used with/without an OS ○Pure C code (macros) 10 https://github.com/contiki-os/contiki

11 Communication Stacks ●4 types ●Rime ○Lightweight communication stack ○When full IPv6 networking is overkill ○Simple operations (single message sending) ○Layered stack ●uIP ○TCP/IP stack ○Meant for 8 bit and 16 bit devices ○Very low RAM and overhead code 11 Rime uIP 6LoWPAN IPv4 Lightest Heaviest http://dunkels.com/adam/dunkels07rime. pdfhttps://github.com/adamdunkels/uip

12 Communication Stacks (continued) ●IPv6 Ready certification ○Developed by Cisco ○Smallest IPv6 stack when it was created ●6LoWPAN ○IPv6 over Low power Wireless Personal Area Networks ○Specializes in low power IPv6 communication ○Allows send/receive over IEEE 802.15.4 ■Same network as Zigbee ●Capabilities: UDP, TCP, HTTP 12 http://www.ti.com/lsds/ti/wireless_connectivity/6lowpan/overview.page http://www.tldp.org/HOWTO/Multicast-HOWTO-2.html Rime uIP 6LoWPAN IPv4 Lightest Heaviest

13 Memory Allocation ●3 types ○memb memory block ■Static memory struct ■Most common ■Lightweight ○mmem managed memory, ○malloc - standard C library https://github.com/contiki-os/contiki/wiki/Memory-allocation 13

14 Timers ●Uses: time elapsed, low power wake up, real time scheduling ○Timer & STimer ■Set, reset, check expiration manually, time remaining ○Etimer ■ Timed events, repeated ○Ctimer ■Call a function when expired ○Rtimer ■For real-time tasks, preemptive 14

15 Power awareness ●Designed for small systems and to last on a pair of AA for years ○Dr. Kevin Fu ●Provides mechanisms for energy management and system power consumption ●Uses timers to figure out where more energy was spent 15

16 Sleepy routers ●Power saving feature ●When devices are used as relay-nodes, or routers, in wireless networks, Contiki allows these nodes to sleep between packets 16

17 Cooja networking simulator ●Simulates Contiki nodes ●Emulated node ○Complete hardware emulation ●Cooja node ○Contiki code executed in the simulator ●Java node ●Uses: ○Swarm intelligence ○Indoor localization 17 https://github.com/contiki-os/contiki http://www.contiki-os.org/start.html

18 Applications 18

19 Applications -- Koubachi Garden Sensor Wireless, connected garden sensor Data on water, temperature, and light WiFi Connected 2 AA Batteries Push notifications and lookup database http://www.koubachi.com 19

20 Applications -- LIFX Color Changing Lights Adjusts color, warmth, brightness and intensity Can be set to adjust via schedule Connects with: Apps, IFTTT, Nest Products, Samsung SmartThings, Amazon Echo, and others Contiki: Wireless connectivity http://www.lifx.com 20

21 Applications -- Life of a Badger Sensor Collars with Microcontrollers running Contiki “Detailing badger behavior and locations underground was impossible” - Dr. Andrew Markham Data sent wirelessly Researchers using network maps of collar nodes http://www.bbc.com/news/t echnology-13751740 21

22 ATUM ●Created here at U of M ○Available in lab for our final projects ●Project requirements: ○“Connected” - network enabled ○Low power ○Responsive ○Small ●Uses: ○Timer (for PWM) ○Protothreads ○Interrupts 22 https://github.com/lab11/atum

23 Questions? 23

24 Resources Getting Started http://www.contiki-os.org http://www.eecs.umich.edu/courses/eecs373/Lec/RTOS_short.pdf https://github.com/contiki-os/contiki Protothreads http://dunkels.com/adam/pt/expansion.html https://engineering.purdue.edu/dcsl/reading/2009/rpanta-protothread.pdf Networking https://github.com/adamdunkels/uip http://dunkels.com/adam/dunkels07rime.pdf http://www.tldp.org/HOWTO/Multicast-HOWTO-2.html http://www.ti.com/lsds/ti/wireless_connectivity/6lowpan/overview.page 24

25 Bibliography http://www.contiki-os.org http://contiki-os.blogspot.com http://www.thingsquare.com/customers/ http://www.lifx.com http://www.eecs.umich.edu/courses/eecs373/Lec/RTOS_short.pdf http://www.koubachi.com http://www.bbc.com/news/technology-13751740 https://github.com/adamdunkels/uip http://dunkels.com/adam/dunkels07rime.pdf https://engineering.purdue.edu/dcsl/reading/2009/rpanta-protothread.pdf 25

26 mmem and malloc heap memory allocators mmem is byte aligned, memcpy() or packed must be used malloc is the same as defined in stdlib.h https://github.com/contiki-os/contiki/wiki/Memory-allocation 26


Download ppt "Contiki OS Sharvil Patel, Michael Ray, Emily Rowland 1."

Similar presentations


Ads by Google