This repository has been archived by the owner on Apr 23, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 69
Add simulator, add device option to command filter #336
Open
git-remove
wants to merge
15
commits into
master
Choose a base branch
from
AddSimulator
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 2 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
2689e9f
Add simulator, add device option to command filter
cc0705d
Simplify installing Device SDK
a94420f
Change helpUrl of Simulator
6aed0b0
Change name of simualtor package file
6983c00
Merge branch 'master' into AddSimulator
git-remove c0005be
New version of simulator
8ebf026
Modify Dependency
6e3498b
Merge branch 'master' into AddSimulator
git-remove 36d215c
Fix format and small bugs
6ff3689
Remove test folder
bd141b6
Fix example bug
a4e8eab
Fix extentsion bug
7613d35
Merge branch 'master' into AddSimulator
git-remove 7c29775
Merge branch 'master' into AddSimulator
git-remove c22d63f
Merge branch 'master' into AddSimulator
Sneezry File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"name": "iot-workbench-raspi", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Replace iot-workbench-raspi with other string. raspi stands for Raspberry Pi |
||
"version": "0.1.0", | ||
"main": "app.js", | ||
"dependencies": { | ||
"azure-iot-device-mqtt": "^1.4.3" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
const clientFromConnectionString = require('azure-iot-device-mqtt').clientFromConnectionString; | ||
const Message = require('azure-iot-device').Message; | ||
const connectionString = require('./config.json').connectionString; | ||
const client = clientFromConnectionString(connectionString); | ||
|
||
client.open(err => { | ||
if (err) { | ||
console.error('Could not connect: ' + err); | ||
process.exit(1); | ||
} else { | ||
const data = { | ||
topic: 'iot' | ||
}; | ||
const message = new Message(JSON.stringify(data)); | ||
|
||
setInterval(() => { | ||
client.sendEvent(message, err => { | ||
if (err) { | ||
console.warn('Send message to IoT Hub failed: ' + err.toString()); | ||
} else { | ||
console.log('Message sent to IoT Hub.'); | ||
} | ||
}); | ||
}, 2000); | ||
|
||
client.on('message', msg => { | ||
console.log(msg); | ||
client.complete(msg, () => { | ||
console.log('completed'); | ||
}); | ||
}); | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{ | ||
"templates": [ | ||
{ | ||
"description": "", | ||
"detail": "Create project with device only code.", | ||
"label": "Device only", | ||
"type": "Basic", | ||
"sketch": "basic.js" | ||
}, | ||
{ | ||
"description": "", | ||
"detail": "Create project that connects to Azure IoT Hub, such as sending sensor data to cloud.", | ||
"label": "With Azure IoT Hub", | ||
"type": "IotHub", | ||
"sketch": "simple_iothub.js" | ||
}, | ||
{ | ||
"description": "", | ||
"detail": "Create project that connects to Azure IoT Hub and processes device data further in Azure Functions.", | ||
"label": "With Azure Functions", | ||
"type": "AzureFunctions", | ||
"sketch": "simple_iothub.js" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
helpUrl should be changed to IoT Workbench repo URL