User Tools

Site Tools


iotivity_upnp_bridge_build

How To View/Get IoTivity Projects

IoTivity UPnP Bridge requires source from iotivity and iotivity-upnp-bridge projects. You can find all iotivity projects here:

Linux IoTivity Build

IoTivity UPnP Bridge requires iotivity project built on Linux before building iotivity-upnp-bridge project.

Known Issues:

There is currently a [bug reported for IoTivity](https://jira.iotivity.org/browse/IOT-1126)

This can be worked around by building iotivity project with TARGET_TRANSPORT=IP flag.

example:

  $ scons TARGET_TRANSPORT=IP RELEASE=1

The outputs of the iotivity build will be in:

<top directory of the project>/out/linux/<target_arch>/<build_type>/

example:

iotivity/out/linux/x86_64/release/.

Linux IoTivity UPnP Bridge Build

Install required build libraries

Ubuntu

  $ sudo apt-get install libgupnp-1.0-dev libgssdp-1.0-dev libboost-regex-dev
  $ sudo apt-get install gupnp-tools #Optional but recommended.. Required Version: 0.8.12

Fedora

  $ sudo dnf install gssdp-devel gupnp-devel
  $ sudo dnf install gupnp-tools #Optional but recommended.. Required Version: 0.8.12

Setup IoTivity UPnP Bridge Build Environment with IoTivity Project

Under iotivity-upnp-bridge, you will need to copy the setenv.sh.example to setenv.sh. Open and edit the setenv.sh file to reflect the location of iotivity environment. You can then source the setenv.sh to setup the iotivity-upnp-bridge environment.

  $ cp setenv.sh.example setenv.sh 
  $ vi setenv.sh
  $ source setenv.sh

Likewise, you will need to copy the BuildOptions.txt.example to BuildOptions.txt. Open and edit the BuildOptions.txt file to reflect the location of iotivity environment.

  $ cp BuildOptions.txt.example BuildOptions.txt
  $ vi BuildOptions.txt

Build

To build iotivity-upnp-bridge project run 'scons'. Variables specified in the BuildOptions.txt can be overwriten by adding them to the scons command at runtime. Linux Only Supported

example:

  $ scons BUILD_TYPE=release

The outputs of the iotivity-upnp-bridge build will be in:

<top directory of the project>/out/linux/<target_arch>/<build_type>/

example:

iotivity-upnp-bridge/out/linux/x86_64/release/.

Testing

Navigate to the `out/linux/x86_64/<build_type>/bin` directory.

Run the following:

  $ gupnp-network-light #requires gupnp-tools
  $ ./UpnpBridge
  $ ./Observer
  $ ./iotApp
      or 
  $ ./SimpleClient

The `gupnp-network-light` is a virtual gupnp light that will only respond to UPnP. The `UpnpBridge` is the code that bridges IoTivity and UPnP. The `Observer` finds the UPnP light using IoTivity and observes any changes in the current lights attributes and reports the change. The `SimpleClient` will find the light and will toggle the light state.

The Client toggles the state of any discovered light and quits after 10 seconds. Alternatively, if given any runtime argument, the Client runs until Control-C toggling the state of any discovered light every 5 seconds.

The ObserveClient runs until Control-C, it writes OBSERVE messages to the console when the state of a light changes.

Android UPnP Client Apps

The Android UPnP Client Apps are built along with all of the other IoTivity Android examples. These instructions assume that the system has already been set up for Android development. Follow IoTivity instructions for [Android development](https://www.iotivity.org/) or Android Build Instructions

  $ cd iotivity

Copy the Android UPnP Client Apps into the IoTivity Android example code.

  $ cp -rv ../iotivity-upnp-bridge/android/examples/upnpclient/ android/examples
  $ cp -rv ../iotivity-upnp-bridge/android/examples/upnpavclient/ android/examples

Edit the settings.gradle file to include the upnpclients.

  $ sed -i "/^include / s/$/, ':upnpclient', ':upnpavclient'/" android/examples/settings.gradle

Building UPnP Client Demo Android Apps

  $ scons TARGET_OS=android TARGET_ARCH=<armeabi|x86|x86_64> TARGET_TRANSPORT=IP

For example, Nexus 7 Table which has arm chipset.

  $ scons TARGET_OS=android TARGET_ARCH=armeabi TARGET_TRANSPORT=IP

The UPnP Client Demo Android App, 'upnpclient-debug.apk' is in the 'android/examples/upnpclient/build/outputs/apk' directory.

The UPnP AV Client Demo Android App, 'upnpavclient-debug.apk' is in the 'android/examples/upnpavclient/build/outputs/apk' directory.

Installing UPnP Client Demo Android Apps

Follow IoTivity instructions for installing Andriod example apps under Running Android Example Apps section for [Android development](https://www.iotivity.org/) or Android Build Instructions

Testing UPnP Client Demo Android Apps

Caveat: This currently requires the UpnpBridge running on a Linux system with UPnP Client Demo Android Apps

iotivity_upnp_bridge_build.txt · Last modified: 2016/11/08 21:08 by Rick Bell