Skip to main content

The command line for MoaT

Project description

The MoaT

"MoaT" is an acronym of "Master of all Things", which is either aspirational or just plain pretentious. Take your pick.

If you assume that this repository contains the same stuff as a regular moat, i.e. a lot of water of questionable quality (plus whatever the castle's inhabitants wanted to get rid off), you might not be too far off the mark.

Well, except for the water.

Seriously …

The MoaT code comprises a lot of somewhat-opinionated code to control various IoT devices. Among those are photovoltaics, irrigation, door intercoms, and whatnot.

The core of MoaT is written in anyio-compatible asynchronous Python3, written with Structured Concurrency principles in mind.

Satellite microcontrollers typically run MicroPython, again heavily using structured async code: MicroPython supports taskgroups if you patch it lightly.

Structured what?

Structured Concurrency.

There's a Wikipedia article about it.

A good Pythonic introduction is here.

Repository Structure

The MoaT code is built using git submodules, corresponding to separate moat-XXX packages.

The top module contains the command-line front-end of MoaT. Any MoaT code that can reasonably be controlled by a command line hooks into it, by way of a _main module with a cli object, which should be an asyncclick group (or command).

The only mandatory submodule is "util". It contains a heap of semi-structured helper code which the rest of the MoaT infrastructure depends on. "moat-util" also has a command line; it serves as a convenient example for building your own extension, and exports a time-until-absolute-date calculator and a msgpack codec.

Modules

Libraries

  • dbus: an async DBus client.

  • gpio: a library to read and write GPIO lines.

  • modbus: an opinionated Modbus client and server library.

  • mqtt: a MQTT broker, client library, and client command line front-ends.

  • wire: a bidirectional link exchanging structured messages, with backends for serial and TCP.

  • micro: Support for MoaT sattelites running MicroPython

MoaT parts

  • main, util: See above.

  • kv: distributed masterless eventually-consistent key-value storage.

  • ems: Battery management, photovoltaics, …

  • src: MoaT source code management

MoaT-KV components

Moat-KV is a master-less distributed key-value storage system. It is resistant to partitioning and intended to be always-on. It will not block or lose updates in a partitioned network; inconsistent entries are re-synchronized upon reconnection.

"moat.kv" is currently named "distkv". Conversion to MoaT is planned.

  • kv-akumuli: Data storage to Akumuli, an efficient light-weight time series database

  • kv-gpio: Connecting Moat-KV and MoaT-GPIO

  • kv-hass: Use MoaT-KV as the MQTT back-end to Home Assistant

  • kv-inv: Network inventory management (hosts, networks, VLANs, links between hosts)

  • kv-knx: Link with KNX building automation networks

  • kv-owfs: Connecting 1wire sensors

  • kv-wago: A rudimentary interface for WAGO 330 controllers

MoaT-EMS components

EMS is an acronym for "Energy Management System".

  • ems-battery: Battery management

  • ems-inv: Inverter management

  • ems-sched: Energy storage scheduling

More will follow.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

moat-0.1.17.tar.gz (9.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

moat-0.1.17-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

File details

Details for the file moat-0.1.17.tar.gz.

File metadata

  • Download URL: moat-0.1.17.tar.gz
  • Upload date:
  • Size: 9.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.8.2 requests/2.25.1 setuptools/66.1.1 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.11.2

File hashes

Hashes for moat-0.1.17.tar.gz
Algorithm Hash digest
SHA256 5c5d049038d675789980b14fc697f30bac311ffffe1bc56114cb39c20b4a175f
MD5 3dcf71b811ffe23fbe67ce3278b2a2b8
BLAKE2b-256 eefbe52e1e272b7146552fc49e7179e08ed8cc9cd916d40db167599db043cb25

See more details on using hashes here.

File details

Details for the file moat-0.1.17-py3-none-any.whl.

File metadata

  • Download URL: moat-0.1.17-py3-none-any.whl
  • Upload date:
  • Size: 6.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.8.2 requests/2.25.1 setuptools/66.1.1 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.11.2

File hashes

Hashes for moat-0.1.17-py3-none-any.whl
Algorithm Hash digest
SHA256 f8a1edba64978fb6ec2ea351656d267882f893c667fbfb4c5a11069144a3d619
MD5 f7033b92f41e4813a8019d16ec50e9e3
BLAKE2b-256 fb4125d376daf06d2b8967e2626915de2fa0fc141d26f966497a66b5f75d747e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page