Giter Site home page Giter Site logo

formulahendry / vscode-azure-iot-toolkit Goto Github PK

View Code? Open in Web Editor NEW
6.0 4.0 3.0 19.73 MB

This extension is now maintained in the Microsoft repo

Home Page: https://github.com/microsoft/vscode-azure-iot-toolkit

TypeScript 100.00%
azure azure-iot vscode typescript iot iothub visual-studio-code vscode-extension

vscode-azure-iot-toolkit's Introduction

[DEPRECATED] Azure IoT Toolkit

Join the chat at https://gitter.im/formulahendry/vscode-azure-iot-toolkit Marketplace Version Installs Rating Build Status Build status

Toolkit makes Azure IoT Development easier. For more awesome Azure IoT projects and resources, please visit https://aka.ms/azure.iot

Upgrade to Microsoft offical Azure IoT Toolkit extension

This extension is deprecated. It is moved to Microsoft offical Azure IoT Toolkit extension. Please uninstall this extension and install the offical extension.

Features

[x] Device Explorer

[x] Send messages to Azure IoT Hub (device-to-cloud message)

[x] Monitor device-to-cloud messages

[x] Code snippet for IoT Hub

[x] Send messages to Azure Event Hub

[x] Monitor Event Hub messages

[x] Send/monitor messages from Azure IoT Hub to device (cloud-to-device message)

[x] Device management (List, Create, Delete)

[x] Discover devices connected via Ethernet, USB serial and WiFi

[x] Deploy and run in remote machine

[x] Invoke Direct Method

[x] Get/update Device Twin

[ ] Debug in remote machines

[ ] And more...

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

Prerequisites

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

Click Device Explorer

  1. If you have not set Iot Hub Connection String before, an input box will pop up, then enter your Iot Hub Connection String (It is one-time configuration).

Enter Connection String

  1. The device list will be shown.

Device Explorer

Commands

Command Keyboard Shortcuts Menu Contexts
IoT: Send message to IoT Hub Ctrl+Alt+F9 view/item/context
IoT: Start monitoring IoT Hub message Ctrl+Alt+F10 view/title
IoT: Stop monitoring IoT Hub message Ctrl+Alt+F11 editor/context (in output panel)
IoT: Send C2D message to device None view/item/context
IoT: Start monitoring C2D message None view/item/context
IoT: Stop monitoring C2D message None editor/context (in output panel)
IoT: Send message to Event Hub None editor/context
IoT: Start monitoring Event Hub message None editor/context
IoT: Stop monitoring Event Hub message None editor/context (in output panel)
IoT: List device Ctrl+Alt+F1 None
IoT: Create device Ctrl+Alt+F2 view/title
IoT: Delete device Ctrl+Alt+F3 view/item/context
IoT: Discover connected device Ctrl+Alt+F6 editor/context
IoT: Deploy to remote machine Ctrl+Alt+F4 None
IoT: Run in remote machine Ctrl+Alt+F5 None

Usages

  • 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.

  • Send/monitor messages for Azure Event Hub

Event Hub

  • Deploy and run in remote machine
Config description
azure-iot-toolkit.localFolder The folder of current machine to deploy
azure-iot-toolkit.remoteFolder The folder of remote machine to deploy
azure-iot-toolkit.host The hostname or IP address of remote machine
azure-iot-toolkit.username The username of remote machine
azure-iot-toolkit.password The password of remote machine
azure-iot-toolkit.command The command to run in remote machine

Remote

  • Discover Ethernet, USB serial, WiFi devices

    1. Install Node.js or install device-discovery-cli:
    $ npm install --global device-discovery-cli
    
    1. Discover devices in VS Code:

Device

Configuration

To set the Device Connection String which is used to send device-to-cloud message or other functions as a device simulator:

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

To set the IoT Hub Connection String to monitor device-to-cloud message or other functions as a service simulator:

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

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

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

To set the Event Hub Connection String:

{
    "azure-iot-toolkit.eventHubConnectionString": "{Event Hubs connection string}"
}

To set the Event Hub Path:

{
    "azure-iot-toolkit.eventHubPath": "{Event Hub path/name}"
}

To set the Event Hub Consumer Group (default is "$Default"):

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

To set whether to show verbose info when monitoring messages (default is true):

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

To set whether to stringify device-to-cloud messages (default is true):

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

Telemetry data

By default, anonymous telemetry data collection is turned on to understand user behavior to improve this extension. To disable it, update the settings.json as below:

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

Change Log

See Change Log here

Issues

Submit the issues if you find any bug or have any suggestion.

Contribution

Fork the repo and submit pull requests.

vscode-azure-iot-toolkit's People

Contributors

formulahendry avatar nickdarvey avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

vscode-azure-iot-toolkit's Issues

"The connection string is missing the property: SharedAccessKeyName"

Getting this message when trying to initiate. trying the following format directly copied from the azure portal: HostName=my-azure-hostname.azure-devices.net;ShareAccessKeyName=iothubowner;SharedAccessKey=XXXXXXXXX...=
In settings for "azure-iot-toolkit.iotHubConnectionString" the same string in dubble quotes.

What am I missing here?

Please use the latest version of applicationinsights or remove its usage

Hello,

This extension uses 0.21.0 version of applicationInsights which monkey patches the require module. This can have unforeseen consequences in the extension host of VS Code.

Please update to using the latest version 1.0.6 of applicationinsights that has the fix to avoid such monkey patches.

For more details, see microsoft/ApplicationInsights-node.js#425

Since this extension is deprecated, another option is to remove the use of applicationInsights altogether.

Thanks!

D2C message is stringified

Repro

  1. Right-click on a device and tap 'IoT: Send message to IoT Hub'
  2. Send a JSON message, e.g.
    {"__m":{"e":[],"t":[],"l":[]},"d":"00FF","t":"1498085316","cid":"test"}

Expected
JSON message is sent as-is, e.g.
{"__m":{"e":[],"t":[],"l":[]},"d":"00FF","t":"1498085316","cid":"test"}

Actual
JSON message is sent stringified, e.g.
"{\"__m\":{\"e\":[],\"t\":[],\"l\":[]},\"d\":\"00FF\",\"t\":\"1498085316\",\"cid\":test\"}"

I don't know if this is best practice, but it isn't enforced. (At least, we're successfully using IOT Hub without stringifying our payload, and things like routing still work).

Add Code Snippets

  • JavaScript
    • Send D2C message
    • Monitor D2C message
    • C2D message
    • Device Twins
    • Direct methods
  • .NET
  • Java

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.