Weather Station in Go.
$ cd Panahan
- Install dependencies with
go get
. - Compile by
go install
orgo build -o main.o main.go
.
$ cd Panahan/main/app
- Run
bower install
to install all used dependencies. - Place
/app
in same directory as the executable.
- Start InfluxDB CLI
$ influx
> CREATE DATABASE weather_data
> USE weather_data
- Create continues queries which group sensor data into the tables
hours
,days
andweeks
> CREATE CONTINUOUS QUERY cq_hour ON weather_data BEGIN SELECT mean(temperature) AS temperature, max(temperature) AS max_temperature, min(temperature) AS min_temperature, mean(humidity) as humidity, mean(pressure) as pressure, sum(rain)/count(rain) as rain, sum(sun)/count(sun) as sun INTO hours FROM sensors where time > '2015-12-01' GROUP BY time(1h) END
> CREATE CONTINUOUS QUERY cq_hour ON weather_data BEGIN SELECT mean(temperature) AS temperature, max(max_temperature) AS max_temperature, min(min_temperature) AS min_temperature, mean(humidity) as humidity, mean(pressure) as pressure, sum(rain)/count(rain) as rain, sum(sun)/count(sun) as sun INTO days FROM hours where time > '2015-12-01' GROUP BY time(1d) END
> CREATE CONTINUOUS QUERY cq_hour ON weather_data BEGIN SELECT mean(temperature) AS temperature, max(max_temperature) AS max_temperature, min(min_temperature) AS min_temperature, mean(humidity) as humidity, mean(pressure) as pressure, sum(rain)/count(rain) as rain, sum(sun)/count(sun) as sun INTO weeks FROM days where time > '2015-12-01' GROUP BY time(1w) END
- make sure
/app
folder is in the same directory as binary - make sure
config.toml
is in the same directory as binary - set server and sensor options in
config.toml
sudo $GO_PATH/bin/main
- Weather station using sensors for temperature, humidity, air pressure, air quality, brightness and rain
- Written entirely in Go
- Front end making use of modern technologies such as Angular & jQuery
- influxDB as database for working with time-series data
- Mux
- Influxdb client