- setConnectTimeout(5000ms) instead of 10ms (NimBLE-Arduino v2 uses ms)
- Fix NVS stored address: use ble_addr_t struct constructor to avoid
double byte-reversal, and correct type BLE_ADDR_PUBLIC
- Use onScanEnd callback to defer connect until scan fully terminated
- Separate foundAddr to avoid race between scan callback and loop
BleRelayManager.kt: Android's gatt.writeCharacteristic() returns false when a
previous GATT operation (CCCD writeDescriptor) is still pending. Split
startEcdhHandshake() into two phases: CCCD setup (with ecdhCccdPending flag)
and sendEcdhHandshake() triggered from onDescriptorWrite callback.
main.cpp: After SET_ID over USB, update BLE advertising scan response
manufacturer data so Android can find the server by its new UUID prefix.
ESP32 server: include 4-byte device UUID prefix as manufacturer data
(company 0xFFFF) in BLE scan response, allowing pre-connection filtering.
Android: check manufacturer data in ScanCallback.onScanResult before
connecting. Skips devices with non-matching UUID prefix, preventing
wasted connections to wrong SylDa devices. Backward compatible with
old firmware (proceeds if no manufacturer data present).
- 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
- New tools/check_versions.sh: verifies version.txt, version.h, SylDaVersions.kt match
- release.yml: 'Verify version consistency' step after build, aborts release if mismatch
- ci.yml: same check after debug APK build
- scripts/release.sh: now runs full pipeline (pio run -> copy firmware -> gradle -> check)
and refuses dirty working tree
- Untrack version.h, SylDaVersions.kt, release/ — always regenerated fresh from version.txt
Prevents the v1.1 bug where stale generated files caused version mismatch
and infinite re-flash loop.
Root cause: version.h and SylDaVersions.kt were stale, causing
app to expect BUILD_NR:18 while firmware reports BUILD_NR:16.
This triggered infinite re-flash loop on every 'Module bijwerken'.
Rebuilt firmware and APK so all versions agree on server=17/client=3.
Replace v1.1 release with corrected builds.
- Replace name-based scan filter (getName() == 'SylDa_Server') with
isAdvertisingService(SERVICE_UUID) to prevent BLE name spoofing
- Post-connect UUID verification via UUID_CHAR_UUID was already in place
- Update log messages to reflect service-UUID-based scanning
- Add ID? command to firmware: server responds 'SylDa_Server', client 'SylDa_Client'
- Add tools/pio_upload_port.py POST-script that queries connected ESP32s
- Remove hardcoded upload_port from platformio.ini
- Script logic: 1 ESP32 → use directly, 2+ → ID? query, no match → prompt user
- Requires pyserial for serial queries (graceful fallback if missing)
- Replace remaining Serial.println("ERROR:...") with ESP_LOGE in client.cpp
- Add Serial.println("ERROR") for protocol response where needed
- Downgrade heartbeat from ESP_LOGI to ESP_LOGD (not needed in production)
- Convert all Serial.println/printf debug logging to ESP_LOGE/W/I/D
- Add TAG-based log identification (server/client)
- Lower CORE_DEBUG_LEVEL from 5 to 3 for production
- Keep Serial.printf for USB serial protocol commands (KEY?, VERSION?, etc.)
- MainActivity: remove isServer check — relay buttons always enabled when
connected, regardless of device mode (fixes silently broken buttons when
device mode accidentally set to 'client')
- client.cpp: invert HS-S43A touch sensor readings (!tActive) — sensors
are active LOW
- build.gradle: bump versionCode 2, versionName 1.1
- platformio.ini: use stable by-id port for server ESP32
- firmware/*.bin: rebuilt with LED signaling and touch fixes
- MainActivity: suppress toast when activity not resumed, auto-navigate to
Settings on new firmware
- SettingsActivity: unified BLE/USB radio buttons + single update button,
version check before OTA, show dialog before loadFirmware, spinner timeout
- BleRelayManager: expose getEspVersion()
- OtaManager: reduce chunk size 500→248 to fit BLE MTU 255
- ESP: WRITE→WRITE_NR on OTA characteristic (was silently dropping data)
- Layout/strings: remove intro text, add method radio buttons
- Bump all firmware versions to v5
- Firmware: add VERSION? command returning BUILD_NR for version check
- Android: flash button checks firmware version first, skips flash if current
- After flash: auto key exchange via reboot detection (expectingReboot flag)
- device_filter.xml + intent-filter: USB permission 'always allow' checkbox
- singleTop + onNewIntent prevents unwanted SettingsActivity launch on USB connect
- platformio.ini: upload_port updated to /dev/ttyACM1
- Firmware: add explicit setScanResponseData with setCompleteServices for
128-bit service UUID so Android ScanFilter finds the device
- Android: hexStringToBytes accepts any even-length hex (fixes UUID=32chars
failing the hardcoded 64-char check)
- Android: onActivityResult matches SettingsActivity.RESULT_SCAN instead of
Activity.RESULT_OK