Frequently asked questions for Connected Factory solution accelerator

See also, the general FAQ for IoT solution accelerators.

Where can I find the source code for the solution accelerator?

The source code is stored in the following GitHub repository:

What is OPC UA?

OPC Unified Architecture (UA), released in 2008, is a platform-independent, service-oriented interoperability standard. OPC UA is used by various industrial systems and devices such as industry PCs, PLCs, and sensors. OPC UA integrates the functionality of the OPC Classic specifications into one extensible framework with built-in security. It is a standard that is driven by the OPC Foundation. The OPC Foundation is a not-for-profit organization with more than 440 members. The goal of the organization is to use OPC specifications to facilitate multi-vendor, multi-platform, secure and reliable interoperability through:

  • Infrastructure
  • Specifications
  • Technology
  • Processes

Why did Microsoft choose OPC UA for the Connected Factory solution accelerator?

Microsoft chose OPC UA because it is an open, non-proprietary, platform independent, industry-recognized, and proven standard. It is a requirement for Industrie 4.0 (RAMI4.0) reference architecture solutions ensuring interoperability between a broad set of manufacturing processes and equipment. Microsoft sees demand from its customers to build Industrie 4.0 solutions. Support for OPC UA helps lower the barrier for customers to achieve their goals and provides immediate business value to them.

How do I add a public IP address to the simulation VM?

You have two options to add the IP address:

  • Use the PowerShell script Simulation/Factory/Add-SimulationPublicIp.ps1 in the repository. Pass in your deployment name as a parameter. For a local deployment, use <your username>ConnFactoryLocal. The script prints out the IP address of the VM.

  • In the Azure portal, locate the resource group of your deployment. Except for a local deployment, the resource group has the name you specified as solution or deployment name. For a local deployment using the build script, the name of the resource group is <your username>ConnFactoryLocal. Now add a new Public IP address resource to the resource group.

Note

In either case, ensure you install the latest patches by following the instructions on the Ubuntu website. Keep the installation up to date for as long as your VM is accessible through a public IP address.

How do I remove the public IP address to the simulation VM?

You have two options to remove the IP address:

  • Use the PowerShell script Simulation/Factory/Remove-SimulationPublicIp.ps1 of the repository. Pass in your deployment name as a parameter. For a local deployment, use <your username>ConnFactoryLocal. The script prints out the IP address of the VM.

  • In the Azure portal, locate the resource group of your deployment. Except for a local deployment, the resource group has the name you specified as solution or deployment name. For a local deployment using the build script, the name of the resource group is <your username>ConnFactoryLocal. Now remove the Public IP address resource from the resource group.

How do I sign in to the simulation VM?

Signing in to the simulation VM is only supported if you have deployed your solution using the PowerShell script build.ps1 in the repository.

If you deployed the solution from www.azureiotsolutions.com, you cannot sign in to the VM. You cannot sign in, because the password is generated randomly and you cannot reset it.

  1. Add a public IP address to the VM. See How do I add a public IP address to the simulation VM?
  2. Create an SSH session to your VM using the IP address of the VM.
  3. The username to use is: docker.
  4. The password to use depends on the version you used to deploy:
    • For solutions deployed using the build.ps1 script before 1 June 2017, the password is: Passw0rd.
    • For solutions deployed using the build.ps1 script after 1 June 2017, you can find the password in the <name of your deployment>.config.user file. The password is stored in the VmAdminPassword setting. The password is generated randomly at deployment time unless you specify it using the build.ps1 script parameter -VmAdminPassword

How do I stop and start all docker processes in the simulation VM?

  1. Sign in to the simulation VM. See How do I sign in to the simulation VM?
  2. To check which containers are active, run: docker ps.
  3. To stop all simulation containers, run: ./stopsimulation.
  4. To start all simulation containers:

    • Export a shell variable with the name IOTHUB_CONNECTIONSTRING. Use the value of the IotHubOwnerConnectionString setting in the <name of your deployment>.config.user file. For example:

      export IOTHUB_CONNECTIONSTRING="HostName={yourdeployment}.azure-devices.net;SharedAccessKeyName=iothubowner;SharedAccessKey={your key}"
      
    • Run ./startsimulation.

How do I update the simulation in the VM?

If you have made any changes to the simulation, you can use the PowerShell script build.ps1 in the repository using the updatedimulation command. This script builds all the simulation components, stops the simulation in the VM, uploads, installs, and starts them.

How do I find out the connection string of the IoT hub used by my solution?

If you deployed your solution with the build.ps1 script in the repository, the connection string is the value of IotHubOwnerConnectionString in the <name of your deployment>.config.user file.

You can also find the connection string using the Azure portal. In the IoT Hub resource in the resource group of your deployment, locate the connection string settings.

Which IoT Hub devices does the Connected Factory simulation use?

The simulation self registers the following devices:

  • proxy.beijing.corp.contoso
  • proxy.capetown.corp.contoso
  • proxy.mumbai.corp.contoso
  • proxy.munich0.corp.contoso
  • proxy.rio.corp.contoso
  • proxy.seattle.corp.contoso
  • publisher.beijing.corp.contoso
  • publisher.capetown.corp.contoso
  • publisher.mumbai.corp.contoso
  • publisher.munich0.corp.contoso
  • publisher.rio.corp.contoso
  • publisher.seattle.corp.contoso

Using the DeviceExplorer or the IoT extension for Azure CLI 2.0 tool, you can check which devices are registered with the IoT hub your solution is using. To use device explorer, you need the connection string for the IoT hub in your deployment. To use the IoT extension for Azure CLI 2.0, you need your IoT Hub name.

How can I get log data from the simulation components?

All components in the simulation log information in to log files. These files can be found in the VM in the folder home/docker/Logs. To retrieve the logs, you can use the PowerShell script Simulation/Factory/Get-SimulationLogs.ps1 in the repository.

This script needs to sign in to the VM. You may need to provide credentials for the sign-in. See How do I sign in to the simulation VM? to find the credentials.

The script adds/removes a public IP address to the VM, if it does not yet have one and removes it. The script puts all log files in an archive and downloads the archive to your development workstation.

Alternatively log in to the VM via SSH and inspect the log files at runtime.

How can I check if the simulation is sending data to the cloud?

With the DeviceExplorer or the iothub-explorer tool, you can inspect the data sent to IoT Hub from certain devices. To use these tools, you need to know the connection string for the IoT hub in your deployment. See How do I find out the connection string of the IoT hub used by my solution?

Inspect the data sent by one of the publisher devices:

  • publisher.beijing.corp.contoso
  • publisher.capetown.corp.contoso
  • publisher.mumbai.corp.contoso
  • publisher.munich0.corp.contoso
  • publisher.rio.corp.contoso
  • publisher.seattle.corp.contoso

If you see no data sent to IoT Hub, then there is an issue with the simulation. As a first analysis step you should analyze the log files of the simulation components. See How can I get log data from the simulation components? Next, try to stop and start the simulation and if there's still no data sent, update the simulation completely. See How do I update the simulation in the VM?

How do I enable an interactive map in my Connected Factory solution?

To enable an interactive map in your Connected Factory solution, you must have an existing Bing Maps API for Enterprise plan.

When deploying from www.azureiotsolutions.com, the deployment process verifies that your subscription has an enabled Bing Maps API for Enterprise plan and automatically deploys an interactive map into Connected Factory. If this is not the case, you can still enable an interactive map in your deployment as follows:

When you deploy using the build.ps1 script in the Connected Factory GitHub repository and you have a Bing Maps API for Enterprise plan, set the environment variable $env:MapApiQueryKey in the build window to the query key of your plan. The interactive map is then enabled automatically.

If you don't have a Bing Maps API for Enterprise plan, deploy the Connected Factory solution from www.azureiotsolutions.com or using the build.ps1 script. Then add a Bing Maps API for Enterprise plan to your subscription as explained in How do I create a Bing Maps API for Enterprise account?. Look up the query key of this account as explained in How to obtain your Bing Maps API for Enterprise QueryKey and save this key. Navigate to the Azure portal and access the App Service resource in your Connected Factory deployment. Navigate to Application settings, where you find a section App settings. Set the MapApiQueryKey to the query key you obtained. Save the settings and then navigate to Overview and restart the App Service.

How do I create a Bing Maps API for Enterprise account

You can get a free Internal Transactions Level 1 Bing Maps for Enterprise plan. However, you can only add two of these plans to an Azure subscription. If you don't have a Bing Maps API for Enterprise account, create one in the Azure portal by clicking + Create a resource. Then search for Bing Maps API for Enterprise and follow the prompts to create it.

Bing key

How to obtain your Bing Maps API for Enterprise QueryKey

Once you have created your Bing Maps API for Enterprise plan, add a Bing Maps for Enterprise resource to the resource group of your Connected Factory solution in the Azure portal.

  1. In the Azure portal, navigate to the resource group that contains your Bing Maps API for Enterprise plan.

  2. Click All Settings, then Key Management.

  3. There are two keys: MasterKey and QueryKey. Copy the QueryKey value.

  4. To have the key picked up by the build.ps1 script, set the environment variable $env:MapApiQueryKey in your PowerShell environment to the QueryKey of your plan. The build script then automatically adds the value to the settings of the App Service.

  5. Run a local or cloud deployment using the build.ps1 script.

How do enable the interactive map while debugging locally?

To enable the interactive map while you are debugging locally, set the value of the setting MapApiQueryKey in the files local.user.config and <yourdeploymentname>.user.config in the root of your deployment to the value of the QueryKey you copied previously.

How do I use a different image at the home page of my dashboard?

To change the static image shown io the home page of the dashboard, replace the image WebApp\Content\img\world.jpg. Then rebuild and redeploy the WebApp.

How do I use non OPC UA devices with Connected Factory?

To send telemetry data from non OPC UA devices to Connected Factory:

  1. Configure a new station in the Connected Factory topology in the ContosoTopologyDescription.json file.

  2. Ingest the telemetry data in Connected Factory compatible JSON format:

    [
      {
        "ApplicationUri": "<the_value_of_OpcUri_of_your_station",
        "DisplayName": "<name_of_the_datapoint>",
        "NodeId": "value_of_NodeId_of_your_datapoint_in_the_station",
        "Value": {
          "Value": <datapoint_value>,
          "SourceTimestamp": "<timestamp>"
        }
      }
    ]
    
  3. The format of <timestamp> is: 2017-12-08T19:24:51.886753Z

  4. Restart the Connected Factory App Service.

Next steps

You can also explore some of the other features and capabilities of the IoT solution accelerators: