GithubHelp home page GithubHelp logo

jonas-hagen / meteo-logger-server Goto Github PK

View Code? Open in Web Editor NEW
6.0 2.0 3.0 93 KB

Simple logger and server for Vaisala WXT meteo stations.

License: BSD 2-Clause "Simplified" License

Shell 1.46% Python 64.25% CSS 1.58% HTML 32.71%
meteorology environment weather weather-station

meteo-logger-server's Introduction

WXT meteo station logger and server

Simple logger and web server for the Vaisala WXT 536 meteo station.

Features:

  • Read WXT meteo data from the weather station
  • Store the meteo data in CSV files
  • Live upload the data to a mysql/postgresql database
  • Present a nice web interface with plots.

Disclaimer

This has been written to be installed on a small platform (like RasberryPi) which is more or less dedicated to logging and providing meteo data. The install procedure is quite a hack and is not very user friendly.

The gunicorn server is used to provide the flask app, supervised by systemd. A proxy like ngix is strongly recommended but not necessary.

Components

  • Python package meteo contains:
    • logger.py for logging meteo data. This script is meant to be started by systemd only.
    • data.py helper functions to read and average csv data.
    • server.py The server for API endpoints and web page.
    • gunicorn_config.py Configurator for the gunicorn server reads the /etc/meteo.yml config file.
  • Systemd service files, which will go to /etc/systemd/system/:
    • meteologger.service and
    • meteoserver.service.
  • Config file meteo.yml, used by the server and the logger, will go to /etc.
  • Python setup files for pip setup.py and MANIFEST.in
  • Install script install.sh (quick hack, use with care).

Requirements

  • System dependencies:

    • Python 3
    • systemd (optional)
  • Most important python dependencies (install with pip):

    • pandas 0.20.3 or newer
    • matplotlib
    • flask
    • flask-caching
    • gunicorn

Installation of numpy, matplotlib and pandas via pip can take a long time on a RasberryPi.

Installation

Run sudo install.sh or copy paste the commands one by one.

Debugging / Managing the services

After installation, start the logger in the foreground and adjust config file /etc/meteo.yml as needed:

sudo /usr/local/bin/logger.py

If the logger.py runs smoothly, abort it with 'Ctrl-C' and start it as a service:

sudo systemctl start meteologger.service

Check the log file:

sudo journalctl -fu meteologger.service

Then, start and check the server in the same way:

sudo systemctl start meteoserver.service
sudo journalctl -fu meteoserver.service

Now visit the webpage: http://yourraspi:8080

Summary

  • Start / stop / status:
    • sudo systemctl {start|stop|restart|status} meteologger.service
    • sudo systemctl {start|stop|restart|status} meteoserver.service
  • View journal log:
    • sudo journalctl -p info -fu meteologger.service
    • sudo journalctl -p info -fu meteoserver.service

License (2-Clause BSD)

Copyright (c) 2017, Jonas Hagen

All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  • Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

  • Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

meteo-logger-server's People

Contributors

tcpluess avatar jonas-hagen avatar

Stargazers

Khramovskikh avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

meteo-logger-server's Issues

got problem on meteoserver

I found your WXT log solution is very useful, thanks for your contributions!

I got problem on meteoserver. I try to let you know what problem I occurred, so I type โ€œ ~/meteo-logger-server-master/meteo $ sudo python3 server.pyโ€ and I got error message in the attached. I will be appreciated if you could advise me how to proceed.

Thank you!
Chin-Jen
error.txt

WXT Display and Logger

Hi Jonas,
i found your WXT Project and would like tu use that. Since i am new on Raspberry and github i would like to get your help for installing your code on my Raspi.
In your comment you said the installation is a little hack. So could you prepate an easier methode ie a mirror or similar which contains a complete working version? I do have the WXT and also a small external LCD screen for the Raspi.
Communication can be also in German.
Thaks for a reply
Jens

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.