2020-12-23 09:11:11 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
2021-01-09 18:38:57 +00:00
|
|
|
"git.openpdu.org/OpenPDU/openpdu/syslog"
|
|
|
|
"git.openpdu.org/OpenPDU/openpdu/ups"
|
|
|
|
"git.openpdu.org/OpenPDU/openpdu/webui"
|
2020-12-23 09:11:11 +00:00
|
|
|
"github.com/spf13/viper"
|
|
|
|
)
|
|
|
|
|
2021-01-19 13:27:24 +00:00
|
|
|
const version = "0.1"
|
|
|
|
|
2020-12-23 14:32:05 +00:00
|
|
|
func init() {
|
2021-01-04 17:37:10 +00:00
|
|
|
viper.SetDefault("system.hostname", "openpdu")
|
2020-12-23 14:32:05 +00:00
|
|
|
}
|
2020-12-23 09:11:11 +00:00
|
|
|
|
2020-12-23 14:32:05 +00:00
|
|
|
func main() {
|
2021-01-10 14:43:23 +00:00
|
|
|
CreateBoards()
|
|
|
|
CreateOutlets()
|
2021-01-09 18:38:57 +00:00
|
|
|
InitBoards()
|
|
|
|
MQTTSetup()
|
|
|
|
go MQTTRefreshLoop()
|
|
|
|
go ups.UpsConnect()
|
2021-01-19 09:39:35 +00:00
|
|
|
go displayLoop()
|
2021-01-09 18:38:57 +00:00
|
|
|
syslog.Info("hostname: " + viper.GetString("system.hostname"))
|
|
|
|
webui.StartServer()
|
2020-12-23 09:11:11 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// https://github.com/ColorlibHQ/AdminLTE/archive/v2.4.17.tar.gz
|
|
|
|
|
|
|
|
/* TODO
|
|
|
|
|
|
|
|
- config reset gpio
|
|
|
|
- classi per board
|
|
|
|
- classi per outlet
|
|
|
|
- fai funzionare toggle
|
|
|
|
- scan i2c
|
|
|
|
- impostazioni log
|
|
|
|
|
|
|
|
*/
|