In this project a Weather-Data Acquisition and Management System has been developed. In this system an Arduino-based microcontorller (client) interfaces different kinds of sensors and forms the core entity of the weather-station developed throughout this project. Acquired data is then forwarded to a RaspberryPi-based device (server) where data is processed and permanently stored in MySQL databases. A GUI-Application (CoSESWeatherApp) has been developed to enable users to conveniently interact with the system (weather-data export, account management, system commands etc.).
- CoSES Weather-Station: View current weather and weather-trends in Garching: CoSES: Weather-Station Website
- Download the App: Download the latest version of the CoSESWeatherApp: Download
The utilized structure of this project-repository is listed below. As the list shows, this project is split into four sub-directories. Important files are also listed and briefly discussed respectively.
-
Client: Source-code for the microcontroller
- CoSESClient.ino: To be flashed onto the microcontroller
-
CoSESWeatherApp: App-Development (GUI)
- CoSESWeatherApp.py: Main source-file of the app (logic and functionality)
- CoSESWeatherApp_ui.ui: Main source-file of GUI in QtDesigner-format (visual appearance)
- CoSESWeatherApp_ui.py: Main source-file of GUI converted to python-format
- convert_ui_to_py_MyApp.bat: Batch-file to convert QtDesigner-format (.ui-files) to python-code (.py-files)
- CoSESWeatherApp.spec: Specification-file (spec-file) tells PyInstaller how to bundle the app
- BuildApp.bat: Batch-file to start PyInstaller and bundle the app according to the spec-file
-
Server: Source-code for the server
- CoSESServer.py: Main server-process (opens socket to acquire raw data forwarded by microcontroller)
- CoSESDriver.py: WeeWx-driver (interface between server-process, databases and WeeWx-framework)
- db_manager.php: Database API-script (functionality and queries)
- db_config.php: Database API-script (authentication data)
- CoSESWeather.ini: Path-file (contains URLs and file-paths utilized in the project)
- CoSESServerManager.sh: Helper-script (monitoring and restarting of system-processes)
- MySQLBackUp.sh: Helper-script (backup creation of MySQL databases)
- WatchDogResetter.sh: Reset of watchdog-timer (on server-side)
- localhost.sql: Initial database-structure (can be imported to create required database-tables)
-
WeeWx: Modified WeeWx-framework installation
- weewx-3.9.1(CoSESWeather_mod).tar.gz: WeeWx weather-station framework (modified installation package)
This section gives a brief overview on the required third-party modules and libraries utilized in this project.
- Python 2.7 (Python language and interpreter): Python 2.7
- PyQt4 and QtWebKit (GUI development): PyQt4 GUI toolkit
- requests (Sending HTTP/1.1 requests): HTTP for Humans
- configparser (Configuration-file management): ConfigParser
- xlsxwriter (Excel-file creation): XlsxWriter
- PyInstaller (Bundles project): PyInstaller
- Arduino (IDE and standard modules): Arduino IDE
- Controllino (Microcontroller library): Controllino Lib
- MAX31865 (PT100 amplifier library): MAX31865 Lib
- PT100 (PT100 look-up table): PT100 LookUp
The commands needed in order to install required packages are listed below. Administrative privileges on the target devicve are required for installation.
- Apache2 (HTTP web-server)
sudo apt install apache2
- MySQL (database management system)
sudo apt install mariadb-server
- phpMyAdmin (web-based tool for database management)
sudo apt install phpmyadmin
- PHP (programming language required by phpMyAdmin and Apache)
sudo apt install php php-mbstring libapache2-mod-php
- MySQL connector for PHP
sudo apt install php-mysql
The popular open-source weather-station framework WeeWx is used in this project. For detailed information on functionality and customization the extensive documentation on the WeeWx-website is to be considered.
Website: WeeWx Framework