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"
|
|
|
|
)
|
|
|
|
|
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-09 18:38:57 +00:00
|
|
|
InitBoards()
|
|
|
|
InitOutlets()
|
|
|
|
MQTTSetup()
|
|
|
|
go MQTTRefreshLoop()
|
|
|
|
go ups.UpsConnect()
|
|
|
|
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
|
|
|
|
|
|
|
|
*/
|