Merge pull request #415 from Microsoft/pre-release
Merge recent changes.
|
@ -1,7 +1,7 @@
|
|||
---
|
||||
title: "Pixelcraft - A DevKit Painter"
|
||||
title: "Pixelcraft - A IoT DevKit Painter"
|
||||
link: "http://pixelcraft.cc/"
|
||||
excerpt: "Paint the pixels or import an image to modify on DevKit screen, all within browser now."
|
||||
excerpt: "Paint the pixels or import an image to modify on IoT DevKit screen, all within browser now."
|
||||
header:
|
||||
image: /assets/images/communities-pixelcraft.jpg
|
||||
teaser: /assets/images/communities-pixelcraft-th.jpg
|
||||
|
@ -13,4 +13,4 @@ difficulty: EASY
|
|||
last_modified_at: 2018-02-02
|
||||
---
|
||||
|
||||
This article describes how to use Pixcelcraft tool to paint or modify an imported image to display on DevKit screen. Kudos to Zhe Li.
|
||||
This article describes how to use Pixcelcraft tool to paint or modify an imported image to display on IoT DevKit screen. Kudos to Zhe Li.
|
||||
|
|
|
@ -11,7 +11,7 @@ sidebar:
|
|||
image_alt: "logo"
|
||||
text: "IoT Maker, Tinker, Developer"
|
||||
- title: "Responsibilities"
|
||||
text: "Your coolest ideas that can make the DevKit rock 'n roll."
|
||||
text: "Your coolest ideas that can make the IoT DevKit rock 'n roll."
|
||||
---
|
||||
|
||||
Don't hesitate to let us know the next best and coolest ideas you come up with for the DevKit. Let us make it even a better IoT development kit.
|
||||
Don't hesitate to let us know the next best and coolest ideas you come up with for the IoT DevKit. Let us make it even a better IoT development kit.
|
||||
|
|
|
@ -4,12 +4,12 @@ Liya Du:
|
|||
name : "Liya Du"
|
||||
email : "liydu@microsoft.com"
|
||||
bio : "Cogito, ergo sum."
|
||||
avatar : "/assets/images/bio-photo.jpg"
|
||||
avatar : "/assets/images/photo-liki.jpg"
|
||||
twitter : "likidu"
|
||||
|
||||
Arthur Ma:
|
||||
name : "Arthur Ma"
|
||||
email : "arthma@microsoft.com"
|
||||
bio : "Engine behind DevKit"
|
||||
avatar : "/assets/images/bio-photo.jpg"
|
||||
bio : "Engine behind IoT DevKit"
|
||||
avatar : "/assets/images/photo-arthur.jpg"
|
||||
twitter : "arthurma1978"
|
|
@ -8,7 +8,7 @@ main:
|
|||
url: /docs/projects/
|
||||
- title: "Blog"
|
||||
url: https://blogs.msdn.microsoft.com/iotdev/
|
||||
- title: "v1.4.0"
|
||||
- title: "v1.4.1"
|
||||
url: /versions/
|
||||
class: "masthead-circle"
|
||||
|
||||
|
@ -25,22 +25,64 @@ docs:
|
|||
url: /docs/projects/
|
||||
- title: How-to Guides
|
||||
children:
|
||||
- title: "Manual installation"
|
||||
url: /docs/installation/
|
||||
- title: "Firmware upgrading"
|
||||
url: /docs/firmware-upgrading/
|
||||
- title: "Use configure mode"
|
||||
url: /docs/use-configuration-mode/
|
||||
- title: "Understand security chip"
|
||||
url: /docs/understand-security-chip
|
||||
- title: "Customize device ID"
|
||||
url: /docs/customize-device-id/
|
||||
- title: "Disable data collection"
|
||||
url: /docs/disable-data-collection/
|
||||
- title: "Manual installation"
|
||||
url: /docs/installation/
|
||||
- title: API Reference
|
||||
children:
|
||||
- title: "Arduino"
|
||||
url: /docs/apis/arduino-language-reference/
|
||||
- title: "AudioV2"
|
||||
url: /docs/apis/audio-v2/
|
||||
- title: "Display"
|
||||
url: /docs/apis/display/
|
||||
- title: "EEPROMInterface"
|
||||
url: /docs/apis/eeprom-interface/
|
||||
- title: "FileSystem"
|
||||
url: /docs/apis/file-system/
|
||||
- title: "HTTP Client"
|
||||
url: /docs/apis/http-client/
|
||||
- title: "External Interrupts"
|
||||
url: /docs/apis/external-interrupts/
|
||||
- title: "IrDA"
|
||||
url: /docs/apis/irda/
|
||||
- title: "LED"
|
||||
url: /docs/apis/led/
|
||||
- title: "MemoryPool"
|
||||
url: /docs/apis/memory-pool/
|
||||
- title: "Memory Status"
|
||||
url: /docs/apis/memory-status/
|
||||
- title: "Mutex"
|
||||
url: /docs/apis/mutex/
|
||||
- title: "OTA Programing"
|
||||
url: /docs/apis/ota/
|
||||
- title: "Queue"
|
||||
url: /docs/apis/queue/
|
||||
- title: "Semaphore"
|
||||
url: /docs/apis/semaphore/
|
||||
- title: "Sensor: Humidity & Temperature (HTS221)"
|
||||
url: /docs/apis/hts221/
|
||||
- title: "Sensor: Magnetic (LIS2MDL)"
|
||||
url: /docs/apis/lis2mdl/
|
||||
- title: "Sensor: Pressure (LPS22HB)"
|
||||
url: /docs/apis/lps22hb/
|
||||
- title: "Sensor: Accelerometer & Gyroscope (LSM6DSL)"
|
||||
url: /docs/apis/lsm6dsl/
|
||||
- title: "System Function"
|
||||
url: /docs/apis/system-function/
|
||||
- title: "Thread"
|
||||
url: /docs/apis/thread/
|
||||
- title: "Timer"
|
||||
url: /docs/apis/timer/
|
||||
- title: "Watchdog Timer"
|
||||
url: /docs/apis/watchdog-timer/
|
||||
- title: "WebSocket Client"
|
||||
url: /docs/apis/websocket-client/
|
||||
- title: "WiFi"
|
||||
url: /docs/apis/wifi/
|
||||
- title: "WiFiClient"
|
||||
|
@ -49,49 +91,3 @@ docs:
|
|||
url: /docs/apis/wifi-server/
|
||||
- title: "WiFiUDP"
|
||||
url: /docs/apis/wifi-udp/
|
||||
- title: "Display"
|
||||
url: /docs/apis/display/
|
||||
- title: "LED"
|
||||
url: /docs/apis/led/
|
||||
- title: "AudioV2"
|
||||
url: /docs/apis/audioV2/
|
||||
- title: "HTS221"
|
||||
url: /docs/apis/hts221/
|
||||
- title: "LSM6DSL"
|
||||
url: /docs/apis/lsm6dsl/
|
||||
- title: "LIS2MDL"
|
||||
url: /docs/apis/lis2mdl/
|
||||
- title: "LPS22HB"
|
||||
url: /docs/apis/lps22hb/
|
||||
- title: "IrDA"
|
||||
url: /docs/apis/irda/
|
||||
- title: "EEPROMInterface"
|
||||
url: /docs/apis/EEPROMInterface/
|
||||
- title: "MemoryPool"
|
||||
url: /docs/apis/MemoryPool/
|
||||
- title: "Queue"
|
||||
url: /docs/apis/Queue/
|
||||
- title: "Thread"
|
||||
url: /docs/apis/Thread/
|
||||
- title: "Mutex"
|
||||
url: /docs/apis/Mutex/
|
||||
- title: "Semaphore"
|
||||
url: /docs/apis/Semaphore/
|
||||
- title: "Timer"
|
||||
url: /docs/apis/Timer/
|
||||
- title: "FileSystem"
|
||||
url: /docs/apis/FileSystem/
|
||||
- title: "Audio-Retired"
|
||||
url: /docs/apis/audio-retired/
|
||||
- title: "Memory Status"
|
||||
url: /docs/apis/memory-status/
|
||||
- title: "WebSocket Client"
|
||||
url: /docs/apis/websocket-client/
|
||||
- title: "Watchdog Timer"
|
||||
url: /docs/apis/watchdog-timer/
|
||||
- title: "External Interrupts"
|
||||
url: /docs/apis/external-interrupts/
|
||||
- title: "System Function"
|
||||
url: /docs/apis/system-function/
|
||||
- title: "HTTP Client"
|
||||
url: /docs/apis/http-client/
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
---
|
||||
title: "Get started"
|
||||
permalink: /docs/get-started/
|
||||
excerpt: "How to quickly install and set up your development environment to use the DevKit."
|
||||
excerpt: "How to quickly install and set up your development environment to use the IoT DevKit."
|
||||
variable:
|
||||
- platform: windows
|
||||
name: Windows
|
||||
|
@ -10,12 +10,12 @@ variable:
|
|||
last_modified_at: 2018-03-12
|
||||
---
|
||||
|
||||
**Notice:** [Azure IoT Workbench](https://marketplace.visualstudio.com/items?itemName=vsciot-vscode.vscode-iot-workbench) is the new tool for developing on DevKit. If you are looking for old experiences by using the installer, you can find it [here](https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-arduino-iot-devkit-az3166-get-started)
|
||||
**Notice:** [Azure IoT Workbench](https://aka.ms/iot-workbench) is the new tool for developing on IoT DevKit. If you are looking for old experiences by using the installer, you can find it [here](https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-arduino-iot-devkit-az3166-get-started).
|
||||
{: .notice--warning}
|
||||
|
||||
For first-time users of the MXChip IoT DevKit (a.k.a. DevKit), follow these quick steps to:
|
||||
- Prepare your development environment.
|
||||
- Send temperature and humidity data from built-in DevKit sensors to the Azure IoT Hub.
|
||||
- Send temperature and humidity data from built-in IoT DevKit sensors to the Azure IoT Hub.
|
||||
|
||||
If you have already done this, you can try more samples from the [Projects Catalog]({{"/docs/projects/" | absolute_url }}) or build your own IoT application.
|
||||
|
||||
|
@ -23,11 +23,11 @@ If you have already done this, you can try more samples from the [Projects Catal
|
|||
|
||||
## What you learn
|
||||
|
||||
* How to connect the DevKit to a wireless access point.
|
||||
* How to connect the IoT DevKit to a wireless access point.
|
||||
* How to install the development environment.
|
||||
* How to create an IoT Hub and register a device for the DevKit.
|
||||
* How to collect sensor data by running a sample application on the DevKit.
|
||||
* How to send the DevKit sensor data to your IoT hub.
|
||||
* How to create an IoT Hub and register a device for the IoT DevKit.
|
||||
* How to collect sensor data by running a sample application on the IoT DevKit.
|
||||
* How to send the IoT DevKit sensor data to your IoT hub.
|
||||
|
||||
## What you need
|
||||
|
||||
|
@ -39,9 +39,9 @@ If you have already done this, you can try more samples from the [Projects Catal
|
|||
|
||||
## Prepare your hardware
|
||||
|
||||
To connect the DevKit to your computer:
|
||||
To connect the IoT DevKit to your computer:
|
||||
|
||||
1. Connect the Micro-USB end to the DevKit.
|
||||
1. Connect the Micro-USB end to the IoT DevKit.
|
||||
2. Connect the USB end to your computer.
|
||||
3. The green LED for power confirms the connection.
|
||||
|
||||
|
@ -49,26 +49,26 @@ To connect the DevKit to your computer:
|
|||
|
||||
## Configure Wi-Fi
|
||||
|
||||
IoT projects rely on internet connectivity. Use AP Mode on the DevKit to configure and connect to Wi-Fi.
|
||||
IoT projects rely on internet connectivity. Use AP Mode on the IoT DevKit to configure and connect to Wi-Fi.
|
||||
|
||||
1. Hold down button B, push and release the reset button, and then release button B. Your DevKit enters AP mode for configuring the Wi-Fi connection. The screen displays the service set identifier (SSID) of the DevKit and the configuration portal IP address:
|
||||
1. Hold down button B, push and release the reset button, and then release button B. Your IoT DevKit enters AP mode for configuring the Wi-Fi connection. The screen displays the service set identifier (SSID) of the IoT DevKit and the configuration portal IP address:
|
||||
![Reset button, button B, and SSID]({{"/assets/images/getting-started/wifi-ap.jpg" | absolute_url }})
|
||||
|
||||
2. Use a Web browser on a different Wi-Fi enabled device (computer or mobile phone) to connect to the DevKit SSID displayed in the previous step. If it asks for a password, leave it empty.
|
||||
2. Use a Web browser on a different Wi-Fi enabled device (computer or mobile phone) to connect to the IoT DevKit SSID displayed in the previous step. If it asks for a password, leave it empty.
|
||||
![Network info and Connect button]({{"/assets/images/getting-started/connect-ssid.png" | absolute_url }})
|
||||
|
||||
3. Open **192.168.0.1** in the browser. Select the Wi-Fi network that you want the DevKit to connect to, type the password for the Wi-Fi conection, and then click **Connect**.
|
||||
3. Open **192.168.0.1** in the browser. Select the Wi-Fi network that you want the IoT DevKit to connect to, type the password for the Wi-Fi conection, and then click **Connect**.
|
||||
![Password box and Connect button]({{"/assets/images/getting-started/wifi-portal.png" | absolute_url }})
|
||||
|
||||
4. The DevKit reboots in a few seconds. You then see the Wi-Fi name and assigned IP address on the screen of the DevKit:
|
||||
4. The IoT DevKit reboots in a few seconds. You then see the Wi-Fi name and assigned IP address on the screen of the IoT DevKit:
|
||||
![Wi-Fi name and IP address]({{"/assets/images/getting-started/wifi-ip.jpg" | absolute_url }})
|
||||
|
||||
**Note:** After asuccessful Wi-Fi connection, the currently-installed and latest available version of the DevKit's firmware is displayed on the DevKit screen. If the DevKit is not running on the latest available version, follow the [firmware upgrading guide]({{"/docs/firmware-upgrading/" | absolute_url }}) to install the latest version.
|
||||
**Note:** After asuccessful Wi-Fi connection, the currently-installed and latest available version of the IoT DevKit's firmware is displayed on the IoT DevKit screen. If the IoT DevKit is not running on the latest available version, follow the [firmware upgrading guide]({{"/docs/firmware-upgrading/" | absolute_url }}) to install the latest version.
|
||||
{: .notice--info}
|
||||
|
||||
## Install development environment
|
||||
|
||||
We recommend [Azure IoT Workbench](https://marketplace.visualstudio.com/items?itemName=vsciot-vscode.vscode-iot-workbench) extension for Visual Studio Code to develop on the IoT DevKit.
|
||||
We recommend [Azure IoT Workbench](https://aka.ms/iot-workbench) extension for Visual Studio Code to develop on the IoT DevKit.
|
||||
|
||||
Azure IoT Workbench provides an integrated experience to develop IoT solutions. It helps both on device and cloud development using Azure IoT and other services. You can watch this [Channel9 video](https://channel9.msdn.com/Shows/Internet-of-Things-Show/IoT-Workbench-extension-for-VS-Code) to have an overview of what it does.
|
||||
|
||||
|
@ -136,7 +136,7 @@ Now you are all set with preparing and configuring your development environment.
|
|||
|
||||
## Build your first project
|
||||
|
||||
1. Make sure your DevKit is **not connected** to your computer. Start VS Code first, and then connect the DevKit to your computer.
|
||||
1. Make sure your IoT DevKit is **not connected** to your computer. Start VS Code first, and then connect the IoT DevKit to your computer.
|
||||
|
||||
1. In the bottom right status bar, check the **MXCHIP AZ3166** is shown as selected board and serial port with **STMicroelectronics** is used.
|
||||
![Select board and serial port]({{"/assets/images/getting-started/select-board.png" | absolute_url }})
|
||||
|
@ -153,13 +153,13 @@ Now you are all set with preparing and configuring your development environment.
|
|||
|
||||
1. Click `F1` to open the command palette, type and select **IoT Workbench: Device**, then select **Config Device Settings > Select IoT Hub Device Connection String**.
|
||||
|
||||
1. On IoT DevKit, hold down button **A**, push and release the **reset** button, and then release button **A**. Your DevKit enters configuration mode and saves the connection string.
|
||||
1. On IoT DevKit, hold down button **A**, push and release the **reset** button, and then release button **A**. Your IoT DevKit enters configuration mode and saves the connection string.
|
||||
![Set connection string]({{"/assets/images/getting-started/connection-string.png" | absolute_url }})
|
||||
|
||||
1. Click `F1` again, type and select **IoT Workbench: Device**, then select **Device Upload**.
|
||||
![Verification and upload of the Arduino sketch]({{"/assets/images/getting-started/arduino-upload.png" | absolute_url }})
|
||||
|
||||
The DevKit reboots and starts running the code.
|
||||
The IoT DevKit reboots and starts running the code.
|
||||
|
||||
**Note:** If there is errors or interruptions, you can always recover by running the command again.
|
||||
{: .notice--info}
|
||||
|
@ -204,4 +204,4 @@ If you encounter problems, you can refer to [FAQs]({{"/docs/faq/" | absolute_url
|
|||
## Next Steps
|
||||
|
||||
You have successfully connected an MXChip IoT DevKit to your IoT hub, and you have sent the captured sensor data to your IoT hub.
|
||||
Check our [Projects Catalog]({{"/docs/projects/" | absolute_url }}) for more samples you can build with the DevKit and Azure multiple services.
|
||||
Check our [Projects Catalog]({{"/docs/projects/" | absolute_url }}) for more samples you can build with the IoT DevKit and Azure multiple services.
|
||||
|
|
|
@ -7,9 +7,28 @@ last_modified_at: 2017-05-05T10:16:34-04:00
|
|||
|
||||
{% include toc icon="columns" %}
|
||||
|
||||
|
||||
|
||||
**Notice:** [Azure IoT Workbench](https://aka.ms/iot-workbench) is the new tool for developing on IoT DevKit. If you are looking for FAQ for old experiences by using the installer, you can try the [old one]({{"/docs/legacy/faq" | absolute_url}}) .
|
||||
{: .notice--warning}
|
||||
|
||||
|
||||
## General
|
||||
|
||||
### Is the DevKit Microsoft hardware?
|
||||
### GDPR and IoT DevKit
|
||||
|
||||
Microsoft collects data to operate effectively and provide you the best experiences.
|
||||
Participation is voluntary and when you choose to participate, your device automatically sends data to Microsoft about how you use the IoT DevKit.
|
||||
|
||||
If you choose to participate, you can stop at any time as described [here](https://code.visualstudio.com/docs/supporting/faq#_how-to-disable-telemetry-reporting).
|
||||
|
||||
|
||||
|
||||
> If you are looking for disable the data collection for old installation package, please follow the steps in [this document]({{"/docs/legacy/disable-data-collection" | absolute_url}}) .
|
||||
|
||||
|
||||
|
||||
### Is the IoT DevKit Microsoft hardware?
|
||||
|
||||
No. The hardware manufacturer is [MXChip](http://www.mxchip.com), an established player for IoT hardware. Through a partnership between MXChip and Microsoft, we rapidly iterated on the design and engineering of an Arduino compatible board with rich pre-installed sensors. Microsoft's goal is to boost productivity for developers creating and prototyping IoT applications with awesome Visual Studio Code tooling that leverages the power of Microsoft Azure.
|
||||
|
||||
|
@ -29,40 +48,24 @@ You can purchase the kit from our hardware partner's product page: [https://aka.
|
|||
|
||||
## Installation
|
||||
|
||||
### Command window seems stuck and there is no progress update for a while.
|
||||
### Failed to install Arduino Package for IoT DevKit
|
||||
|
||||
This could be due to putting the Windows command window in "Selection" mode. To verify, check the command window title:
|
||||
Sometimes, whatever in Arduino IDE or VS Code, people get failed to install the MXChip IoT DevKit package and have bellowing error:
|
||||
|
||||
![Window select mode]({{"/assets/images/faq/window-select.png" | absolute_url }})
|
||||
![Smartscreen]({{"/assets/images/faq/crc.png" | absolute_url }})
|
||||
|
||||
If you see **select** on the title, this means you are in Selection mode. It prevents refresh of the output, that is why you cannot see any progress.
|
||||
This might be a cache issue both on local Arduino cache and remote CDN cache.
|
||||
Please clean the local cache first:
|
||||
1. Uninstall the IoT DevKit package, whatever in Arduino IDE or VS Code.
|
||||
|
||||
To resolve, press any key within the command window area and you see **select** disappear in the title.
|
||||
2. Manually remove the cache folder:
|
||||
|
||||
### Homebrew permission error on macOS.
|
||||
- For Windows, remove *%localappdata%/Arduino15/staging/packages*
|
||||
- For macOS, remove *~/Library/Arduino15/staging*
|
||||
|
||||
When you run `install.sh` to install development environment on macOS. You may get a Homebrew permission error:
|
||||
2. Then re-install the package.
|
||||
|
||||
![Homebrew permission error]({{"/assets/images/faq/brew-permission-error.png" | absolute_url }})
|
||||
|
||||
To resolve, follow the instruction of Homebrew by running:
|
||||
|
||||
```bash
|
||||
brew doctor
|
||||
```
|
||||
|
||||
![Homebrew doctor]({{"/assets/images/faq/brew-doctor.png" | absolute_url }})
|
||||
|
||||
### Inconsistency between node versions of npm and Yarn.
|
||||
|
||||
When you run `install.sh` to install development environment on macOS, you may get a node incompatible error:
|
||||
|
||||
```
|
||||
The engine "node" is incompatible with this module. Expected version ">= 8".
|
||||
Found incompatible module
|
||||
```
|
||||
|
||||
To resolve, please upgrade node to the latest version.
|
||||
If it's still not work please contact [us](https://gitter.im/Microsoft/azure-iot-developer-kit){:target="_blank"} for support.
|
||||
|
||||
### Windows Defender SmartScreen prevented an unrecognized app error.
|
||||
|
||||
|
@ -82,7 +85,7 @@ To resolve, try to use Wi-Fi with normal WPA/WPA2 authentication.
|
|||
|
||||
### Cannot connect to 5 GHz Wi-Fi.
|
||||
|
||||
Currently, DevKit only can connect to 2.4 GHz Wi-Fi, 5 GHz is not supported due to hardware restrictions.
|
||||
Currently, IoT DevKit only can connect to 2.4 GHz Wi-Fi, 5 GHz is not supported due to hardware restrictions.
|
||||
|
||||
## Cloud Provisioning
|
||||
|
||||
|
@ -100,14 +103,6 @@ To resolve the issue, please clear the browser's cache and cookies.
|
|||
|
||||
For more details please check [I can't sign in to manage my Azure subscription](https://docs.microsoft.com/en-us/azure/billing/billing-cannot-login-subscription).
|
||||
|
||||
### Creating new Azure IoT Hub fails.
|
||||
|
||||
You may encounter the error message as the screen below:
|
||||
|
||||
![Only one IoT Hub]({{"/assets/images/faq/iothub.png" | absolute_url }})
|
||||
|
||||
This is because Azure IoT Hub only allows [one free hub per Azure subscription](https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-create-through-portal). In this case, you may select the existing IoT Hub instead of trying to create a new one.
|
||||
|
||||
## Development
|
||||
|
||||
### Visual Studio Code cannot find Arduino IDE.
|
||||
|
@ -116,19 +111,6 @@ Occasionally, when you launch Visual Studio Code, you are prompted with an error
|
|||
|
||||
To resolve, close Visual Studio Code, then launches the actual Arduino IDE once. Subsequently, when you open Visual Studio Code it should correctly locate the Arduino IDE path.
|
||||
|
||||
### Get "Error: AZ3166: Unknown package" when using `task device-upload`.
|
||||
|
||||
This is a known issue caused by the platform index of the board AZ3166 is not refreshed.
|
||||
|
||||
To solve this problem, we need to refresh the platform index:
|
||||
|
||||
1. Open Arduino IDE, find **Tools > Board: 'local board name' > Boards Manager...**.
|
||||
![Open Arduino Board Manager]({{"/assets/images/faq/unknown-package.png" | absolute_url }})
|
||||
|
||||
2. Wait until all platforms index is refreshed and then close Arduino IDE.
|
||||
|
||||
3. Re-open VS Code to run `task device-upload` again.
|
||||
|
||||
### Additional warnings during compilation.
|
||||
|
||||
In certain environment, lots of warnings message pops up in the VS Code OUTPUT windows when you invoke `Arduino Verify`, `Arduino Upload` or `task device-upload` to compile the project.
|
||||
|
@ -137,7 +119,7 @@ It is caused by the incorrect warning handling between Visual Studio Code Arduin
|
|||
|
||||
### Compilation error for Azure Function.
|
||||
|
||||
When the mini solution of Shake-Shake and DevKit Translator do not work, in Azure portal, you got the following error for the Azure Function you deployed:
|
||||
When the mini solution of Shake-Shake and IoT DevKit Translator do not work, in Azure portal, you got the following error for the Azure Function you deployed:
|
||||
|
||||
```
|
||||
2017-11-15T03:24:23.426 Function compilation error
|
||||
|
@ -152,19 +134,12 @@ Here is the workaround:
|
|||
2. Add a new Application setting named `WEBSITE_USE_PLACEHOLDER` with value 0.
|
||||
3. Save and Restart the Function App.
|
||||
|
||||
### Get "serialport.node" error when using `task device-upload`
|
||||
|
||||
If the Node.js installed on your machine is not a LTS one, you might get below error when using the `task device-upload`:
|
||||
![Node.js not LTS]({{"/assets/images/faq/node-lts.png" | absolute_url }})
|
||||
|
||||
To resolve, please uninstall the existing Node.js and then re-install [the package](https://microsoft.github.io/azure-iot-developer-kit/docs/get-started/#step-5-prepare-the-development-environment).
|
||||
|
||||
### Get "Error Presented: #include errors detected" when opening a project
|
||||
|
||||
The error message is **Error Presented: #include errors detected. Please update your includePath.**
|
||||
|
||||
This is an issue coming from the [Microsoft C/C++ extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode.cpptools).
|
||||
Switch the IntelliSense engine to "**Tag Parser**" can fix this issue:
|
||||
Switch the IntelliSense engine to "**Tag Parser**" can workaround this issue:
|
||||
|
||||
* Press F1 and key in 'settings' and select the `Preference: Open User Settings`
|
||||
|
||||
|
@ -184,35 +159,6 @@ Switch the IntelliSense engine to "**Tag Parser**" can fix this issue:
|
|||
|
||||
You can get more detail from [C/C++ for VS Code](https://code.visualstudio.com/docs/languages/cpp).
|
||||
|
||||
### Customize device ID
|
||||
|
||||
The default device ID in IoT Hub for DevKit is AZ3166, you can change it if you need in your own scenario.
|
||||
|
||||
To customize device ID, open `.bin/config.json` in the mini-solution project, and add `device` field. For example:
|
||||
|
||||
```json
|
||||
{
|
||||
"sketch": "../GetStarted.ino",
|
||||
"config": "deviceConnectionString",
|
||||
"provision_iot_hub": true,
|
||||
"provision_azure_function": false,
|
||||
"tasks": {
|
||||
"provision": ["subscription", "iothub", "armtemplatedeployment", "device"],
|
||||
"deploy": []
|
||||
},
|
||||
"device": "CUSTOMIZED_DEVICE_ID"
|
||||
}
|
||||
```
|
||||
|
||||
Notice: The device ID is hardcoded now in the project catalog samples. We will improve the development experience to resolve this issue. However, if you need to change the default **AZ3166** to other, here's the list of files you need to modify for each sample:
|
||||
|
||||
* DevKitTranslator - [azurefunction/devkit-translator/run.csx](https://github.com/Microsoft/devkit-sdk/blob/master/AZ3166/src/libraries/AzureIoT/examples/DevKitTranslator/azurefunction/devkit-translator/run.csx#L42)
|
||||
* GetStarted - [config.h](https://github.com/Microsoft/devkit-sdk/blob/master/AZ3166/src/libraries/AzureIoT/examples/GetStarted/config.h#L9)
|
||||
* RemoteMonitoring - [RemoteMonitoring.ino](https://github.com/Microsoft/devkit-sdk/blob/master/AZ3166/src/libraries/AzureIoT/examples/RemoteMonitoring/RemoteMonitoring.ino#L23)
|
||||
* ShakeShake - [azureFunction/shakeshake-cs/run.csx](https://github.com/Microsoft/devkit-sdk/blob/master/AZ3166/src/libraries/AzureIoT/examples/ShakeShake/azureFunction/shakeshake-cs/run.csx#L91) & [azureFunction/shakeshake-node/index.js](https://github.com/Microsoft/devkit-sdk/blob/master/AZ3166/src/libraries/AzureIoT/examples/ShakeShake/azureFunction/shakeshake-node/index.js#L29)
|
||||
* DevKitDPS - [config.h](https://github.com/DevKitExamples/DevKitDPS/blob/master/config.h#L9)
|
||||
* DevKitState - [azureFunction/devkit-state/run.csx](https://github.com/DevKitExamples/DevKitState/blob/master/azureFunction/devkit-state/run.csx#L60) & [web/js/main.js](https://github.com/DevKitExamples/DevKitState/blob/master/web/js/main.js#L7)
|
||||
|
||||
### Arduino upload return Error: STLinkMethod: Invalid option for "upload_method" option for board "MXCHIP_AZ3166"
|
||||
|
||||
In Visual Studio Code, when trying to invoke "Arduion:Board Config" to configure MXChip board ,the Upload Method selection wasn’t visible:
|
||||
|
|
|
@ -7,7 +7,12 @@ author_profile: false
|
|||
|
||||
<h3>Official tutorials that guide you build and learn IoT empowered by Azure.</h3>
|
||||
|
||||
<p class="notice--warning">DevKit is moving to use Azure IoT Workbench as the new tool for developing on it. If you are looking for old experience, you can still find it by clicking <strong>"Previous verion"<strong>.</p>
|
||||
|
||||
|
||||
**Notice:** [Azure IoT Workbench](https://aka.ms/iot-workbench) is the new tool for developing on IoT DevKit. If you are looking for old experience, you can still find it by clicking "**Previous version**".
|
||||
{: .notice--warning}
|
||||
|
||||
|
||||
|
||||
<div class="grid__wrapper">
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
title: "Upgrade DevKit firmware"
|
||||
title: "Upgrade the bootloader for IoT DevKit"
|
||||
permalink: /docs/firmware-upgrading/
|
||||
excerpt: "Instructions for upgrading device firmware."
|
||||
last_modified_at: 2017-10-11
|
||||
|
@ -7,24 +7,24 @@ last_modified_at: 2017-10-11
|
|||
|
||||
{% include toc icon="columns" %}
|
||||
|
||||
## Upgrade Firmware
|
||||
## Upgrade the bootloader for IoT DevKit
|
||||
|
||||
Follow bellowing steps to upgrade your DevKit firmware to [latest version]({{"/versions" | absolute_url }}).
|
||||
Follow bellowing steps to download the [latest version]({{"/versions" | absolute_url }}) of default firmware for IoT DevKit, and upgrade the bootloader.
|
||||
|
||||
### Step 1. Connect DevKit to your computer via USB
|
||||
### Step 1. Connect IoT DevKit to your computer via USB
|
||||
|
||||
Once the DevKit is connected, in Windows you see a new USB mass storage device in Windows Explorer called `AZ3166`.
|
||||
Once the IoT DevKit is connected, in Windows you see a new USB mass storage device in Windows Explorer called `AZ3166`.
|
||||
|
||||
### Step 2. Upgrade firmware
|
||||
|
||||
1. Download the latest firmware.
|
||||
1. Download the latest version of default firmware for IoT DevKit which includes the bootloader.
|
||||
|
||||
[<i class='fa fa-download'></i> Download](https://aka.ms/devkit/prod/firmware/latest){: .click-download-tracker .btn .btn--success .btn--large}
|
||||
|
||||
|
||||
2. Drag & drop the `.bin` file you downloaded to `AZ3166` device.
|
||||
|
||||
3. Wait until the file is copied, then the DevKit will reboot to the latest firmware.
|
||||
3. Wait until the file is copied, then the IoT DevKit will reboot to the latest firmware.
|
||||
|
||||
After done, you will see the firmware version on the screen of the kit if it has connected with Internet.
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
---
|
||||
title: "Use configuration mode"
|
||||
permalink: /docs/use-configuration-mode/
|
||||
excerpt: "Get into DevKit Configuration Mode to configure your device."
|
||||
excerpt: "Get into IoT DevKit Configuration Mode to configure your device."
|
||||
variable:
|
||||
- platform: windows
|
||||
name: Windows
|
||||
|
@ -12,11 +12,11 @@ last_modified_at: 2018-01-08
|
|||
|
||||
{% include toc icon="columns" %}
|
||||
|
||||
DevKit has the configuration model that you can configure settings like WiFi, IoT Hub connection string and security feature for it.
|
||||
IoT DevKit has the configuration model that you can configure settings like WiFi, IoT Hub connection string and security feature for it.
|
||||
|
||||
## Before you begin
|
||||
|
||||
* Connect DevKit to the computer.
|
||||
* Connect IoT DevKit to the computer.
|
||||
* Download SSH and Telnet client like [Putty](https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html) for Windows.
|
||||
|
||||
{% include switch.html content = page.variable %}
|
||||
|
@ -47,14 +47,14 @@ DevKit has the configuration model that you can configure settings like WiFi, Io
|
|||
|
||||
2. Type `terminal` and select **Terminal** app.
|
||||
|
||||
3. List DevKit device.
|
||||
3. List IoT DevKit device.
|
||||
```bash
|
||||
ls /dev/cu.usbmodem*
|
||||
```
|
||||
|
||||
4. In the list of connected devices, the device name is like **/dev/cu.usbmodem1433**
|
||||
|
||||
5. Connect to the DevKit using the Terminal screen utility.
|
||||
5. Connect to the IoT DevKit using the Terminal screen utility.
|
||||
```bash
|
||||
screen /dev/cu.usbmodemXXXX 115200 –L
|
||||
```
|
||||
|
@ -70,7 +70,7 @@ DevKit has the configuration model that you can configure settings like WiFi, Io
|
|||
|
||||
## Commands
|
||||
|
||||
Commands for the DevKit Configuration Mode.
|
||||
Commands for the IoT DevKit Configuration Mode.
|
||||
|
||||
### help
|
||||
|
|
@ -17,18 +17,18 @@ IoT security is the area of endeavor concerned with safeguarding connected devic
|
|||
|
||||
The STSAFE-A100 consists of a full turnkey solution with a secure operating system running on the latest generation of secure microcontrollers.
|
||||
|
||||
![STSAFE on DevKit]({{"/assets/images/how-to/stsafe/stsafe-on-devkit.png" | absolute_url }})
|
||||
![STSAFE on IoT DevKit]({{"/assets/images/how-to/stsafe/stsafe-on-devkit.png" | absolute_url }})
|
||||
|
||||
On the chip, it employs data partitions to be used to store critical data such as Wi-Fi SSID, Wi-Fi password and IoT hub connection string safely. Credential data can be isolated in those partitions. To read and write those partitions, a developer uses `dataZoneIndex` for operating on specific partition. See [API Reference](http://microsoft.github.io/azure-iot-developer-kit/docs/apis/EEPROMInterface/) to learn about using it on Arduino.
|
||||
On the chip, it employs data partitions to be used to store critical data such as Wi-Fi SSID, Wi-Fi password and IoT hub connection string safely. Credential data can be isolated in those partitions. To read and write those partitions, a developer uses `dataZoneIndex` for operating on specific partition. See [API Reference](http://microsoft.github.io/azure-iot-developer-kit/docs/apis/eeprom-interface/) to learn about using it on Arduino.
|
||||
|
||||
### Enable the secure channel
|
||||
|
||||
By default, the security chip is not enabled. It means the data you store on EEPROM is in plain text. There are two ways to enable it:
|
||||
|
||||
1. Use `enable_secure 1` command in [Configurition Mode]({{"/docs/use-configuration-mode/" | absolute_url }}).
|
||||
2. Call `enableHostSecurityChannel()` function in Arduino. see [API reference]({{"/docs/apis/EEPROMInterface/" | absolute_url }}).
|
||||
2. Call `enableHostSecurityChannel()` function in Arduino. see [API reference]({{"/docs/apis/eeprom-interface/" | absolute_url }}).
|
||||
|
||||
After enabled, the DevKit will negotiate a key with secure chip. The key will be stored at both DevKit and secure chip side. All data as well as the read / write operations on I2C will then be encrypted.
|
||||
After enabled, the IoT DevKit will negotiate a key with secure chip. The key will be stored at both IoT DevKit and secure chip side. All data as well as the read / write operations on I2C will then be encrypted.
|
||||
|
||||
**Notice:** **Enable the security chip with caution.** Using drag and drop to upgrade firmware will make data saved in EEPROM will no longer be readable immediately after enabling the security channel. This is a design with the security chip to ensure data can not be breached.
|
||||
{: .notice--warning}
|
||||
|
@ -37,9 +37,9 @@ The status between enabling and disabling the security channel.
|
|||
|
||||
![STSAFE status]({{"/assets/images/how-to/stsafe/stsafe-status.png" | absolute_url }})
|
||||
|
||||
The difference of the data commuinication between DevKit and the security chip (EEPROM).
|
||||
The difference of the data commuinication between IoT DevKit and the security chip (EEPROM).
|
||||
|
||||
![STSAFE communication with DevKit]({{"/assets/images/how-to/stsafe/communication.png" | absolute_url }})
|
||||
![STSAFE communication with IoT DevKit]({{"/assets/images/how-to/stsafe/communication.png" | absolute_url }})
|
||||
|
||||
## Problems and feedback
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
---
|
||||
title: "Manual installation"
|
||||
permalink: /docs/installation/
|
||||
excerpt: "Instructions for manually install tools and packages."
|
||||
excerpt: "[] Instructions for manually install tools and packages."
|
||||
variable:
|
||||
- platform: windows
|
||||
name: Windows
|
||||
|
@ -9,10 +9,15 @@ variable:
|
|||
name: macOS
|
||||
- platform: ubuntu
|
||||
name: Ubuntu
|
||||
last_modified_at: 2017-10-23
|
||||
last_modified_at: 2018-8-4
|
||||
---
|
||||
|
||||
We suggest you use the [installation package]({{"/docs/get-started/#a-download-latest-package" | absolute_url}}) to install everything automatically. If you have problems on using the one-click install experience, follow these steps to manually install tools and packages for DevKit development.
|
||||
**Notice:** This article is only for the old experiences by using the installer, and will be obsoleted soon.
|
||||
we strongly recommend you to use [Azure IoT Workbench](https://aka.ms/iot-workbench) which has much better experiences on both installation and development for developing on IoT DevKit.
|
||||
You can follow this [tutorial]({{"/docs/get-started" | absolute_url}}) to install [Azure IoT Workbench](https://aka.ms/iot-workbench) and start up the new journey with IoT DevKit.
|
||||
{: .notice--warning}
|
||||
|
||||
If you have problems on using the one-click install experience, follow these steps to manually install tools and packages for IoT DevKit development.
|
||||
|
||||
{% include switch.html content = page.variable %}
|
||||
|
||||
|
@ -30,13 +35,13 @@ The Visual Studio Code Arduino extension relies on the Arduino IDE. Download and
|
|||
|
||||
### Step 3. Install Visual Studio Code
|
||||
|
||||
Download and install [Visual Studio Code for Windows](https://code.visualstudio.com/){:target="_blank"}. This is the primary development tool for building DevKit IoT applications.
|
||||
Download and install [Visual Studio Code for Windows](https://code.visualstudio.com/){:target="_blank"}. This is the primary development tool for building IoT DevKit applications.
|
||||
|
||||
### Step 4. Download the latest package
|
||||
|
||||
1. Download [Windows Installer](https://nodejs.org/en/download/){:target="_blank"} to install Node.js.
|
||||
|
||||
2. Download the .zip file that contains required task scripts for DevKit development in VS Code.
|
||||
2. Download the .zip file that contains required task scripts for IoT DevKit development in VS Code.
|
||||
|
||||
[<i class='fa fa-download'></i> Download](https://aka.ms/devkit/prod/installpackage/tasks/latest){: .click-download-tracker .btn .btn--success .btn--large}
|
||||
|
||||
|
@ -54,9 +59,9 @@ You can install Azure Marketplace extensions directly in Visual Studio Code. Sel
|
|||
|
||||
![installation-extensions]({{"/assets/images/installation-extensions-win.png" | absolute_url}})
|
||||
|
||||
### Step 6. Install the DevKit board package
|
||||
### Step 6. Install the IoT DevKit board package
|
||||
|
||||
Add the DevKit board by using Board Manager in Visual Studio Code.
|
||||
Add the IoT DevKit board by using Board Manager in Visual Studio Code.
|
||||
|
||||
1. Use `Ctrl+Shift+P` to open the command palette, type **Arduino**, and then find and select **Arduino: Board Manager**.
|
||||
|
||||
|
@ -74,7 +79,7 @@ Add the DevKit board by using Board Manager in Visual Studio Code.
|
|||
|
||||
### Step 7. Install ST-Link drivers
|
||||
|
||||
[ST-Link/V2](http://www.st.com/en/development-tools/st-link-v2.html){:target="_blank"} driver is required to communicate with the DevKit.
|
||||
[ST-Link/V2](http://www.st.com/en/development-tools/st-link-v2.html){:target="_blank"} driver is required to communicate with the IoT DevKit.
|
||||
|
||||
1. Download the driver from [STMicro product page](http://www.st.com/en/embedded-software/stsw-link009.html){:target="_blank"}.
|
||||
|
||||
|
@ -115,13 +120,13 @@ The Visual Studio Code Arduino extension relies on the Arduino IDE.
|
|||
|
||||
### Step 3. Install Visual Studio Code
|
||||
|
||||
Download and install [Visual Studio Code for macOS](https://code.visualstudio.com/){:target="_blank"}. This is the primary development tool for building DevKit IoT applications.
|
||||
Download and install [Visual Studio Code for macOS](https://code.visualstudio.com/){:target="_blank"}. This is the primary development tool for building IoT DevKit applications.
|
||||
|
||||
### Step 4. Download the latest package
|
||||
|
||||
1. Install Node.js. You can use popular macOS package manager [Homebrew](https://brew.sh/){:target="_blank"} or [pre-built installer](https://nodejs.org/en/download/){:target="_blank"} to install it.
|
||||
|
||||
2. Download the .zip file that contains required task scripts for DevKit development in VS Code.
|
||||
2. Download the .zip file that contains required task scripts for IoT DevKit development in VS Code.
|
||||
|
||||
[<i class='fa fa-download'></i> Download](https://aka.ms/devkit/prod/installpackage/mac/latest){: .click-download-tracker .btn .btn--success .btn--large}
|
||||
|
||||
|
@ -153,9 +158,9 @@ You can install Azure Marketplace extensions directly in Visual Studio Code.
|
|||
**Note:** Make sure the Arduino path is set the right location you have installed your Arduino IDE.
|
||||
{: .notice}
|
||||
|
||||
### Step 6. Install the DevKit board package
|
||||
### Step 6. Install the IoT DevKit board package
|
||||
|
||||
Add the DevKit board by using Board Manager in Visual Studio Code.
|
||||
Add the IoT DevKit board by using Board Manager in Visual Studio Code.
|
||||
|
||||
1. Use `Cmd+Shift+P` to open the command palette, type **Arduino**, and then find and select **Arduino: Board Manager**.
|
||||
|
||||
|
@ -175,7 +180,7 @@ You now have all the necessary tools and packages installed for macOS.
|
|||
|
||||
## Ubuntu
|
||||
|
||||
The DevKit development environment can be installed and ran on Linux such as Ubuntu with manual configurations. Here is a detailed instructions from [Noel Bundick](https://twitter.com/acanthamoeba) about it: [Using the Azure IoT DevKit with Linux](https://www.noelbundick.com/2018/01/28/Using-the-Azure-IoT-DevKit-with-Linux/).
|
||||
The IoT DevKit development environment can be installed and ran on Linux such as Ubuntu with manual configurations. Here is a detailed instructions from [Noel Bundick](https://twitter.com/acanthamoeba) about it: [Using the Azure IoT DevKit with Linux](https://www.noelbundick.com/2018/01/28/Using-the-Azure-IoT-DevKit-with-Linux/).
|
||||
|
||||
## Next Steps
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
---
|
||||
title: "Audio"
|
||||
permalink: /docs/apis/audioV2/
|
||||
excerpt: "The second version Audio module for AZ3166"
|
||||
permalink: /docs/apis/audio-v2/
|
||||
excerpt: "The Audio module for AZ3166"
|
||||
last_modified_at: 2017-11-22T10:16:34-04:00
|
||||
---
|
||||
|
|
@ -1,11 +1,11 @@
|
|||
---
|
||||
title: "EEPROMInterface"
|
||||
permalink: /docs/apis/EEPROMInterface/
|
||||
permalink: /docs/apis/eeprom-interface/
|
||||
excerpt: "Library for EEPROMInterface on AZ3166"
|
||||
last_modified_at: 2018-01-04T05:16:34-04:00
|
||||
---
|
||||
|
||||
EEPROMInterface class is used to store critical data like passwords, keys and other configurations need encrypted. Data is stored on the STSAFE secure chip on DevKit. Security feature is not enabled by default. To enable it, refer to `enableHostSecureChannel()`. And our EEPROM supports secure channel between our MCU and secure chip after function called.
|
||||
EEPROMInterface class is used to store critical data like passwords, keys and other configurations need encrypted. Data is stored on the STSAFE secure chip on IoT DevKit. Security feature is not enabled by default. To enable it, refer to `enableHostSecureChannel()`. And our EEPROM supports secure channel between our MCU and secure chip after function called.
|
||||
|
||||
## Assembly
|
||||
|
|
@ -1,11 +1,11 @@
|
|||
---
|
||||
title: "FileSystem"
|
||||
permalink: /docs/apis/FileSystem/
|
||||
permalink: /docs/apis/file-system/
|
||||
excerpt: "Library for FileSystem on AZ3166"
|
||||
last_modified_at: 2018-01-09T05:16:34-04:00
|
||||
---
|
||||
|
||||
The FATFileSystem class implemented on mbed OS APIs, provides the core API for file system operations on DevKit. The SFlashBlockDevice class provides the underlying API for representing block-based storage that can be used to back a file system.
|
||||
The FATFileSystem class implemented on mbed OS APIs, provides the core API for file system operations on IoT DevKit. The SFlashBlockDevice class provides the underlying API for representing block-based storage that can be used to back a file system.
|
||||
For more information about File System, please visit [MbedOS](https://docs.mbed.com/docs/mbed-os-api-reference/en/latest/APIs/storage/filesystem/){:target="_blank"}
|
||||
|
||||
## Assembly
|
|
@ -1,6 +1,6 @@
|
|||
---
|
||||
title: "MemoryPool"
|
||||
permalink: /docs/apis/MemoryPool/
|
||||
permalink: /docs/apis/memory-pool/
|
||||
excerpt: "Library for MemoryPool on AZ3166"
|
||||
last_modified_at: 2018-01-05T05:16:34-04:00
|
||||
---
|
|
@ -1,6 +1,6 @@
|
|||
---
|
||||
title: "Mutex"
|
||||
permalink: /docs/apis/Mutex/
|
||||
permalink: /docs/apis/mutex/
|
||||
excerpt: "Library for Mutex on AZ3166"
|
||||
last_modified_at: 2018-01-09T05:16:34-04:00
|
||||
---
|
|
@ -0,0 +1,92 @@
|
|||
---
|
||||
title: "OTA Programing"
|
||||
permalink: /docs/apis/ota/
|
||||
excerpt: "The OTA programing module for AZ3166"
|
||||
last_modified_at: 2018-8-3T10:16:34-04:00
|
||||
---
|
||||
|
||||
The OTA (Over-the-Air) programing API provide the capability of update the firmware from Azure cloud for IoT DevKit.
|
||||
|
||||
## Assembly
|
||||
|
||||
OTAFirmwareUpdate.h
|
||||
|
||||
## Summary
|
||||
|
||||
| Methods |
|
||||
| :------ |
|
||||
| [OTADownloadFirmware](#otadownloadfirmware) - `int OTADownloadFirmware(const char *url, uint16_t *crc16Checksum, const char* ssl_ca_pem)` |
|
||||
| [OTAApplyNewFirmware](#otaapplynewfirmware) - `int OTAApplyNewFirmware(int fwSize, uint16_t crc16Checksum)` |
|
||||
|
||||
|
||||
## Methods
|
||||
|
||||
### OTADownloadFirmware
|
||||
|
||||
```cpp
|
||||
int OTADownloadFirmware(const char *url, uint16_t *crc16Checksum, const char* ssl_ca_pem);
|
||||
```
|
||||
|
||||
> Download new firmware from the given URL.
|
||||
>
|
||||
> #### Parameters
|
||||
>
|
||||
> | Type | Name | Description |
|
||||
> | :--- | :--- | :---------- |
|
||||
> | const char* | [in] url | The URL to download firmware from. |
|
||||
> | uint16_t* | [out] crc16Checksum | Return the CRC-16 (XMODEM) checksum of the downloaded firmware |
|
||||
> | const char* | [in] ssl_ca_pem | Cert of the site of the given URL to ensure the connection is under a secure manner, default is NULL which means use cert of Microsoft Azure for TLS communication. |
|
||||
>
|
||||
> #### Return value
|
||||
>
|
||||
> Return the size of the new firmware on success, otherwise return -1 if encounter network issue, return -2 if encounter external flash accessing issue.
|
||||
|
||||
### OTAApplyNewFirmware]
|
||||
|
||||
```cpp
|
||||
int OTAApplyNewFirmware(int fwSize, uint16_t crc16Checksum);
|
||||
```
|
||||
|
||||
> Apply the new firmware, after reboot the device will update to the new version.
|
||||
>
|
||||
> #### Parameters
|
||||
>
|
||||
> | Type | Name | Description |
|
||||
> | :--- | :--- | :---------- |
|
||||
> | int | [in] fwSize | Size of the firmware. |
|
||||
> | uint16_t | [in] crc16Checksum | The CRC-16 (xmodem) checksum value of the firmware |
|
||||
>
|
||||
> #### Return value
|
||||
>
|
||||
> Return 0 on success, otherwise return -1.
|
||||
|
||||
## Sample Code
|
||||
|
||||
``` cpp
|
||||
// This can be customized according to the board type.
|
||||
uint16_t checksum = 0;
|
||||
int fwSize = OTADownloadFirmware(packageURI, &checksum);
|
||||
if (fwSize == 0 || fwSize == -1)
|
||||
{
|
||||
// Report error status, DownloadFailed
|
||||
return;
|
||||
}
|
||||
else if (fwSize == -2)
|
||||
{
|
||||
// Report error status, DeviceError
|
||||
return;
|
||||
}
|
||||
else if (fwSize != fwInfo->fwSize)
|
||||
{
|
||||
// Report error status, FileSizeNotMatch
|
||||
return;
|
||||
}
|
||||
|
||||
// Applying
|
||||
if (OTAApplyNewFirmware(fwSize, checksum) != 0)
|
||||
{
|
||||
// Report error status, ApplyFirmwareFailed
|
||||
return;
|
||||
}
|
||||
|
||||
```
|
|
@ -1,6 +1,6 @@
|
|||
---
|
||||
title: "Queue"
|
||||
permalink: /docs/apis/Queue/
|
||||
permalink: /docs/apis/queue/
|
||||
excerpt: "Library for Queue on AZ3166"
|
||||
last_modified_at: 2018-01-05T05:16:34-04:00
|
||||
---
|
|
@ -1,6 +1,6 @@
|
|||
---
|
||||
title: "Audio-retired"
|
||||
permalink: /docs/apis/audio-retired/
|
||||
permalink: /docs/apis/retired/audio-v1/
|
||||
excerpt: "The retired Audio module for AZ3166"
|
||||
last_modified_at: 2017-11-22T10:16:34-04:00
|
||||
---
|
|
@ -1,6 +1,6 @@
|
|||
---
|
||||
title: "Semaphore"
|
||||
permalink: /docs/apis/Semaphore/
|
||||
permalink: /docs/apis/semaphore/
|
||||
excerpt: "Library for Semaphore on AZ3166"
|
||||
last_modified_at: 2018-01-09T05:16:34-04:00
|
||||
---
|
|
@ -1,6 +1,6 @@
|
|||
---
|
||||
title: "Thread"
|
||||
permalink: /docs/apis/Thread/
|
||||
permalink: /docs/apis/thread/
|
||||
excerpt: "Library for Thread on AZ3166"
|
||||
last_modified_at: 2018-01-08T05:16:34-04:00
|
||||
---
|
|
@ -1,6 +1,6 @@
|
|||
---
|
||||
title: "Timer"
|
||||
permalink: /docs/apis/Timer/
|
||||
permalink: /docs/apis/timer/
|
||||
excerpt: "Library for Timer on AZ3166"
|
||||
last_modified_at: 2018-01-09T05:16:34-04:00
|
||||
---
|
|
@ -1,13 +1,13 @@
|
|||
---
|
||||
title: "Customize device ID"
|
||||
permalink: /docs/customize-device-id/
|
||||
title: "[Obsoleted] Customize device ID"
|
||||
permalink: /docs/legacy/customize-device-id/
|
||||
excerpt: "Customize device ID in IoT Hub"
|
||||
last_modified_at: 2018-01-08
|
||||
last_modified_at: 2018-08-04
|
||||
---
|
||||
|
||||
## Customize device ID
|
||||
|
||||
The default device ID in IoT Hub for DevKit is **AZ3166**, you can change it if you need it in your own scenario.
|
||||
The default device ID in IoT Hub for IoT DevKit is **AZ3166**, you can change it if you need it in your own scenario.
|
||||
|
||||
To customize the device ID, open `.bin/config.json` in the mini-solution project, and add `device` field. For example:
|
||||
|
||||
|
@ -25,4 +25,4 @@ To customize the device ID, open `.bin/config.json` in the mini-solution project
|
|||
}
|
||||
```
|
||||
|
||||
Then can go through the steps in tutorial again to register your DevKit with this new device ID.
|
||||
Then can go through the steps in tutorial again to register your IoT DevKit with this new device ID.
|
|
@ -1,15 +1,22 @@
|
|||
---
|
||||
title: "Disable data collection"
|
||||
permalink: /docs/disable-data-collection/
|
||||
title: "[Obsoleted] Disable data collection"
|
||||
permalink: /docs/legacy/disable-data-collection/
|
||||
excerpt: "Instructions for disable data collection."
|
||||
variable:
|
||||
- platform: windows
|
||||
name: Windows
|
||||
- platform: macos
|
||||
name: macOS
|
||||
last_modified_at: 2018-03-27
|
||||
last_modified_at: 2018-08-4
|
||||
---
|
||||
|
||||
|
||||
|
||||
**Notice:** We strongly recommend you to use [Azure IoT Workbench](https://aka.ms/iot-workbench) for developing on IoT DevKit.
|
||||
{: .notice--warning}
|
||||
|
||||
|
||||
|
||||
Microsoft collects data to operate effectively and provide you the best experiences.
|
||||
Participation is voluntary and when you choose to participate, your device automatically sends data to Microsoft about how you use the IoT DevKit.
|
||||
|
|
@ -0,0 +1,122 @@
|
|||
---
|
||||
title: "[Obsoleted] Frequently asked questions"
|
||||
permalink: /docs/legacy/faq/
|
||||
excerpt: "Frequently asked questions"
|
||||
last_modified_at: 2018-08-04
|
||||
---
|
||||
|
||||
{% include toc icon="columns" %}
|
||||
|
||||
|
||||
|
||||
**Notice:** [Azure IoT Workbench](https://aka.ms/iot-workbench) is the new tool for developing on IoT DevKit, and we strongly recommend you use this tool for developing that can avoid below problems if still use the old tools installed by the all-in-one installation package.
|
||||
{: .notice--warning}
|
||||
|
||||
|
||||
|
||||
## Installation
|
||||
|
||||
### Command window seems stuck and there is no progress update for a while.
|
||||
|
||||
This could be due to putting the Windows command window in "Selection" mode. To verify, check the command window title:
|
||||
|
||||
![Window select mode]({{"/assets/images/faq/window-select.png" | absolute_url }})
|
||||
|
||||
If you see **select** on the title, this means you are in Selection mode. It prevents refresh of the output, that is why you cannot see any progress.
|
||||
|
||||
To resolve, press any key within the command window area and you see **select** disappear in the title.
|
||||
|
||||
### Homebrew permission error on macOS.
|
||||
|
||||
When you run `install.sh` to install development environment on macOS. You may get a Homebrew permission error:
|
||||
|
||||
![Homebrew permission error]({{"/assets/images/faq/brew-permission-error.png" | absolute_url }})
|
||||
|
||||
To resolve, follow the instruction of Homebrew by running:
|
||||
|
||||
```bash
|
||||
brew doctor
|
||||
```
|
||||
|
||||
![Homebrew doctor]({{"/assets/images/faq/brew-doctor.png" | absolute_url }})
|
||||
|
||||
### Inconsistency between node versions of npm and Yarn.
|
||||
|
||||
When you run `install.sh` to install development environment on macOS, you may get a node incompatible error:
|
||||
|
||||
```
|
||||
The engine "node" is incompatible with this module. Expected version ">= 8".
|
||||
Found incompatible module
|
||||
```
|
||||
|
||||
To resolve, please upgrade node to the latest version.
|
||||
|
||||
|
||||
|
||||
## Cloud Provisioning
|
||||
|
||||
### Creating new Azure IoT Hub fails.
|
||||
|
||||
You may encounter the error message as the screen below:
|
||||
|
||||
![Only one IoT Hub]({{"/assets/images/faq/iothub.png" | absolute_url }})
|
||||
|
||||
This is because Azure IoT Hub only allows [one free hub per Azure subscription](https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-create-through-portal). In this case, you may select the existing IoT Hub instead of trying to create a new one.
|
||||
|
||||
## Development
|
||||
|
||||
### Get "Error: AZ3166: Unknown package" when using `task device-upload`.
|
||||
|
||||
This is a known issue caused by the platform index of the board AZ3166 is not refreshed.
|
||||
|
||||
To solve this problem, we need to refresh the platform index:
|
||||
|
||||
1. Open Arduino IDE, find **Tools > Board: 'local board name' > Boards Manager...**.
|
||||
![Open Arduino Board Manager]({{"/assets/images/faq/unknown-package.png" | absolute_url }})
|
||||
|
||||
2. Wait until all platforms index is refreshed and then close Arduino IDE.
|
||||
|
||||
3. Re-open VS Code to run `task device-upload` again.
|
||||
|
||||
### Get "serialport.node" error when using `task device-upload`
|
||||
|
||||
If the Node.js installed on your machine is not a LTS one, you might get below error when using the `task device-upload`:
|
||||
![Node.js not LTS]({{"/assets/images/faq/node-lts.png" | absolute_url }})
|
||||
|
||||
To resolve, please uninstall the existing Node.js and then re-install [the package](https://microsoft.github.io/azure-iot-developer-kit/docs/get-started/#step-5-prepare-the-development-environment).
|
||||
|
||||
### Customize device ID
|
||||
|
||||
The default device ID in IoT Hub for IoT DevKit is AZ3166, you can change it if you need in your own scenario.
|
||||
|
||||
To customize device ID, open `.bin/config.json` in the mini-solution project, and add `device` field. For example:
|
||||
|
||||
```json
|
||||
{
|
||||
"sketch": "../GetStarted.ino",
|
||||
"config": "deviceConnectionString",
|
||||
"provision_iot_hub": true,
|
||||
"provision_azure_function": false,
|
||||
"tasks": {
|
||||
"provision": ["subscription", "iothub", "armtemplatedeployment", "device"],
|
||||
"deploy": []
|
||||
},
|
||||
"device": "CUSTOMIZED_DEVICE_ID"
|
||||
}
|
||||
```
|
||||
|
||||
Notice: The device ID is hardcoded now in the project catalog samples. We will improve the development experience to resolve this issue. However, if you need to change the default **AZ3166** to other, here's the list of files you need to modify for each sample:
|
||||
|
||||
* DevKitTranslator - [azurefunction/devkit-translator/run.csx](https://github.com/Microsoft/devkit-sdk/blob/master/AZ3166/src/libraries/AzureIoT/examples/DevKitTranslator/azurefunction/devkit-translator/run.csx#L42)
|
||||
* GetStarted - [config.h](https://github.com/Microsoft/devkit-sdk/blob/master/AZ3166/src/libraries/AzureIoT/examples/GetStarted/config.h#L9)
|
||||
* RemoteMonitoring - [RemoteMonitoring.ino](https://github.com/Microsoft/devkit-sdk/blob/master/AZ3166/src/libraries/AzureIoT/examples/RemoteMonitoring/RemoteMonitoring.ino#L23)
|
||||
* ShakeShake - [azureFunction/shakeshake-cs/run.csx](https://github.com/Microsoft/devkit-sdk/blob/master/AZ3166/src/libraries/AzureIoT/examples/ShakeShake/azureFunction/shakeshake-cs/run.csx#L91) & [azureFunction/shakeshake-node/index.js](https://github.com/Microsoft/devkit-sdk/blob/master/AZ3166/src/libraries/AzureIoT/examples/ShakeShake/azureFunction/shakeshake-node/index.js#L29)
|
||||
* DevKitDPS - [config.h](https://github.com/DevKitExamples/DevKitDPS/blob/master/config.h#L9)
|
||||
* DevKitState - [azureFunction/devkit-state/run.csx](https://github.com/DevKitExamples/DevKitState/blob/master/azureFunction/devkit-state/run.csx#L60) & [web/js/main.js](https://github.com/DevKitExamples/DevKitState/blob/master/web/js/main.js#L7)
|
||||
|
||||
|
||||
|
||||
|
||||
{% include social-share.html %}
|
||||
|
||||
[![Back to Top]({{"/assets/images/faq-back-to-top.png" | absolute_url }})](#){: .faq-back-to-top}
|
|
@ -79,7 +79,7 @@
|
|||
|
||||
{% if page.header.extra_logo %}
|
||||
{% for extra in page.header.extra_logo %}
|
||||
<a class="page__extra-logo" href="{{ extra.url }}" target="_blank" style="background: url({{ extra.image_path | absolute_url }});"></a>
|
||||
<a class="page__extra-logo" href="{{ extra.url }}" target="_blank" style="background: url({{ extra.image_path | absolute_url }});"><span class="screen-reader-text">Azure Certified for IoT device catalog</span></a>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
||||
|
|
|
@ -65,7 +65,7 @@ projects: "2, 5, 6"
|
|||
---
|
||||
|
||||
<div class="landing-page-video">
|
||||
{% include whatsnew.html news = "The DevKit is now using Azure IoT Workbench, an integrated tool on Visual Studio Code to develop IoT application." link = "Learn more about Azure IoT Workbench" url="https://marketplace.visualstudio.com/items?itemName=vsciot-vscode.vscode-iot-workbench" %}
|
||||
{% include whatsnew.html news = "The IoT DevKit is now using Azure IoT Workbench, an integrated tool on Visual Studio Code to develop IoT application." link = "Learn more about Azure IoT Workbench" url="https://aka.ms/iot-workbench" %}
|
||||
</div>
|
||||
|
||||
{% include feature_row id="part1" type="right" %}
|
||||
|
|
|
@ -21,7 +21,7 @@ last_modified_at: 2017-06-28
|
|||
|
||||
{% include toc icon="columns" %}
|
||||
|
||||
In this project, you will create an Azure IoT Hub, connect DevKit to it, and collect the temperature and humidity data from sensors and send the data to the IoT hub.
|
||||
In this project, you will create an Azure IoT Hub, connect IoT DevKit to it, and collect the temperature and humidity data from sensors and send the data to the IoT hub.
|
||||
|
||||
## What you learn
|
||||
|
||||
|
@ -33,7 +33,7 @@ In this project, you will create an Azure IoT Hub, connect DevKit to it, and col
|
|||
|
||||
Finish the [Getting Started Guide]({{"/docs/get-started/" | absolute_url }}) to:
|
||||
|
||||
* Have your DevKit connected to Wi-Fi
|
||||
* Have your IoT evKit connected to Wi-Fi
|
||||
* Prepare the development environment
|
||||
|
||||
An active Azure subscription. If you do not have one, you can register via one of the methods:
|
||||
|
@ -49,7 +49,7 @@ Visual Studio Code is the primary development tool for IoT DevKit. If this is th
|
|||
|
||||
### A. Start VS Code
|
||||
|
||||
Make sure your DevKit is not connected. Start VS Code first and connect the DevKit to your computer. VS Code automatically finds the DevKit and opens an introduction page:
|
||||
Make sure your IoT DevKit is not connected. Start VS Code first and connect the IoT DevKit to your computer. VS Code automatically finds the IoT DevKit and opens an introduction page:
|
||||
|
||||
![Introduction page]({{"/assets/images/mini-solution/vscode_start.png" | absolute_url }})
|
||||
|
|
@ -3,176 +3,5 @@ title: "Shake, shake"
|
|||
permalink: /docs/projects/shake-shake-macos/
|
||||
---
|
||||
|
||||
**Notice:** This manual steps for running **'Shake, shake'** project on macOS is subject to change.
|
||||
**Notice:** This page has been obsolted, please refer the [new one]({{"/docs/projects/shake-shake" | absolute_url }}).
|
||||
{: .notice--warning}
|
||||
|
||||
{% include toc icon="columns" %}
|
||||
|
||||
### Step 1. Create Azure IoT Hub
|
||||
|
||||
1. Sign in to [Azure portal](https://portal.azure.com/).
|
||||
|
||||
2. Click **New > Internet of Things > IoT Hub** or search for 'IoT Hub' and click **Create**:
|
||||
![shake-shake-mac-create-iothub]({{"/assets/images/shake-shake-mac-create-iothub.png" | absolute_url }})
|
||||
|
||||
3. In the **IoT hub** pane, enter the following information for your IoT hub:
|
||||
![shake-shake-mac-hub-details]({{"/assets/images/shake-shake-mac-hub-details.png" | absolute_url }})
|
||||
> * **Name**: It is the name for your IoT hub. If the name you enter is valid, a green check mark appears.
|
||||
> * **Pricing and scale tier**: Select the free F1 tier. This option is sufficient for this demo. See [pricing and scale tier](https://azure.microsoft.com/pricing/details/iot-hub/){:target="_blank"}.
|
||||
> * **Resource group**: Create a resource group to host the IoT hub or use an existing one. See Using [resource groups to manage your Azure resources](https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-group-portal){:target="_blank"}.
|
||||
> * **Location**: Select the closest location to you where the IoT hub is created.
|
||||
> * **Pin the dashboard**: Check this option for easy access to your IoT hub from the dashboard.
|
||||
|
||||
4. Click **Create**. It could take a few minutes for your IoT hub to be created. You can see progress in the **Notifications** pane:
|
||||
![shake-shake-mac-notification]({{"/assets/images/shake-shake-mac-notification.png" | absolute_url }})
|
||||
|
||||
5. After your IoT hub is created, click it from the Resource groups. Make a note of the IoT Hub name:
|
||||
![shake-shake-mac-iothub-name]({{"/assets/images/shake-shake-mac-iothub-name.png" | absolute_url }})
|
||||
|
||||
6. Click on the IoT Hub name, in the **Shared access policies** pane, click the **iothubowner** policy, and then make a note of the **Connection string** value for your IoT hub:
|
||||
![shake-shake-mac-iothub-connection-string]({{"/assets/images/shake-shake-mac-iothub-connection-string.png" | absolute_url }})
|
||||
|
||||
### Step 2. Register a device in the IoT hub for the your device
|
||||
|
||||
1. In the [Azure portal](https://portal.azure.com/){:target="_blank"}, open your IoT hub.
|
||||
|
||||
2. Click **Device Explorer**.
|
||||
|
||||
3. In the Device Explorer pane, click **Add** to add a device with name "**AZ3166**" to your IoT hub:
|
||||
![shake-shake-mac-create-device]({{"/assets/images/shake-shake-mac-create-device.png" | absolute_url }})
|
||||
> * **Device ID**: The ID of the new device.
|
||||
> * **Authentication type**: Select Symmetric Key.
|
||||
> * **Auto generate keys**: Check this field.
|
||||
> * **Connect device to IoT Hub**: Click Enable.
|
||||
|
||||
4. Click **Save**.
|
||||
|
||||
5. After the device is created, open the device in the **Device Explorer** pane.
|
||||
|
||||
6. Make a note of the primary key of the connection string.
|
||||
![shake-shake-mac-connection-string]({{"/assets/images/shake-shake-mac-connection-string.png" | absolute_url }})
|
||||
|
||||
### Step 3. Configure device connection string to DevKit
|
||||
|
||||
1. With your DevKit connected to computer, open the terminal.
|
||||
|
||||
2. List relevant serial port:
|
||||
```bash
|
||||
ls -l /dev/cu.*
|
||||
```
|
||||
You get following outputs like:
|
||||
```bash
|
||||
crw-rw-rw- 1 root wheel 20, 1 May 17 18:36 /dev/cu.Bluetooth-Incoming-Port
|
||||
crw-rw-rw- 1 root wheel 20, 33 May 18 18:11 /dev/cu.usbmodem1423
|
||||
```
|
||||
The later one ended with `usbmodem1423` is the actual serial port of the DevKit.
|
||||
|
||||
3. Open serial monitor:
|
||||
```bash
|
||||
screen /dev/cu.usbmodem1423 115200
|
||||
```
|
||||
|
||||
4. Get into configuration mode:
|
||||
Hold down button A, then push and release the reset button.
|
||||
|
||||
5. In the prompt of the serial port with `#`, configure your connection string you get from previous step:
|
||||
```bash
|
||||
set_az_iothub [your connection string]
|
||||
```
|
||||
You will see the information once configuration is successful:
|
||||
```bash
|
||||
INFO: Set Azure Iot hub connection string successfully.
|
||||
```
|
||||
Now exit the serial monitor by first type `Ctrl+A` and then `Ctrl+\` and type 'y'.
|
||||
|
||||
### Step 4. Deploy Azure Functions
|
||||
|
||||
#### A. Create Azure Functions
|
||||
|
||||
1. Click **New > Everything** and search for **Function App**:
|
||||
![shake-shake-mac-create-function-app]({{"/assets/images/shake-shake-mac-create-function-app.png" | absolute_url }})
|
||||
|
||||
2. Specify the Name and Resource Group of the function:
|
||||
![shake-shake-mac-function-app-name]({{"/assets/images/shake-shake-mac-function-app-name.png" | absolute_url }})
|
||||
|
||||
3. Go to the Function App you just created and create a new custom function:
|
||||
![shake-shake-mac-custom-function]({{"/assets/images/shake-shake-mac-custom-function.png" | absolute_url }})
|
||||
|
||||
4. Choose **EventHubTrigger-Javascript** from the template list and type the IoT Hub name you noted in **Event Hub name** field:
|
||||
![shake-shake-mac-eventhub-trigger]({{"/assets/images/shake-shake-mac-eventhub-trigger.png" | absolute_url }})
|
||||
|
||||
5. Click **New** to create Event Hub connection:
|
||||
![shake-shake-mac-new-eventhub-connection]({{"/assets/images/shake-shake-mac-new-eventhub-connection.png" | absolute_url }})
|
||||
|
||||
6. Select **IoT Hub** tab, confirm it selects the right IoT Hub and click **Select**:
|
||||
![shake-shake-mac-function-connection-string]({{"/assets/images/shake-shake-mac-function-connection-string.png" | absolute_url }})
|
||||
|
||||
7. Click **Create** to finish creating a new function.
|
||||
|
||||
#### B. Upload the Azure Functions files of the project
|
||||
|
||||
1. Click **[my function name] > View Files > Upload**:
|
||||
![shake-shake-mac-function-upload]({{"/assets/images/shake-shake-mac-function-upload.png" | absolute_url }})
|
||||
|
||||
2. Press `Cmd+Shift+G`, and then click **Go**.
|
||||
|
||||
3. Continue to navigate to the following folder:
|
||||
```bash
|
||||
~/Library/Arduino15/packages/AZ3166/hardware/stm32f4/0.8.1/libraries/AzureIotHub/examples/ShakeShake/azureFunction
|
||||
```
|
||||
4. Upload `index.js` and `package.json`.
|
||||
|
||||
5. Click `index.js` again to refresh the code:
|
||||
![shake-shake-mac-function-refresh]({{"/assets/images/shake-shake-mac-function-refresh.png" | absolute_url }})
|
||||
|
||||
6. Select **Platform features** and click **Console** to launch the console:
|
||||
![shake-shake-mac-open-console]({{"/assets/images/shake-shake-mac-open-console.png" | absolute_url }})
|
||||
|
||||
7. In the console, run the following commands:
|
||||
```bash
|
||||
cd [your function name]
|
||||
npm install
|
||||
```
|
||||
![shake-shake-mac-npm-install]({{"/assets/images/shake-shake-mac-npm-install.png" | absolute_url }})
|
||||
|
||||
#### C. Configure and run Azure Functions
|
||||
|
||||
1. Select **Platform features** and click **Application settings**:
|
||||
![shake-shake-mac-app-settings]({{"/assets/images/shake-shake-mac-app-settings.png" | absolute_url }})
|
||||
|
||||
2. Add a new Key / Value pair in **App settings** section and click **Save**:
|
||||
- Key: **iotHubConnectionString**
|
||||
- Value: **[your IoT Hub connection string]**
|
||||
![shake-shake-mac-eventhub-connection-string]({{"/assets/images/shake-shake-mac-eventhub-connection-string.png" | absolute_url }})
|
||||
|
||||
3. Go to your Azure Function code and click **Run**:
|
||||
![shake-shake-mac-function-run]({{"/assets/images/shake-shake-mac-function-run.png" | absolute_url }})
|
||||
|
||||
### Step 5. Build and upload Arduino sketch
|
||||
|
||||
#### A. Open the Arduino Examples folder in VS Code:
|
||||
|
||||
Make sure your DevKit is not connected. Start VS Code first and connect the DevKit to your computer. VS Code will automatically find it and pops up introduction page. Switch to **'Arduino Examples'** tab, navigate to `Examples for MXCHIP AZ3166 > AzureIoTHub` and click on `ShakeShake`.
|
||||
|
||||
![shake-shake-example]({{"/assets/images/shake-shake-example.png" | absolute_url }})
|
||||
|
||||
**Notice:** Occasionally, when you launch VS Code, you will be prompted with error that cannot find Arduino IDE or related board package. Close VS Code, launch Arduino IDE once and VS Code should locate Arduino IDE path correctly.
|
||||
{: .notice--warning}
|
||||
|
||||
#### B. Modify the #hashtag
|
||||
|
||||
Open `ShakeShake.ino` and look for the line of code:
|
||||
|
||||
```cpp
|
||||
static const char* iot_event = "{\"topic\":\"iot\"}";
|
||||
```
|
||||
|
||||
Replace the string `iot` in the curly brace with your preferred hashtag.
|
||||
|
||||
#### C. Build and upload Arduino sketch
|
||||
|
||||
Use `Cmd+Shift+P` to open the command palette, type **Arduino**, and then find and select **Arduino: Upload**. Then it will start compiling and uploading the Arduino sketch. After it is done, the DevKit reboots and starts running the code.
|
||||
|
||||
## Test the project
|
||||
|
||||
Check how to [test the result]({{"/docs/projects/shake-shake/#test-the-project" | absolute_url }}).
|
|
@ -7,6 +7,30 @@ last_modified_at: 2018-01-09
|
|||
|
||||
{% include toc icon="columns" %}
|
||||
|
||||
## Version 1.4.1 (August 6, 2018)
|
||||
|
||||
### Release Summary
|
||||
|
||||
* SDK
|
||||
|
||||
* Add [OTA Programming API]({{"docs/apis/ota" | absolute_url }}).
|
||||
|
||||
* UARTClass class support extra serial port (PB_6 & PB_7).
|
||||
|
||||
![UART1]({{"/assets/images/release/141_uart.png" | absolute_url }})
|
||||
|
||||
* [Audio class]({{"docs/apis/audio-v2" | absolute_url }}) support automatic level control on microphone.
|
||||
|
||||
* Mini Solution
|
||||
|
||||
* Add IoT DevKit firmware OTA update mini solution.
|
||||
|
||||
**Notice:** Please make sure you have upgrade the firmware before running the OTA mini solution.
|
||||
{: .notice--warning}
|
||||
|
||||
* Special thanks to [capfish](https://github.com/capfish) , [Adamantinu](https://github.com/Adamantinu) and [Chris Lovett](https://github.com/lovettchris), thank you for your contributions and feedbacks.
|
||||
|
||||
|
||||
## Version 1.4.0 (July 19, 2018)
|
||||
|
||||
### Release Summary
|
||||
|
@ -19,13 +43,13 @@ last_modified_at: 2018-01-09
|
|||
* SDK
|
||||
* Reduce the size of file system which builds upon the 2MB on-board SPI flash.
|
||||
|
||||
**Notice:** Because it need more on-board SPI flash space to store the new firmware for firmware updating, we reduced the space of [file system]({{"docs/apis/FileSystem" | absolute_url }}). So if you have files on IoT DevKit, please make sure they have been well backed up before upgrade to this new SDK.
|
||||
**Notice:** Because it need more on-board SPI flash space to store the new firmware for firmware updating, we reduced the space of [file system]({{"docs/apis/file-system" | absolute_url }}). So if you have files on IoT DevKit, please make sure they have been well backed up before upgrade to this new SDK.
|
||||
{: .notice--warning}
|
||||
|
||||
* Add [setVolume API]({{"docs/apis/audioV2" | absolute_url }}) to support change the audio volume.
|
||||
* Add [setVolume API]({{"docs/apis/audio-v2" | absolute_url }}) to support change the audio volume.
|
||||
|
||||
* Mini Solution
|
||||
* Update the DevKit Translator to use the new [Audio APIs]({{"docs/apis/audioV2" | absolute_url }}).
|
||||
* Update the DevKit Translator to use the new [Audio APIs]({{"docs/apis/audio-v2" | absolute_url }}).
|
||||
|
||||
* Development Tools
|
||||
* Deprecate existing one-click installation package.
|
||||
|
@ -68,7 +92,7 @@ last_modified_at: 2018-01-09
|
|||
* Add [Watchdog Timer API](https://microsoft.github.io/azure-iot-developer-kit/docs/apis/watchdog-timer/).
|
||||
* Add [External Interrupts API](https://microsoft.github.io/azure-iot-developer-kit/docs/apis/external-interrupts/).
|
||||
* Fix MQTT client reconnect issue.
|
||||
* Filter out DevKit hotspot in the WiFi configuration page.
|
||||
* Filter out IoT DevKit hotspot in the WiFi configuration page.
|
||||
* Fix bugs.
|
||||
|
||||
* Mini Solution
|
||||
|
@ -154,7 +178,7 @@ During the past 2 weeks, we got chance to revisit our code and did some minor ch
|
|||
* Fix memory leak issue in IoT Hub MQTT client when there was a long drop on Wi-Fi.
|
||||
|
||||
* Development Tools
|
||||
* Improve the stability for DevKit Windows/Mac installation.
|
||||
* Improve the stability for IoT DevKit Windows/Mac installation.
|
||||
* Support customized IoT Hub Device ID in configuring device connection string.
|
||||
|
||||
### Downloads
|
||||
|
@ -171,11 +195,11 @@ Happy new year 2018! Let us talk about the fundamentals of IoT this time: the se
|
|||
### Release Summary
|
||||
|
||||
* Firmware
|
||||
* Upgrade the DevKit firmware to enable DPS feature.
|
||||
* Upgrade the IoT DevKit firmware to enable DPS feature.
|
||||
* New tool `set_dps_uds` is added in the configuration mode, which help to save the **Unique Device Secret (UDS)** into the STSAFE chip, for more detail please check [this topic]({{"/docs/projects/dps/#save-unique-device-secret-on-stsafe-security-chip" | absolute_url }}).
|
||||
|
||||
* SDK
|
||||
* Open source [DevKit SDK](https://github.com/Microsoft/devkit-sdk), you are welcome to contribute :)
|
||||
* Open source [IoT DevKit SDK](https://github.com/Microsoft/devkit-sdk), you are welcome to contribute :)
|
||||
* Upgrade the Azure IoT C SDK to [1.1.28]( https://github.com/Azure/azure-iot-sdk-c/releases/tag/2017-11-17).
|
||||
* Archive the Azure IoT C SDK in the Arduino board package, greatly reduce the compile time.
|
||||
* Enable the secure channel, protecting confidentiality and integrity of data with STSAFE chip on IoT DevKit.
|
||||
|
@ -235,7 +259,7 @@ The new Audio library gives the ability to continuous recording voice through th
|
|||
|
||||
## Version 1.2.0 (October 24, 2017)
|
||||
|
||||
No more manual steps to prepare your DevKit development environment on macOS! The time saving one-click installation now support macOS as well. And yes, we love bash.
|
||||
No more manual steps to prepare your IoT DevKit development environment on macOS! The time saving one-click installation now support macOS as well. And yes, we love bash.
|
||||
|
||||
### Release Summary
|
||||
|
||||
|
@ -247,7 +271,7 @@ No more manual steps to prepare your DevKit development environment on macOS! Th
|
|||
* Bug fix: Enable HttpClient response callback when handling large response body.
|
||||
|
||||
* Project Catalog
|
||||
* New mini solution: DeviceStates. Use Azure IoT Hub device twins to monitor DevKit state and control the user LED.
|
||||
* New mini solution: DeviceStates. Use Azure IoT Hub device twins to monitor IoT DevKit state and control the user LED.
|
||||
* Fix gyroscope values and added acceleration sensor in SensorStatus sample.
|
||||
* Use MQTT Client wrapper for GetStarted, RemoteMonitoring and ShakeShake mini solutions.
|
||||
* Improve telemetry logics in mini solutions on macOS.
|
||||
|
@ -287,12 +311,12 @@ No more manual steps to prepare your DevKit development environment on macOS! Th
|
|||
|
||||
## Version 1.1.0 (September 4, 2017)
|
||||
|
||||
DevKit now officially has full support for [ST-SAFE](http://www.st.com/en/secure-mcus/stsafe-a100.html){:target="_blank"}, the security chip that provides secure authentication and data management for IoT solutions. Since it's enabled on bootloader level, a [firmware upgrade]({{"/docs/firmware-upgrading" | absolute_url}}) is mandatory to make the DevKit work properly.
|
||||
IoT DevKit now officially has full support for [ST-SAFE](http://www.st.com/en/secure-mcus/stsafe-a100.html){:target="_blank"}, the security chip that provides secure authentication and data management for IoT solutions. Since it's enabled on bootloader level, a [firmware upgrade]({{"/docs/firmware-upgrading" | absolute_url}}) is mandatory to make the IoT DevKit work properly.
|
||||
|
||||
### Release Summary
|
||||
|
||||
* Firmware
|
||||
* Upgrade the DevKit firmware to enable STSAFE.
|
||||
* Upgrade the IoT DevKit firmware to enable STSAFE.
|
||||
|
||||
* SDK
|
||||
* Bug fix: Under bad network environment, the Device SDK in mbed OS occasionally crashes.
|
||||
|
@ -330,7 +354,7 @@ Summer does not mean slow down. We further enriched our project catalog and tune
|
|||
* Add support for audio playback API.
|
||||
|
||||
* Project Catalog
|
||||
* Add 'DevKit Translator' example for DevKit to understand more languages :robot:.
|
||||
* Add 'DevKit Translator' example for IoT DevKit to understand more languages :robot:.
|
||||
* Add 'Door Monitor' example uses third party email service to send notifications.
|
||||
* Replace manual steps with VS Code tasks for 'Connect to Azure IoT Hub' example.
|
||||
* Improve Azure Functions stability and performance used by examples.
|
||||
|
@ -399,7 +423,7 @@ After a month work of stabilizing the code, fixing bugs and adding more samples,
|
|||
|
||||
* Project Catalog
|
||||
* Add 'Connect to Azure IoT Hub' example and documentation that align with other [Azure IoT Hub get started tutorials](https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-get-started){:target="_blank"}.
|
||||
* Add 'Remote Monitoring' example and documentation that make DevKit connect to [Azure IoT Suite](https://www.azureiotsuite.com){:target="_blank"}.
|
||||
* Add 'Remote Monitoring' example and documentation that make IoT DevKit connect to [Azure IoT Suite](https://www.azureiotsuite.com){:target="_blank"}.
|
||||
* Add 'MQTT Client' example and documentation that send MQTT messages to public free MQTT broker.
|
||||
* Shake, Shake: Use testing Twitter bearer token as default, developer can replace it with her own by following the tutorial.
|
||||
* Shake, Shake: Add delay and retry logic when not receiving any message due to function delay.
|
||||
|
@ -412,7 +436,7 @@ After a month work of stabilizing the code, fixing bugs and adding more samples,
|
|||
|
||||
## Version 0.8.1 (May 21, 2017)
|
||||
|
||||
Some bug fixes before DevKit debut on [//Build](https://build.microsoft.com/){:target="_blank"} and [Maker Faire Bay Area](http://makerfaire.com/){:target="_blank"}.
|
||||
Some bug fixes before IoT DevKit debut on [//Build](https://build.microsoft.com/){:target="_blank"} and [Maker Faire Bay Area](http://makerfaire.com/){:target="_blank"}.
|
||||
|
||||
## Version 0.8.0 (May 5, 2017)
|
||||
|
||||
|
|
|
@ -0,0 +1,24 @@
|
|||
---
|
||||
title: "IoT DevKit OTA updates"
|
||||
permalink: /docs/projects/devkit-ota/
|
||||
redirect_to:
|
||||
- https://github.com/Microsoft/vscode-iot-workbench/blob/master/docs/iot-devkit/devkit-ota.md
|
||||
excerpt: "Update IoT DevKit firmware OTA (Over-the-Air) through Azure IoT Hub Automatic Device Management."
|
||||
header:
|
||||
overlay_image: /assets/images/projects-ota-firmware-updateg.jpg
|
||||
overlay_full: true
|
||||
teaser: /assets/images/projects-ota-firmware-update-th.jpg
|
||||
icons:
|
||||
- url: /assets/images/icon-iot-hub.svg
|
||||
target: https://azure.microsoft.com/en-us/services/iot-hub/
|
||||
title: IoT Hub
|
||||
difficulty: MEDIUM
|
||||
variable:
|
||||
- platform: windows
|
||||
name: Windows
|
||||
- platform: macos
|
||||
name: macOS
|
||||
last_modified_at: 2018-08-03
|
||||
---
|
||||
|
||||
|
|
@ -3,7 +3,7 @@ title: "Remote Monitoring"
|
|||
permalink: /docs/projects/remote-monitoring/
|
||||
redirect_to:
|
||||
- https://github.com/Microsoft/vscode-iot-workbench/blob/master/docs/iot-devkit/devkit_remote_monitoringv2.md
|
||||
excerpt: "Visualize sensors status on DevKit using Azure IoT Suite Remote Monitoring."
|
||||
excerpt: "Visualize sensors status on IoT DevKit using Azure IoT Suite Remote Monitoring."
|
||||
PreviousVersionUrl: https://docs.microsoft.com/en-us/azure/iot-accelerators/iot-accelerators-arduino-iot-devkit-az3166-devkit-remote-monitoringv2
|
||||
header:
|
||||
overlay_image: /assets/images/projects-remote-monitoring.jpg
|
||||
|
@ -31,140 +31,3 @@ variable:
|
|||
name: macOS
|
||||
last_modified_at: 2017-06-28
|
||||
---
|
||||
|
||||
In this tutorial, you learn how to run a sample app on your DevKit to send sensor data to your Azure IoT Suite.
|
||||
|
||||
{% include toc icon="columns" %}
|
||||
|
||||
## What you need
|
||||
|
||||
Finish the [Getting Started Guide]({{"/docs/get-started/" | absolute_url }}) to:
|
||||
|
||||
* Have your DevKit connected to Wi-Fi
|
||||
* Prepare the development environment
|
||||
|
||||
An active Azure subscription. If you do not have one, you can register via one of these two methods:
|
||||
|
||||
* Activate a [free 30-day trial Microsoft Azure account](https://azure.microsoft.com/en-us/free/){:target="_blank"}
|
||||
* Claim your [Azure credit](https://azure.microsoft.com/en-us/pricing/member-offers/msdn-benefits-details/){:target="_blank"} if you are MSDN or Visual Studio subscriber
|
||||
|
||||
## Step 1. Create an Azure IoT Suite
|
||||
|
||||
1. Go to [Azure IoT Suite site](https://www.azureiotsuite.com/) and click **Create a new solution**.
|
||||
|
||||
![remote-monitoring-azure-iot-suite-solution-types]({{"/assets/images/mini-solution/remote-monitoring/azure-iot-suite-solution-types.png" | absolute_url }})
|
||||
|
||||
**Notice:** By default, this creates an S2 IoT Hub after it creates one IoT Suite. If this IoT hub will not be used with massive number of devices, we highly recommend you downgrade it from S2 to S1, and delete the IoT Suite--the IoT Hub will also be deleted--when you no longer need it. This will save you money:).
|
||||
{: .notice--warning}
|
||||
|
||||
2. Select **Remote monitoring**.
|
||||
|
||||
3. Enter a solution name, select a subscription and a region, and then click **Create solution**. The solution may take a while to be provisioned.
|
||||
|
||||
![remote-monitoring-azure-iot-suite-new-solution]({{"/assets/images/mini-solution/remote-monitoring/azure-iot-suite-new-solution.png" | absolute_url }})
|
||||
|
||||
4. After the provision is completed, click **Launch**. Some simulated devices are created for the solution during the provision process. Click **DEVICES** to check them out.
|
||||
|
||||
![remote-monitoring-azure-iot-suite-new-solution-created]({{"/assets/images/mini-solution/remote-monitoring/azure-iot-suite-new-solution-created.png" | absolute_url }})
|
||||
|
||||
![remote-monitoring-azure-iot-suite-console]({{"/assets/images/mini-solution/remote-monitoring/azure-iot-suite-console.png" | absolute_url }})
|
||||
|
||||
5. Click **ADD A DEVICE**.
|
||||
|
||||
6. Click **Add New** for **Custom Device**.
|
||||
|
||||
![remote-monitoring-azure-iot-suite-add-new-device]({{"/assets/images/mini-solution/remote-monitoring/azure-iot-suite-add-new-device.png" | absolute_url }})
|
||||
|
||||
7. Click **Let me define my own Device ID**, enter `AZ3166`, and then click **Create**.
|
||||
|
||||
![remote-monitoring-azure-iot-suite-new-device-configuration]({{"/assets/images/mini-solution/remote-monitoring/azure-iot-suite-new-device-configuration.png" | absolute_url }})
|
||||
|
||||
8. Make a note of **IoT Hub Hostname**, and click **Done**.
|
||||
|
||||
## Step 2. Open the RemoteMonitoring sample
|
||||
|
||||
1. Disconnect the DevKit from your computer, if it is connected.
|
||||
|
||||
2. Start VS Code.
|
||||
|
||||
3. Connect the DevKit to your computer. VS Code automatically detects your DevKit and opens the following pages:
|
||||
* The DevKit introduction page.
|
||||
* Arduino Examples: Hands-on samples to get started with DevKit.
|
||||
|
||||
4. Expand left side **ARDUINO EXAMPLES** section, browse to **Examples for MXCHIP AZ3166 > AzureIoT**, and select **RemoteMonitoring**. This will open a new VS Code window with a project folder in it.
|
||||
|
||||
![mini-solution-vscode]({{"/assets/images/mini-solution/vscode_start.png" | absolute_url }})
|
||||
|
||||
If you happen to close the pane, you can reopen it. Use `Ctrl+Shift+P` (macOS: `Cmd+Shift+P`) to open the command palette, type **Arduino**, and then find and select **Arduino: Examples**.
|
||||
|
||||
## Step 3. Provision required Azure services
|
||||
|
||||
In the solution window, run your task through `Ctrl+P` (macOS: `Cmd+P`) by entering `task cloud-provision` in the provided text box:
|
||||
|
||||
In the VS Code terminal, an interactive command line guides you through provisioning the required Azure services:
|
||||
|
||||
![remote-monitoring-provision]({{"/assets/images/mini-solution/remote-monitoring/provision.png" | absolute_url }})
|
||||
|
||||
**Notice:** If the page hangs in the loading status when trying to sign in to Azure, please check this [FAQ steps]({{"/docs/faq/#page-hangs-when-log-in-azure" | absolute_url}}) to resolve the issue.
|
||||
{: .notice--warning}
|
||||
|
||||
## Step 4. Build and upload the device code
|
||||
|
||||
{% include switch.html content = page.variable %}
|
||||
|
||||
### Windows
|
||||
|
||||
1. Use `Ctrl+P` to run `task config-device-connection`.
|
||||
|
||||
2. The terminal will ask you whether you want to use connection string that retrieves from `task cloud-provision` step. You could also input your own device connection string by clicking 'Create New...'
|
||||
|
||||
3. The terminal prompts you to enter configuration mode. To do so, hold down button A, then push and release the reset button. The screen displays the DevKit id and 'Configuration'.
|
||||
![Verification and upload of the Arduino sketch]({{"/assets/images/mini-solution/remote-monitoring/config-device-connection.png" | absolute_url }})
|
||||
|
||||
4. After `task config-device-connection` finished, click `F1` to load VS Code commands and select `Arduino: Upload`, then VS Code starts verifying and uploading the Arduino sketch:
|
||||
![Verification and upload of the Arduino sketch]({{"/assets/images/mini-solution/remote-monitoring/arduino-upload.png" | absolute_url }})
|
||||
|
||||
The DevKit reboots and starts running the code.
|
||||
|
||||
**Notice:** Occasionally, you may get an "Error: AZ3166: Unknown package" error message. This occurs when the board package index is not refreshed correctly. Check this [FAQ steps]({{"/docs/faq/#development" | absolute_url}}) to resolve this issue.
|
||||
{: .notice--warning}
|
||||
|
||||
### macOS
|
||||
|
||||
1. Put DevKit into configuration mode:
|
||||
Hold down button A, then push and release the reset button. The screen displays 'Configuration'.
|
||||
|
||||
2. Use `Cmd+P` to run `task config-device-connection`.
|
||||
|
||||
3. The terminal will ask you whether you want to use connection string that retrieves from `task cloud-provision` step. You could also input your own device connection string by clicking 'Create New...'
|
||||
![device-upload]({{"/assets/images/mini-solution/remote-monitoring/config-device-connection.png" | absolute_url }})
|
||||
|
||||
4. After `task config-device-connection` finished, click `Cmd + shift + p` to load VS Code commands and select `Arduino: Upload`, then VS Code starts verifying and uploading the Arduino sketch:
|
||||
![device-upload]({{"/assets/images/mini-solution/remote-monitoring/arduino-upload.png" | absolute_url }})
|
||||
|
||||
The DevKit reboots and starts running the code.
|
||||
|
||||
**Notice:** Occasionally, you may get an "Error: AZ3166: Unknown package" error message. This occurs when the board package index is not refreshed correctly. Check this [FAQ steps]({{"/docs/faq/#development" | absolute_url}}) to resolve the issue.
|
||||
{: .notice--warning}
|
||||
|
||||
## Test the project
|
||||
|
||||
When the sample app runs, DevKit sends sensor data over Wi-Fi to your Azure IoT Suite. To see the result, follow these steps:
|
||||
|
||||
1. Go to your Azure IoT Suite, and click **DASHBOARD**.
|
||||
|
||||
2. On the Azure IoT Suite solution console, you will see your DevKit sensor status.
|
||||
|
||||
{% include gallery id="layouts_gallery" caption="View sensor information within Azure IoT Suite." %}
|
||||
|
||||
## Customize device ID
|
||||
|
||||
You can customize device ID in IoT Hub by following [this doc]({{"/docs/customize-device-id/" | absolute_url }}), however, you still need to change the hardcoding `AZ3166` to customized device ID in the code currently. Here's the list of files you need to modify:
|
||||
|
||||
* [RemoteMonitoring.ino](https://github.com/Microsoft/devkit-sdk/blob/master/AZ3166/src/libraries/AzureIoT/examples/RemoteMonitoring/RemoteMonitoring.ino#L23)
|
||||
|
||||
## Problems and feedback
|
||||
|
||||
If you encounter problems, please refer to [FAQs]({{"/docs/faq/" | absolute_url }}) or reach out to us from the channels below.
|
||||
|
||||
{% include feedback.html tutorial="remote-monitoring" %}
|
||||
|
|
|
@ -8,5 +8,3 @@ header:
|
|||
difficulty: EASY
|
||||
last_modified_at: 2017-12-12
|
||||
---
|
||||
|
||||
This article describes how, as a device developer, to connect a MXChip IoT DevKit (DevKit) device to your Microsoft IoT Central application.
|
||||
|
|
|
@ -3,7 +3,7 @@ title: "MQTT Client"
|
|||
permalink: /docs/projects/mqtt-helloworld/
|
||||
redirect_to:
|
||||
- https://github.com/Microsoft/vscode-iot-workbench/blob/master/docs/iot-devkit/devkit-mqtt-client.md
|
||||
excerpt: "Use DevKit as a client to send messages to MQTT server."
|
||||
excerpt: "Use IoT DevKit as a client to send messages to MQTT server."
|
||||
PreviousVersionUrl: https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-arduino-iot-devkit-az3166-mqtt-helloworld
|
||||
header:
|
||||
overlay_image: /assets/images/projects-mqtt-helloworld.jpg
|
||||
|
@ -12,73 +12,3 @@ header:
|
|||
difficulty: EASY
|
||||
last_modified_at: 2017-06-28
|
||||
---
|
||||
|
||||
In this project, you learn how to use the MQTT Client library to send messages to an MQTT broker.
|
||||
The MQTT client library we used is part of the [Eclipse Paho](http://www.eclipse.org/paho/) project, which provides APIs for using MQTT over multiple means of transport.
|
||||
|
||||
{% include toc icon="columns" %}
|
||||
|
||||
## What you need
|
||||
|
||||
Finish the [Getting Started Guide]({{"/docs/get-started/" | absolute_url }}) to:
|
||||
|
||||
* Have your DevKit connected to Wi-Fi
|
||||
* Prepare the development environment
|
||||
|
||||
## Step 1. Open the project folder
|
||||
|
||||
1. Disconnect the DevKit from your computer, if it is already connected.
|
||||
|
||||
2. Start VS Code.
|
||||
|
||||
3. Connect the DevKit to your computer.
|
||||
VS Code automatically detects your DevKit and opens the following pages:
|
||||
* The DevKit introduction page.
|
||||
* Arduino Examples: Hands-on samples to get you started with your DevKit.
|
||||
Links to these two pages appear on the EXPLORER panel on the left side of the Visual Studio Code window.
|
||||
![mini-solution-vscode]({{"/assets/images/mini-solution/vscode_start.png" | absolute_url }})
|
||||
|
||||
## Step 2. Open the MQTTClient Arduino sample sketch
|
||||
|
||||
Expand left side **Aduino Examples** section, browse to **Examples for MXCHIP AZ3166 > MQTT**, and select **MQTTClient**. This will open a new VS Code window with a project folder in it.
|
||||
|
||||
![examples-folder]({{"/assets/images/mini-solution/mqtt-helloworld/examples.png" | absolute_url}})
|
||||
|
||||
If you happen to close the pane, you can reopen it. Use `Ctrl+Shift+P` (macOS: `Cmd+Shift+P`) to open the command palette, type **Arduino**, and then find and select **Arduino: Examples**.
|
||||
|
||||
## Step 3. Build and upload the Arduino sketch to the DevKit
|
||||
|
||||
Type `Ctrl+P` (macOS: `Cmd+P`) to run `task device-upload`. Once the upload is completed, DevKit restarts and runs the sketch.
|
||||
|
||||
![device-upload]({{"/assets/images/mini-solution/mqtt-helloworld/device-upload.jpg" | absolute_url}})
|
||||
|
||||
**Notice:** Occasionally, you may get the "Error: AZ3166: Unknown package" message. This occurs when the board package index is not refreshed. Check this [FAQ steps]({{"/docs/faq/#development" | absolute_url}}) to resolve this issue.
|
||||
{: .notice--warning}
|
||||
|
||||
## Test the project
|
||||
|
||||
In VS Code, follow these steps to open and set up the Serial Monitor:
|
||||
|
||||
1. Click the `COM[X]` word on the status bar to set the correct COM port with `STMicroelectronics`:
|
||||
![set-com-port]({{"/assets/images/mini-solution/mqtt-helloworld/set-com-port.jpg" | absolute_url}})
|
||||
|
||||
2. Click the power plug icon on the status bar to open the Serial Monitor:
|
||||
![serial-monitor]({{"/assets/images/mini-solution/mqtt-helloworld/serial-monitor.jpg" | absolute_url}})
|
||||
|
||||
3. On the status bar, click the number that represents the Baud Rate and set it to `115200`:
|
||||
![set-baud-rate]({{"/assets/images/mini-solution/mqtt-helloworld/set-baud-rate.jpg" | absolute_url}})
|
||||
|
||||
The Serial Monitor displays all the messages sent by the sample sketch. When the sketch runs, it connects the DevKit to Wi-Fi. When the Wi-Fi connection is successful, the sketch sends a message to the MQTT broker. After that, the sketch repeatedly sends two "iot.eclipse.org" messages using QoS 0 and QoS 1, respectively.
|
||||
|
||||
![serial-output]({{"/assets/images/mini-solution/mqtt-helloworld/serial-output.jpg" | absolute_url}})
|
||||
|
||||
## Problems and feedback
|
||||
|
||||
If you encounter problems, you can refer to [FAQs]({{"/docs/faq/" | absolute_url }}) or reach out to us from the channels below.
|
||||
|
||||
{% include feedback.html tutorial="mqtt-helloworld" %}
|
||||
|
||||
## See Also
|
||||
|
||||
* [Connect IoT DevKit AZ3166 to Azure IoT Hub in the cloud]({{"/docs/getting-started/" | absolute_url }})
|
||||
* [Shake, Shake for a Tweet]({{"/docs/projects/shake-shake/" | absolute_url }})
|
||||
|
|
|
@ -2,8 +2,9 @@
|
|||
title: "Device registration with DPS"
|
||||
permalink: /docs/projects/dps/
|
||||
redirect_to:
|
||||
- https://docs.microsoft.com/en-us/azure/iot-dps/how-to-connect-mxchip-iot-devkit
|
||||
- https://github.com/Microsoft/vscode-iot-workbench/blob/master/docs/iot-devkit/devkit_dps.md
|
||||
excerpt: "Use the Device Provisioning Service to automatically provision security enabled devices to IoT hub."
|
||||
PreviousVersionUrl: https://docs.microsoft.com/en-us/azure/iot-dps/how-to-connect-mxchip-iot-devkit
|
||||
header:
|
||||
overlay_image: /assets/images/projects-dps.jpg
|
||||
overlay_full: true
|
||||
|
@ -15,189 +16,3 @@ icons:
|
|||
difficulty: MEDIUM
|
||||
last_modified_at: 2018-01-05
|
||||
---
|
||||
|
||||
Microsoft Azure provides a rich set of integrated public cloud services for all your IoT solution needs. The IoT Hub Device Provisioning Service is a helper service for IoT Hub that enables zero-touch, just-in-time provisioning to the right IoT hub without requiring human intervention, enabling customers to provision millions of devices in a secure and scalable manner.
|
||||
|
||||
This project shows how to configure DevKit in order to make it automatically register to IoT Hub using the Device Provisioning Service. In this tutorial, you will learn how to:
|
||||
|
||||
* Set up the Device Provisioning Service configuration on the device
|
||||
* Save Unique Device Secret on STSAFE security chip
|
||||
* Generate X.509 certificate
|
||||
* Create a device enrollment entry in the Device Provisioning Service
|
||||
|
||||
{% include toc icon="columns" %}
|
||||
|
||||
## Before you begin
|
||||
|
||||
To complete the steps in this tutorial, you need the following:
|
||||
|
||||
* Prepare your DevKit with [Getting Started Guide]({{"/docs/get-started/" | absolute_url }}).
|
||||
* Upgrade to latest firmware (>= 1.3.0) with [Firmware Upgrading]({{"/docs/firmware-upgrading/" | absolute_url }}) tutorial.
|
||||
* Create and link IoT Hub with Device Provisioning Service instance with [Set up auto provisioning](https://docs.microsoft.com/en-us/azure/iot-dps/quick-setup-auto-provision).
|
||||
|
||||
## Set up the Device Provisioning Service configuration on the device
|
||||
|
||||
To enable the DevKit to connect to the Device Provisiong Service instance you just created:
|
||||
|
||||
1. In the Azure portal, select the **Overview** blade for your Device Provisioning Service and note down the **Global device endpoint** and **ID Scope** value.
|
||||
![DPS Global Endpoint and ID Scope]({{"/assets/images/mini-solution/dps/dps-global-endpoint.png" | absolute_url }})
|
||||
|
||||
2. Make sure `git` is installed on your machine and is added to the environment variables accessible to the command window. See [Software Freedom Conservancy's Git client tools](https://git-scm.com/download/) to have the latest version installed.
|
||||
|
||||
3. Open a command prompt. Clone the GitHub repo for DPS sample code:
|
||||
```bash
|
||||
git clone https://github.com/DevKitExamples/DevKitDPS.git
|
||||
```
|
||||
|
||||
4. Launch VS Code and connect DevKit to computer, open the folder that contains the code you cloned.
|
||||
|
||||
5. Open **DevKitDPS.ino**, Find and replace `[Global Device Endpoint]` and `[ID Scope]` with the values you just note down.
|
||||
![DPS Endpoint]({{"/assets/images/mini-solution/dps/endpoint.png" | absolute_url }})
|
||||
You can leave the **registrationId** as blank, the application will generate one for you based on the MAC address and firmware version. If you want to customized it, the Registration ID has to use alphanumeric, lowercase, and hyphen combinations only with maximum 128 characters long. See [Manage device enrollments with Azure portal](https://docs.microsoft.com/en-us/azure/iot-dps/how-to-manage-enrollments) for more details.
|
||||
|
||||
6. Use **Quick Open** in VS Code (Windows: `Ctrl+P`, macOS: `Cmd+P`) and type **task device-upload** to build and upload the code to the DevKit.
|
||||
|
||||
7. Observe the success of the task in the output window.
|
||||
|
||||
## Save Unique Device Secret on STSAFE security chip
|
||||
|
||||
Device Provisioning Service can be configured on device based on its [Hardware Security Module (HSM)](https://azure.microsoft.com/en-us/blog/azure-iot-supports-new-security-hardware-to-strengthen-iot-security/). DevKit uses [Device Identity Composition Engine (DICE)](https://trustedcomputinggroup.org/wp-content/uploads/Foundational-Trust-for-IOT-and-Resource-Constrained-Devices.pdf) from the [Trusted Computing Group (TCG)](https://trustedcomputinggroup.org). A **Unique Device Secret (UDS)** saved in STSAFE security chip on the DevKit is used to generate the device unique [X.509](https://docs.microsoft.com/en-us/azure/iot-dps/tutorial-set-up-device#select-a-hardware-security-module) certificate. The certificate can be later used for the enrollment process in the Device Provisioning Service.
|
||||
|
||||
A typical **Unique Device Secret (UDS)** is a 64 characters long string. A sample UDS is as below:
|
||||
|
||||
<span id="uds"></span>
|
||||
```
|
||||
19e25a259d0c2be03a02d416c05c48ccd0cc7d1743458aae1cb488b074993eae
|
||||
```
|
||||
|
||||
<span id="hex"></span>
|
||||
Each of two characters are used as Hex value in the security calculation. So the above sample UDS is resolved to: "`0x19`, `0xe2`, `0x5a`, `0x25`, `0x9d`, `0x0c`, `0x2b`, `0xe0`, `0x3a`, `0x02`, `0xd4`, `0x16`, `0xc0`, `0x5c`, `0x48`, `0xcc`, `0xd0`, `0xcc`, `0x7d`, `0x17`, `0x43`, `0x45`, `0x8a`, `0xae`, `0x1c`, `0xb4`, `0x88`, `0xb0`, `0x74`, `0x99`, `0x3e`, `0xae`".
|
||||
|
||||
To save Unique Device Secret on the DevKit:
|
||||
|
||||
<span id="steps"></span>
|
||||
1. Take the sample UDS string above and change one or many characters to other values between `0` and `f`. This is used as your own UDS.
|
||||
|
||||
2. Open serial monitor by using tool like Putty, see [Use Configuration Mode]({{"/docs/use-configuration-mode/" | absolute_url }}) for details.
|
||||
|
||||
3. With the DevKit connected to computer, hold down button A, then push and release the reset button to enter configuration mode. The screen should show the DevKit id and **'Configuration'**.
|
||||
|
||||
4. Copy the sample UDS above. In serial monitor window, type **set_dps_uds [your_own_uds_value]** and press the Enter key to save it.
|
||||
|
||||
5. Without closing the serial monitor window, press reset button on the DevKit.
|
||||
|
||||
6. Note down **DevKit MAC Address** and **DevKit Firmware Version** value.
|
||||
![Firmware version]({{"/assets/images/mini-solution/dps/firmware-version.png" | absolute_url }})
|
||||
|
||||
## Generate X.509 certificate
|
||||
|
||||
{% include switch.html content = page.variable %}
|
||||
|
||||
1. Open file explorer and go to the folder contain the DSP sample code you cloned, there is a **.build** folder, find and copy **DPS.ino.bin** and **DPS.ino.map** in it.
|
||||
![Generated files]({{"/assets/images/mini-solution/dps/generated-files.png" | absolute_url }})
|
||||
|
||||
**Note:** If you have changed the `built.path` configuration for Arduino to other folder. You need to find those files in the folder you configured.
|
||||
{: .notice--info}
|
||||
|
||||
2. Paste these two files into **tools** folder on the same level with **.build** folder.
|
||||
|
||||
3. Run **dps_cert_gen.exe** (or **./dps_cert_gen_mac** for macOS), follow the prompts to enter your **UDS**, **MAC address** for the DevKit and the **firmware version** to generate the X.509 certificate.
|
||||
|
||||
Windows:
|
||||
![Run dps_cert_gen.exe]({{"/assets/images/mini-solution/dps/dps-cert-gen.png" | absolute_url }})
|
||||
|
||||
macOS:
|
||||
![Run dps_cert_gen_mac for mac]({{"/assets/images/mini-solution/dps/dps-cert-gen-mac.png" | absolute_url }})
|
||||
|
||||
4. Observe the success of generation, a **.pem** certificate is saved in the same folder.
|
||||
|
||||
|
||||
## Create a device enrollment entry in the Device Provisioning Service
|
||||
|
||||
1. In the Azure portal, navigate to your provisioning service. Click **Manage enrollments**, and select the **Individual Enrollments** tab.
|
||||
![Individual enrollments]({{"/assets/images/mini-solution/dps/individual-enrollments.png" | absolute_url }})
|
||||
|
||||
2. Click **Add**.
|
||||
|
||||
3. In **Mechanism**, choose **X.509**.
|
||||
![Upload cert]({{"/assets/images/mini-solution/dps/upload-cert.png" | absolute_url }})
|
||||
|
||||
4. In **Certificate .pem or .cer file**, upload the **.pem** certificate you just have.
|
||||
|
||||
5. Leave the rest as default and click **Save**.
|
||||
|
||||
## Start the DevKit
|
||||
|
||||
1. Launch VS Code and open serial monitor.
|
||||
|
||||
2. Press the **Reset** button on your DevKit.
|
||||
|
||||
You should see the DevKit start the registration with your Device Provisioning Service.
|
||||
|
||||
![VS Code output]({{"/assets/images/mini-solution/dps/vscode-output.png" | absolute_url }})
|
||||
|
||||
## Verify the DevKit is registered on IoT Hub
|
||||
|
||||
Once your device boots, the following actions should take place:
|
||||
|
||||
1. The device sends a registration request to your Device Provisioning Service.
|
||||
2. The Device Provisioning Service sends back a registration challenge to which your device responds.
|
||||
3. On successful registration, the Device Provisioning Service sends the IoT hub URI and device ID back to the device.
|
||||
4. The IoT Hub client application on the device then connects to your hub.
|
||||
5. On successful connection to the hub, you should see the device appear in the IoT hub's Device Explorer.
|
||||
![Device registered]({{"/assets/images/mini-solution/dps/device-registered.png" | absolute_url }})
|
||||
|
||||
## Customize device ID
|
||||
|
||||
You can customize device ID in IoT Hub by following [this doc]({{"/docs/customize-device-id/" | absolute_url }}), however, you still need to change the hardcoding `AZ3166` to customized device ID in the code currently. Here's the list of files you need to modify:
|
||||
|
||||
* [config.h](https://github.com/DevKitExamples/DevKitDPS/blob/master/config.h#L9)
|
||||
|
||||
## Problems and feedback
|
||||
|
||||
If you encounter problems, you can find [FAQs]({{"/docs/faq/" | absolute_url }}) if you encounter problems or reach out to us from the channels below.
|
||||
|
||||
{% include feedback.html tutorial="dps" %}
|
||||
|
||||
## Next Steps
|
||||
|
||||
Now that you have learned prepare the DevKit to enroll a device securely to DPS using DICE, so that it will automatically register to IoT Hub with zero-touch.
|
||||
|
||||
Advance to the other tutorials to learn:
|
||||
|
||||
* [Create and provision a simulated device](https://docs.microsoft.com/en-us/azure/iot-dps/quick-create-simulated-device)
|
||||
* [Manage device enrollments](https://docs.microsoft.com/en-us/azure/iot-dps/how-to-manage-enrollments)
|
||||
* [Revoke device access](https://docs.microsoft.com/en-us/azure/iot-dps/how-to-revoke-device-access-portal)
|
||||
* [Use HSM with SDK](https://docs.microsoft.com/en-us/azure/iot-dps/use-hsm-with-sdk)
|
||||
* [Control access to Provisioning Service](https://docs.microsoft.com/en-us/azure/iot-dps/how-to-control-access)
|
||||
|
||||
<script>
|
||||
function generateUDS() {
|
||||
var uds = [];
|
||||
for (var i = 0; i < 32; i++) {
|
||||
var char = Math.floor(Math.random() * 256).toString(16);
|
||||
if (char.length === 1) {
|
||||
char = `0${char}`;
|
||||
}
|
||||
uds.push(char);
|
||||
}
|
||||
return uds;
|
||||
}
|
||||
|
||||
(function() {
|
||||
var udsWatcher = setInterval(function(){
|
||||
if($) {
|
||||
clearInterval(udsWatcher);
|
||||
var uds = generateUDS();
|
||||
$('p:has(#uds) + .highlighter-rouge code').html(uds.join(''));
|
||||
|
||||
var chars = $('p:has(#hex) code');
|
||||
for (var i = 0; i < 32; i++) {
|
||||
$(chars.get(i)).html(`0x${uds[i]}`);
|
||||
}
|
||||
|
||||
$('p:has(#steps) + ol li:first-child').remove();
|
||||
}
|
||||
}, 500);
|
||||
})();
|
||||
</script>
|
|
@ -3,7 +3,7 @@ title: "DevKit Translator"
|
|||
permalink: /docs/projects/devkit-translator/
|
||||
redirect_to:
|
||||
- https://github.com/Microsoft/vscode-iot-workbench/blob/master/docs/iot-devkit/devkit-translator.md
|
||||
excerpt: "Turn DevKit as a translator by using Bing Speech Translator service."
|
||||
excerpt: "Turn IoT DevKit as a translator by using Bing Speech Translator service."
|
||||
PreviousVersionUrl: https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-arduino-iot-devkit-az3166-translator
|
||||
header:
|
||||
overlay_image: /assets/images/projects-devkit-translator.jpg
|
||||
|
@ -46,144 +46,3 @@ variable:
|
|||
name: macOS
|
||||
last_modified_at: 2017-07-17
|
||||
---
|
||||
|
||||
In this project, you learn how to use DevKit as a translator. The app records your voice and translates it to English text shown on the DevKit screen.
|
||||
|
||||
{% include toc icon="columns" %}
|
||||
|
||||
## What you need
|
||||
|
||||
Finish the [Getting Started Guide]({{"/docs/get-started/" | absolute_url }}) to:
|
||||
|
||||
* Have your DevKit connected to Wi-Fi
|
||||
* Prepare the development environment
|
||||
|
||||
An active Azure subscription. If you do not have one, you can register via one of the methods:
|
||||
|
||||
* Activate a [free 30-day trial Microsoft Azure account](https://azure.microsoft.com/en-us/free/){:target="_blank"}
|
||||
* Claim your [Azure credit](https://azure.microsoft.com/en-us/pricing/member-offers/msdn-benefits-details/){:target="_blank"} if you are MSDN or Visual Studio subscriber
|
||||
|
||||
## Step 1. Open the project folder
|
||||
|
||||
### A. Start VS Code
|
||||
|
||||
- Make sure your DevKit is not connected to your PC.
|
||||
- Start VS Code
|
||||
- Connect the DevKit to your computer.
|
||||
|
||||
VS Code automatically finds the DevKit and opens an introduction page:
|
||||
|
||||
![Introduction page]({{"/assets/images/mini-solution/vscode_start.png" | absolute_url }})
|
||||
|
||||
**Notice:** Occasionally, when you launch VS Code, you may be prompted with error saying that the Arduino IDE or related board package cannot be found. If this happens, close VS Code, launch the Arduino IDE once again, and VS Code should locate the Arduino IDE path correctly.
|
||||
{: .notice--warning}
|
||||
|
||||
### B. Open the Arduino Examples folder
|
||||
|
||||
Expand left side **ARDUINO EXAMPLES** section, browse to **Examples for MXCHIP AZ3166 > AzureIoT**, and select **DevKitTranslator**. This will open a new VS Code window with the DEVKITTRANSLATOR project folder in it.
|
||||
|
||||
![mini-solution-examples]({{"/assets/images/mini-solution/vscode_examples.png" | absolute_url }})
|
||||
|
||||
If you happen to close the pane, you can reopen it. Use `Ctrl+Shift+P` (macOS: `Cmd+Shift+P`) to open the command palette, type **Arduino**, and then find and select **Arduino: Examples**.
|
||||
|
||||
## Step 2. Provision Azure services
|
||||
|
||||
In the solution window, run the cloud-provisioniong task by typing `Ctrl+P` (macOS: `Cmd+P`) and entering `task cloud-provision` in the text box:
|
||||
|
||||
In the VS Code terminal, an interactive command line will guide you through provisioning all required Azure services:
|
||||
|
||||
![mini-solution-provision-sub]({{"/assets/images/mini-solution/devkit-translator/cloud-provision.png" | absolute_url }})
|
||||
|
||||
**Notice:** If the page hangs in the loading status when trying to sign in to Azure, please check this [FAQ steps]({{"/docs/faq/#page-hangs-when-log-in-azure" | absolute_url}}) to resolve this issue.
|
||||
{: .notice--warning}
|
||||
|
||||
## Step 3. Deploy Azure Functions
|
||||
|
||||
Use `Ctrl+P` (macOS: `Cmd+P`) to run `task cloud-deploy` to deploy the Azure Functions code. This process usually takes 2 to 5 minutes to complete:
|
||||
|
||||
![mini-solution-deploy]({{"/assets/images/mini-solution/devkit-translator/cloud-deploy.png" | absolute_url }})
|
||||
|
||||
After Azure Function deploys successfully, fill in the azure_config.h file with function app name. You can navigate to [Azure portal](https://portal.azure.com/){:target="_blank"} to find it:
|
||||
|
||||
![mini-solution-function-app]({{"/assets/images/mini-solution/devkit-translator/azure-function.png" | absolute_url }})
|
||||
|
||||
**Notice:** If the Azure Function does not work properly, please check this [FAQ steps]({{"/docs/faq/#compilation-error-for-azure-function" | absolute_url}}) to resolve this issue.
|
||||
{: .notice--warning}
|
||||
|
||||
## Step 4. Build and upload the device code
|
||||
|
||||
{% include switch.html content = page.variable %}
|
||||
|
||||
### Windows
|
||||
|
||||
1. Use `Ctrl+P` to run `task config-device-connection`.
|
||||
|
||||
2. The terminal will ask you whether you want to use connection string that retrieves from `task cloud-provision` step. You could also input your own device connection string by clicking 'Create New...'
|
||||
|
||||
3. The terminal prompts you to enter configuration mode. To do so, hold down button A, then push and release the reset button. The screen displays the DevKit id and 'Configuration'.
|
||||
![Verification and upload of the Arduino sketch]({{"/assets/images/mini-solution/devkit-translator/config-device-connection.png" | absolute_url }})
|
||||
|
||||
4. After `task config-device-connection` finished, click `F1` to load VS Code commands and select `Arduino: Upload`, then VS Code starts verifying and uploading the Arduino sketch:
|
||||
![Verification and upload of the Arduino sketch]({{"/assets/images/mini-solution/devkit-translator/arduino-upload.png" | absolute_url }})
|
||||
|
||||
The DevKit reboots and starts running the code.
|
||||
|
||||
**Notice:** Occasionally, you may get an "Error: AZ3166: Unknown package" eror message. This occurs when the board package index is not refreshed correctly. Check this [FAQ steps]({{"/docs/faq/#development" | absolute_url}}) to resolve this issue.
|
||||
{: .notice--warning}
|
||||
|
||||
### macOS
|
||||
|
||||
1. Put DevKit into configuration mode:
|
||||
Hold down button A, then push and release the reset button. The screen displays 'Configuration'.
|
||||
|
||||
2. Use `Cmd+P` to run `task config-device-connection`.
|
||||
|
||||
3. The terminal will ask you whether you want to use connection string that retrieves from `task cloud-provision` step. You could also input your own device connection string by clicking 'Create New...'
|
||||
![device-upload]({{"/assets/images/mini-solution/devkit-translator/config-device-connection.png" | absolute_url }})
|
||||
|
||||
4. After `task config-device-connection` finished, click `Cmd + shift + p` to load VS Code commands and select `Arduino: Upload`, then VS Code starts verifying and uploading the Arduino sketch:
|
||||
![device-upload]({{"/assets/images/mini-solution/devkit-translator/arduino-upload.png" | absolute_url }})
|
||||
|
||||
The DevKit reboots and starts running the code.
|
||||
|
||||
**Notice:** Occasionally, you may get an "Error: AZ3166: Unknown package" error message. This is occurs when the board package index is not refreshed correctly. Check this [FAQ steps]({{"/docs/faq/#development" | absolute_url}}) to resolve this issue.
|
||||
{: .notice--warning}
|
||||
|
||||
## Test the project
|
||||
|
||||
After app initialization, follow the instructions on the DevKit screen.
|
||||
The default source language is Chinese.
|
||||
|
||||
To translate Chinese to English:
|
||||
|
||||
- Simply press and hold button B while speaking, then release button B to initiate the translation. Several seconds later, the translation will be shown on the screen.
|
||||
|
||||
To select a source language other than Chinese:
|
||||
|
||||
- Press button A to enter setup mode.
|
||||
- Press button B to scroll all supported source languages.
|
||||
- Press button A to confirm your choice of source language.
|
||||
- Press and hold button B while speaking, then release button B to initiate the translation. Several seconds later, the translation will be shown on the screen.
|
||||
|
||||
{% include gallery id="layouts_gallery" caption="Translate as you go" %}
|
||||
|
||||
- Press button A and B to scroll and select the source language.
|
||||
- Press button B to talk, release to send the voice and get the translation text
|
||||
|
||||
## How it works
|
||||
|
||||
![mini-solution-voice-to-tweet-diagram]({{"/assets/images/mini-solution/devkit-translator/diagram.png" | absolute_url }})
|
||||
|
||||
The Arduino sketch records your voice then posts an HTTP request to trigger Azure Functions. Azure Functions calls the cognitive service speech translator API to do the translation. After Azure Functions gets the translation text, it sends a C2D message to the device. Then the translation is displayed on the screen.
|
||||
|
||||
## Customize device ID
|
||||
|
||||
You can customize device ID in IoT Hub by following [this doc]({{"/docs/customize-device-id/" | absolute_url }}), however, you still need to change the hardcoding `AZ3166` to customized device ID in the code currently. Here's the list of files you need to modify:
|
||||
|
||||
* [azurefunction/devkit-translator/run.csx](https://github.com/Microsoft/devkit-sdk/blob/master/AZ3166/src/libraries/AzureIoT/examples/DevKitTranslator/azurefunction/devkit-translator/run.csx#L42)
|
||||
|
||||
## Problems and feedback
|
||||
|
||||
If you encounter problems, you can refer to [FAQs]({{"/docs/faq/" | absolute_url }}) or reach out to us from the channels below.
|
||||
|
||||
{% include feedback.html tutorial="devkit-translator" %}
|
||||
|
|
|
@ -43,231 +43,3 @@ variable:
|
|||
name: macOS
|
||||
last_modified_at: 2017-07-05
|
||||
---
|
||||
|
||||
In this project, you learn how to use the motion sensor to trigger an event using Azure Functions. The app will retrieve a random tweet with a #hashtag you have configured in your Arduino sketch. The tweet will display on the DevKit screen.
|
||||
|
||||
{% include toc icon="columns" %}
|
||||
|
||||
## What you need
|
||||
|
||||
Finish the [Getting Started Guide]({{"/docs/get-started/" | absolute_url }}) to:
|
||||
|
||||
* Have your DevKit connected to Wi-Fi
|
||||
* Prepare the development environment
|
||||
|
||||
An active Azure subscription. If you do not have one, you can register via one of these methods:
|
||||
|
||||
* Activate a [free 30-day trial Microsoft Azure account](https://azure.microsoft.com/en-us/free/){:target="_blank"}
|
||||
* Claim your [Azure credit](https://azure.microsoft.com/en-us/pricing/member-offers/msdn-benefits-details/){:target="_blank"} if you are an MSDN or Visual Studio subscriber
|
||||
|
||||
## Step 1. Open the project folder
|
||||
|
||||
### A. Start VS Code
|
||||
|
||||
- Make sure your DevKit is **not** connected to your computer.
|
||||
- Start VS Code.
|
||||
- Connect the DevKit to your computer.
|
||||
|
||||
VS Code will automatically find your DevKit and display an introduction page:
|
||||
|
||||
![mini-solution-vscode]({{"/assets/images/mini-solution/vscode_start.png" | absolute_url }})
|
||||
|
||||
**Notice:** Occasionally, when you launch VS Code, you may be prompted with an error message saying that the Arduino IDE or related board package cannot be found. If this should occur, close VS Code, launch the Arduino IDE again and VS Code should locate Arduino IDE path correctly.
|
||||
{: .notice--warning}
|
||||
|
||||
### B. Open Arduino Examples folder
|
||||
|
||||
Expand left side **ARDUINO EXAMPLES** section, browse to **Examples for MXCHIP AZ3166 > AzureIoT**, and select **ShakeShake**. This opens a new VS Code window with a project folder in it.
|
||||
|
||||
![mini-solution-examples]({{"/assets/images/mini-solution/vscode_examples.png" | absolute_url }})
|
||||
|
||||
If you happen to close the pane, you can reopen it. Use `Ctrl+Shift+P` (macOS: `Cmd+Shift+P`) to open the command palette, type **Arduino**, and then find and select **Arduino: Examples**.
|
||||
|
||||
## Step 2. Provision Azure services
|
||||
|
||||
1. In the solution window, run your task through `Ctrl+P` (macOS: `Cmd+P`) by entering `task cloud-provision`:
|
||||
|
||||
In the VS Code terminal, an interactive command line will guide you through provisioning the required Azure services:
|
||||
|
||||
![cloud-provision]({{"/assets/images/mini-solution/shake-shake/cloud-provision.png" | absolute_url }})
|
||||
|
||||
**Notice:** If the page hangs in the loading status when trying to sign in to Azure, please refer to this [FAQ steps]({{"/docs/faq/#page-hangs-when-log-in-azure" | absolute_url}}) to resolve the issue.
|
||||
{: .notice--warning}
|
||||
|
||||
2. When a list of Azure subscriptions display in the terminal, use the **up** and **down** arrow keys to select the Azure subscription that you will use to provision the Azure IoT Hub. Then press **Enter** to confirm the selected subscription.
|
||||
|
||||
![Select Azure subscription]({{"/assets/images/mini-solution/shake-shake/select-subscription.png" | absolute_url }})
|
||||
|
||||
_Select Azure subscription_
|
||||
|
||||
3. Provision IoT Hub
|
||||
* If you've provisioned IoT Hub(s) before, a list of IoT Hubs associated with the subscription appears in the terminal. Please use **up** and **down** arrow keys to select one from the list and press **Enter** to confirm.
|
||||
|
||||
![Select an existing IoT Hub]({{"/assets/images/mini-solution/shake-shake/select-existing-iothub.png" | absolute_url }})
|
||||
|
||||
_Select existing Free IoT Hub_
|
||||
|
||||
Wait several minutes to finish ARM Template deployment and IoT Hub Device provision. Then press any key to exit the terminal.
|
||||
|
||||
![Select an existing IoT Hub done]({{"/assets/images/mini-solution/shake-shake/select-iothub-done.png" | absolute_url }})
|
||||
|
||||
_Finish selecting IoT Hub_
|
||||
|
||||
* If you don't have any IoT Hub, please follow the steps to create a free IoT Hub:
|
||||
* Resource group provision:
|
||||
Use **up** and **down** arrow keys to choose a resource group you've created before or select **Create New...** to provision a new resource group. Complete the resource group provision according to the command line prompt.
|
||||
|
||||
![Select or create Azure resource group]({{"/assets/images/mini-solution/shake-shake/select-or-create-resource-group.png" | absolute_url }})
|
||||
|
||||
If you choose to create a new resource group:
|
||||
* Use **up** and **down** arrow keys to select region for a new resource group provision, and then press **Enter** to confirm.
|
||||
|
||||
![Select region for a new resource group provision]({{"/assets/images/mini-solution/shake-shake/select-region-for-resource-group.png" | absolute_url }})
|
||||
|
||||
_Select region for resource group provision_
|
||||
|
||||
* Input a name for new resource group.
|
||||
|
||||
![Input name for resource group]({{"/assets/images/mini-solution/shake-shake/input-name-for-resource-group.png" | absolute_url }})
|
||||
|
||||
_Input a name for resource group provision_
|
||||
|
||||
* IoT Hub provision:
|
||||
|
||||
Enter a name for your new IoT Hub, and press **Enter** to confirm.
|
||||
|
||||
![Input a name for IoT Hub]({{"/assets/images/mini-solution/shake-shake/input-name-for-iothub.png" | absolute_url }})
|
||||
|
||||
_Input a name for IoT Hub provision_
|
||||
|
||||
Wait several minutes to finish ARM Template deployment and IoT Hub Device provision. Then press any key to exit the terminal.
|
||||
|
||||
![Provision Azure IoT Hub done]({{"/assets/images/mini-solution/shake-shake/provision-iothub-done.png" | absolute_url }})
|
||||
|
||||
_Finish cloud provision_
|
||||
|
||||
## Step 3. Modify the #hashtag
|
||||
|
||||
Open `ShakeShake.ino` and look for this line of code:
|
||||
|
||||
```cpp
|
||||
static const char* iot_event = "{\"topic\":\"iot\"}";
|
||||
```
|
||||
|
||||
Replace the string `iot` within the curly braces with your preferred hashtag. DevKit will later retrieve a random tweet containing the hashtag you specified here.
|
||||
|
||||
## Step 4. Deploy Azure Functions
|
||||
|
||||
Use `Ctrl+P` (macOS: `Cmd+P`) to run `task cloud-deploy`. This will start deploying the Azure Functions code:
|
||||
|
||||
![cloud-deploy]({{"/assets/images/mini-solution/shake-shake/cloud-deploy.png" | absolute_url }})
|
||||
|
||||
**Notice:** Occasionally, the Azure Function may not work properly. If this occurs, please check this [FAQ steps]({{"/docs/faq/#compilation-error-for-azure-function" | absolute_url}}) to resolve this issue.
|
||||
{: .notice--warning}
|
||||
|
||||
## Step 5. Build and upload the device code
|
||||
|
||||
{% include switch.html content = page.variable %}
|
||||
|
||||
### Windows
|
||||
|
||||
1. Use `Ctrl+P` to run `task config-device-connection`.
|
||||
|
||||
2. The terminal will ask you whether you want to use connection string that retrieves from `task cloud-provision` step. You could also input your own device connection string by clicking 'Create New...'
|
||||
|
||||
3. The terminal prompts you to enter configuration mode. To do so, hold down button A, then push and release the reset button. The screen displays the DevKit id and 'Configuration'.
|
||||
![Verification and upload of the Arduino sketch]({{"/assets/images/mini-solution/shake-shake/config-device-connection.png" | absolute_url }})
|
||||
|
||||
4. After `task config-device-connection` finished, click `F1` to load VS Code commands and select `Arduino: Upload`, then VS Code starts verifying and uploading the Arduino sketch:
|
||||
![Verification and upload of the Arduino sketch]({{"/assets/images/mini-solution/shake-shake/arduino-upload.png" | absolute_url }})
|
||||
|
||||
The DevKit reboots and starts running the code.
|
||||
|
||||
**Notice:** Occasionally, you may get an "Error: AZ3166: Unknown package" error message. This occurs when the board package index is not refreshed correctly. Check this [FAQ steps]({{"/docs/faq/#development" | absolute_url}}) to resolve this issue.
|
||||
{: .notice--warning}
|
||||
|
||||
### macOS
|
||||
|
||||
1. Put DevKit into configuration mode:
|
||||
Hold down button A, then push and release the reset button. The screen displays 'Configuration'.
|
||||
|
||||
2. Use `Cmd+P` to run `task config-device-connection`.
|
||||
|
||||
3. The terminal will ask you whether you want to use connection string that retrieves from `task cloud-provision` step. You could also input your own device connection string by clicking 'Create New...'
|
||||
![device-upload]({{"/assets/images/mini-solution/shake-shake/config-device-connection.png" | absolute_url }})
|
||||
|
||||
4. After `task config-device-connection` finished, click `Cmd + shift + p` to load VS Code commands and select `Arduino: Upload`, then VS Code starts verifying and uploading the Arduino sketch:
|
||||
![device-upload]({{"/assets/images/mini-solution/shake-shake/arduino-upload.png" | absolute_url }})
|
||||
|
||||
The DevKit reboots and starts running the code.
|
||||
|
||||
**Notice:** Occasionally, you may get an "Error: AZ3166: Unknown package" error message. This occurs when the board package index is not refreshed correctly. Check this [FAQ steps]({{"/docs/faq/#development" | absolute_url}}) to resolve this issue.
|
||||
{: .notice--warning}
|
||||
|
||||
## Test the project
|
||||
|
||||
After app initialization, click button A and gently shake the DevKit board to retrieve a random tweet containing your hashtag (e.g. #iot). Within a few seconds, a tweet will display on your DevKit screen.:
|
||||
|
||||
{% include gallery id="layouts_gallery" caption="Shake, shake for a random tweet containing the #hashtag you set in the code." %}
|
||||
|
||||
- Press button A again, then shake for a new tweet.
|
||||
- Press button B to scroll through the rest of the tweet.
|
||||
|
||||
**Notice:** If the screen displays **No Tweets**, please check [this step]({{"/docs/projects/shake-shake/#problems-and-feedback" | absolute_url}}).
|
||||
{: .notice--warning}
|
||||
|
||||
## How it works
|
||||
|
||||
![diagram]({{"/assets/images/mini-solution/shake-shake/diagram.png" | absolute_url }})
|
||||
|
||||
The Arduino sketch sends an event to Azure IoT Hub which triggers the Azure Functions app. Azure Functions contains the logic to connect to Twitter's API and retrieve a tweet. It wraps the tweet text into a C2D (Cloud-to-device) message and sends it back to the device.
|
||||
|
||||
## Optional: Use your own Twitter bearer token
|
||||
|
||||
This sample project uses a pre-configured Twitter bearer token for testing purposes. But there is a [rate limit](https://dev.twitter.com/rest/reference/get/search/tweets){:target="_blank"} for every Twitter account. You might want to consider using your own token. Here are simple instructions to do so:
|
||||
|
||||
1. Go to [Twitter Developer portal](https://dev.twitter.com/){:target="_blank"} to register a new Twitter app.
|
||||
|
||||
2. [Get Consumer Key and Consumer Secrets](https://support.yapsody.com/hc/en-us/articles/203068116-How-do-I-get-a-Twitter-Consumer-Key-and-Consumer-Secret-key-){:target="_blank"} of your app.
|
||||
|
||||
3. Use [some utility](https://gearside.com/nebula/utilities/twitter-bearer-token-generator/){:target="_blank"} to generate a Twitter bearer token from these two keys.
|
||||
|
||||
4. In the [Azure portal](https://portal.azure.com/){:target="_blank"}, get into the **Resource Group** and find the Azure Function (Type: App Service) for your "Shake, Shake" project. The name always contains 'shake...' string.
|
||||
![azure-function]({{"/assets/images/mini-solution/shake-shake/azure-function.png" | absolute_url }})
|
||||
|
||||
5. Update the code for `run.csx` within **Functions > shakeshake-cs** with your own token:
|
||||
```csharp
|
||||
...
|
||||
string authHeader = "Bearer " + "[your own token]";
|
||||
...
|
||||
```
|
||||
![twitter-token]({{"/assets/images/mini-solution/shake-shake/twitter-token.png" | absolute_url }})
|
||||
|
||||
5. Save the file and click **Run**.
|
||||
|
||||
|
||||
## Problems and feedback
|
||||
|
||||
### Problems
|
||||
|
||||
#### The screen displays 'No Tweets' while every step has run successfully
|
||||
|
||||
This normally happens for the first time you deploy and run the sample. This is because the function app requires anywhere from a couple of seconds to as much as one minute to cold start the app. Or, there are some blips when running the code that will cause restarting of the app. When this happens, the device app can get a timeout for fetching the tweet. In this case, you may try one or both of these methods to solve this issue:
|
||||
|
||||
1. Click the reset button on the DevKit to run the device app again.
|
||||
|
||||
2. In the [Azure portal](https://portal.azure.com/){:target="_blank"}, find the Azure Functions app you created and restart it:
|
||||
![azure-function-restart]({{"/assets/images/mini-solution/shake-shake/azure-function-restart.png" | absolute_url }})
|
||||
|
||||
### Feedback
|
||||
|
||||
If you encounter problems, you can refer to [FAQs]({{"/docs/faq/" | absolute_url }}) or reach out to us from the channels below.
|
||||
|
||||
## Customize device ID
|
||||
|
||||
You can customize device ID in IoT Hub by following [this doc]({{"/docs/customize-device-id/" | absolute_url }}), however, you still need to change the hardcoding `AZ3166` to customized device ID in the code currently. Here's the list of files you need to modify:
|
||||
|
||||
* [azureFunction/shakeshake-cs/run.csx](https://github.com/Microsoft/devkit-sdk/blob/master/AZ3166/src/libraries/AzureIoT/examples/ShakeShake/azureFunction/shakeshake-cs/run.csx#L91)
|
||||
* [azureFunction/shakeshake-node/index.js](https://github.com/Microsoft/devkit-sdk/blob/master/AZ3166/src/libraries/AzureIoT/examples/ShakeShake/azureFunction/shakeshake-node/index.js#L29)
|
||||
|
||||
{% include feedback.html tutorial="shake-shake" %}
|
||||
|
|
|
@ -34,172 +34,3 @@ variable:
|
|||
name: macOS
|
||||
last_modified_at: 2017-07-17
|
||||
---
|
||||
|
||||
In this project, you learn how to use the magnetic sensor to detect magnetic field, triggering the SendGrid service to send notification to your email when the change of magnetic field is too large. A useful situation is that you can attach it to your door with a magnet. Then it could detect the state of your door and notify you when you away.
|
||||
|
||||
{% include toc icon="columns" %}
|
||||
|
||||
## What you need
|
||||
|
||||
Finish the [Getting Started Guide]({{"/docs/get-started/" | absolute_url }}) to:
|
||||
|
||||
* Have your DevKit connected to Wi-Fi
|
||||
* Prepare the development environment
|
||||
|
||||
An active Azure subscription. If you do not have one, you can register via one of these methods:
|
||||
|
||||
* Activate a [free 30-day trial Microsoft Azure account](https://azure.microsoft.com/en-us/free/){:target="_blank"}.
|
||||
* Claim your [Azure credit](https://azure.microsoft.com/en-us/pricing/member-offers/msdn-benefits-details/){:target="_blank"} if you are an MSDN or Visual Studio subscriber.
|
||||
|
||||
## Step 1. Deploy SendGrid service in Azure
|
||||
|
||||
[SendGrid](https://sendgrid.com/){:target="_blank"} is a cloud-based email delivery platform. We will use this service to send out email notifications.
|
||||
|
||||
**Note:** if you have deployed a SendGrid service, please go to [step 2](#step-2-deploy-iot-hub-in-azure).
|
||||
{: .notice--info}
|
||||
|
||||
### A. SendGrid Deployment
|
||||
|
||||
To provision the service, we will use the **Deploy to Azure** button to provision Azure services. This button enables quick and easy deployment of your open source projects to Microsoft Azure.
|
||||
|
||||
Click the **Deploy to Azure**button, below.
|
||||
|
||||
[![Deploy to Azure](https://azuredeploy.net/deploybutton.png)](https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2FVSChina%2Fdevkit-door-monitor%2Fmaster%2FSendGridDeploy%2Fazuredeploy.json){:.click-action-tracker .click-tracker-name--DeployToAzure target="_blank"}
|
||||
|
||||
You will then see the following page (or you should first sign in to Azure), completing the sign-up form:
|
||||
|
||||
* **Resource group**: Create a resource group to host the SendGrid service or use an existing one. See [Using resource groups to manage your Azure resources](https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-group-portal){:target="_blank"}.
|
||||
|
||||
* **Name**: It is the name for your SendGrid service. You should choose a unique name differing from other services you may have.
|
||||
|
||||
* **Password**: The service requires a password, but we will not be using it for anything in this project.
|
||||
|
||||
* **Email**: The SendGrid service will send verification to this email address.
|
||||
|
||||
**Tip:** Check the **Pin to dashboard** option to make this application easier to find in the future.
|
||||
{: .notice--success}
|
||||
|
||||
![SendGrid Deploy]({{"/assets/images/mini-solution/door-monitor/sendgrid-deploy.png" | absolute_url }})
|
||||
|
||||
### B. SendGrid API Key creation
|
||||
|
||||
After the deployment succeeds, click it and then click the **Manage** button. You will jump to your sendgrid page, and will need to verify your email address.
|
||||
|
||||
![SendGrid Manage]({{"/assets/images/mini-solution/door-monitor/sendgrid-manage.png" | absolute_url }})
|
||||
|
||||
On the sendgrid page, click **Settings** > **API Keys** > **Create API Key**. Input the **API Key Name** and click **Create & View**.
|
||||
|
||||
![SendGrid Create API First]({{"/assets/images/mini-solution/door-monitor/sendgrid-create-api-first.png" | absolute_url }})
|
||||
|
||||
![SendGrid Create API Second]({{"/assets/images/mini-solution/door-monitor/sendgrid-create-api-second.png" | absolute_url }})
|
||||
|
||||
Your API key will be displayed only one time. Please be sure to store it safely, as it will be used in the next step.
|
||||
|
||||
## Step 2. Deploy IoT Hub in Azure
|
||||
|
||||
We will now provision other Azure IoT related services and deploy Azure Functions for this project.
|
||||
|
||||
Click the **Deploy to Azure**button, below.
|
||||
|
||||
[![Deploy to Azure](https://azuredeploy.net/deploybutton.png)](https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2FVSChina%2Fdevkit-door-monitor%2Fmaster%2Fazuredeploy.json){:.click-action-tracker .click-tracker-name--DeployToAzure target="_blank"}
|
||||
|
||||
You will then see the following page (or you should first sign in to Azure), completing the sign-up form:
|
||||
|
||||
* **Resource group**: Create a resource group to host the SendGrid service or use an existing one. See [Using resource groups to manage your Azure resources](https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-group-portal){:target="_blank"}.
|
||||
|
||||
* **Iot Hub Name**: This is the name for your IoT hub. You should choose a unique name differing from other services you may have.
|
||||
|
||||
* **Iot Hub Sku**: F1 (limited one per subscription) is free. You can see more pricing information at [pricing and scale tier](https://azure.microsoft.com/pricing/details/iot-hub/){:target="_blank"}.
|
||||
|
||||
* **From Email**: This should be the same email address you used when setting up the SendGrid service.
|
||||
|
||||
**Tip:** Check the **Pin to dashboard** option to make this application easier to find in the future.
|
||||
{: .notice--success}
|
||||
|
||||
![IoTHub Deploy]({{"/assets/images/mini-solution/door-monitor/iot-hub-deploy.png" | absolute_url }})
|
||||
|
||||
## Step 3. Build and upload the code
|
||||
|
||||
### A. Start VS Code
|
||||
|
||||
- Make sure your DevKit is **not** connected to your computer.
|
||||
- Start VS Code
|
||||
- Connect the DevKit to your computer.
|
||||
|
||||
VS Code will automatically detect your DevKit and open an introduction page:
|
||||
|
||||
![VSCode]({{"/assets/images/mini-solution/vscode_start.png" | absolute_url }})
|
||||
|
||||
**Notice:** Occasionally, when you launch VS Code, you may be prompted with error message stating that it cannot find Arduino IDE or related board package. If this should happen, close VS Code, launch the Arduino IDE again and VS Code should locate the Arduino IDE path correctly.
|
||||
{: .notice--warning}
|
||||
|
||||
### B. Open Arduino Examples folder
|
||||
|
||||
Expand left side **ARDUINO EXAMPLES** section, browse to **Examples for MXCHIP AZ3166 > AzureIoT**, and select **DoorMonitor**. This will open a new VS Code window with a project folder in it.
|
||||
|
||||
![mini-solution-examples]({{"/assets/images/mini-solution/vscode_examples.png" | absolute_url }})
|
||||
|
||||
If you happen to close the pane, you can reopen it. Use `Ctrl+Shift+P` (macOS: `Cmd+Shift+P`) to open the command palette, type **Arduino**, and then find and select **Arduino: Examples**.
|
||||
|
||||
### C. Provision Azure services
|
||||
|
||||
In the solution window, run your task by typing `Ctrl+P` (macOS: `Cmd+P`) and entering `task cloud-provision` in the provided text box.:
|
||||
|
||||
In the VS Code terminal, an interactive command line will guide you through provisioning the required Azure services. You need to select all the same items from the prompted list that you previously provisioned in [Step 2]({{"/docs/projects/door-monitor#step-2-deploy-iot-hub-in-azure" | absolute_url }}).
|
||||
|
||||
![Cloud Provision]({{"/assets/images/mini-solution/door-monitor/cloud-prevision.png" | absolute_url }})
|
||||
|
||||
**Notice:** If the page hangs in the loading status when trying to sign in to Azure, please check this [FAQ steps]({{"/docs/faq/#page-hangs-when-log-in-azure" | absolute_url}}) to resolve this issue.
|
||||
{: .notice--warning}
|
||||
|
||||
### D. Build and upload the device code
|
||||
|
||||
{% include switch.html content = page.variable %}
|
||||
|
||||
#### Windows
|
||||
|
||||
1. Use `Ctrl+P` to run `task device-upload`.
|
||||
2. The terminal prompts you to enter configuration mode. To do so, hold down button A, then push and release the reset button. The screen displays the DevKit ID and 'Configuration'.
|
||||
|
||||
This sets the connection string that is retrieved from the `task cloud-provision` step.
|
||||
|
||||
VS Code then starts verifying and uploading the Arduino sketch to the DevKit:
|
||||
|
||||
![device-upload]({{"/assets/images/mini-solution/door-monitor/device-upload.png" | absolute_url }})
|
||||
|
||||
The DevKit reboots and starts running the code.
|
||||
|
||||
**Notice:** Occasionally, you may get an "Error: AZ3166: Unknown package" error messafge. This occurs when the board package index is not refreshed correctly. Check this [FAQ steps]({{"/docs/faq/#development" | absolute_url}}) to resolve this issue.
|
||||
{: .notice--warning}
|
||||
|
||||
#### macOS
|
||||
|
||||
1. Put the DevKit into configuration mode:
|
||||
Hold down button A, then push and release the reset button. The screen displays 'Configuration'.
|
||||
2. Use `Cmd+P` to run `task device-upload`.
|
||||
|
||||
This sets the connection string that is retrieved from the `task cloud-provision` step.
|
||||
|
||||
VS Code then starts verifying and uploading the Arduino sketch to the DevKit:
|
||||
|
||||
![device-upload]({{"/assets/images/mini-solution/door-monitor/device-upload.png" | absolute_url }})
|
||||
|
||||
The DevKit reboots and starts running the code.
|
||||
|
||||
**Notice:** Occasionally, you may get an "Error: AZ3166: Unknown package" error message. This occurs when the board package index is not refreshed correctly. Check this [FAQ steps]({{"/docs/faq/#development" | absolute_url}}) to resolve this issue.
|
||||
{: .notice--warning}
|
||||
|
||||
## Test the project
|
||||
|
||||
The program first initializes when the DevKit is in the presence of a stable magnetic field. After initialization, `Door closed` is displayed on the screen. When the magnetic field changes from the initial condition, the state changes to `Door opened`. Whenever the state changes from `closed -> opened` or `opened -> closed`, you will receive a email containing this information. (These email messages may take around 5 minutes to be received.)
|
||||
|
||||
{% include gallery id="layouts_gallery" caption="e.g.: use a magnet in the y axis, the magnetic field change and it is recognized as door opened." %}
|
||||
|
||||
**Note:** When receiving with two continuous emails, some of the email client would display wrongly. Please careful select an email client when you use.
|
||||
{: .notice--info}
|
||||
|
||||
## Problems and feedback
|
||||
|
||||
If you encounter problems, you can refer to [FAQs]({{"/docs/faq/" | absolute_url }}) or reach out to us from the channels below.
|
||||
|
||||
{% include feedback.html tutorial="door-monitor" %}
|
||||
|
|
|
@ -81,7 +81,7 @@ The following are required to complete this lab:
|
|||
- An [MXChip IoT DevKit](https://microsoft.github.io/azure-iot-developer-kit/)
|
||||
- A computer running [Windows 10 Anniversary Edition](https://www.microsoft.com/en-us/software-download/windows10) or higher
|
||||
- Finish the [Getting Started Guide]({{"/docs/get-started/" | absolute_url }}) to:
|
||||
* Have your DevKit connected to Wi-Fi
|
||||
* Have your IoT DevKit connected to Wi-Fi
|
||||
* Upgrade to the latest firmware
|
||||
* Prepare the development environment
|
||||
- An active Azure subscription. If you do not have one, you can register via one of the methods:
|
||||
|
|
|
@ -34,7 +34,7 @@ The following are required to complete this lab:
|
|||
- An [MXChip IoT DevKit](https://microsoft.github.io/azure-iot-developer-kit/)
|
||||
- A computer running [Windows 10 Anniversary Edition](https://www.microsoft.com/en-us/software-download/windows10) or higher
|
||||
- Finish the [Getting Started Guide]({{"/docs/get-started/" | absolute_url }}) to:
|
||||
* Have your DevKit connected to Wi-Fi
|
||||
* Have your IoT DevKit connected to Wi-Fi
|
||||
* Upgrade to the latest firmware
|
||||
* Prepare the development environment
|
||||
- An active Azure subscription. If you do not have one, you can register via one of the methods:
|
||||
|
|
|
@ -31,7 +31,7 @@ The following are required to complete this lab:
|
|||
- An [MXChip IoT DevKit](https://microsoft.github.io/azure-iot-developer-kit/)
|
||||
- A computer running [Windows 10 Anniversary Edition](https://www.microsoft.com/en-us/software-download/windows10) or higher
|
||||
- Finish the [Getting Started Guide]({{"/docs/get-started/" | absolute_url }}) to:
|
||||
* Have your DevKit connected to Wi-Fi
|
||||
* Have your IoT DevKit connected to Wi-Fi
|
||||
* Upgrade to the latest firmware
|
||||
* Prepare the development environment
|
||||
- An active Azure subscription. If you do not have one, you can register via one of the methods:
|
||||
|
|
|
@ -39,7 +39,7 @@ The following are required to complete this lab:
|
|||
- An [MXChip IoT DevKit](https://microsoft.github.io/azure-iot-developer-kit/)
|
||||
- A computer running [Windows 10 Anniversary Edition](https://www.microsoft.com/en-us/software-download/windows10) or higher
|
||||
- Finish the [Getting Started Guide]({{"/docs/get-started/" | absolute_url }}) to:
|
||||
* Have your DevKit connected to Wi-Fi
|
||||
* Have your IoT DevKit connected to Wi-Fi
|
||||
* Upgrade to the latest firmware
|
||||
* Prepare the development environment
|
||||
- An active Azure subscription. If you do not have one, you can register via one of the methods:
|
||||
|
|
Двоичные данные
docs/assets/images/devkit-board-vector@2x.png
До Ширина: | Высота: | Размер: 23 KiB После Ширина: | Высота: | Размер: 24 KiB |
После Ширина: | Высота: | Размер: 11 KiB |
Двоичные данные
docs/assets/images/getting-started/firmware.jpg
До Ширина: | Высота: | Размер: 510 KiB После Ширина: | Высота: | Размер: 121 KiB |
Двоичные данные
docs/assets/images/getting-started/sensors.jpg
До Ширина: | Высота: | Размер: 329 KiB После Ширина: | Высота: | Размер: 118 KiB |
Двоичные данные
docs/assets/images/getting-started/wifi-ap.jpg
До Ширина: | Высота: | Размер: 477 KiB После Ширина: | Высота: | Размер: 118 KiB |
Двоичные данные
docs/assets/images/getting-started/wifi-ip.jpg
До Ширина: | Высота: | Размер: 323 KiB После Ширина: | Высота: | Размер: 138 KiB |
После Ширина: | Высота: | Размер: 17 KiB |
После Ширина: | Высота: | Размер: 7.1 KiB |
После Ширина: | Высота: | Размер: 273 KiB |
После Ширина: | Высота: | Размер: 164 KiB |
После Ширина: | Высота: | Размер: 8.5 KiB |
|
@ -1 +1 @@
|
|||
1.4.0
|
||||
1.4.1
|
|
@ -223,13 +223,13 @@
|
|||
|
||||
|
||||
<p class="page__cta_secondary">
|
||||
<a href="https://aka.ms/iot-devkit-simulator" target="_blank">Not having a DevKit yet? Try our simulator now.</a>
|
||||
<a href="https://aka.ms/iot-devkit-simulator" target="_blank">Not having a IoT DevKit yet? Try our simulator now.</a>
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
|
||||
<a class="page__extra-logo" href="https://catalog.azureiotsuite.com/details?title=MXChip-IoT-DevKit&source=home-page" target="_blank" style="background: url(https://microsoft.github.io/azure-iot-developer-kit/assets/images/logo-azure-certified.svg);"></a>
|
||||
<a class="page__extra-logo" href="https://catalog.azureiotsuite.com/details?title=MXChip-IoT-DevKit&source=home-page" target="_blank" style="background: url(https://microsoft.github.io/azure-iot-developer-kit/assets/images/logo-azure-certified.svg);"><span class="screen-reader-text">Azure Certified for IoT device catalog</span></a>
|
||||
|
||||
|
||||
</div>
|
||||
|
@ -276,7 +276,7 @@
|
|||
<div class="archive__item">
|
||||
|
||||
<div class="archive__item-teaser">
|
||||
<img src="https://microsoft.github.io/azure-iot-developer-kit/assets/images/devkit-board-vector@2x.png" alt="DevKit Board" style="width: 50%;" />
|
||||
<img src="https://microsoft.github.io/azure-iot-developer-kit/assets/images/devkit-board-vector@2x.png" alt="IoT DevKit Board" style="width: 50%;" />
|
||||
</div>
|
||||
|
||||
|
||||
|
@ -371,7 +371,7 @@
|
|||
|
||||
|
||||
<div class="archive__item-excerpt">
|
||||
<p>All the cool things you can do with an Arduino can be done with the DevKit. It is targeted for developers to create and prototype IoT projects, using a low-power device, quickly and easily. There are 25 external GPIO pins on the edge connector of the board, allowing you to connect to external sensors and actuators.</p>
|
||||
<p>All the cool things you can do with an Arduino can be done with the IoT DevKit. It is targeted for developers to create and prototype IoT projects, using a low-power device, quickly and easily. There are 25 external GPIO pins on the edge connector of the board, allowing you to connect to external sensors and actuators.</p>
|
||||
|
||||
</div>
|
||||
|
||||
|
|