WeatherPi is a JEE based project. The used application server is a WildFly running on a RaspberryPi. There are different components delivering sensor data. The sensor data is collected, processed and stored into a database.
There is another RaspberryPi with a connected touch screen displaying the sensor data.
All outdoor sensors are connected to different ESP8266 WiFi modules.
Forecast data is retrieved from ForecastIO and actual data is pushed to twitter.
The list of actually implemented sensors.
- TSL2591: Light Sensor
- MCP9808: Temperature
- DHT22: Temperature and Humidity
- BME280: Temperature, Humidity and Pressure
The Birdhouse the Anemometer ans the Dustsensor are publishing their sensor data via MQTT to a local installed Mosquitto broker. Here are some instructions for the installation of the Mosquitto MQTT Server on the RaspberryPi. The published messages are JSON encoded, this makes it easy to convert them to Java or JavaScript objects.
{
"sensor": "DHT22",
"place": "BIRDHOUSE",
"type": "TEMPERATURE",
"temperature": 4.7000,
"time": 1502381794
}
The time parameter is optional, if not present, the actual time will be used.
The sensor data is written to a MySQL database for later processing of the data.
One RaspberryPi with a connected 7'' touch screen is used to display the data. Therefore, Chrome is started in Kiosk mode.
The user interface is touch enabled and optimized for the sreen resolution of the original RaspberryPi touch screen. Live data is published via WebSockets and forecast data is used from ForecastIO. It is also possible to display historical data for the temperature, humidity, pressure and the wind speed. There are three ranges, back one day, one week ore one month. The display is updated continuously.
A Node-RED flow is used to read the data from the WebSocket and publish it in Apple HomeKit.
Actual weather data is pushed via the Twitter REST API. This is done using the Twitter4J library. Every three hours, the actual temperature, humidity and pressure is posted, every hour the pressure tendency and the actual wind speed and once a day a climatological classification of the last day.
Reading weather forecast from ForecastIO using their API. The data is queried each hour and cached internally. The icons used for displaying some weather informations are from Adam Whitcroft
A description of the software and hardware components.