mongoose-os

Mongoose OS - an IoT Firmware Development Framework. Supported microcontrollers: ESP32, ESP8266, CC3220, CC3200, STM32F4, STM32L4, STM32F7. Amazon AWS IoT, Microsoft Azure, Google IoT Core integrated. Code in C or JavaScript.

OTHER License

Stars
2.5K
Committers
44
mongoose-os - Beta2

Published by cpq over 8 years ago

What's new

Support for Over-The-Air (OTA) firmware updates

This functionality allows for remote updating of the firmware on the device. The added functionality in Smart.js is that should there have been an issue during the update for whatever reason (e.g. faulty firmware, firmware data broken during the network transfer or the device ‘hanging’ with the new firmware), a rollback to the old firmware is automatically done. That ensures that OTA will never freeze / hang the device.

See https://www.cesanta.com/developer/smartjs#_ota_over_the_air_programming for more info.

New configuration infrastructure

A newly flashed device starts a Web UI in Access Point Mode.
Join to the AP advertised by your device, connect to http://192.168.4.1 with your browser and configure your WiFi parameters and many other settings.

You can find the configuration infrastructure documentation at [here]https://www.cesanta.com/developer/smartjs#_configuration_infrastructure

Improved memory management

We have substantially improved memory management. To find out how this was done, check out this blog post on https://blog.cesanta.com/embedded-heap-behaviour-analysis-and-improvement

Our JS standard library is now resident on flash. SJS runtime consumes about 10K of heap for SJS runtime. 30K left for the user on the ESP8266.

We also implemented memory mapped files for spiffs file system that allow us to run precompiled JS files straight off flash memory.

New hardware interfaces

Two new features to check out:

  • Pulse Width Modulation, or PWM, is a technique for getting analog results with digital means. Digital control is used to create a square wave, a signal switched between on and off
  • Analog-to-digital converter, or ADC, is a device that converts a continuous physical quantity (usually voltage) to a digital number that represents the quantity’s amplitude.

WebDAV

Edit the files on your device with WebDAV. Read more about it at:

https://www.cesanta.com/developer/smartjs#_using_webdav

Wifi.ready

You can run some JS code whenever your WiFi is ready:

Wifi.ready(function() {
  print(“Hey, my ip is:”, Wifi.ip());
});

Other enhancements

This release comes with many changes, just a few highlights:

  • New bytecode interpreter. Uses less C stack.
  • Improved WebSocket support.
  • Http.request accepts also the output of URL.parse: Http.request($.extend(URL.parse(“http://www.example.com”), {"method": "posts"}, ...);
  • Changed C function API. JS Exceptions now don’t use setjmp.
  • C debugging tools to help you with custom C code linked in your FW:
    • GDB and coredump support, to perform postmortem debugging
    • Heap tracer and heap debugger, to visualize heap fragmentation and catch heap corruption

Using Cesanta Cloud

Cesanta runs a public cloud service at https://cloud.cesanta.com. To login, all you need is a github or G+ account.
Any other cloud service can be used to store data - please use Http or WebSocket API.

The Smart.js firmware comes with an implementation of our websocket based protocol that is designed to make your device easily accessible behind NATs and to support disconnected operation by managing the queuing of messages for you:

https://www.cesanta.com/developer/cloud

Write your own handlers on your device and make it respond to commands send by other devices or by software running on your servers and call other device or store data such as metrics on our cloud services:

clubby.oncmd('/v1/MyThing.PokeMySensor', function(cmd, done) {
  print('got command:', cmd.args.blah);

  GPIO.write(yourLEDPin, true);

  clubby.call('//api.cesanta.com', {
    cmd: '/v1/Metrics.Publish',
    args: {vars: [[{__name__: 'frobulator'}, readFrobulatorValue()]]}
   }, function(res) {
    GPIO.write(yourLEDPin, false);
    done('your response');
  });
});

Smart.js reference and examples can be found at https://www.cesanta.com/developer/smartjs

Flashing utility (Flash-n-Chips) can be downloaded from https://github.com/cesanta/fnc/releases

mongoose-os - Smart.js Beta

Published by cpq almost 9 years ago

nodejs-compatible HTTP API

Smart.js HTTP API is now compatible with node.js: a subset of node.js's API is implemented. A snippet below demonstrates supported features:

var server = Http.createServer(function(req, res) {
  if (req.uri == '/hello') {
    res.writeHead(200, {'Content-Type': 'text/plain'});
    res.write(req);
    res.end('\n');
  } else {
    res.serve({ document_root: '/tmp' });
  }
}).listen('127.0.0.1:8000');

var client = Http.request({
  hostname: '127.0.0.1',
  port: 8000,
  path: '/hello',
  method: 'POST',
}, function(res) {
  print('in reply handler', res);
}).end('this is POST data');

Online demo

To demonstrate the abilities of the Smart.js platform, we’ve put together a demo website. It shows a predefined interactive dashboard that allows you to control an IoT device. Demo website link.

Enhancements

  • Networking stack enhancements
  • Memory footprint enhancements
  • Simpler function call API

Using Cesanta Cloud

Cesanta runs a public cloud service at https://cloud.cesanta.com. To login, all you need is a github or G+ account.
Any other cloud service can be used to store data - please use Http API.

mongoose-os - Smart.js ALPHA2.1

Published by imax9000 about 9 years ago

  • Updated SPIFFS
  • Fixed CC3200 support in Flashnchips
mongoose-os - Smart.js ALPHA2

Published by cpq about 9 years ago

Alpha2 release of the Smart.js IoT platform.

What's new

  • Enhanced ESP8266 chip support
  • Implemented TI CC3200 chip support
  • Implemented POSIX support (Mac, Windows, Linux, Raspberry PI, etc)
  • Implemented online file editor on the cloud dashboard - allows to edit files on remote devices!

We have ported Smart.js to the POSIX environment, meaning that you can start and try out the platform without the embedded hardware. Simply download the package, unpack it and run on your workstation.

Using Cesanta Cloud

Cesanta runs a public cloud service at https://cloud.cesanta.com. To login, all you need is a github or G+ account.
Any other cloud service can be used to store data - please use Http API.

mongoose-os - Smart.js ALPHA1.1

Published by imax9000 about 9 years ago

A few bugfixes after ALPHA1.

mongoose-os - Smart.js ALPHA1

Published by cpq over 9 years ago

Alpha release of the Smart.js IoT platform.

  • Implemented ESP8266 chip support
  • Implemented File, HTTP, GPIO, I2C, SPI, Wifi, Cloud API

Note: code for the cloud part is not released yet, but you can use the public cloud service at cloud.cesanta.com. All you need is a github or G+ account.

Package Rankings
Top 8.17% on Proxy.golang.org
Badges
Extracted from project README
License Gitter