GithubHelp home page GithubHelp logo

wago / azure-iot-edge Goto Github PK

View Code? Open in Web Editor NEW
5.0 4.0 1.0 3.95 MB

This repository contains instructions for building and starting a Microsoft Edge Runtime Container on WAGO devices. (e.g. PFC200 G2 or Wago Touch Panel)

License: MIT License

Dockerfile 58.96% Shell 41.04%
docker microsoft azure-iot-edge pfc200 azure-iot arm32v7 touch-panel iot

azure-iot-edge's Introduction

Statistics Docker Hub

DockerHub stars DockerHub pulls

Statistics Git Hub

GitHub issues GitHub stars

How to setup Azure Iot Edge on Wago Device

Prerequisites for tutorial

Create an Iot-Hub, add iot edge device and deviceDeploy your first IoT Edge Module:

https://docs.microsoft.com/en-us/azure/iot-edge/quickstart-linux

Please go through the following points:

  • Create an IoT Hub.
  • Register an IoT Edge device to your IoT hub.
  • The section "Configure your IoT Edge device" can be completely ignored.
  • Remotely deploy a SimulatedTemperatureSensor module to an IoT Edge device.

Attention: To prevent port "443" clashing of "edgeHub" container and of Wago Webserver, it is absolutely necessary to change the "HostBindings". You can use any free host ports. Navigate to Azure Portal-> Your Edge Device-> Set modules on device->Runtime Settings


AdvanceEdgeSettings

Configuration and start of azure iot edge runtime container.

The configuration of azure-iot-edge-runtime container is done via the config.yaml file. This file is generated by the command below into the empty mounted folder.

  docker run --rm -v /config:/config wagoautomation/azure-iot-edge init

Attention: The file is read-only and must be made temporary writable for the current user.

chmod 644 
or
chmod 666

Note:
Attention there is a discrepancy between the default configuration of azureiotedge-agent in the cloud (currently v1.4) and the configuration in the device. (v1.1).
If you are not careful, two images are downloaded, which leads to "no space on device" problems. The workaround is to keep the configurations the same. e.g. after the

docker run --rm -v /config:/config wagoautomation/azure-iot-edge init

, synchronize the configuration manually.

Finally, provisioning configurations can be made by editing the corresponding sections in config.yaml (e.g. manual provisioning using connection string or X.509 certificate) For more details see: https://docs.microsoft.com/en-us/azure/iot-edge/how-to-manual-provision-symmetric-key?tabs=azure-portal%2Clinux

 docker run -d --name azure-iot-edge-runtime \
   --restart=unless-stopped \
   -v /var/run/docker.sock:/var/run/docker.sock \
   -v /config:/config:ro \
   wagoautomation/azure-iot-edge

After the container start, all deployments defined in Microsoft Azure are automatically downloaded and started.
This may take a few minutes.
With the Docker commands you can track the provisioning process.

docker images 
docker ps
docker logs 

After all containers have been started, the following Docker command should return the following:

docker ps --format "table {{.Image}}\t {{.Status}}\t{{.Names}}"

docker_ps_format

The "SimulatedTemperatureSensor" module sends "500" simulation messages to your Iot Hub. The telemetry data can be displayed e.g. with a Visual Studio Code extension. (see: https://marketplace.visualstudio.com/items?itemName=vsciot-vscode.azure-iot-toolkit)


Finally, Wago device is ready for azure iot edge module deployment!

Happy IoTing!

Azure IoT Edge Modbus Module

You need a running Modbus Slave (Server) e.g. Wago Device or Modbus slave Simulator

How to deploy microsoft modbus ingestion module see here:

Develop a C# IoT Edge module

How to develop your own azure iot edge module see here: https://docs.microsoft.com/en-us/azure/iot-edge/tutorial-csharp-module

azure-iot-edge's People

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

renehezser

azure-iot-edge's Issues

docker not found

With the newest version the container starts, but the docker-entrypoint.sh fails with "docker not found" in line 20.

me@randomhost:~ $ sudo docker run --name azure-iot-edge-runtime -v /var/run/docker.sock:/var/run/docker.sock -v /config:/config wagoautomation/azure-iot-edge
azure-iot-edge
b5e5b8a864df
/docker-entrypoint.sh: line 20: docker: command not found
/docker-entrypoint.sh: line 21: docker: command not found
Device "eth1" does not exist.
...

To have docker available from inside the container, add -v /usr/bin/docker:/usr/bin/docker to the mapped volumes.

Trying to access another device from the host network from the IoT Edge modules

Based on the documentation we succeed to deploy the azure-iot-edge runtime on the WAGO device connected it our Azure IoTHub and successfully deployed some modules on the device.

But when we try to connect to external device via a TCP/UDP connection from a IoT Edge module running on the Wago device we're not able to access the external device. The external device is in the same ip segment as the host network of the Wago device. And also if we deploy an container on the host network of the docker instance we are able to access the external device.

So we assume that we cannot access the external device because all the containers for the IoT Edge modules are created within a separate azure-iot-edge docker network and probably the routing is not configured properly. Do you perhaps have some guidance on how to approach this scenario? And is this even a supported scenario from this device?

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.