Extend OS with Plugin

What is a Plug-in?

Plug-in is to create an obnizOS that contains a user-created program and operate it on a device (plug-in OS), instead of operating it via the cloud. This enables the development of the following software that cannot be handled by the existing obnizOS alone.

  • Fast and accurate IO operations that are not affected by network delays
  • Program offline behavior
  • Arduino libraries can be used for development with ArduinoIDE

How to develop

Create the program you want to run in the Arduino IDE. You can use the plug-in by putting it into the device you want to run.

The created plugin OS supports OTA from obnizCloud as well as USB writing from Arduino IDE, and OTA processing is done by cloud and obnizOS, so you don't need to develop software for it.

obnizOS plugin

The relationship between obnizOS and plugins

The program will "use obnizOS" from the software you create.
You can start and stop obnizOS from the software you create.
However, if obnizOS is not running, you cannot use OTA, device management, IO control, and other functions available in obniz.
When you start obnizOS, it will create a new task. By doing this, obnizOS will run while the plug-in continues to run.
In obnizOS, when you connect to the network or go offline, an event is generated, which can be retrieved by the plug-in. See the reference for details.

// Example
#include <obniz.h>.

void setup() {
  Serial.begin(115200);
  obniz.start();
}

void loop() {

}

Sample projects

Example plug-ins for M5ATOM and M5ATOM Lite are available.

  • Wi-Fi connection status display with LED
  • button to enter device setting mode

This is an example.

https://github.com/obniz/obniz-plugin-atom

Articles