Skip to content

Commit

Permalink
Fix OTA updating with inbuilt BLE, prepare for merge into main
Browse files Browse the repository at this point in the history
  • Loading branch information
kercre123 committed Apr 21, 2024
1 parent be1e051 commit 2da2347
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions chipper/pkg/wirepod/setup/ble.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//go:build linux && !android
// +build linux,!android
//go:build inbuiltble
// +build inbuiltble

package botsetup

Expand Down
6 changes: 3 additions & 3 deletions chipper/pkg/wirepod/setup/ble_other.go
Original file line number Diff line number Diff line change
@@ -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")
}
2 changes: 1 addition & 1 deletion chipper/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions chipper/webroot/js/ble.js
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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) => {
Expand Down

0 comments on commit 2da2347

Please sign in to comment.