Skip to content

Instantly share code, notes, and snippets.

View ThomasPe's full-sized avatar

Thomas Pentenrieder ThomasPe

View GitHub Profile
@ThomasPe
ThomasPe / deployment.template.json
Created September 16, 2020 12:52
Module Deployment Configuration for using Bluetooth / BLE in Docker Container
"modules": {
"BLEModule": {
"version": "1.0",
"type": "docker",
"status": "running",
"restartPolicy": "always",
"settings": {
"image": "${MODULES.BLEModule}",
"createOptions": {
"NetworkingConfig": {
@ThomasPe
ThomasPe / pipeline.yaml
Created August 22, 2021 20:20
Angular => Azure DevOps => Azure BLOB Storage Deployment
trigger:
- main
pool:
vmImage: ubuntu-latest
steps:
- task: NodeTool@0
inputs:
versionSpec: '14.x'
@ThomasPe
ThomasPe / Dockerfile.amd64
Created September 16, 2020 14:14
Docker configuration for using noble / BLE in Azure IoT Edge
FROM node:10-slim
RUN apt-get update || : && apt-get -y install bluetooth bluez libbluetooth-dev libudev-dev build-essential make python
WORKDIR /app/
COPY package*.json ./
RUN npm install --production
@ThomasPe
ThomasPe / app.js
Created September 16, 2020 13:41
Reading Ruuvi Tag messages in IoT Edge
Client.fromEnvironment(Transport, function (err, client) {
if (err) {
throw err;
} else {
client.on('error', function (err) {
throw err;
});
// connect to the Edge instance
client.open(function (err) {
@ThomasPe
ThomasPe / deployment.template.json
Created September 8, 2020 07:50
deployment.template.json Full
{
"$schema-template": "2.0.0",
"modulesContent": {
"$edgeAgent": {
"properties.desired": {
"schemaVersion": "1.0",
"runtime": {
"type": "docker",
"settings": {
"minDockerVersion": "v1.25",
@ThomasPe
ThomasPe / deployment.template.json
Created September 8, 2020 07:47
deployment.template.json $edgeHub
"$edgeHub": {
"properties.desired": {
"schemaVersion": "1.0",
"routes": {
"IdentityTranslationModuleToIoTHub": "FROM /messages/modules/IdentityTranslationModule/outputs/* INTO $upstream",
"sensorToIdentityTranslationModule": "FROM /messages/modules/SimulatedTemperatureSensor/outputs/temperatureOutput INTO BrokeredEndpoint(\"/modules/IdentityTranslationModule/inputs/input1\")"
},
"storeAndForwardConfiguration": {
"timeToLiveSecs": 7200
}
@ThomasPe
ThomasPe / deployment.template.json
Created September 8, 2020 07:39
deployment.template.json Modules
"modules": {
"IdentityTranslationModule": {
"version": "1.0",
"type": "docker",
"status": "running",
"restartPolicy": "always",
"settings": {
"image": "${MODULES.IdentityTranslationModule}",
"createOptions": {}
},
@ThomasPe
ThomasPe / app.js
Created September 7, 2020 15:00
IoT Edge Identity Translation Module Sample
'use strict';
const Transport = require('azure-iot-device-mqtt').Mqtt;
const ModuleClient = require('azure-iot-device').ModuleClient;
const Message = require('azure-iot-device').Message;
const DeviceClient = require('azure-iot-device').Client;
let simulatedTemperatureClient;
ModuleClient.fromEnvironment(Transport, function (err, moduleClient) {
@ThomasPe
ThomasPe / index.js
Created October 3, 2018 11:07
Delete | Azure Functions + NodeJs + Table Storage
const azure = require('azure-storage');
const tableService = azure.createTableService();
const tableName = "mytable";
module.exports = function (context, req) {
context.log('Start ItemDelete');
const id = req.query.id;
if (id) {
@ThomasPe
ThomasPe / index.js
Created October 3, 2018 11:05
Update | Azure Functions + NodeJs + Table Storage
const azure = require('azure-storage');
const tableService = azure.createTableService();
const tableName = "mytable";
module.exports = function (context, req) {
context.log('Start ItemUpdate');
if (req.body) {