Test your Code

  1. If not already done, install the newly created package into your eGeoffrey test instance by running, from within the directory where eGeoffrey is installed, egeoffrey-cli install <path_to_your_package>/manifest.yml. This will install your package in eGeoffrey, even if not available yet in the Marketplace
  2. If instead the package is already installed, download the latest version by running sudo egeoffrey-cli package update egeoffrey-service-example (if the package is called egeoffrey-service-example)
  3. Start your package by running sudo egeoffrey-cli house start. You package will be downloaded and started
  4. Review the logs generated by eGeoffrey with egeoffrey-cli house logs / egeoffrey-cli house logs_tail or those generated by your package only with egeoffrey-cli house logs egeoffrey-service-example (if the package is called egeoffrey-service-example)

Alternative testing procedure

If going through the automatic development and building process is time consuming for you and you want to test small changes of your code step by step, you can run your module without the need to package it first.

Additional Requirements

  • Python (v2.7)
  • eGeoffrey SDK Python dependencies (pip install paho-mqtt requests tinynumpy pyyaml yq apscheduler)
  • Any Python library and/or operating system dependencies required for running your code installed
  • eGeoffrey SDK (git clone https://github.com/egeoffrey/egeoffrey-sdk)

Manually Running your code

  • Add eGeoffrey SDK to your local repository with ln -s <egeoffrey_sdk_directory>/sdk <your_package_directory>/sdk. This will create a symbolic link to the eGeoffrey SDK
  • Configure the runtime environment by setting the environment variables you need to ensure your code can connect to the eGeoffrey test instance. You need at least to set EGEOFFREY_GATEWAY_HOSTNAME and EGEOFFREY_MODULES
  • Start your module by running python -m sdk.python.module.start