SmartHive.ZWave is Azure IoT Edge gateway modules for Zwave protocol.

March 14, 2018 ยท View on GitHub

SmartHive.ZWave based on:

How to build modules

You can now build the IoT Edge runtime and samples on your local machine:

  1. Install the prerequisites

    The steps in this tutorial assume you are running Ubuntu Linux.

    To install the prerequisite packages, open a shell and run the following commands:

    sudo apt-get -y update && sudo apt-get -y install libgnutls28-dev libgnutlsxx28 libudev-dev libyaml-dev curl build-essential libcurl4-openssl-dev git cmake make libssl-dev uuid-dev valgrind libglib2.0-dev libtool autoconf nano
      

    In the shell, run the following command to clone the Azure IoT Edge GitHub repository to your local machine:

    git clone --recursive https://github.com/MaxKhlupnov/SmartHive SmartHive
  2. Open a shell. Navigate to the root folder in your local copy of the SmartHive repository.
  3. Compile and install OpenZWave

    Run the build script as follows:

    cd open-zwave && make && make install && ldconfig /usr/local/lib64

    See https://github.com/OpenZWave/open-zwave for more info

  4. Merge SmartHive project and iot-edge project for compilation

    Copy SmartHive.ZWaveModule and SmartHive.ZWaveMappingModule folders into iot-edge/modules directory
    Copy SmartHive.ZWaveGateway folders into iot-edge/samples directory

    Prepare iot-edge CMakeLists.txt for compilation. Run scripts as follows:

     printf "\n add_subdirectory(SmartHive.ZWaveGateway) \n" >> $HOME/SmartHive/iot-edge/samples/CMakeLists.txt
     printf "\n add_subdirectory(SmartHive.ZWaveModule)\n add_subdirectory(SmartHive.ZWaveMappingModule) \n" >> $HOME/SmartHive/iot-edge/modules/CMakeLists.txt
  5. Compile iot-edge with SmartHive modules

    Run the build script from iot-edge directory as follows:

    tools/build.sh --disable-native-remote-modules

    See https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-linux-iot-edge-get-started for more info

  6. Compiled modules and gateway sample will be placed in the iot-edge\build directory

How to build Docker image

  1. Install Docker
  2. In the shell, run the following command to clone the Azure IoT Edge GitHub repository to your local machine:

    git clone https://github.com/MaxKhlupnov/SmartHive SmartHive

    Run script as follow from Docker folder

    docker build -t zwavemodule ./

How to run

  • Run SmartHive.ZWaveGateway same ways as https://github.com/Azure/iot-edge/tree/master/v1/samples/simulated_device_cloud_upload.

    samples/SmartHive.ZWaveGateway/SmartHive.ZWaveGateway zwave_device_cloud_upload_<your platform>.json
  • Run Docker container as follow:

    sudo docker run -p 8008:8008 -i -t --privileged  --device /dev/ttyACM0 openzwave/openzwave-control-panel /bin/bash

There are three parts in the project.