From 30753e514e57201f434d39056db5ffc8397d00d5 Mon Sep 17 00:00:00 2001 From: Ray H Date: Wed, 23 Sep 2020 17:54:50 +0800 Subject: [PATCH 1/4] Add Optoma IFP5 series file. --- get_started/Optoma-IFP5-Series.md | 112 ++++++++++++++++++++++++++++++ 1 file changed, 112 insertions(+) create mode 100644 get_started/Optoma-IFP5-Series.md diff --git a/get_started/Optoma-IFP5-Series.md b/get_started/Optoma-IFP5-Series.md new file mode 100644 index 000000000..0552ac61e --- /dev/null +++ b/get_started/Optoma-IFP5-Series.md @@ -0,0 +1,112 @@ +--- +platform: android +device: Optoma IFP 5 Series +language: java +--- + +Run a simple JAVA sample on Optoma IFP 5 Series running Android +=== +--- + +# Table of Contents + +- [Introduction](#Introduction) +- [Step 1: Prerequisites](#Prerequisites) +- [Step 2: Prepare your Device](#PrepareDevice) +- [Step 3: Build and Run the Sample](#Build) +- [Next Steps](#NextSteps) + + +# Introduction + +**About this document** + +This document describes how to connect Optoma IFP 5 Series with Azure IoT SDK. This multi-step process includes: + +- Configuring Azure IoT Hub +- Registering your IoT device +- Build and deploy Azure IoT SDK on device + + + +# Step 1: Prerequisites + +You should have the following items ready before beginning the process: + +- Connect the device to internet. +- Download and install latest JDK from [here](http://www.oracle.com/technetwork/java/javase/downloads/index.html). +- Download [Android Studio](https://developer.android.com/studio/index.html) on your Windows machine and follow the installation instructions. +- Computer with Git client installed and access to the [azure-iot-sdk-java](https://github.com/Azure/azure-iot-sdk-java) GitHub public repository. +- [Setup your IoT hub][lnk-setup-iot-hub] +- [Provision your device and get its credentials][lnk-manage-iot-hub] + + +# Step 2: Prepare your Device + +- Make sure desktop is ready as per instructions given in [Prepare your development environment](#Setup_DevEnv). + +- Plug in your device to your development machine with a USB cable. If you're developing on Windows, you might need to install the appropriate USB driver for your device. For help installing drivers, see the [OEM USB Drivers](https://developer.android.com/studio/run/oem-usb.html) document. + +- Connect the device to internet. + +- On host PC, run adb shell and execute following commands: + + ./adb devices + ./adb shell + +- Turn on Wifi and configure to connect to internet (commands to configure wifi to connect to internet automatically...) + + +# Step 3: Build and Run the sample + +## 3.1 Modify and Build the Samples + +1. Start a new instance of Android Studio and open Android project from [here](android-sample-code): + + azure-iot-sdk-java/device/samples/android-sample/ + +2. Go to MainActivity.java, replace the [device connection string] placeholder with connection string of the device you have created in Provision your device and get its credentials and save the file. An example of IoT Hub Connection String is as below: + + HostName=[YourIoTHubName];SharedAccessKeyName=[YourAccessKeyName];SharedAccessKey=[YourAccessKey] + +3. Build your project by going to ***Build menu > Make Project***. + +## 3.2 Run and Validate the Samples + +In this section you will run the Azure IoT client SDK samples to validate communication between your device and Azure IoT Hub. You will send messages to the Azure IoT Hub service and validate that IoT Hub has successfully receive the data. You will also monitor any messages sent from the Azure IoT Hub to client. + +### 3.2.1 Run the Sample: + +- Select one of your project's files and click Run from the toolbar. +- In the Choose Device window that appears, select the Choose a running device radio button, select your device, and click OK. +- Android Studio will install the app on your connected device and starts it. + +### 3.2.2 Send Device Message to IoT Hub + +- See [Manage IoT Hub]([lnk-manage-iot-hub]) to learn how to observe the messages IoT Hub receives from the application. +- Run Device explorer on your Development platform. +- Set your IoT Hub Connection String on Configuration tab. Then select Data tab. +- Select Device ID on your device, click Monitor button to start receive event hub data. +- As soon as you run the app on your device (or emulator). Click SEND MESSAGE on app of test device. +- Check Data Monitor window in Device explorer. Verify Receiving events message on Event Hub Data. + + +# Next Steps + +You have now learned how to run a sample application that collects sensor data and sends it to your IoT hub. To explore how to store, analyze and visualize the data from this application in Azure using a variety of different services, please click on the following lessons: + +- [Manage cloud device messaging with iothub-explorer] +- [Save IoT Hub messages to Azure data storage] +- [Use Power BI to visualize real-time sensor data from Azure IoT Hub] +- [Use Azure Web Apps to visualize real-time sensor data from Azure IoT Hub] +- [Weather forecast using the sensor data from your IoT hub in Azure Machine Learning] +- [Remote monitoring and notifications with Logic Apps] + +[Manage cloud device messaging with iothub-explorer]: https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-explorer-cloud-device-messaging +[Save IoT Hub messages to Azure data storage]: https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-store-data-in-azure-table-storage +[Use Power BI to visualize real-time sensor data from Azure IoT Hub]: https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-live-data-visualization-in-power-bi +[Use Azure Web Apps to visualize real-time sensor data from Azure IoT Hub]: https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-live-data-visualization-in-web-apps +[Weather forecast using the sensor data from your IoT hub in Azure Machine Learning]: https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-weather-forecast-machine-learning +[Remote monitoring and notifications with Logic Apps]: https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-monitoring-notifications-with-azure-logic-apps +[lnk-setup-iot-hub]: ../setup_iothub.md +[lnk-manage-iot-hub]: ../manage_iot_hub.md \ No newline at end of file From 186ae98f2ad4a2084892865937cb1ecb7bce7b2f Mon Sep 17 00:00:00 2001 From: Ray H Date: Tue, 29 Sep 2020 11:05:38 +0800 Subject: [PATCH 2/4] Update the sample code. --- get_started/Optoma-IFP5-Series.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/get_started/Optoma-IFP5-Series.md b/get_started/Optoma-IFP5-Series.md index 0552ac61e..f9d85b2ac 100644 --- a/get_started/Optoma-IFP5-Series.md +++ b/get_started/Optoma-IFP5-Series.md @@ -61,8 +61,9 @@ You should have the following items ready before beginning the process: ## 3.1 Modify and Build the Samples -1. Start a new instance of Android Studio and open Android project from [here](android-sample-code): - +1. Start a new instance of Android Studio and open Android project from +[here][android-sample-code]. + azure-iot-sdk-java/device/samples/android-sample/ 2. Go to MainActivity.java, replace the [device connection string] placeholder with connection string of the device you have created in Provision your device and get its credentials and save the file. An example of IoT Hub Connection String is as below: From 3fb790cf67d2c9cedd8b79a4c324d4904c7950b7 Mon Sep 17 00:00:00 2001 From: Ray H Date: Tue, 29 Sep 2020 11:08:52 +0800 Subject: [PATCH 3/4] Update the sample url. --- get_started/Optoma-IFP5-Series.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/get_started/Optoma-IFP5-Series.md b/get_started/Optoma-IFP5-Series.md index f9d85b2ac..e74bddc80 100644 --- a/get_started/Optoma-IFP5-Series.md +++ b/get_started/Optoma-IFP5-Series.md @@ -62,10 +62,9 @@ You should have the following items ready before beginning the process: ## 3.1 Modify and Build the Samples 1. Start a new instance of Android Studio and open Android project from -[here][android-sample-code]. +[here](https://github.com/Azure/azure-iot-sdk-java/tree/master/device/iot-device-samples/android-sample). - azure-iot-sdk-java/device/samples/android-sample/ - + 2. Go to MainActivity.java, replace the [device connection string] placeholder with connection string of the device you have created in Provision your device and get its credentials and save the file. An example of IoT Hub Connection String is as below: HostName=[YourIoTHubName];SharedAccessKeyName=[YourAccessKeyName];SharedAccessKey=[YourAccessKey] From e33ccfdc2cdde4858836c2ab0c4dfa2be2fb3272 Mon Sep 17 00:00:00 2001 From: Ray H Date: Wed, 30 Sep 2020 14:21:13 +0800 Subject: [PATCH 4/4] Update the Optoma IFP5 series file. --- get_started/Optoma-IFP5-Series.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/get_started/Optoma-IFP5-Series.md b/get_started/Optoma-IFP5-Series.md index e74bddc80..5eef4df1d 100644 --- a/get_started/Optoma-IFP5-Series.md +++ b/get_started/Optoma-IFP5-Series.md @@ -62,12 +62,13 @@ You should have the following items ready before beginning the process: ## 3.1 Modify and Build the Samples 1. Start a new instance of Android Studio and open Android project from -[here](https://github.com/Azure/azure-iot-sdk-java/tree/master/device/iot-device-samples/android-sample). +[here](https://github.com/ssbomb/Azure-IoT-Client). 2. Go to MainActivity.java, replace the [device connection string] placeholder with connection string of the device you have created in Provision your device and get its credentials and save the file. An example of IoT Hub Connection String is as below: - HostName=[YourIoTHubName];SharedAccessKeyName=[YourAccessKeyName];SharedAccessKey=[YourAccessKey] + String deviceconnectionString = "HostName=[YourIoTHubName];SharedAccessKeyName=[YourAccessKeyName];SharedAccessKey=[YourAccessKey]"; + 3. Build your project by going to ***Build menu > Make Project***. @@ -83,7 +84,7 @@ In this section you will run the Azure IoT client SDK samples to validate commun ### 3.2.2 Send Device Message to IoT Hub -- See [Manage IoT Hub]([lnk-manage-iot-hub]) to learn how to observe the messages IoT Hub receives from the application. +- See [Manage IoT Hub](https://github.com/Azure/azure-iot-device-ecosystem/blob/master/manage_iot_hub.md) to learn how to observe the messages IoT Hub receives from the application. - Run Device explorer on your Development platform. - Set your IoT Hub Connection String on Configuration tab. Then select Data tab. - Select Device ID on your device, click Monitor button to start receive event hub data.