This specification describes the use cases of MiniApp applied to the IoT paradigm and the architecture of MiniApp that will cover these IoT scenarios. This document specifies how to reuse and extend the MiniApp Packaging and MiniApp Lifecycle and defines specific APIs for MiniApps in the IoT field.
MiniApp is a new format of mobile application, a hybrid solution which relies on Web technologies (especially CSS and Javascript) but also integrates with Native capabilities. Currently, MiniApps have mature deployments in cellphone and PC.
IoT device is becoming another carrier running MiniApps. MiniApp for IoT intends to enable interoperability across multiple IoT device platforms and IoT operating systems. Rather than having to deal with the difference across the multiple IoT device platforms and IoT operating systems, by introducing MiniApps for IoT, developers only need to focus on the application development on IoT device.
MiniApp for IoT shares similar architecture of MiniApp running on the cellphone and PC. But since IoT device has different hardware capabilities, MiniApp for IoT has its unique features.
The purpose of this specification is to provide:
This section presents the use cases targeted by MiniApp for IoT and which are used to derive the MiniApp Packaging for IoT, MiniApp Lifecycle for IoT, and MiniApp APIs for IoT.
The following sections are not exhaustive. Rather they serve as illustrations, where MiniApp for IoT can provide additional benefit or enable new scenarios.
The HVAC (heating, ventilating, and air-conditioning) applications and lighting applications are usually deployed in homes and buildings, to manage the indoor environment. A switch panel is used to control the HVAC application and lighting application.
[[[#figure-miniapp-iot-use-case-switch-panel-screen-and-button]]] shows an example of HVAC application switch panel which has a screen and several physical buttons. In this case, by introducing MiniApp for IoT, the switch panel’s screen UI can be designed and developed using Web technologies, to display the HVAC information. For example, the target temperature value inputted by the physical and the measured real-time temperature value can be displayed.
[[[#figure-miniapp-iot-use-case-switch-panel-touch-screen]]] shows an example of HAVC and lighting application switch panel which has a touch screen. In this case, by introducing MiniApp for IoT, the switch panel’s touch screen UI can be designed and developed using Web technologies, to both display information and control the indoor HAVC and lighting application. For example, information like measured real-time temperature value, current date and time, etc., can be displayed in one MiniApp page. Besides, by clicking the virtual button on the touch screen, it can navigate to another MiniApp page to configure and control the HAV and lighting application, like setting the target temperature, turn on or off the lights, etc.
In smart home scenarios, gateways are connected to local IoT devices such as sensors, cameras and home appliances through corresponding local communication protocols such as Wi-Fi, Bluetooth Mesh, Zigbee, etc. At the same time, gateways can be connected to the cloud through the Internet. Usually, the gateways do not have a screen.
In this case, by introducing MiniApp for IoT to gateway, the local device connection functionality (such as to establish connection between gateway and IoT device using Wi-Fi, Bluetooth Mesh or Zigbee) and cloud connection functionality (such as to establish connection between gateway and cloud using MQTT or HTTP) can be designed and developed using Web technologies.
Smart speaker is a very popular appliance in smart home scenario. Users can interact with the smart speaker either through voice commands or through the touch screen on the smart speaker. Users can ask smart speakers to play music and video, to control the IoT devices at home, to do on online shopping through the touch screen.
[[[#figure-miniapp-iot-use-case-smart-speaker-touch-screen]]] shows an example of smart speaker with a touch screen. In this case, by introducing MiniApp for IoT, the smart speaker’s touch screen UI can be designed and developed using Web technologies, to play music and video, to control the IoT devices at home, to do on online shopping.
A checkout pad is a machine deployed in the checkout desk in shopping store, café, and supermarket. On the checkout pad, customers can check the items and price, and also make the payment through face payment or barcode payment.
[[[#figure-miniapp-iot-use-case-checkout-pad-screen-camera]]] shows an example of checkout pad with a screen and a camera. In this case, by introducing MiniApp for IoT, the checkout pad’s screen UI and camera can be developed using Web technologies, to display the items and price information, to display the barcode for customers to make the payment, and to scan the customer’s face to complete the face payment by the camera on the checkout pad.
A video conference terminal is used to set up video/audio conference call.
[[[#figure-miniapp-iot-use-case-video-conference-terminal-touch-screen]]] shows an example of video conference terminal which has a touch screen. In this case, by introducing MiniApp for IoT, the video conference terminal’s touch screen UI can be designed and developed using Web technologies, for users to configure and establish the video/audio conference call.
A face recognition terminal for access control is used to provide employees with quick and convenient access to the workplace while preventing fraud.
[[[#figure-miniapp-iot-use-case-face-recognition-terminal-screen-camera]]] shows an example of face recognition terminal for access control with a screen and a camera. In this case, by introducing MiniApp for IoT, the face recognition terminal’s screen UI and camera can be developed using Web technologies, to scan the employee’s face and display on the screen, and to complete the employee identification.
Home appliances or domestic appliances are used to assist in household functions such as cooking (e.g., microwave ovens, dehumidifiers, toasters, coffeemakers, and bread machines), cleaning (e.g., washing machines and robotic vacuum cleaners), and food preservation (e.g., refrigerators and freezers). Web-enabled consumer electronics with embedded logic may include user interfaces that implement MiniApp for IoT to offer advanced automatic control and intuitive end-user feedback.
[[[#figure-miniapp-iot-use-case-smart-home-appliance]]] shows several cooking appliances controlled by a common logic unit that provides a user interface that could be implemented using a MiniApp for IoT.
In-vehicle infotainment systems provide audio, video, navigation, and driving aids, as well as gaming entertainment for vehicle passengers. These systems may be deployed in private (e.g., car, van, and coach) and public transport (e.g., boat, train, bus, and aircraft) as a service for passengers.
[[[#figure-miniapp-iot-use-case-infotainment]]] shows an aircraft with infotainment displays in the back of the seats, allowing passengers to access in-flight information and interact with entertainment services. These systems, sometimes operating offline due to the limitations of the environment, could implement these infotainment services through MiniApps for IoT.
Users may find public displays in different contexts. Smart cities deploy informative kiosks with maps, transport information, and other public services available to citizens and tourists in the streets, as shown in [[[#figure-miniapp-iot-use-case-street-kiosk]]]. Similar informative screens may be found indoors in public facilities like airports, train stations, and shopping malls, sometimes allowing customers or users to interact with the system.
These public displays may include sensors and serve interactive services, applications, and widgets implemented through MiniApps for IoT. The MiniApp could access the sensors' information and offer user interaction to use its services.
Traditional industries connected to engineering, like manufacturing, usually have instrumentation and process control systems to control their industrial processes. A wide range of HMI types and control systems are adapted to the sector and its specific environmental peculiarities. MiniApps for IoT with dedicated protocols to interact with actuators and read sensors could be run on robust and precise interactive systems like SCADA and other ad-hoc industrial solutions.
Microcontroller boards and kits, popularized by the open-hardware movement, offer makers and developers the possibility to quickly design and implement digital devices on simple IoT infrastructures using modules, shields, and other electric hardware components.
These microcontrollers and boards run different operating systems with libraries and APIs to read and write input-output ports using different protocols (e.g., I2C, SPI, and UART). These input-output interfaces enable interaction with other electronic components and systems. MiniApp for IoT could be implemented in those systems, facilitating the acquisition, processing, and delivery of data and user interaction.
To address the use cases in Section 2, this section provides the MiniApp for IoT Architecture.
[[[#figure-miniapp-iot-architecture]]] shows the MiniApp for IoT Architecture.
Unlike MiniApps running on cellphone, which either run on top of a certain mobile App or run on top of mobile OS, MiniApp for IoT is running on top of IoT OS (operating system).
Similar as MiniApps running on cellphone, in MiniApp for IoT, the View layer is usually separated from the Logic layer. The View layer is responsible for rendering MiniApp pages, including Web rendering and Native rendering. The Logic layer is responsible for MiniApp’s event processing, API calling and lifecycle management.
MiniApp for IoT also have the Packaging and Lifecycle, which will be described in Section 4 and Section 5.
One of the key features of MiniApp for IoT is that it deals with many IoT device native functionalities, including but not limited to IoT communication protocols (like MQTT, Bluetooth Mesh) management, I/O for peripheral (like, UART, GPIO, I2C, SPI), and hardware functionalities (like ADC, DAC, hardware timer). The details will be described in Section 6.
The use cases in Section 2.1, 2.3, 2.4, 2.5 and 2.6 show the MiniApp for IoT device with a screen, which is similar to the MiniApp running on cellphone or PC.
Therefore, the MiniApp Packaging can be applied for MiniApp packaging for IoT device with a screen.
The use case in Section 2.2 shows the MiniApp for IoT device without a screen.
Therefore, a simplified MiniApp Packaging’s directory and file system is defined to be applied for IoT device without a screen. Specifically, the CSS Resources are not required.
MiniApp Lifecycle needs to be extended for MiniApp lifecycle for IoT.
MiniApp for cellphone either runs in foreground or background. When running in foreground, the MiniApp is shown to users. When user chooses to close the MiniApp by clicking the close button on MiniApp, or go to the mobile phone’s home screen, the MiniApp switches to run in background, which means the MiniApp is suspended in the background.
However, in the case of MiniApp for IoT, when user chooses to close the MiniApp by clicking the close button on MiniApp, or go to the home screen, some MiniApps will still provide services to users and will not be suspended, like music playing. Therefore, a new lifecycle event and states need to be defined.
MiniApp Global Application Lifecycle Events is extended to include one new global application lifecycle event for MiniApp for IoT:
MiniApp running permanently
MiniApp Global Application Lifecycle States is extended to include one new global application lifecycle state for MiniApp for IoT:
Accordingly, MiniApp Global Application Lifecycle interface and callbacks needs to be extended.
MiniApp Page Lifecycle Events is extended to include one new page lifecycle event for MiniApp for IoT:
MiniApp page running permanently
MiniApp Page Lifecycle States is extended to include one new page lifecycle state for MiniApp for IoT: page permanent.
Accordingly, MiniApp Page Lifecycle interface and callbacks needs to be extended.
To interact with IoT device native capabilities, a set of APIs need to be defined for MiniApp for IoT.
The MQTT API provides interfaces that MiniApp for IoT can access, configure and control MQTT protocol in the underlying IoT device, so that the IoT device can transfer data with another entity (such as another device, or backend server) through MQTT protocol.
The Bluetooth Mesh API provides interfaces that MiniApp for IoT can access, configure and control Bluetooth Mesh connection in the underlying IoT device, so that the IoT device can establish Bluetooth Mesh connection with another device.
The UART API provides interfaces that MiniApp for IoT can access UART embedded in the underlying devices.
The SPI API provides interfaces that MiniApp for IoT can access devices via SPI interfaces embedded in the underlying devices.
The GPIO API provides interfaces that MiniApp for IoT can access GPIO embedded in the underlying devices.
The I2C API provides interfaces that MiniApp for IoT can access devices via I2C interfaces embedded in the underlying devices.
The Device low power management API provides interfaces that MiniApp for IoT can access and configure low power management functionality in the underlying IoT device.
The ADC API provides interfaces that MiniApp for IoT can access ADC embedded in the underlying devices.
The DAC API provides interfaces that MiniApp for IoT can access DAC embedded in the underlying devices.
The Hardware timer API provides interfaces that MiniApp for IoT can access Hardware timer embedded in the underlying devices.
TBD