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
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.
This project has been coded with Python 3. Modbus-tk library has been chosen for device communication. Paho MQTT is choosen for MQTT communication
Follow the steps below to prepare the environment for the project.
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
- Clone the repo (Change the directory if you want)
git clone https://github.com/orcunbaslak/solarian-datalogger /home/pi/solarian-datalogger
- Create a configuration file from the sample
cd config
cp sample-config.yml config.yml
- Edit the configuration file
config.yml
nano config.yml
- Create a MQTT file from the sample (OPTIONAL)
cp sample-mqtt.yml mqtt.yml
- Edit the configuration file
mqtt.yml
(OPTIONAL)
nano mqtt.yml
- Create a GrayLog file from the sample (OPTIONAL)
cp sample-graylog.yml graylog.yml
- Edit the configuration file
graylog.yml
(OPTIONAL)
nano graylog.yml
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.
See the open issues for a list of proposed features (and known issues).
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.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/NewInverter
) - Commit your Changes (
git commit -m 'Add a new inverter driver'
) - Push to the Branch (
git push origin feature/NewInverter
) - Open a Pull Request
Distributed under the GNU GPL v3 License. See LICENSE
for more information.
You can find a list of similar projects that I used for help and inspiration.
Orçun Başlak - @orcunbaslak - website - [email protected]
Solarian Enerji - @solarianenerji - website - [email protected]
Project Link: https://github.com/orcunbaslak/solarian-datalogger