Skip to content

orcunbaslak/solarian-datalogger

Repository files navigation

Contributors Forks Stargazers Issues MIT License LinkedIn


Logo

Solarian Datalogger

Solarian datalogger is a datalogger for solar systems. You can write a driver for your device and call the driver using the YAML file provided. You should implement a get_data() method to correctly read all data and return a JSON file.

Report Bug · Request Feature

Table of Contents

About The Project

There are many causes for people to write code. As an engineering company owner; I was frusturated to see how incompetent datalogging companies doing business around. Data losses, buggy software and other issues led me to write a minimalist piece of software for solar system just to get the basic data from inverters/sensors/string combiners into our influxdb server.

Here's why:

  • As engineers; our time is money. Bad data makes us invest more time in it. We don't want to fix someone else's errors.
  • Good data yields good engineering analysis and accurate results. You deserve more precise and accurate results.
  • Why consume the time trying to fix someone elses inaccurate data instead of enjoying the sun outside with your family?

Please feel free to fork or send pull requests. Please keep the code as minimal as possible.

Built With

This project has been coded with Python 3. Modbus-tk library has been chosen for device communication. Paho MQTT is choosen for MQTT communication

Getting Started

Follow the steps below to prepare the environment for the project.

Prerequisites

First you need to get Python 3 installed and running with dependencies correctly installed.

  • bash
sudo apt update
sudo apt-get -y dist-upgrade
sudo apt-get -y install git python3-distutils gcc python3-dev parallel lftp
sudo curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
sudo python3 get-pip.py
sudo pip3 install pyyaml modbus_tk psutil paho-mqtt graypy

Installation

  1. Clone the repo (Change the directory if you want)
git clone https://github.com/orcunbaslak/solarian-datalogger /home/pi/solarian-datalogger
  1. Create a configuration file from the sample
cd config
cp sample-config.yml config.yml
  1. Edit the configuration file config.yml
nano config.yml
  1. Create a MQTT file from the sample (OPTIONAL)
cp sample-mqtt.yml mqtt.yml
  1. Edit the configuration file mqtt.yml (OPTIONAL)
nano mqtt.yml
  1. Create a GrayLog file from the sample (OPTIONAL)
cp sample-graylog.yml graylog.yml
  1. Edit the configuration file graylog.yml (OPTIONAL)
nano graylog.yml

Usage

You can feed the file to Python3 interpreter and it's all good to go given you've prepared a correct YAML file and network/serial connections are working as intended.

python3 datalogger.py

You can use specific args to modify inner workings of the script

  --config CONFIG   YAML file containing device settings. Default "config.yml"
  --log LOG         Log levels, DEBUG, INFO, WARNING, ERROR or CRITICAL
  --pi-analytics    Enable or disable RaspberryPi device data acquisition
  --verbose         Print the acquired data to console
  --write-disabled  Disables file writing. Dry-run.
  --mqtt            Enables the MQTT feature. Mqtt config file must be set.
  --graylog         Pushes logging data to the specified GrayLog server. Graylog config file must be set.

Roadmap

See the open issues for a list of proposed features (and known issues).

Contributing

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/NewInverter)
  3. Commit your Changes (git commit -m 'Add a new inverter driver')
  4. Push to the Branch (git push origin feature/NewInverter)
  5. Open a Pull Request

License

Distributed under the GNU GPL v3 License. See LICENSE for more information.

Similar Projects

You can find a list of similar projects that I used for help and inspiration.

Contact

Orçun Başlak - @orcunbaslak - website - [email protected]

Solarian Enerji - @solarianenerji - website - [email protected]

Project Link: https://github.com/orcunbaslak/solarian-datalogger