
Mongoose OS – An Open Source Operating System for the Internet of Things - j4mie
https://mongoose-os.com/
======
grive
> Prototyping and Scripting Engine

> Micropython Moving to production (C/C++) or factoring out critical pieces to
> C/C++ is not trivial

VS.

> mJS - JavaScript engine for prototyping and C/C++ for production

I don't know much about it, but from the surface it seems that the problem is
exactly the same? What is the benefit of prototyping in JS instead of Python?
In the end, either you refactor everything purely in C, or you use both in
your production system.

I see mJS does FFI to interface with other C routines. Why introduce a second
language to your project? This seems like a huge overhead for no benefit
(you're still expected to write C at some point). The language is only a
subset of JS, so "not JS", so no ecosystem and new assumptions you have to
redefine before getting serious with it?

Is it just me who thinks it's a bad idea? Would someone be able to explain the
advantage of going in this direction?

~~~
ntoll
Speaking from experience, using MicroPython is trivial and often "good
enough", as are implementing modules for MicroPython in C should they be
needed (C isn't my first language by a long shot, but I managed to write a
module for MicroPython with little problem).

Also, MicroPython has pretty much all the features of core Python whereas mJS
appears to have pretty much all the useful features of JS removed. Why not
just use C instead of mJS?

Finally, couching Mongoose in a way that criticises the efforts of others is a
bit of a turn off for me. Give me positive reasons for using your product
rather than bashing the people you believe are your competitors. The culture
and community of a project is important - negativity such as this is a
worrying signal.

~~~
askvictor
> Why not just use C instead of mJS?

Perhaps mjs has a repl? Don't really know, but that would be the only real
advantage imo.

------
mijoharas
> GPLv2 license: FREE FOR NON-COMMERCIAL USE

This confuses me, the GPLv2 doesn't say anything about commercial use, it
merely says that you need to redistribute the source code to anyone that you
distribute your software to.

Have they placed additional restrictions on the GPL (which I believe you are
prohibited from doing)? or are they just trying to highlight that they are
dual-licensing it under a license that isn't copyleft if you pay them (since
lots of companies have no-gpl policies)?

~~~
jpfr
GPL does not allow static binaries from both GPLed code and commercial code.

A workaround is a plugin mechanism with dynamic loading of .dll or .so
libraries. But that won't fly on a microcontroller.

~~~
greenhouse_gas
.dll won't help with GPL, only with LGPL (IANAL)

~~~
yebyen
I think you have it backwards, if I am interpreting your very brief statement
fully correctly...

If you are building a library and you want it to be open source but also
usable by products that are not open source, you can use LGPL. If you are
building a proprietary library and you want to keep it proprietary, but link
it into a GPL application, I _think_ there is nothing is stopping you from
doing that.

You still have an open-source application, it just won't work without the
proprietary library.

(This sounds like it should be against the letter of the GPL, but as a thought
experiment, pretend someone else wrote the library. Say, Nvidia, and you are
Linus. You have no control over how their library gets licensed, and there is
no person or body which can stop you from releasing your own code as GPL, even
if it may have branches that depend on proprietary code.)

Doing OSS this way is most certainly against the spirit of the GPL, but I
think it is within the letter.

~~~
mbel
You read the previous statement backwards. OP meant: dynamic linking allows
you to use LGPL libraries with proprietary applications; to use GPL libraries
in your application you have to make your application free even if you are
linking dynamically.

~~~
yebyen
Yes, but neither one prevents you from linking proprietary libraries into your
OSS application.

> .dll won't help with GPL, only with LGPL (IANAL)

Was pretty much totally ambiguous about what exactly was meant.

~~~
yebyen
Am I wrong?

------
dmitriid
> FEATURED COMMUNITY PROJECTS

> Door bell - ESP32, AWS IoT

> Door sensor - ESP32, MC-38, AWS IoT/MQTT, SNS

> Smart heater on AWS IoT

> IoT doorbell that works via MQTT - generic MQTT server, AWS IoT, Google IoT,
> etc

Why the hell would I want my door bell be controlled via MQTT on AWS?

~~~
planb
It's not on AWS but runs on a local raspberry pi, but my doorbell signals via
MQTT that someone ringed. This makes my security camera take a picture and
sends a push notification to a custom made iOS app which shows who's in front
of the door on my apple watch. If I'm logged in my home wifi, I can even open
the door with a button directly from this notification. I would argue that I'm
not the only one who finds that useful.

~~~
GordonS
Is "signalizes" a word? Did you mean "signals"?

~~~
planb
Thanks, I've corrected it.

------
kierenj
You had me until the "Pricing" section.

The Old Way - Varies, depends on many factors. Requires ongoing investments,
hiring developers or integrators

The New Way - GPLv2 license: FREE FOR NON-COMMERCIAL USE / Commercial License:
CONTACT US

So with Mongoose OS, you don't have to invest, or hire developers? Am I being
unfair by thinking that, while the other points make life easier, this is
scraping the barrel a bit?

Why not just say "and the price which gets you all of these advantages is.." ?

~~~
Spivak
Are you annoyed that they're selling commercial exceptions to the GPL or that
they're not listing the price on the page?

~~~
asmithmd1
The latter. Just give me an idea of the order of magnitude of the price. Is a
commercial license closer to $1000 or $100,000?

------
robinduckett
Bit of a confusing name, when there is already an extremely popular mongodb
node.js framework called Mongoose

~~~
mijoharas
Also confusing as there is a small mammal that eats snakes called mongoose.

~~~
rena-anju
Also confusing when there is a vehicle in the Halo series called Mongoose.
Confusing, confusing...

------
monocasa
I really fail to see what this brings to the table.

In the section on their main page contrasting with arduino, they bascailly
just say that they're more reliable, with nothing to really back that up.

Looking at their documentation, I don't really see how they can make that
claim. The issues with Arduino's reliability stems, IMO, from the fact that
Arduino code isn't an RTOS. Ie. there's no separation of real time priorities.
This also seems to not really be an RTOS either, just a fancy bare metal
environment.

What is this structurally bringing to the table beyond Arduino other than "we
think we wrote the code better"?

~~~
Rebelgecko
I'm thinking about using Mongoose for a future project (as opposed to Arduino
IDE or the ESP SDK directly) I think the advantages are:

Security: TLS 1.2, x509 certificates, ability to stop random people from
flashing your board)

Remote management: OTA process doesn't seem that different from other methods,
but they have some other nice things. For example they make it really easy to
separate your code from your configuration.

~~~
monocasa
> ability to stop random people from flashing your board

That part in particular seems like a really bold assumption.

~~~
Rebelgecko
I haven't read over their encryption code, but even if it's not enough to stop
a determined hacker it's still better than nothing.

------
Dowwie
"The old way: Micropython" <\-- what? really? old, already? They're just
getting warmed up, baby.

~~~
ageofwant
Damn right. Mid level python dev in my team builds Django views on one screen
and programs the embedded micropython board that sits on the drill in the pit
on the other, all while cajoling with his millennial tribesman in the chat app
du jour. Can't beat that.

------
skratlo
But why Javascript? Clearly another hype-driven project. Please, use reason
not hype when deciding on technology. This is fast food

~~~
recursio
Is it not reasonable that any Joe Schmo can easily build both front end UI's
and servers with one of the most adopted languages?

~~~
petecox
I'm reminded of earlier efforts using Firefox OS which sought to create a "Web
of Things". I'd didn't get around to backing the Runcible project but watching
Aubrey's video below, I hope it succeeds.

[http://janos.io/](http://janos.io/)
[https://www.youtube.com/watch?v=0qgIObR6jGs](https://www.youtube.com/watch?v=0qgIObR6jGs)
[http://mono.hm/](http://mono.hm/)

------
dankohn1
If you're considering embedded OS options, please look at these two
(completely free) projects from the Linux Foundation:

Yocto project creates a custom embedded distro based on your needs
[https://www.yoctoproject.org/](https://www.yoctoproject.org/)

Zephyr supports hardware that can't easily run Linux
[https://www.zephyrproject.org/](https://www.zephyrproject.org/)

~~~
drozd
Sure, try to run those on e.g. TI CC3200 microcontroller.

~~~
sgt
Yocto does not seem to support CC3200.

~~~
drozd
That's right, cause Linux cannot run on the large class of microcontrollers -
particularly, those with less than 4M of RAM. Mongoose OS is targeting that
category.

~~~
dankohn1
Zephyr is an open source OS that targets smaller microcontrollers.

------
anujdeshpande
A recent tweet that I found funny - "Every time a conf organizer accepts a
talk about #IoT using JavaScript ... somewhere in the world an IoT/embedded
developer ... dies !"[1].

On a serious note though - Does anyone know a mass manufactured product (based
on a uController) that actually uses anything other than C/C++?

Rust is a strong contender too, surprised to not see it mentioned here. See an
older discussion about Rust on ARM Cortex M[2]

1\.
[https://twitter.com/ppatierno/status/894575063562936321](https://twitter.com/ppatierno/status/894575063562936321)
2\.
[https://news.ycombinator.com/item?id=14071282](https://news.ycombinator.com/item?id=14071282)

~~~
squarefoot
"On a serious note though - Does anyone know a mass manufactured product
(based on a uController) that actually uses anything other than C/C++?"

None that I know of, but ESP8266 and similar MCUs are so widespread that
probably there are lots of products using say nodemcu (ESP+Lua scripting)
under the hood.
[http://nodemcu.com/index_en.html](http://nodemcu.com/index_en.html)

Wifimcu is a similar product but uses a STM32F4 MCU.
[http://www.wifimcu.com/](http://www.wifimcu.com/)

I would personally love to see more use of Nim in this field; it just seem the
right tool for the job for being easy to learn, small, fast and powerful.

------
hardwaresofton
Does the world need another open source operating system for the internet of
things? I wonder if creating a new one was really necessary or if they could
have built on top of one that already exists.

While I can't say I know intimately all the problems that need to be solved
for IoT to responsibly reach mass consumption, but I'm pretty sure having an
operating system wasn't the problem. Maybe this is just an enterprise cash
grab?

~~~
jaboutboul
It's definitely not a cash grab as the project is open source. There are many
problems in this space that cannot be served using current solution,
especially in environments that are super resource constrained. For example,
this is made to run on a very small footprint of RAM, even smaller than what
an embedded Linux distro would use.

------
legulere
Written in C so we can continue enjoying IoT devices being exploited by buffer
overflows.

------
j4mie
If I wanted to make something that (say) reports sensor readings over MQTT to
AWS IoT, what firmware options are there? NodeMCU looked great (Lua!) but
doesn't seem to support X509 client certificates (which AWS needs). There's
Arduino, Mongoose, Micropython - any others? What's the best way to go?

------
p4bl0
It's sad that _security_ isn't one of the homepage sell points of this OS. It
feels like IoT is severly in need of serious "security by design". OS level
would be a good start.

~~~
jaboutboul
Security is actually one of the most important pieces of this puzzle and the
team is one of the team's top priorities. Agreed it would be good to talk more
about that on the homepage and everything that is being done in that respect.
Mongoose is actually one of the first embedded platforms that support AWS IOT
and X509 across multiple architectures

~~~
pjmlp
I fail to see how when C is part of the tooling.

------
daww
Unfortunately the documentation is lacking and mJS (especially the ffi) is
nowehere near production ready

------
bschwindHN
Why don't more people use FreeRTOS? I always find it to be a nice way to
coordinate all the tasks you need to run in an embedded system, without having
to manage a huge kernel like Linux. It's also free so there's that...

~~~
jaboutboul
This is based off of freertos

~~~
bschwindHN
Is it? I looked all over the site and don't see any mentions of "FreeRTOS",
"RTOS", "real time", "tasks", or anything else that would indicate it's based
off of FreeRTOS.

------
jaboutboul
Okay, so lots of comments on here and most of them are just plain wrong, FUD
or stem from simple misunderstanding. Also, lots of people not groking the
value proposition. Let me take a crack at clarifying some key points.

So first off, the project is GPLv2 whether you use it for commercial or non-
commercial use. The team's first language is not English, they are actually
Russian and based out of Ireland, so there is bound to be some confusion. What
they were basically trying to say with that, is if you need the extra features
and the backend, etc. Those are not GPLv2 but the project itself is--no matter
how you use it--is. I mentioned it to them team and they already corrected the
site.

Second, the value proposition behind this is tremendous. Remember the days
before Unix and DOS/Windows ran on every machine in the world? Every machine
had its own design, its own arch/cpu, its own OS, and its own interfaces.
Computing was cool, but each machine was really an island. If you wanted to
run your code on another machine then you had to port it over. Then Unix and
CP/M-80/DOS came along and you could write something on one machine and it ran
(almost) on anything with the same OS. Thats the name of the game here. This
is groundbreaking for embedded/IOT development.

Real embedded development is hard enough as it is. If you're doing a one off
project for something in your home, then its pretty straightforward. Now try
and take that to a mass production-scale product and the level of complexity
is increased 50x.

Imagine trying to bring a product to market, you need to pick a hardware
platform/MCU to build with. Now imagine your suppliers hit a chip shortage and
you can't use that chip, what do you? Sit back and wait for 6 months? What
Mongoose OS allows you to do is write your code once and run it on multiple
embedded platforms, you would just select another MCU, maybe make some minor
modification to the pinouts, flash the firmware and BAM, you are back in
business. Not to mention the fact that you have standard interfaces across all
devices, MCUs, etc. It just makes development so much simpler.

Not only that, but you now have to manage potentially hundreds of thousands of
devices (or millions if your product is really successful). What do you? How
do you handle firmware updates? How do you track status of all those devices?
How do you do customer support without a debug interface, well the enterprise
offering (or something like AWS IOT) will help you manage that process and
make your life a whole lot easier.

Now on the topic of why mJS vs. Python and a mix of C. You have to understand
that embedded development is often _EXTREMELY_ resource constrained. mJS fits
into ~25K of flash space and less than 1K of RAM. This is awesome. It affords
you the smallest possible functionality with the greatest possible
flexibility. Write your logic in js and then call C for anything more
critical/performance.

I asked one of the team members and basically what he said was (I paraphrase)
that mixing C with a scripting language is a pretty production ready solution.
Obviously its preferable to write the critical pieces in C and then the higher
level logic in the higher level language. It would be ideal if you could have
type safety and compile-time checks in the high-level language. The ideal
language to write logic in would be Go, and Go 2 promises to have a smaller
runtime/footprint so hopefully one day that will be a possibility.

In terms of everyone else talking about how the project is positioning itself,
well let's just say that marketing is a work in progress ;)

~~~
iancarroll
> mJS fits into ~25K of flash space and less than 1K of RAM. This is awesome.
> It affords you the smallest possible functionality with the greatest
> possible flexibility.

I agree, but having said that, I have been trying to use Mongoose on the
CC3200 and it is very difficult with Mongoose and mJS. Mongoose with mJS
occupies upwards of 225K of flash, and the CC3200 only has 256KB of RAM (and
the program must be loaded into RAM to execute). Plus I believe you lose
another 16K to the Mongoose bootloader.

But this is more of a problem with the CC3200, admittedly; 256KB of RAM isn't
great for an internet-connected device.

~~~
jaboutboul
yes the cc3200 is a difficult platform to deal with, but one that is very
popular due to the proliferation of the boards, the excellent battery life
capabilities and the number of inbuilt sensors. The support for it isn't
totally baked yet, at last as far as my last go-round with it, but it is being
actively worked on.

------
m-p-3
Interesting, I'll have to look into it when I build some prototype (just a
personal hobby-type of project) with my ESP8266.

------
mkj
"Better. Cheaper^. Faster"

^ Contact us for pricing

