This article instructs how to prepare your development environment to use the EnOS Device SDK for MQTT for Java.
Preparing development environment
- Installing Java JDK SE
- Installing Maven
- Obtaining EnOS Device SDK for MQTT for Java
- Feature List
- Sample Code
To use the EnOS Device SDK for MQTT for Java, you will need to install Java SE 8.
To use EnOS Device SDK for MQTT for Java, we recommend you use Maven 3.
You can obtain the EnOS Device SDK for MQTT for Java through the following methods:
- Include the project as a dependency in your Maven project
- Download the source code by cloning this repo and build on your machine
This is the recommended method of including the EnOS IoT SDKs in your project.
-
Navigate to http://search.maven.org, search for com.envisioniot.enos and take note of the latest version number (or the version number of whichever version of the sdk you desire to use).
-
In your main pom.xml file, add the EnOS Device SDK for MQTT for Java as a dependency as follows:
<dependency> <groupId>com.envisioniot</groupId> <artifactId>enos-mqtt</artifactId> <version>2.1.0</version> <!--You might need to change the version number as you need.--> </dependency>
-
Get a copy of the EnOS Device SDK for MQTT for Java from master branch of the GitHub (current repo). You should fetch a copy of the source from the master branch of the GitHub repository: https://github.com/EnvisionIot/enos-iot-mqtt-java-sdk
git clone https://github.com/EnvisionIot/enos-iot-mqtt-java-sdk.git
-
When you have obtained a copy of the source, you can build the SDK for Java.
The EnOS Device SDK for MQTT for Java supports the following functions:
- Registration of devices
- Add, update, query, or delete of gateway devices
- Online and offline of sub-devices
- Create or delete of device tags
- Create device measurepoints
- Upload device alerts
- Upload device messages
- Set device measurepoints and get measurepoint data
- Enable device services
- Send messages on device startup, stop, and delete
- Connect to EnOS Cloud
- Connect to EnOS via SSL/TLS
- Connect via Configuration Profile
- Send Device Telemetry to EnOS
- Send Command to Device
- NTP Service
- OTA Service
- End-to-End Sample Code:
You can find the sample code from
<dir>/blob/master/src/main/java/com/envisioniot/enos/iot_mqtt_sdk/sample/SimpleSendReceive.java
, where,<dir>
is the directory of this SDK in your local store.