IBM / ibm-cloud-functions-serverless-iot-openfridge

WARNING: This repository is no longer maintained :warning: This repository will not be updated. The repository will be kept available in read-only mode. See https://developer.ibm.com/code/patterns/ for the latest patterns.
Apache License 2.0
20 stars 22 forks source link
bluemix ibm-developer-technology-cloud ibm-developer-technology-iot ibmcode iot mqtt openwhisk openwhisk-hands-on-demo openwhisk-sample openwhisk-use-cases serverless watson-iot-platform

Read this in other languages: 中国, português.

Build Status

Proactive customer service with Apache OpenWhisk on IBM Cloud Functions and the Watson IoT Platform

WARNING: This repository is no longer maintained :warning:

This repository will not be updated. The repository will be kept available in read-only mode.

This project demonstrates serverless technology - powered by Apache OpenWhisk on IBM Cloud Functions - in a smarter home scenario where appliances send diagnostic readings to the cloud for analysis and proactive maintenance.

The application integrates the Watson IoT Platform, OpenWhisk, and IBM Code services in an event-driven use case driven by those status messages from Internet-connected appliances.

This highlights the serverless programming model and discusses the benefits of this approach relative to traditional cloud development for handling IoT workloads. For more background, check out the developer story on IBM Code.

You should have a basic understanding of the OpenWhisk programming model. If not, try the action, trigger, and rule demo first. You'll also need a IBM Code account and the latest OpenWhisk command line tool (wsk) installed and on your PATH.

If you're just interested in the OpenWhisk package for Watson IoT MQTT integration, you can find that in its own package repository.

Project OpenFridge

Components

Improving customer service with IoT device driven analytics

The Internet of Things enables manufacturers and their customers to make more efficient use of hardware devices by attaching them to a network. Software running on a device can be paired with analytics in the cloud to improve the quality of customer service and lower the cost of maintenance for consumer and manufacturer alike.

In this use case an appliance manufacturer proactively manages diagnostic events from machines in a customer's home. A network-connected refrigerator can report that it needs a part serviced (such as a water filter in need of replacement because its filter life reading is low). These message events can trigger analytics logic to send alerts (such as that a replacement part was automatically ordered because the customer was still within the covered warranty period).

Event-driven computing based on a serverless architecture is a compelling programming model for IoT because it offers the following key benefits to the developer:

The diagram below shows how a solution built on the Watson IoT platform and OpenWhisk can enable this connected home use case and provide the benefits of a serverless architecture.

High level diagram

Primary workflow

A refrigerator periodically sends diagnostic readings to a cloud service indicating the status of its parts. It might send these only when certain threshold is breached (using edge analytics) or allow a cloud service to determine a normal range for all readings it receives (cloud analytics).

{
    "appliance_serial": "aaaabbbbcccc",
    "part_number": "ddddeeeeffff",
    "reading": "15",
    "timestamp": 1466632598
}

Supplementary workflows

Bringing it all together

These workflows come together to demonstrate an end-to-end scenario that can improve customer service with OpenWhisk, IBM Code, and Watson services.

Triggers and actions

Running the sample application

  1. Set up the IBM Code services (Cloudant, SendGrid, Watson IoT, and a Cloud Foundry app).
  2. Set up the OpenWhisk actions, triggers, and rules.

Learn more

License

This code pattern is licensed under the Apache Software License, Version 2. Separate third party code objects invoked within this code pattern are licensed by their respective providers pursuant to their own separate licenses. Contributions are subject to the Developer Certificate of Origin, Version 1.1 (DCO) and the Apache Software License, Version 2.

Apache Software License (ASL) FAQ