
Chirimen, a Firefox OS-Powered IoT Single-Board Computer Developed by Mozilla - SnaKeZ
http://mozopenhard.mozillafactory.org/
======
beardicus
Welp. Two hours in and the comments are shaping up as you'd expect on HN.

Is it really so hard to empathize with people who have different skill sets
than yourself? Yes, C would be more efficient. Yes, this wouldn't be very cost
effective used in a high volume product. Yes, it's a little funky to write a
web page just to plonk your script tag in there.

But, if you spend all day doing front-end dev with jQuery and just want to
prototype some blinky lights or a flood sensor in your basement, now you've
already got all the skills you need. You're not producing a million units,
you're not worried about power so much as it'll be plugged in. An evening with
a soldering iron and your text editor and off you go.

Anyways. For prior art on this ecosystem, see janOS:

[http://janos.io/](http://janos.io/)

which is basically stripped down firefoxOS which runs your app only (none of
the launcher crud and such) in god-mode. It's actually quite fun to go grab a
$30 phone off of ebay, and have a nice programmable screen and sensor suite
with wifi, gps, and cell connectivity. Indeed, I find it more compelling than
this board they're releasing, because I like taking advantage of the cheapness
of mass manufacturing. The only downside is it's difficult to impossible to
break out any GPIO on phones.

~~~
pjc50
I agree, and I come from an old-school C and embedded background. If you do it
in C, you have the opposite problem: interacting with the hardware is easy,
speaking to a web API becomes a huge pain.

There's an "impedance mismatch", which has to be overcome somewhere. And
computing power is getting cheaper and cheaper. We're at the point where if
you have a little board in a case with some I/O connectors, the CPU will be
the _least_ expensive part. Casework and connectors will make up a
surprisingly large part of the cost, often costing whole dollars!

Edit: also, debugging your C microcontroller program can be quite a pain, even
once you have a correctly configured in-circuit debugger.

~~~
frik
If you know C, you will love Arduino. It's very easy to "to speak to a web
API". They are usually low power 8-bit CPUs with 16 MHz, exactly right for
small projects like blinking some lights that should run on battery for years.

JavaScript/Python/etc on RaspherryPi or this new Mozilla thingy are
interesting too, though will drain your battery faster. You need an OS on a
32bit CPU. If it's connected to the web you should also update the software
stack.

~~~
jjoonathan
> If you know C, you will love Arduino.

Isn't it the opposite? If you aren't comfortable with C, Arduino has a simple
enough API and good enough tutorials+documentation that you can still make it
work.

If you _are_ comfortable with C, just about everything is better than arduino
because you'll get debugger support and full control over all the goodies like
clocks, charge pumps, DMA controllers, asynchronous ADC operation, pin
multiplexers, USB/Ethernet controllers, etc.

~~~
HeyLaughingBoy
I live in the middle. For quickie little projects like my NMEA protocol
converter, the Arduino tools & IDE are fine, if barely adequate as the project
has grown.

However, I have another project where Atmel Studio is a better choice. So I
import all the Arduino libraries I need (there's a plugin that can do this
automatically, but it's buggy), and then just build it as a regular C++
project but I get "free" use of the libraries without the crappy Arduino IDE.

The nice thing about Arduino is it's so popular that the economies of scale
let me buy hardware cheaper than I could build it myself and pretty much all
the libraries I need are already written. Although I have had to debug a few
of them!! The bad thing is their terrible interface that's really made for
tiny programs only.

------
wycx
Specs:

SoC: RK3066 Memory: DDR3 1GB NAND Flash: 1GB microHDMI female microUSB x 1
(OTG) USB x 1 microUSB x 1 (UART debug) GPIO > 1 (Configurable) I2C 2 UART 2
SPI 2 Audio analog stereo IN x 1 / OUT x 1 PWM 1 Analog IN x 1

~~~
vertex-four
Note that everyone's missed - it has HDMI out. This is looking more at smart
devices that display information and which you can interact with directly,
rather than devices which you configure occasionally and which are hidden
otherwise.

Additionally, this is likely a DIY/hobbyist board and a reference device - any
major company doing their own thing will likely be building their own devices.
Mozilla isn't in the B2B business.

~~~
makomk
Which is useful for early prototyping I guess, but does it have any way of
interfacing to non-HDMI screens? You wouldn't want to use HDMI for a product,
and even for DIY hobbyist stuff it's probably not ideal; small HDMI screens
with touch are exotic, expensive, and not all that small.

~~~
e12e
Is there any reason they'll _remain_ exotic, expensive and not that small? (I
don't know what interface the typical high-dpi oled touch screens use, like
the ones you find on a Galaxy Note 4 etc) -- but it seems that HDMI might make
perfect sense for a tiny 4k screen (and it seems reasonable those will become
more and more common)?

~~~
makomk
Devices don't use HDMI to talk to their built-in screens due to licensing
fees, complexity, etc. Usually it's either LVDS or embedded DisplayPort these
days, with newer/4K screens being more likely to use DisplayPort and older
ones generally using LVDS.

------
dafrankenstein2
//We will share openly the firmware code, board design, manufacturing process,
API spec, and all necessary sources. //

thats a good thing bcoz firmware code is not open in Raspberry PI

~~~
throwaway7767
It remains to be seen whether this applies to _all_ firmware on the device.
Hopefully it does, but I've seen too many similar claims by hardware
manufacturers that turn out to mean "only these specific firmware bits".

------
mundanevoice
Mozilla does so many things. I am afraid they loose their focus on one thing
they could have done best. Make the best open source browser of the world.
Look how they abandoned firefox OS phones. They shouldn't hope to become
Google by doing almost everything Google does. Google is way bigger and has
better Engineers.

~~~
thristian
The thing is, making "the best open source browser of the world" has never
been a priority for Mozilla. Their stated goal has always been "to promote
openness, innovation & opportunity on the Web".

The first thing they made was a web-browser, because they had all the pieces
and all the people right there, they had a good idea how to do it, and because
the biggest threat to openness, innovation and opportunity on the Web at the
time was the dominance of Internet Explorer.

These days, Mozilla must be less focussed because there's no single dominant
threat to focus on. There's things like video patent codecs, DRM, promoting
HTTPS, the ever-increasing complexity of the browser stack, the enticing power
of native mobile apps, the lack of an awesome funding model for freely-
distributed content, the return of walled-garden content platforms...

They could focus on making Firefox awesome and abandon all the rest of those
issues, then we'd have a nice browser but we might have a much less
interesting and useful Internet to browse with it. I do not envy Mozilla's
leadership in the slightest right now, they're making a bunch of very tough
decisions and nobody will know if they did the right thing for maybe five or
ten years.

~~~
mundanevoice
> These days, Mozilla must be less focussed because there's no single dominant
> threat to focus on.

I don't think this is the right way. Having two much on the plate can actually
be negative and you might end up doing nothing really well. I don't think that
Mozilla should only be working on Firefox, but rather select few more which
manage to do properly. We need a focused Mozilla, not a scattered Mozilla
which tend to do everything that's a FAD (For eg: IOT)

------
raffomania
I never understood why people want to use browser technologies for the
internet of things.

~~~
userbinator
I think it's just unfamiliarity with anything else, and unawareness of the
staggering complexity this introduces. Also, this is Mozilla who have a large
concentration of people familiar with browser technologies.

On the other hand, I think IoTs with web interfaces aren't a bad idea.

~~~
jacquesm
> I think IoTs with web interfaces aren't a bad idea.

I think it is. The internet-of-things does not need to suffer from massive
power consumption and hard to implement on the micro-controller scale
protocols.

It needs something much more along the lines of encrypted UDP than that it
needs to use 'web technologies'. Imagining a stack made on 'web technologies'
running off power harvested over a relatively long period of time is painful.

~~~
userbinator
I had in mind more things like routers, home automation management consoles,
etc. which have had web interfaces for a very long time, but it doesn't take
all that much power to do it[1], unless you want to run a full Linux kernel
and JS and all that other bloat which tiny IoTs don't need.

[1] [http://www-ccs.cs.umass.edu/shri/iPic.html](http://www-
ccs.cs.umass.edu/shri/iPic.html) (images also mirrored at
[http://cc2.savs.hcc.edu.tw/~chuavv/smallest/iPic/ipic.html](http://cc2.savs.hcc.edu.tw/~chuavv/smallest/iPic/ipic.html)
)

~~~
TeMPOraL
Indeed. Basic web technologies - client-side HTML, CSS and JavaScript (and I
mean writing them directly, not via absurdly wasteful layers of JS frameworks)
- are a great tools for adding UIs to connected devices. You don't need _that_
much resources for a HTTP server if you already have TCP/IP connectivity, and
you also don't need much resources to output some rudimentary HTML or to
process POST requests.

It's also a pretty cool tool for adding UIs to software you code locally.
Embedding a HTTP server is simple in most languages, and for some cases, a web
interface will be much simpler than building an equivalent from "native" UI
components.

\--

Incidentally, one of the best demonstrations I saw of that was in the book
Land of Lisp. The book teaches you Common Lisp by guiding you through writing
a few games. At some point, you end up embedding in your game a _very_ simple
HTTP server - and suddenly, you get to have interactive graphics (via SVG)
without the author having to teach you lots of stuff about some random UI
library.

------
ohitsdom
<title>CHIRIMEN example - Led</title>

Weird code like this is what you get when you apply web technologies to
hardware. But I guess I should wait until their docs come out, maybe the title
tag will be used by something.

------
msh
They properly have a better chance here than with FFOS, there are no carries
to interface with and the audience is developers who know mozilla in advance.

------
davb
I opened this on my phone, and just seen some links (MozOpenHand Links). I had
no idea there was supposed to be more content here. The actual content is
hidden for mobile UAs (I have no idea why, but it's very confusing).

I'd have expected more from a Mozilla project.

You can see what I'm talking about by spoofing a mobile UA in your browser.

------
vinceyuan
Obviously Mozilla still doesn't know why Firefox OS/phone failed.

~~~
SunboX
that's simply wrong. FxOS for phones didn't fail and Mozilla knows whats going
on. Maybe some bad communication and PR, that's sad.

~~~
vinceyuan
> _FxOS for phones didn 't fail_

Any new phone shipped with firefox os? Nobody buys it. It totally failed.

~~~
SunboX
Depends on what you define as goal. It's mainly dedicated to developers.
[http://elioqoshi.me/en/2016/01/schrodingers-firefox-
os/](http://elioqoshi.me/en/2016/01/schrodingers-firefox-os/)

------
Animats
Programming a single-board computer in JavaScript is reasonable. But why embed
the JavaScript in HTML? There's no browser, no screen, and no user.

------
daveloyall
Off topic: TIL that in Japanese, you start a letter by stating YOUR name,
rather than greeting your audience.

Accurate?

------
jokoon
"Make Real Things with Browser Technologies"

How is that better or so different than making real things in C ? What problem
would it solve?

I get that js got very popular thanks to browsers, but does that mean we
should use js for everything?

Seems like mozilla is just trying to salvage firefoxOS.

~~~
Already__Taken
I've developed a few things on my Espruino Pico[1] board, some Raspberry pi
and also so arduino things. Just toys really.

One of the nice this I've found with the Pico is because of the JS vm, when I
don't do anything in the code all the power in the chip goes to sleep state,
and just wakes up for me as I've got scheduled. Yes Arduino has sleeps but
i've also go to go learn that as another thing, yes the Pi can be configured
so but that's even more tinkering.

JS seems like a really great "Just get it done" sort of phase to work in.
After that you'd no doubt make a better job of the project with a myriad of
other technologies.

1: [http://www.espruino.com/Pico](http://www.espruino.com/Pico)

~~~
swiley
C does that too unless you sit in a tight loop polling something all the time.

~~~
mwambua
Most embedded applications consist of a tight loop of constant polling. People
slow things down by using delays... But if you use the wrong sort of delay
(read: the most popular one
[https://www.arduino.cc/en/Reference/Delay](https://www.arduino.cc/en/Reference/Delay)),
you'll end up executing nops instead of powering down the processor

~~~
benten10
What would then be the right way to sleep? I've always wanted to do something
like 'sleep until event <X> and do absolutely nothing till them', but end up
using the delay every time.

~~~
Fradow
From what I searched, it's dependant on your microcontroller, so there is no
generic way to do this (since different Arduinos have different
microcontrollers).

For a very low power project I had, I basically found a lib that did deep
sleep correctly for my microcontroller (an ATTiny), then you sleep for a
significative period of time each time (for example, 500ms), and check if the
event happened when sleep ends. That results in a consumption under 10uA.

It is obviously very dependant of what you want to do, some applications can't
afford to check only every X ms.

And be careful too, you need to put everything possible behind your
microcontroller, to be able to disable things during sleep (otherwise, you are
just powering the rest of your circuit for nothing).

------
ilaksh
I am actually hoping for something like web assembly versioned modules with a
p2p module registry to become popular for iot, blockchain, everything. Web
assembly is actually a language-agnostic abstract syntax tree which can be
JITd/compiled across architectures.

------
moondev
This is pretty cool, but imo raspberrypi is making micro-controllers obsolete.
Why would you bother with such a limited environment when you can have a full
linux environment + GPIO for like $10 more.

~~~
TFortunato
In many cases, sure, however there are definitely cases where microcontrollers
still make sense, i.e. real-time control, low power applications.

I work in embedded systems, and a lot of the reason you would choose a
microcontroller is all of the peripherals that are also part of the chip. For
example, if you are doing a project where you need to control motors, you can
get a micro with a lot of built in high resolution timers , built in hardware
for motor commutation, decoding of encoder signals, high speed analog inputs
for feedback, etc. You would also typically AVOID having a linux environment,
and opt for either a hand coded loop, or an RTOS which gives predictable,
deterministic performance.

In my particular industry (robotics), we definitely do like to use a more
powerful computer with linux or some other high level OS on it for a lot of
the high level intelligence, so a lot of what you end up seeing is almost a
'distributed system on a board', where you have a more powerful processor
providing the intelligence, which then issues commands to the less powerful
microcontrollers which do things like control motor torque, sample sensors,
etc...

This doesn't even get into things like power consumption...simply put you can
have microcontroller based systems run for months on a single coin cell
battery, which is going to be a hell of a lot harder to pull off on a RasPi /
linux based system.

All that said, for a lot of projects where you just want to monitor a few
simple sensors, or do a basic home automation type of project, a RasPi can be
a great choice! (Even if my inner engineer is screaming 'your over
complicating it!') But there is definitely still a huge need and use for
micro-controllers as well.

Hope that helps answer your question!

~~~
moondev
Thanks for the details. Yeah that makes a lot of sense. I was looking at it
from a home automation perspective. I have both a photon particle and a raspi.
The raspi just opens so many more doors for me, but power consumption is not
an issue since I always have it plugged in.

------
dafrankenstein2
good job mozilla. this will also promote firefoxOS

------
cguess
Creating an entire HTML page structure just to get to the code because you
need a <script> tag? Oh god.

~~~
0x4a42
You don't need to create the whole page structure like in the example though.
html, head and body tags are optional under certains conditions. [1]

I guess you could just write the example code like this :

    
    
      <!doctype html>
      <script src="gpio.js"></script>
      <script>
      var v = 0;
      GPIO.getPort(196).then(
        function(port) {
          setInterval(toggleLight, 1000, port);
        }
      );
      function toggleLight(port){
        v = v ? 0 : 1;
        port.write(v);
      }
      </script>
    

Just having the script tags would also probably works in most browsers but it
wouldn't be standard compliant (if you care about it...).

[1] [http://www.w3.org/TR/html-markup/](http://www.w3.org/TR/html-markup/)

~~~
mhandley
The equivalent stock Arduino demo is blink:

    
    
      void setup() {
        pinMode(13, OUTPUT);
      }
    
      void loop() {
        digitalWrite(13, HIGH);
        delay(1000); 
        digitalWrite(13, LOW);
        delay(1000); 
      }
    

From my experience of teaching many non-programmers how to use this sort of
device, I think I'll stick with Arduino for now.

