shepherd-herd

Synchronized Energy Harvesting Emulator and Recorder CLI


Keywords
testbed, beaglebone, pru, batteryless, energyharvesting, solar
License
MIT
Install
pip install shepherd-herd==0.7.0

Documentation

SHEpHERD: SyncHronized Energy Harvesting Emulator RecorDer

QA-Tests Documentation Build Pru Code Quality PyPiVersion CodeStyle

Documentation: https://orgua.github.io/shepherd/

Source Code: https://github.com/orgua/shepherd


Batteryless sensor nodes depend on harvesting energy from their environment. Developing solutions involving groups of batteryless nodes requires a tool to analyze, understand and replicate spatio-temporal harvesting conditions. shepherd is a testbed for the batteryless Internet of Things, allowing to record harvesting conditions at multiple points in space over time. The recorded data can be replayed to attached wireless sensor nodes, examining their behavior under the constraints of spatio-temporal energy availability.

Features

  • High-speed, high resolution current and voltage sensing
  • Technology-agnostic: Currently, solar and kinetic energy harvesting are supported
  • Remote programming/debugging of ARM Cortex-M MCUs using Serial-Wire-Debug
  • High resolution, synchronized GPIO tracing
  • Configurable, constant voltage power supply for attached sensor nodes
  • Level-translated serial connection to the attached sensor nodes

For a detailed description see our Paper or the official documentation.

A shepherd instance consists of a group of spatially distributed shepherd nodes that are time-synchronized with each other. Each shepherd node consists of a BeagleBone, the shepherd cape and a particular choice of capelets according to the user requirements.

This repository contains the hardware design files for the shepherd cape and the various capelets, the software running on each shepherd node as well as the tool to orchestrate a group of shepherd nodes connected to a network.

Quickstart

Start by assembling your shepherd nodes, consisting of a BeagleBone Green/Black, a shepherd cape, a harvesting capelet and a target capelet. The next step is to manually install the latest Ubuntu Linux on each BeagleBone. You can install it to SD-card or the on-board eMMC flash, following the official instructions. Make sure to follow the instructions for BeagleBone. Alternatively there are two more detailed guides in the shepherd documentation.

The following instructions describe how to install the shepherd software on a group of shepherd nodes connected to an Ethernet network. We assume that your local machine is connected to the same network, that the nodes have internet access and that you know the IP address of each node.

If you haven't done it yet, clone this repository to your local machine:

git clone https://github.com/orgua/shepherd.git

Next, install the tools used for installing and controlling the shepherd nodes. We'll use Ansible to remotely roll out the basic configuration to each shepherd node and shepherd-herd to orchestrate recording/emulation across all nodes. The tools are hosted on PyPI and require Python version >= 3.6. You'll also need to have sshpass installed on your machine, which is available through the package management system of all major distributions. Install the tools using pip:

pip3 install ansible shepherd-herd

The inventory/herd.yml file shows an example of how to provide the host names and known IP addresses of your BeagleBones. Adjust it to reflect your setup. You can arbitrarily choose and assign the hostnames (sheep0, sheep1, in this example) and the ansible_user (jane in this example). [TODO: update description with roles].

sheep:
  hosts:
    sheep0:
        ansible_host: 192.168.1.100
    sheep1:
        ansible_host: 192.168.1.101
    sheep2:
        ansible_host: 192.168.1.102
  vars:
    ansible_user: jane

Now run the bootstrap.yml Ansible playbook, which sets the hostname, creates a user and enables passwordless ssh and sudo:

ansible-playbook deploy/bootstrap.yml

Finally, use the deploy.yml playbook to setup the shepherd software with the configured roles from inventory:

ansible-playbook deploy/deploy.yml

Usage

Record two minutes of data:

shepherd-herd harvester -d 120 -o recording.h5 -a mppt_voc

The command starts the recording asynchronously and returns after all nodes have started recording. While the nodes are still recording (indicated by blinking of LED 1 and 2), prepare a directory on your local machine:

mkdir ~/shepherd_recordings

After the nodes stop blinking, you can retrieve the data to analyze it on your local machine:

shepherd-herd retrieve recording.h5 ~/shepherd_recordings

For a detailed description of the HDF5 based data format, refer to the corresponding documentation.

Finally, replay the previously recorded data to the attached sensor nodes, recording their power consumption:

shepherd-herd emulator -o consumption.h5 recording.h5

Try shepherd-herd --help or check out the documentation here for a list of all options.

Problems and Questions

shepherd is an early stage project and chances are that something is not working as expected. Also, some features are not yet fully supported or documented. If you experience issues or require additional features, please get in touch via e-mail or by creating an issue on github.

Documentation

The documentation is hosted on readthedocs.

People

shepherd development is lead at the Networked Embedded Systems Lab at TU Dresden as part of the DFG-funded project Next-IoT.

The following people have contributed to shepherd: