[][src]Crate my_iot

Getting started

Grab a release from GitHub for your architecture

or, install it via cargo:

cargo install my-iot

or, clone the repo and build it manually:

git clone https://github.com/eigenein/my-iot-rs.git
cd my-iot-rs
make
sudo make install

Then, you'll need to create a configuration file settings.yml. It must contain exactly one object, please read the settings documentation.

File capabilities

If you're not using make, you may need to manually set capabilities on the produced binary:

setcap cap_net_raw+ep /usr/local/bin/my-iot

This is needed to use some low-level protocols (for instance, ICMP) as a non-root user.

Modules

consts
db

Database interface.

logging

Logging setup.

reading

Describes a sensor reading and related structures.

receiver

Readings receiver that actually processes all readings coming from services.

services

Implements generic Service trait.

settings

Settings

templates

Web interface templates.

threading

Threading utilities.

value

Implements sensor reading value.

web

Implements web server.

Constants

DEFAULT_DB_PATH
DEFAULT_SETTINGS_PATH

Functions

main

Entry point.

spawn_dispatcher

Spawn message dispatcher that broadcasts every received message to emulate multi-producer multi-consumer queue. Thus, services exchange messages with each other.

spawn_services

Spawn all configured services.

Type Definitions

Result