diff --git a/cmd/managementd/main.go b/cmd/managementd/main.go index 22f5dc5..7fcda8e 100644 --- a/cmd/managementd/main.go +++ b/cmd/managementd/main.go @@ -25,6 +25,7 @@ import ( "fmt" "log" "net/http" + "os/exec" "sync" "sync/atomic" "time" @@ -166,6 +167,10 @@ func main() { apiRouter.Use(func(next http.Handler) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { netmanagerclient.KeepHotspotOnFor(60 * 5) + out, err := exec.Command("stay-on-for", "300").CombinedOutput() // Stops camera from going to sleep for 300 seconds + if err != nil { + log.Printf("error running stay-on-for: %s, error: %s", string(out), err) + } next.ServeHTTP(w, r) }) }) diff --git a/go.mod b/go.mod index ab3c49e..a67ac22 100644 --- a/go.mod +++ b/go.mod @@ -19,7 +19,7 @@ require ( ) require ( - github.com/TheCacophonyProject/rpi-net-manager v0.2.3-deb12 + github.com/TheCacophonyProject/rpi-net-manager v0.3.1-deb12 github.com/TheCacophonyProject/trap-controller v0.0.0-20230227002937-262a1adfaa47 golang.org/x/text v0.3.7 ) diff --git a/go.sum b/go.sum index 97c7b06..d90dea4 100644 --- a/go.sum +++ b/go.sum @@ -77,8 +77,8 @@ github.com/TheCacophonyProject/modemd v0.0.0-20190605010435-ae5b0f2eb760/go.mod github.com/TheCacophonyProject/modemd v0.0.0-20190708011609-1940f5b6677b/go.mod h1:txGgnRinv6H0/jB4n71MpuS+2qtu8tAlntIjY5udXDU= github.com/TheCacophonyProject/periph v2.1.1-0.20200615222341-6834cd5be8c1+incompatible h1:0pEn1FoMTgOZR3EkqOTiqd0++jOS/jWlGrbvOHK0/KM= github.com/TheCacophonyProject/periph v2.1.1-0.20200615222341-6834cd5be8c1+incompatible/go.mod h1:K1wa07sGXKzV0G9p+4R069mZk4GOpqKW8GU6/k+BrIo= -github.com/TheCacophonyProject/rpi-net-manager v0.2.3-deb12 h1:wm/90HB7zFF+Kz7bBugGyFXkYTS8fxGO2EWa6sTk6po= -github.com/TheCacophonyProject/rpi-net-manager v0.2.3-deb12/go.mod h1:6Xl1Dp7F8IyvufOv0O5EfoXQjqoA/qNLeoWh3Rv1Y0c= +github.com/TheCacophonyProject/rpi-net-manager v0.3.1-deb12 h1:8NgFktwniMrgvUruPjJpyj9Wjro/0/MpXN5/HehFpYY= +github.com/TheCacophonyProject/rpi-net-manager v0.3.1-deb12/go.mod h1:6Xl1Dp7F8IyvufOv0O5EfoXQjqoA/qNLeoWh3Rv1Y0c= github.com/TheCacophonyProject/rtc-utils v1.2.0 h1:570sPJE/s0b21NrP9VVeSI/gBh/dLK+G5Ne/ZFwkNv0= github.com/TheCacophonyProject/rtc-utils v1.2.0/go.mod h1:uV1SIy93TLZrrBcqDczUNFUz2G/Pk6pZNUdTRglmANU= github.com/TheCacophonyProject/salt-updater v0.4.0 h1:2RCgdI4wr/ZoeWOvfGlZ/Epgz3GTC+Vc7/wS6EI90c0= diff --git a/html/wifi-networks.html b/html/wifi-networks.html index 3faa40e..a3b01d2 100644 --- a/html/wifi-networks.html +++ b/html/wifi-networks.html @@ -81,9 +81,9 @@

Current Networks

-
{{.SSID}}
+
{{.ID}}
- +
diff --git a/management-interface.go b/management-interface.go index d02c91e..8b82406 100644 --- a/management-interface.go +++ b/management-interface.go @@ -316,7 +316,7 @@ func NetworkHandler(w http.ResponseWriter, r *http.Request) { } type wifiNetwork struct { - SSID string + ID string NetworkID int } @@ -337,10 +337,10 @@ func WifiNetworkHandler(w http.ResponseWriter, r *http.Request) { } wifiProps.Networks = []wifiNetwork{} for _, network := range wifiNetworks { - if network.SSID == "" || network.SSID == "bushnet" || network.SSID == "Bushnet" { + if network.ID == "" || network.ID == "bushnet" || network.ID == "Bushnet" || network.ID == "BushnetHotspot" { continue } - wifiProps.Networks = append(wifiProps.Networks, wifiNetwork{SSID: network.SSID}) + wifiProps.Networks = append(wifiProps.Networks, wifiNetwork{ID: network.ID}) } availableWifiNetworks, err := netmanagerclient.ScanWiFiNetworks()