Azure IoT Hub extension for Visual Studio Code
Перейти к файлу
Ray Fang 41ff242c4e
Update default Edge home dir in generated config.json (#54)
2017-12-15 12:49:52 +08:00
.vscode Add unit test (#2) 2017-08-16 10:27:41 +08:00
images Select IoT Hub with Azure login (#18) 2017-09-29 16:24:21 +08:00
resources Update icons in device list (#47) 2017-12-08 14:07:49 +08:00
snippets Add basic snippets for Edge module and route authoring (#50) 2017-12-14 15:44:46 +08:00
src Update default Edge home dir in generated config.json (#54) 2017-12-15 12:49:52 +08:00
test Automatic release in CI (#39) 2017-11-29 17:01:56 +08:00
.gitattributes Force EOF of package.json and package-lock.json as LF 2017-11-29 09:54:59 +08:00
.gitignore Update image path in README 2017-08-21 12:58:53 +08:00
.travis.yml Automatic release in CI (#39) 2017-11-29 17:01:56 +08:00
.vscodeignore JavaScript code snippet to send/monitor D2C message 2017-03-06 15:10:54 +08:00
CHANGELOG.md 0.4.3 2017-12-06 11:38:49 +08:00
CONTRIBUTING.md Add CONTRIBUTING.md 2017-03-02 20:14:47 +08:00
README.md 1) Stop monitoring D2C message when there is error 2) Remove Event Hub related code (#37) 2017-11-15 11:18:59 +08:00
appveyor.yml Fix CI failure due to azure-iothub breaking change 2017-03-01 22:34:19 +08:00
logo.png Change logo folder 2017-03-06 15:21:15 +08:00
package-lock.json Set default name of generated config files even no folder's open (#46) 2017-12-08 15:23:42 +08:00
package.json Add basic snippets for Edge module and route authoring (#50) 2017-12-14 15:44:46 +08:00
tsconfig.json Send/monitor message for Event Hub (#1) 2017-02-27 17:13:31 +08:00
tslint.json Update version to 0.2.1, update BI, handle devices with X.509 cert (#9) 2017-08-24 14:40:05 +08:00

README.md

Azure IoT Toolkit

Join the chat at https://gitter.im/Microsoft/azure-iot-toolkit

Interact with Azure IoT Hub, IoT Device Management, IoT Edge Management, IoT Hub Code Snippets.

Device Explorer

  • Device management
    • List devices
    • Get device info
    • Create device
    • Delete device
  • Interact with Azure IoT Hub
    • Send D2C message to IoT Hub
    • Monitor IoT Hub D2C message
    • Send C2D message to device
    • Monitor C2D message from IoT Hub
    • Invoke Direct Method
    • Get/update Device Twin
  • Interact with Azure IoT Edge Preview (Install Azure IoT Edge for more IoT Edge support)
    • Manage Edge runtime
    • Create deployment for Edge device
    • Generate Edge configuration file

Prerequisites

  1. In Explorer of VS Code, click "IoT Hub Devices" in the bottom left corner.

Click Device Explorer

  1. Click "Set IoT Hub Connection String" in context menu.

Set Connection String

  1. An input box will pop up, then enter your IoT Hub Connection String (It is one-time configuration, and please make sure it is IoT Hub Connection String not Device Connection String. The format is HostName=<my-hub>.azure-devices.net;SharedAccessKeyName=<my-policy>;SharedAccessKey=<my-policy-key>).

Enter Connection String

  1. The device list will be shown.

Device Explorer

NOTE: You could also go to File > Preferences > Settings (Code > Preferences > Settings on Mac), update the config of azure-iot-toolkit.iotHubConnectionString to change your IoT Hub Connection String.

Sign in to Azure

Instead of copying and pasting to set IoT Hub Connection String, you could sign in to Azure to select IoT Hub from your Azure Subscription.

  1. Click "Select IoT Hub" in context menu.

Select IoT Hub

  1. If you have not signed in to Azure, a pop-up will show to let you sign in to Azure.
  2. After you sign in, your Azure Subscription list will be shown, then select an Azure Subscription.
  3. Your IoT Hub list will be shown, then select an IoT Hub.
  4. The device list will be shown.

Code Snippets

Trigger Content
iotSendD2CMessage Send D2C message to IoT Hub
iotMonitorD2CMessage Monitor D2C message for IoT Hub
iotSendC2DMessage Send C2D message to device
iotMonitorC2DMessage Monitor C2D message from IoT Hub
iotCallDirectMethods Send direct methods to device
iotReceiveDirectMethods Receive direct methods from IoT Hub

Snippet

After code snippet is created, you need to install corresponding npm package (e.g. azure-iot-device-mqtt) to run the code snippet. If you want to 'Run Code' directly, you need to install Code Runner.

Configuration

IoT Hub Connection String:

{
    "azure-iot-toolkit.iotHubConnectionString": "HostName=<my-hub>.azure-devices.net;SharedAccessKeyName=<my-policy>;SharedAccessKey=<my-policy-key>"
}

Device Connection String:

{
    "azure-iot-toolkit.deviceConnectionString": "HostName=<my-hub>.azure-devices.net;DeviceId=<known-device-id>;SharedAccessKey=<known-device-key>"
}

IoT Hub Consumer Group (default is "$Default"):

{
    "azure-iot-toolkit.iotHubConsumerGroup": "$Default"
}

Whether to show verbose info when monitoring messages (default is false):

{
    "azure-iot-toolkit.showVerboseMessage": false
}

Whether to stringify device-to-cloud messages (default is false):

{ 
    "azure-iot-toolkit.iotHubD2CMessageStringify": false
}

Whether to show Connection String Input Box on startup (default is true):

{ 
    "azure-iot-toolkit.showConnectionStringInputBox": true
}

Whether to show IoT Hub info when IoT Hub Connection String is not set (default is true):

{ 
    "azure-iot-toolkit.showIoTHubInfo": true
}