Metadata-Version: 2.1
Name: brokkr
Version: 0.2.0
Summary: A package for data logging and management of HAMMA lightning sensors.
Home-page: https://github.com/CAM-Gerlach/brokkr
Author: C.A.M. Gerlach and the HAMMA group
Author-email: CAM.Gerlach@Gerlach.CAM
License: UNKNOWN
Keywords: iot lightning sensor remote control research m2m raspberry pi
Platform: UNKNOWN
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Environment :: No Input/Output (Daemon)
Classifier: Intended Audience :: Science/Research
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Topic :: Scientific/Engineering :: Atmospheric Science
Classifier: Topic :: Scientific/Engineering :: Physics
Classifier: Topic :: System :: Monitoring
Classifier: Topic :: System :: Networking :: Monitoring :: Hardware Watchdog
Requires-Python: >=3.6
Description-Content-Type: text/markdown
Requires-Dist: pymodbus
Requires-Dist: pyserial
Requires-Dist: toml

﻿# Brokkr

A Python package to receive science data and status information from a local HAMMA2 lightning sensor and a Sunsaver MPPT-15L charge controller, store it locally, and transmit it back to a central server (generally, but not necessarily one running the Sindri package).
Further, it can maintain a reverse SSH tunnel to an accessible server for remote access, and receive and execute power, processing system and sensor control commands forwarded as custom binary TCP packets over said connection.



## Installation and Setup

Built and tested under Python 3.7 (but should be compatible with Python >=3.6; lack thereof should be considered a bug) and recent (>= 2019) versions of the packages listed in the `requirements.txt` file.
Works best on Linux, but is tested to be fully functional (aside from service features) on Windows (and _should_ work equally macOS) under the Anaconda distribution.

Following standard installation via ``pip`` (``venv`` highly recommended), the package will install the ``brokkr`` command, which can then be used to install the config files, firewall access, and (on Linux) serial port access, Brokkr systemd service, and SSH/AutoSSh service and configuration with ``brokkr install-all``.
If on Linux, simply reboot to automatically complete setup and start the `brokkr` service, or on all platforms you can manually execute it on the command line immediately with ``brokkr start``.
Use ``brokkr --help`` to get help, ``brokkr --version`` to get the current version and ``brokkr reset`` to reset all preferences and config files to their defaults.
On Linux, the `brokkr` systemd service can be interacted with via the standard systemd commands, e.g. ``sudo systemd {start, stop, enable, disable} brokkr``, ``systemd status brokkr``, ``journalctl -u brokkr``, etc, and the same for ``autossh-brokkr`` which controls remote SSH connectivity.



## Configuration

Configuration files are located under the XDG-standard ``~/.config/brokkr`` directory in the ini-like [TOML](https://github.com/toml-lang/toml) format; they can be generated by running ``brokkr install-config`` (which will not overwrite them if they already exist), and reset to defaults with ``brokkr reset``.
Everything but the ``*_local.toml`` configs are designed to be updated automatically from the server, but the default settings in the ``main_network.toml`` and ``main_site.toml`` files should be edited to ensure optimum behavior in case the Internet is down or the server is not configured on first run.
To temporarily override the centrally-managed settings with local ones, configure the appropriate settings in ``{config-name}_local.toml`` and set its ``override`` to ``true``.


