• This repository has been archived on 28/Jul/2021
  • Stars
    star
    53
  • Rank 543,430 (Top 11 %)
  • Language
    Java
  • License
    Eclipse Public Li...
  • Created about 10 years ago
  • Updated almost 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Client libraries and samples for connecting to IBM Watson IoT using Java

Java for IBM Watson IoT Platform

Build Status Coverage Status GitHub issues GitHub Maven Central

Product Withdrawal Notice

Per the September 8, 2020 announcement IBM Watson IoT Platform (5900-A0N) has been withdrawn from marketing effective December 9, 2020. As a result, updates to this project will be limited.

Overview

Documentation

https://ibm-watson-iot.github.io/iot-java/

Usage

Add a dependency on com.ibm.wiotp.sdk to your project's pom.xml:

<dependency>
  <groupId>com.ibm.wiotp</groupId>
  <artifactId>com.ibm.wiotp.sdk</artifactId>
  <version>0.4.1</version>
</dependency>

Applications

Simple example that initialises an application client from environment variables, connects, sends 1 command to a device, and then disconnects.

import com.google.gson.JsonObject;
import com.ibm.wiotp.sdk.app.ApplicationClient;
import com.ibm.wiotp.sdk.codecs.JsonCodec;

class simpleTest {
	public static void main(String[] args) {
		ApplicationClient appClient = new ApplicationClient();
		appClient.registerCodec(new JsonCodec());
		appClient.connect();
		JsonObject data = new JsonObject();
		data.addProperty("distance", 10);
		appClient.publishCommand("myDeviceType", "myDeviceId", "myCommand", data);
		appClient.disconnect();
	}
}

Devices

Simple example that initialises a device client from environment variables, connects, sends 1 event, and then disconnects.

import com.google.gson.JsonObject;
import com.ibm.wiotp.sdk.device.DeviceClient;
import com.ibm.wiotp.sdk.codecs.JsonCodec;

class simpleTest {
	public static void main(String[] args) {
		DeviceClient deviceClient = new DeviceClient();
		deviceClient.registerCodec(new JsonCodec());
		deviceClient.connect();
		JsonObject data = new JsonObject();
		data.addProperty("distance", 10);
		deviceClient.publishEvent("myEvent", data);
		deviceClient.disconnect();
	}
}

More Repositories

1

iot-python

Python Package and samples for connecting to Maximo IoT and IBM Watson IoT Platform
Python
187
star
2

iot-nodejs

Client libraries and samples for connecting to IBM Watson IoT using nodejs
JavaScript
177
star
3

blockchain-samples

Samples demonstrating the use of Blockchain with IBM Watson IoT
Go
168
star
4

iot-beaglebone

This repository contains sample(s) for connecting TI BeagleBone devices to the IBM Internet of Things Foundation
16
star
5

functions

A companion package to IBM Maximo asset monitor pipeline containing sample functions and base classes from which to derive custom functions
Python
10
star
6

gateway-smartthings

Gateway application to connect Samsung SmartThings to Watson IoT
Groovy
9
star
7

iot-docs

Documentation
8
star
8

grafana4iot

Visualization & dashboard solution for Watson IoT connected devices based on Grafana, Graphite & Statsd
Dockerfile
7
star
9

gateway-hue

Gateway application to connect a Phillips Hue bridge to Watson IoT
Python
4
star
10

iot-simplelink

Sample IBM Internet of things client for Texas Instruments SimpleLink Wi-Fi CC3200 LaunchPad
3
star
11

connector-messagehub

Stream event data from Watson IoT into MessageHub
Java
3
star
12

maximo-asset-monitor-sdk

Provides an SDK for Maximo asset monitor API
Python
1
star
13

iot-galileo

This repository contains sample(s) for connecting Intel Galileo devices to the IBM Internet of Things Foundation
1
star
14

gateway-lightify

Gateway application to connect an OSRAM Lightify hub to Watson IoT
Python
1
star
15

swagger-java

Java
1
star
16

connector-cloudant

Stream event data from Watson IoT into Cloudant
Python
1
star
17

connector-statsd

Stream event data from Watson IoT into statsd
Python
1
star