From 2da2347ef16f3d5a6d040b50982f6961c25caec7 Mon Sep 17 00:00:00 2001 From: kercre123 Date: Sun, 21 Apr 2024 00:35:19 -0500 Subject: [PATCH] Fix OTA updating with inbuilt BLE, prepare for merge into main --- chipper/pkg/wirepod/setup/ble.go | 4 ++-- chipper/pkg/wirepod/setup/ble_other.go | 6 +++--- chipper/start.sh | 2 +- chipper/webroot/js/ble.js | 6 +++--- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/chipper/pkg/wirepod/setup/ble.go b/chipper/pkg/wirepod/setup/ble.go index 5e576ec1..de939053 100644 --- a/chipper/pkg/wirepod/setup/ble.go +++ b/chipper/pkg/wirepod/setup/ble.go @@ -1,5 +1,5 @@ -//go:build linux && !android -// +build linux,!android +//go:build inbuiltble +// +build inbuiltble package botsetup diff --git a/chipper/pkg/wirepod/setup/ble_other.go b/chipper/pkg/wirepod/setup/ble_other.go index bf5ca597..3610146b 100644 --- a/chipper/pkg/wirepod/setup/ble_other.go +++ b/chipper/pkg/wirepod/setup/ble_other.go @@ -1,10 +1,10 @@ -//go:build windows || darwin || android || ios -// +build windows darwin android ios +//go:build !inbuiltble +// +build !inbuiltble package botsetup import "github.com/kercre123/wire-pod/chipper/pkg/logger" func RegisterBLEAPI() { - logger.Println("Not registering BLE API because target isn't linux") + logger.Println("BLE API is unregistered") } diff --git a/chipper/start.sh b/chipper/start.sh index 1c0bf1e6..57065af4 100755 --- a/chipper/start.sh +++ b/chipper/start.sh @@ -85,7 +85,7 @@ elif [[ ${STT_SERVICE} == "vosk" ]]; then export CGO_CFLAGS="-I/root/.vosk/libvosk" export CGO_LDFLAGS="-L /root/.vosk/libvosk -lvosk -ldl -lpthread" export LD_LIBRARY_PATH="/root/.vosk/libvosk:$LD_LIBRARY_PATH" - /usr/local/go/bin/go run -exec "env DYLD_LIBRARY_PATH=$HOME/.vosk/libvosk" cmd/vosk/main.go + /usr/local/go/bin/go run -tags nolibopusfile -exec "env DYLD_LIBRARY_PATH=$HOME/.vosk/libvosk" cmd/vosk/main.go fi else if [[ -f ./chipper ]]; then diff --git a/chipper/webroot/js/ble.js b/chipper/webroot/js/ble.js index 6b719ef6..2ab284eb 100644 --- a/chipper/webroot/js/ble.js +++ b/chipper/webroot/js/ble.js @@ -23,7 +23,7 @@ function checkBLECapability() { .then((response) => { if (response.includes("success")) { BeginBLESetup() - } else if (response.includes("error")) { + } else { authEl.innerHTML = "" m1 = document.createElement("p") m2 = document.createElement("a") @@ -350,11 +350,11 @@ function WhatToDo() { function DoOTA(url) { updateAuthel("Starting OTA update...") - fetch("/api-ble/do_ota?url=" + url) + fetch("/api-ble/start_ota?url=" + url) .then(response => response.text()) .then((response) => { if (response.includes("success")) { - inte = setInterval(function(){ + inte = setInterval(function() { fetch("/api-ble/get_ota_status") .then(otaresp => otaresp.text()) .then ((otaresp) => {