Commit Graph

18 Commits

Author SHA1 Message Date
root 821520fc92 Merge branch 'main' of https://git.hulzer.homeip.net/root/victron-esp32-ble-mqtt 2026-11-14 16:07:50 +00:00
root 9ed32e3846 Config added 2026-11-14 16:05:57 +00:00
Michael Holzmann 83683de27c docs: use esptool 5.x hyphenated commands
- write-flash / erase-flash / merge-bin instead of the deprecated
  write_flash / erase_flash / merge_bin
- esptool instead of esptool.py
- hyphenated --flash-mode/--flash-freq/--flash-size for merge-bin
- note that esptool 4.x still works but prints the deprecation warning
2026-11-14 15:53:56 +00:00
Michael Holzmann 593a426d4f docs: add manual esptool flashing instructions 2026-11-14 15:42:53 +00:00
Michael Holzmann 98eaf718b1 docs: describe build output files and where to find them 2026-11-14 15:39:52 +00:00
Michael Holzmann a608285f11 docs: add build instructions (PlatformIO CLI, venv, notes)
- Document CLI/venv setup alongside the VS Code extension
- Add compile/upload/monitor commands and firmware output path
- Record the pinned espressif32 version and why, dependency versions,
  first-build download, reference flash/RAM usage and clean rebuild
- Add upload troubleshooting (config.h, baud rate, permissions, BOOT)
2026-11-14 15:38:05 +00:00
Michael Holzmann 156f43323c feat: make WiFi power-save and HA discovery configurable
- WIFI_DISABLE_POWER_SAVE (default 1 = keep modem sleep off)
- HA_DISCOVERY_ENABLED: switch auto-discovery off entirely; the payload
  strings are compiled out, saving ~4.6 KB of flash
- HA_DISCOVERY_PREFIX, HA_DEVICE_ID, HA_UNIQUE_PREFIX, HA_DEVICE_NAME,
  HA_MODEL and HA_MANUFACTURER replace the hardcoded garage identifiers,
  so a second MPPT can run without entity/topic collisions
- Defaults reproduce the previous topics, unique_ids and payloads exactly
- Document the new options in README; all values remain #ifndef-guarded
  so existing config.h files keep compiling
2026-11-14 15:19:52 +00:00
Michael Holzmann a2fea10678 chore: harden shared state, parser bounds and build pinning
- Guard the AES output buffer against oversized advertisements
- Protect the cross-core MpptData hand-off with a critical section and
  publish from a consistent snapshot
- Scan in 30s blocks and clear results between them: NimBLE 1.4.x only
  frees its result list when a scan completes, and one entry is kept per
  unique BLE address (including MAC-randomising phones)
- Do not let the forced-reconnect watchdog reset the reboot watchdog
- Publish discovery immediately after a reconnect instead of waiting for
  the retry timer
- Pin espressif32 to 6.13.0 (Arduino core 2.0.17), the last platform
  compatible with NimBLE-Arduino 1.4.x
- Document diagnostics, watchdogs and the data_age_s field
2026-11-14 14:54:35 +00:00
Michael Holzmann 4cd4fbe41a fix: recover from WiFi/MQTT dead states
- Replace the blocking WiFi and MQTT connect loops with non-blocking
  retry-on-timer functions, so the MQTT task never parks forever on an
  unreachable broker
- Publish data on a fixed cadence as well as on new BLE packets, adding
  data_age_s so stale values are visible
- Track successful publishes; force an MQTT reconnect after 5 minutes
  without one (half-open TCP socket) and reboot after 60 minutes with no
  success at all
- Retry Home Assistant discovery every 30s until every config topic has
  been accepted instead of silently giving up
- MQTT keepalive 30s, socket timeout 5s, publish buffer 1024 bytes
2026-11-14 14:49:36 +00:00
Michael Holzmann 98ac623423 fix: stop BLE scan from starving WiFi
- Scan continuously with a 50% duty cycle (interval 100ms / window 50ms)
  instead of a 99% window that leaves almost no airtime for WiFi
- Drop the 5s scan / 10s idle loop cadence, which created regular 10s
  holes in BLE reception
- Restart the scan only when the controller reports it as stopped
- setMaxResults(0): callbacks only, no per-device allocations
- Disable WiFi modem sleep and auto-reconnect on
- Initialise WiFi before BLE and create the MQTT task afterwards so the
  two radio drivers are never brought up concurrently
2026-11-14 14:47:08 +00:00
Michael Holzmann 780df35131 feat: add runtime diagnostics
- Log WiFi association, IP and disconnect reason codes
- Publish solar/mppt/diag every 60s: uptime, WiFi status/RSSI, free and
  min-free heap, WiFi disconnect count, MQTT connect count, publish
  failures, BLE valid/ignored packet counts and BLE packet age
- Count and log failed MQTT data publishes instead of dropping silently
- Log failed BLE scan starts
- Document the new diag topic
2026-11-14 14:46:17 +00:00
MrSossidge 9f459f0d97 docs: rewrite README in house style with support link 2026-09-14 21:49:53 +01:00
MrSossidge 55496cf613
Add donation button to README
Add a 'Buy Me a Coffee' button to the README.
2026-05-27 21:12:54 +01:00
MrSossidge cd534c4d0b Add HA dashboard, configuration template and update README 2026-05-18 14:39:07 +01:00
MrSossidge 35d37e1fe8 Add external load power calculation 2026-05-18 14:17:19 +01:00
MrSossidge 1c19d29353 Add external device load sensor 2026-05-18 13:49:59 +01:00
MrSossidge 27a362b5b3 Add README 2026-05-17 20:41:37 +01:00
MrSossidge 8de1704adc Working Victron SmartSolar BLE to MQTT bridge with HA discovery 2026-05-17 20:32:53 +01:00