Fix BLE scan + touch logic + UUID + version read
- Client: change passive BLE scan to active scan (setActiveScan(true)) Server puts name/UUID in scan response; passive scan never received them, so isAdvertisingService() and getName() failed. - Server: add INPUT_PULLUP on touch pins to prevent floating triggers when sensors disconnected - Server: update BLE UUID characteristic in SET_ID handler (pUuidChar->setValue) so reconnecting clients see correct UUID - Server: touch logic changed from t1Active/t2Active to !t1Active/!t2Active (door closed = relay ON) - Android: flushReadBuffer before VERSION? to discard stale boot log output; use Regex for BUILD_NR parsing - copy_firmware.sh: copy to firmware/server/ and firmware/client/ subdirectories to match EspFlasher.assetPath() - version.txt: server=20 client=5
This commit is contained in:
parent
6a07505d02
commit
cd2d949f87
7 changed files with 64 additions and 31 deletions
|
|
@ -1,22 +1,29 @@
|
|||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
BINARY_DIR="$(cd "$(dirname "$0")/.." && pwd)/.pio/build/s3lite-server"
|
||||
ASSETS_DIR="$(cd "$(dirname "$0")/.." && pwd)/android/app/src/main/assets/firmware"
|
||||
PROJECT_DIR="$(cd "$(dirname "$0")/.." && pwd)"
|
||||
ASSETS_BASE="$PROJECT_DIR/android/app/src/main/assets/firmware"
|
||||
|
||||
mkdir -p "$ASSETS_DIR"
|
||||
copy_binaries() {
|
||||
local BINARY_DIR="$1"
|
||||
local ASSETS_DIR="$2"
|
||||
|
||||
cp "$BINARY_DIR/bootloader.bin" "$ASSETS_DIR/"
|
||||
cp "$BINARY_DIR/partitions.bin" "$ASSETS_DIR/"
|
||||
cp "$BINARY_DIR/firmware.bin" "$ASSETS_DIR/"
|
||||
mkdir -p "$ASSETS_DIR"
|
||||
cp "$BINARY_DIR/bootloader.bin" "$ASSETS_DIR/"
|
||||
cp "$BINARY_DIR/partitions.bin" "$ASSETS_DIR/"
|
||||
cp "$BINARY_DIR/firmware.bin" "$ASSETS_DIR/"
|
||||
|
||||
BOOT_APP0=$(find ~/.platformio/packages/framework-arduinoespressif32 -name "boot_app0.bin" 2>/dev/null | head -1)
|
||||
if [ -n "$BOOT_APP0" ]; then
|
||||
cp "$BOOT_APP0" "$ASSETS_DIR/"
|
||||
else
|
||||
echo "ERROR: boot_app0.bin not found"
|
||||
exit 1
|
||||
fi
|
||||
BOOT_APP0=$(find ~/.platformio/packages/framework-arduinoespressif32 -name "boot_app0.bin" 2>/dev/null | head -1)
|
||||
if [ -n "$BOOT_APP0" ]; then
|
||||
cp "$BOOT_APP0" "$ASSETS_DIR/"
|
||||
else
|
||||
echo "ERROR: boot_app0.bin not found"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Firmware binaries copied to $ASSETS_DIR:"
|
||||
ls -la "$ASSETS_DIR"
|
||||
echo "Copied to $ASSETS_DIR:"
|
||||
ls -la "$ASSETS_DIR"
|
||||
}
|
||||
|
||||
copy_binaries "$PROJECT_DIR/.pio/build/s3lite-server" "$ASSETS_BASE/server"
|
||||
copy_binaries "$PROJECT_DIR/.pio/build/s3lite-client" "$ASSETS_BASE/client"
|
||||
Loading…
Reference in a new issue