
Contiki: The Little-Known Open Source OS That Rules the Internet of Things - maaarghk
http://www.wired.com/2014/06/contiki
======
joshstrange
>> Contiki will soon face competition from the likes of Microsoft, which
recently announced Windows for the Internet of Things [0]. But while
Microsoft’s new operating system will be free for devices less than 9 inches
in size, it won’t be open source. And Contiki has an 11-year head start.

What? Why even mention windows here, these two OS's aren't even close to being
in the same category other than they share the price tag of "free". I'd like
to see windows try to run in under 128mb let alone the 1mb for linux or the
mere kilobytes need for Contiki. A windows mention here seems very out of
place.

[0] [http://www.wired.com/2014/04/free-
windows/](http://www.wired.com/2014/04/free-windows/)

~~~
gedrap
Well, it's Wired. You shouldn't be surprised, as it's how the do it all the
time :)

~~~
Alupis
Unless Microsoft throws everything out and starts fresh, it's doubtful they'll
ever have a serious contender for the embedded market.

------
jortiz81
It's interesting to see that Contiki is taking the lead in this space, since
it was once going toe-to-toe with another open source OS for wireless embedded
networked devices, TinyOS. TinyOS had a large following in the research
community and I believe it was used in several commercial sensor network
deployments by Dust Networks and Arch Rock and at least one other Korean
startup company -- that i believe is still using it in their deployments.

Adam Dunkel has done a nice job of pulling Contiki from the obscure research
community and into the commercial space and is riding the "internet of things"
wave right now. We'll see if it lasts. I'm not familiar with what developments
have taken place on their OS since maybe 2010 or so.

~~~
ldite
I think a major factor is that TinyOS is written in nesC, so to bootstrap it
on a new device you first have to get the nesC compiler ported, _then_ get the
OS working. Contiki, meanwhile, is written in fairly vanilla C.

~~~
fdkz
Output of the nesC compiler is one big C-file, so no problems there.

------
ldite
Note that it's got a pretty good emulator, with a VM image to get you up and
running fast:

[http://contiki-os.org/start.html](http://contiki-os.org/start.html)

(ironically a 1GB download for a Micro-OS)

The emulator lets you do interesting things, like experimenting with mesh
networking, that would require quite a lot of hardware to try for real. (Plus
it's a lot quicker than flashing 15 nodes every time you make a bugfix!)

~~~
arethuza
Yeah - that emulator looks amazing. But dealing with large scale enterprise
application in my day job I was struck with the desire to have a wee
_physical_ device (or devices) to play with - and the small scale of Contiki
really appealed.

~~~
pling
I bought a calculator for that (HP 50g) then found it had 1700-odd pages of
manuals and reference information!

------
SwellJoe
The last time I read about Contiki, all of the screenshots were running on a
C64. And it looked _awesome_! It made me want to play with it on my C64. The
current website is all boring network simulation stuff. Looks like a
corporation.

But, I'm happy to hear Open Source continues to make inroads into the embedded
space. There's billions of devices out there that sometimes people's lives
depend on running a terrifying array of proprietary and unmaintained software
that is potentially broken in subtle (or not so subtle) ways.

Edit: Here's all the stuff about ports to a variety of awesome hardware:
[http://hitmen.c02.at/html/tools_contiki.html](http://hitmen.c02.at/html/tools_contiki.html)

~~~
stinos
_proprietary and unmaintained software that is potentially broken in subtle
(or not so subtle) ways_

You almost make it sound like proprietary per default is or can be broken
while open source is not, that's a bridge too far :P Don't forget that big
companies like TI make money of both the hardware and the software (Code
Composer Studio IDE which is used for pretty much all there DSPs etc) and do
put lots of effort in making everything run properly. Anyway, bugs are
everywhere.. Anecdote: I have used CCS for years while not encountering any
problems at all, while in the same timespan I used open source toolsets I did
find some bugs. Then again, same timespan in using other closed source
toolsets there wre bugs as well so there's no clear winner imo.

~~~
zwieback
Right, major micro/CPU manufacturers, especially TI, occupy a unique position
regarding software tools. They have a long history of very high quality tools
with thorough documentation. And when bugs do occur the level of detail in the
errata always surprise me. The quality of output from TI, ST or Intel is on a
totally different level from anything I've seen in the open source world. I
think the established HW vendors have a different mindset from SW companies,
where open-source now is often the better choice.

Having said that CCS is based on Eclipse, at least when I used it a few years
ago.

~~~
npsimons
_Having said that CCS is based on Eclipse, at least when I used it a few years
ago._

To me, this speaks volumes: it _clearly_ shows that open source _is_ as good
(and in many cases better) than closed proprietary. Granted, as you said, code
quality has more to do with the people behind the code than anything else, but
it still stands that at least with open source, you're not SOL when (not _if_
) something goes wrong.

------
INTPenis
I love this, I remember back when Adam Dunkels came up with this and feeling
proud that he was from Sweden.

Here's a quote of his I kept with me from those days, paraphrased.

    
    
        When I program I always try to code as if I'm writing for a PDP-11. 
    

So no wonder he made such compact C code for the C64.

~~~
MrBuddyCasino
Slightly OT, but I'm constantly amazed what swedes manage to pull off,
considering their small population size they have a lot of impact.

~~~
nickbauman
Their government pays people to write free software.

~~~
Zolomon
What? I have never heard of this as a Swede, what are you referring you?

~~~
fetbaffe
In the same way polar bears roam the streets.

------
thelucky41
I'm using this wonderful operating system for my own sideproject for LED
juggling props.

Aside from the strong hardware support and large community behind it,
Thingsquare has recently released it's slides from their training classes on
Contiki that give an excellent overview. Porting an already existing platform
to my own custom hardware has been relatively painless compared to Linux or an
RTOS, though it is difficult to make Contiki's makefile based workflow work
well in an IDE.

Cooperative protothreads are surprisingly easy to work with, and the IP/mesh
networking stack is highly configurable at each layer. Combined with an
excellent overall code quality, this is the very first open-source project
I've ever really wanted to get involved in.

~~~
hoprocker
Those props sound interesting! Are you embedding the LEDs and circuitry in the
juggling apparatus itself, or putting them in some stage props?

------
maaarghk
[https://www.youtube.com/watch?v=OMzgp7xTp1k](https://www.youtube.com/watch?v=OMzgp7xTp1k)

Some example of Contiki running and browsing the internet on 20 year old
hardware with 64k of ram (Apple IIe)... video is a few years old but still
impressive.

I think I want to try and get this running on some atmel hardware just for fun
:)

------
sieve1234
I am unsure about this. It's big advantage is its size and that it does not
require as much HW support like Linux (like a MMU). The disadvantage is that
it's not a *nix and you loose the whole ecosystem (no Posix).

In my opinion the space that it occupies (the "Internet of Things"), is not
well-defined and it may be probably cheeper to use something like a full-blown
small computer (like the rasperry-pi) with Linux on it.

~~~
peterwwillis
The "Internet of Things" is marketing fluff, like "information superhighway".
What they mean is "we want to charge you for more shit with silicon on it so
we made up a new term". Raspberry Pi is waaayyyyy too big [and pricey] for
devices that are nothing more than a sensor and a gprs module.

~~~
sieve1234
I doubt that. I know there is research in sensor network (e.g. at my
university) and they say they want ulta-small low-power devices but the
experiments I have seen were never in need of that much small devices.

Of course there are applications were you want to go really low-power/extra-
small, but in that case even a micro-controller capable of running Contiki OS
is too big. What I want to say is, that the application space where you can't
deploy a small machine with Linux on it BUT it is feasable to have a small
machine with Contiki on it is pretty narrow.

~~~
retSava
I guess there's always some wiggle room on most deployments. However, where I
used to work, some of the guys at that department were conducting research on
flying foxes as their migration patterns southern to northern parts of
Queensland (Australia) were pretty much unknown (IIRC). The requirements there
gets pretty tough. Also, the power consumption becomes a major factor as it
will limit the amount of useful work the device can do, ie sensing,
communication etc.

Anecdote: I learned about another project where they studied opossums. They
put a collar with a small wireless device around their necks to track their
movements and habits, but couldn't understand why a disproportionate amount of
opossums died for some reason.... The reason was that the device had a small
red LED that would blink to indicate that it was working, and the opossum,
being a nocturnal animal became quite visible in the night, to the joy of all
predators :) :S

~~~
sieve1234
That's really funny because something similar was done at my unversity (I
think with bats, or maybe even flying foxes). I declined because although the
devices were really small and they assured me that the animals did not come to
harm I doubted that. It's like carrying around a big backpack.

This is getting OT, but sensor network applications and discussions often
neglect the problem of device recovery and I know there are projects were
sensors are not recovered and after they did their work (sensing stuff and
sending it to a post-processing node) they go out of energy and become ...
highly toxic waste.

------
davidw
So what kinds of things are people actually using this for here? Anyone doing
something interesting with it?

~~~
maguirre
I am currently working with a startup company developing controls for solar
water heating system, commercial lighting/climate control/monitoring and
finally monitoring for large conventional water heaters - exciting i know ;)
-.

~~~
noir_lord
I'm writing a system to take the Solar Thermal (and other technologies) UK
installation standards and automate a lot of it,

Bureaucracy as a Service ;).

Where in the world are you, I'm in the UK.

~~~
maguirre
I am in the US, get in touch with, We could collaborate maguirre at automatid
com

------
ausjke
This is well known in IoT field I assume, I used it a few years back, after
comparing with tinyos and such. Basically you have Linux, then FreeRTOS, then
Contiki, from large system to the tiny devices.

------
kqr2
Based on this embedded systems survey [1], FreeRTOS is actually quite popular.

[http://www.freertos.org/](http://www.freertos.org/)

[1]
[http://www.eetimes.com/document.asp?doc_id=1322014&print=yes](http://www.eetimes.com/document.asp?doc_id=1322014&print=yes)

------
arethuza
Can anyone recommend hardware for trying this out? I'm tempted to get a
Redwire Econotag II....

~~~
fit2rule
Arduino is pretty workable. Add shields, off you go .. See this:
[https://www.youtube.com/watch?v=OSTGMvvjDHE](https://www.youtube.com/watch?v=OSTGMvvjDHE)

~~~
swah
I don't quite understand how helpful an OS like this is in the kind of
programs you write for the Arduino (say a single loop or timer acquiring
temperature and publishing via radio).

And if you're using something bigger, like a Raspberry Pi, you would use Linux
anyway.

(But people are using it, so it must be useful. I just don't imagine the kind
of applications...)

~~~
chas
Microcontrollers are very useful if you have very tight power constraints
because they have much less complexity than application processors and thus
require much less power. For instance, the CC2538 uses ~1uA when sleeping
whereas the best I have seen quoted for a Raspberry Pi (using a SleepyPi
module), is ~500uA. [1]

This sort of OS is very useful in situations like wireless mesh networks where
the code is more complex than would be suitable for a super-loop architecture,
but the system is too resource-constrained to run something like Linux because
it is trying to hit power requirements.

[1] [http://spellfoundry.com/sleepy-pi/sleepy-pi-
faq/#What_Is_The...](http://spellfoundry.com/sleepy-pi/sleepy-pi-
faq/#What_Is_The_Power_Consumption_When_The_Raspberry_Pi_Is_Switched_Off)

------
bigbugbag
Please remove the facebook tracking snippet from the url before posting on HN.

~~~
dang
Thanks. We removed it.

------
stinos
Suported hardware: [http://contiki-os.org/hardware.html](http://contiki-
os.org/hardware.html). Lot of major players in there it seems.

------
dragonbonheur
The part I'm interested in for now. It will be fun to have it running inside a
C64 emulator on a $50 Android tablet
[http://contiki.cbm8bit.com](http://contiki.cbm8bit.com)

------
Cuuugi
I wonder about name liabilities with the other famous Contiki.

[http://www.contiki.com/](http://www.contiki.com/)

~~~
qbrass
It worked out okay for Python.

------
perone
Little-known ?

