* Merged PR 21: Updated readme.md to clarify supported peripherals and support for adapters

Updated readme.md to clarify supported peripherals and support for adapters

* Merged PR 23: update readme

update readme

* Merged PR 24: fix github file links

GitHub is more restrict with file links.

* Merged PR 25: Updated readmes

Updated Readme based on Joe's and Anch's feedback, fixed typos in the PnPBridge readme, added links to Azure IoT PnP, and updated SerialPnP readme

* Merged PR 26: Private Pre-Release

Private Pre-Release
This commit is contained in:
Mei Wilson 2019-02-19 21:34:01 -08:00 коммит произвёл GitHub
Родитель aa9657ed24
Коммит 3c6d335940
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
3 изменённых файлов: 42 добавлений и 50 удалений

Просмотреть файл

@ -7,12 +7,12 @@
| Windows | :heavy_check_mark: |
| Linux | :heavy_multiplication_x: |
### Development Pre-Requisite
### Development Pre-Requisites
* In order to build Private Preview Azure PnP Bridge, you need to join Microsoft Azure team: https://github.com/Azure
* Ensure CMake and Visual Studio 2017 are installed. **CMake should be in the search PATH.**
* Download Windows 17763 SDK: https://developer.microsoft.com/en-US/windows/downloads/windows-10-sdk
### Build Azure IoT PnP Bridge
### Build the Azure IoT PnP Bridge
#### Step 1: Get the required dependencies for the Azure PnP Bridge
After cloning the Azure PnP Bridge repo to your machine, open the "Developer Command Prompt for VS 2017" and navigate to the directory of the cloned repo:
@ -26,14 +26,14 @@ At this step, if you confirmed you have access to the Azure repo but are not abl
#### Step 2: Build the prerequisite components for the Azure PnP Bridge
```
%REPO_DIR%\> cd PnpBridge\Scripts
%REPO_DIR%\PnpBridge\> cd Scripts
%REPO_DIR%\PnpBridge\Scripts\> build.prereq.cmd
```
#### Step 3: Build the Azure PnP Bridge
1. Open `PnpBridge\src\PnpBridge\PnpBridge.vcxproj` with "Visual Studio 2017"
1. Open `\PnpBridge\src\PnpBridge\PnpBridge.vcxproj` with "Visual Studio 2017"
2. Ensure build target matches the build.prereq.cmd's build (e.g. Release|Debug and x86|x64)
3. Build the solution
4. The built `Pnpbridge.exe` is the Azure PnP Bridge binary
@ -42,7 +42,7 @@ At this step, if you confirmed you have access to the Azure repo but are not abl
To try out Azure IoT PnP Bridge, follow the steps bellow:
* Create an Azure IoT device using Microsoft Azure documentation online and obtain the connections string. If using DPS, the bridge supports symmetric key for the device.
* Create an Azure IoT device using Microsoft Azure documentation online and obtain the connections string. If using DPS, the bridge supports symmetric (e.g. Shared Access Signature or SAS) key for securely connecting to the device.
* Modify the folowing parameters under PnpBridgeParameters node in the config file (config.json):
Using DPS:
@ -56,10 +56,11 @@ To try out Azure IoT PnP Bridge, follow the steps bellow:
"DeviceId": "[Device ID",
"DeviceKey": "[Device primary key]=",
"DeviceCapabilityModelUri": "[Device capability model URI]",
"ModelRepositoryUri": "[Model reporsitory URI]"
"ModelRepositoryUri": "[Model repository URI]"
}
}
```
> Note: If using Azure IoT Central, the primary connection fields you will need to change in the default config file are IdScope, DeviceId, DeviceKey, and DeviceCapabilityModelUri. Refer to the [Azure IoT Central documentation on device connectivity](https://docs.microsoft.com/en-us/azure/iot-central/concepts-connectivity) for how to generate the IdScope, DeviceId, and DeviceKey for your device. The DeviceCapabilityModelUri is the "Id" that is listed for your device's Device Capability Model in Azure IoT Central.
Using your own connection string:
@ -147,7 +148,7 @@ Following are the valid configuration fields:
DeviceId: Unique device id
DeviceKey: Primary device key
DeviceCapabilityModelUri: Device capability model URI
ModelRepositoryUri: Model reporsitory URI
ModelRepositoryUri: Model repository URI
ConnectionString: Connection String
traceOn: Enable tracing [OPTIONAL] [Default is true]
@ -156,19 +157,19 @@ Following are the valid configuration fields:
MatchFilters: Set of identifiers to match the device reported by discovery adapter [REQUIRED]
MatchType: Exact or Contains. Performs a comparision between the MatchParameters
elements and the MatchParameters provided by DiscoveryAdapter [REQUIRED]
MatchParameters: Json array containig user defined parameters [REQUIRED]
MatchParameters: Json array containing user defined parameters [REQUIRED]
InterfaceId: Interface Id to be published for this device. This can be skipped if a
device is self describing [REQUIRED/ Except when SelfDescribing = true]
SelfDescribing: This device will report the PnP interface schema and the InterfaceId.
When using this option, DiscoveryParameters must be specified [OPTIONAL] [true/false]
PnpParameters: PnP adapter parameters is MUST for every device. This is used to bind
the right PnpAdapter for this device [REQUIRED]
Identity: PnpAdapter Idenity
Identity: PnpAdapter Identity
DiscoveryParameters: Discovery parameters are used in case of self describing devices [OPTIONAL]
Identity: Discovery adapter Idenity is used to map this device to discovery adapter [REQUIRED]
Identity: Discovery adapter Identity is used to map this device to discovery adapter [REQUIRED]
DiscoveryAdapters: Json object with Discovery Adapter parameters
Parameters: Json Array containing user defined Initialization arguments for the discovery adapter
Identity: Discovery adapter idenity used to map the discovery adapter [REQUIRED]
Identity: Discovery adapter Identity used to map the discovery adapter [REQUIRED]
```
## Authoring new PnP Bridge Adapters

Просмотреть файл

@ -23,7 +23,7 @@ The library implements the following features
### Getting Started (All Platforms)
#### Adding SerialPnP library to your project
To get started using the library, bring the `SerialPnP.cpp` and `SerialPnP.h` files into your
To get started using the library, bring the `SerialPnP.c` and `SerialPnP.h` files into your
project directory and add them to your project. The library requires platform-specific functionality
to be implemented by the developer or platform implementer. The platform must also provide `malloc` and `free` functions.
@ -62,8 +62,8 @@ The above functions are expected to provide support for serial and reset functio
For serial, the implementation of these functions should maintain a suitable buffer which
is asynchronously accessed by SerialPnP using the above functions.
Example implementation of these functions is available here (TODO), which demonstrates
how the Arduino standard library functions are wrapped to provider SerialPnP support.
Example implementation of these functions is available in [ArduinoSerialPnP.cpp](./ArduinoExample/ArduinoSerialPnP.cpp), which demonstrates
how the Arduino standard library functions are wrapped to provide SerialPnP support.
#### SerialPnP initialization
To expose interfaces using SerialPnP, the library must first be initialized.
@ -136,7 +136,7 @@ The SerialPnP library handles serialization and execution of gateway driven func
to achieve the following:
- Reading properties from device
- Writing properties to device
- Executing methods on device
- Executing commands on device
The library defines a `SerialPnPCb` method signature as below:
```typedef void (*SerialPnPCb)(void*, void*);```
@ -144,19 +144,17 @@ The library defines a `SerialPnPCb` method signature as below:
Callback methods do not return a value, but rather operate on the two pointer
parameters. The first parameter will be input, and the second will be output.
No typing is provided for the parameters - a callback for a given property and method
No typing is provided for the parameters - a callback for a given property and command
is expected to know what schema is selected as part of input definition and have its
method declared appropriately.
A property callback is expected to examine the parameters to determine if the callback
is being made to read or write the value of the property. Where only output parameter is defined,
the callback should place the existing value of the property into the variable pointed to by the
output parameter. Where input and output parameter are both defined, the callback should perform
any necessary validation on the input parameter, update the property if validation succeeds,
and place the new value of the property into the output value.
Property callbacks can be called in two ways:
1. The input parameter is null, and only the output parameter is defined.
- In this case, the callback is being used to read a property. The callback should place the current value of the property into the variable pointed to by the output parameter. Operating on the input parameter when it is null will result in instability.
2. Both the input parameter and output parameters are defined.
- In this case the callback is being used to write a property. The callback should perform any necessary validation on the input parameter, update the property if validation succeeds, and place the new value of the property into the output value.
A command callback should read the input parameter and write the output parameter as
relevant to the functionality of the callback in question.
Command callbacks will be called with both input and output parameters defined. Command callbacks should read the input parameter and write the output parameter as relevant to the functionality of the callback in question.
An example implementation of the property and command callbacks as used in our example
thermometer can be seen below:
@ -206,4 +204,4 @@ provided:
- `SerialPnP_SendEventFloat(const char* EventShortId, float Value)`
#### Examples
Please see (TODO) for an example implementation of the SerialPnP library on an Arduino.
Please see [ArduinoSerialPnP.cpp](./ArduinoExample/ArduinoSerialPnP.cpp) for an example implementation of the SerialPnP library on an Arduino and [ArduinoExample.ino](./ArduinoExample/ArduinoExample.ino) for example usage of the SerialPnP library on an Arduino device.

Просмотреть файл

@ -1,13 +1,16 @@
# This pre-release is confidential
Access to this pre-release software is confidential and should not be disclosed or shared with other parties per your NDA with Microsoft.
# Azure PnP Bridge
## Introduction
Azure PnP Bridge is the open source effort from Microsoft to bridge the PC sensor and peripheral ecosystem with Azure, so that IoT developers can easily connect, remotely monitor, and remotely manage their IoT sensors and peripherals on a large scale. By bridging IoT sensors and peripherals with Azure, the Azure PnP Bridge also enables developers to perform data analytics from either the edge or the cloud to gain insights on their IoT devices.
Azure PnP Bridge is the open source effort from Microsoft that connects the PC sensor and peripheral ecosystem to Azure. It builds on top of [Azure IoT PnP](https://github.com/Azure/Azure-IoT-PnP-Preview/) so that with minimal to no code, developers can easily connect peripherals to Azure, remotely access their data, monitor them, and manage them. This allows developers to perform analytics and gain valuable insights on their IoT devices from either the edge or the cloud. The Azure PnP Bridge accomplishes this without requiring peripherals to have direct Azure connectivity, enabling them to use a Windows host as a gateway to Azure instead. Because of this, it is particularly well suited for connecting cameras and environmental sensors to Azure.
Azure PnP Bridge can be deployed as a standalone executable that can be dropped onto any IoT device PC, or gateway running Windows 10. It can also be compiled into your application code. A simple configuration file tells the Azure PnP Bridge which sensors and peripherals should be exposed up to Azure. Once configured, the Azure PnP Bridge uses the Azure IoT PnP SDK to dynamically publish Azure IoT PnP interfaces for the specified sensors and peripherals up to Azure. Developers can then use existing Azure services and solution accelerators to receive data from and send commands to their sensors and peripherals.
Azure PnP Bridge can be deployed as a standalone executable on any IoT device, PC, industrial PC, server, or gateway running Windows 10. It can also be compiled into your application code. A simple configuration file tells the Azure PnP Bridge which sensors and peripherals should be exposed up to Azure. Once configured, the Azure PnP Bridge uses the Azure IoT PnP SDK to dynamically publish Azure IoT PnP interfaces for the specified sensors and peripherals up to Azure. Developers can then use existing Azure services and solution accelerators to receive data from and send commands to their sensors and peripherals.
## <a id="pre-requisites"></a>Pre-Requisites
## Pre-Requisites
- Windows 10 OS:
- For Camera health monitoring functionality, current Insider Preview OS version is required.
- All other functionality is available on all Windows 10 builds.
@ -18,37 +21,27 @@ Azure PnP Bridge can be deployed as a standalone executable that can be dropped
- Windows IoT Core
- Hardware:
- Any hardware capable supporting above OS SKUs and versions.
- PnP Bridge is extensible and you can write simple adapters to support additional peripherals.
[See peripherals section below](#peripherals-supported-by-default)
- Any hardware platform capable of supporting the above OS SKUs and versions.
- Serial, USB, and Camera peripherals are supported natively. The Azure PnP Bridge can be extended to support any custom peripheral ([see peripherals section below](#peripherals-supported-by-default))
- Private Preview of Azure IoT Central at https://aka.ms/iotc-demo.
- Private Preview of Azure IoT PnP: https://github.com/Azure/Azure-IoT-PnP-Preview/. The included build scripts will automatically clone the required Azure IoT PnP C SDK for you.
- IoT Edge (optional, can be used to help deploy, run, and manage software on the device)
- Private Preview of Azure IoT Central at https://aka.ms/iotc-demo (optional, a fully-managed IoT SaaS solution with UI that can be used to monitor and manage your device from Azure)
- Azure IoT Edge (optional, can be used to help deploy, run, and manage software on the device)
## Azure PnP Bridge Architecture
![Architecture](./PnpBridge/docs/Pictures/AzurePnPBridge.png)
## Using the Azure PnP Bridge
## Peripherals supported by default
### Required development setup
- In order to build Private Preview Azure PnP Bridge, you need to join Microsoft Azure team: https://github.com/Azure
- Ensure cmake and Visual Studio 2017 are installed
- Download Windows 17763 SDK: https://developer.microsoft.com/en-US/windows/downloads/windows-10-sdk
### Peripherals supported by default
Azure PnP Bridge supports the following types of peripherals by default. Developers can extend the Azure PnP Bridge to support additional peripherals. See [readme under PnPBridge](./PnpBridge/ReadMe.md)
- Peripherals such as MCUs that are typically accessed over serial ports:
- Refer to the [SerialPnP\Readme](./SerialPnP/Readme.md) for information on how such devices can self-describe their interfaces.
- USB or other peripherals that can be discovered by Windows
Azure PnP Bridge supports the following types of peripherals by default. Developers can extend the Azure PnP Bridge to support additional peripherals via the instructions in the [PnP Bridge documentation](./PnpBridge/ReadMe.md).
- Peripherals controlled by MCUs that are accessed over serial ports:
- Refer to the [SerialPnP documentation](./SerialPnP/Readme.md) for information on how such devices should self-describe their interfaces to the PnP Bridge
- USB peripherals that can be discovered by Windows
- All cameras supported by Windows OS (Webcam, MIPI cameras and IP of RGB/IR/Depth cameras).
See [PnPBridge\Readme.md](./PnpBridge/ReadMe.md) for information on how to write simple adapters to extend to other peripherals.
### Get Started
## Get Started
Follow [PnPBridge\Readme.md](./PnpBridge/ReadMe.md) to get started on building, deploying and extending the PnP Bridge.