Giter VIP home page Giter VIP logo

edge-proxy's Introduction

Edge proxy is an IoT Edge module that enables end-to-end connectivity to your Edge device using device streams. Ensure your IoT Hub/edge is provisioned in one of the supported regions.

To set up edge proxy for trial purposes, you need to:

alt text

To set up IoT edge in a Vagrant VM

  • Install Vagrant
  • Create an IoT Edge device (follow instructions here) and update device_connection_string in edge-config.yaml with its connection string
  • Use Vagrantfile in this repo to provision the VM by running:
  # Provision and bring up your vagrant VM
  vagrant up

Once done, check that IoT Edge runtime is active and edgeAgent is running:

# SSH to your vagrant VM
vagrant ssh

# Output of command below should show the daemon is in 'active (running)' state
sudo systemctl status iotedge

# Output of command below should show 'edgeAgent' module in 'running' state
# Note that it may take a few minutes for the module to be downloaded
sudo iotedge list

To build the edge proxy image

In your cloned repository folder, run:

docker build -t <image_name> .
docker push <image_name>

You can skip this step and use pre-built image rezas/edgeproxy:0.40_mqtt that is published here.

To deploy edge proxy to IoT edge

  1. Register a regular IoT device and remember the device name and the connection string

  2. Register and create IoT Edge device, make sure it's running ok

  3. Add a deployment module using Set modules

  4. In Image URI, fill in rezas/edgeproxy:0.40_mqtt to use the pre-published image or use the image_name you porvided here

  5. In Environment Variables, add these three fields

    Name Value Comment
    TARGET_IP 172.17.0.1 This is the local IP address of the host as seen by an IoT Edge module/container
    TARGET_PORT 22 Port for SSH
    CONNECTIONSTRING <Connection string of the regular device your created in step 1> This module has its own connection to IoT Hub for the Hackathon
  6. Click next, next, next, then Submit

  7. It'll take a while to pull the image, so wait a while till you see the module is running

SSH using edge proxy and Azure CLI

  1. Follow instructions to sideload the extension and login

  2. Proxy the stream:

    az iot hub proxy -n [hub] -d [device created earlier] --port [port]
    
  3. Open another terminal window

  4. Use a valid username and credentials to SSH to your IoT edge device.

    ssh -p [port] username@localhost
    

    For the case of vagrant, use ssh -i .vagrant/machines/default/virtualbox/private_key -p 2222 vagrant@localhost. Note you need to use the private key of your Vagrant VM (this is usually stored in your provisioned VM folder under .vagrant/machines/default/virtualbox/private_key.

Run edge proxy in docker

# Use a valid device connection string
CONNECTIONSTRING=""

# Default value is localhost (container itself)
export TARGET_IP=$HOSTNAME

# Default value is 22
export TARGET_PORT=22

docker run \
    --env CONNECTIONSTRING="$CONNECTIONSTRING" \
    --env TARGET_IP="$TARGET_IP" \
    --env TARGET_PORT="$TARGET_IP" \
    -it \
    <image_name>

edge-proxy's People

Contributors

rezasherafat avatar shkreza avatar c-ryan-k avatar jlian avatar

Stargazers

Dustin Dahl avatar Santiago Jiménez avatar René Hézser avatar Gowtham avatar

Watchers

 avatar

Forkers

djwinter29

edge-proxy's Issues

Licensing policy

Hi,
I was browsing usable iot edge modules and noticed your work. Could you consider adding LICENSE.md file or similar to inform what is your policy considering your work.

👍

Adding azure cli extension fails

While trying adding az cli extensions, received the following error:

tdev@ubuntu:~/azure_device_streams/edge-proxy/azure-cli-iot-extension$ az iot hub proxy -n myiothub -d myedgedevice --port 22
Unable to load extension 'azure-cli-iot-ext: unrecognized kwargs: ['min_profile']'. Use --debug for more information.
Unable to load extension 'azure-iot: unrecognized kwargs: ['min_profile']'. Use --debug for more information.
CommandNotFoundError: 'proxy' is misspelled or not recognized by the system.
Still stuck? Run 'az iot hub --help' to view all commands or go to 'https://aka.ms/cli_ref' to learn more

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.