Fresh UI/UX
Dark, high‑contrast theme with navy/black gradient and subtle branding watermarks.
Splash with animated “A product of Neenjas Electric” tagline; no white launch flash.
Clean, half‑width metric tiles; units readable on dark; no distracting underlines.
Device header shows: Device name, Serial (MAC‑style), MPPT Version, Bluetooth Version.
BLE discovery and connection
Scans for BLE devices whose names contain “MPPT”; guides users to enable Bluetooth when off.
Remembers last device and auto‑opens its dashboard on subsequent launches.
Requests the optimal MTU (up to 247) and automatically discovers/chooses the correct notify characteristic.
Robust connect/subscribe sequence with “Connecting” (amber) state, automatic resubscribe and reconnect if notifications stop.
Real‑time telemetry
Decodes the MPPT’s 60‑byte frame into command, status, and info fields.
Live metrics include: Battery Voltage/Current, PV Voltage/Current, Max Charging Power, Nominal Output Voltage, and setpoints.
Alarm status shows “Hardware Fault” and “Over‑Temperature” indicators (green/red) and updates in real time.
Online/Offline logic auto‑learns notification cycle time; marks Offline when silent > 5× cycle and clears values without destroying layout.
Graphs + historical logging
Per‑device logging keyed by deviceId + SerialHex + MPPT Version; CSV stored on‑device.
Left‑swipe from dashboard header to a live Graphs page (right‑swipe to return).
Graphs auto‑scale and merge historical CSV with live data for continuous insight.
BLE Trace (diagnostics)
Password‑protected (default “1234”, configurable) trace with autoscroll, copy, and clear.
Logs: connection state updates, service/characteristic discovery, MTU negotiation, subscription, raw hex notifications, and parsed frame summaries.
Firmware update (beta, bootloader/DFU)
“Update Firmware” button opens a modal: pick a .bin/.hex file, start DFU, view live logs and progress bar.
Implements a generic BLE‑DFU flow (enter bootloader → erase → chunked write → finish → reset). UUIDs/opcodes can be configured to match your ESP32 bootloader.
Reliability and safety
Single, guarded runtime permission request (no overlapping prompts).
Safe timers/subscriptions (no setState after dispose).
Optional emulator/mock mode for UI testing without real BLE.
Platform + packaging
Proper Android BLE permissions and iOS Bluetooth usage strings.
Android native launch gradient; launcher icon uses RealMPPT logo.
App package renamed to com.neenjas_electric.real_mppt; release signing support enabled (key.properties).
How to use
Open app → enable Bluetooth if prompted → pick an “MPPT” device → view live dashboard.
Swipe left on header to view live graphs; swipe right to return.
Tap “Update Firmware” to run a BLE DFU (beta); follow on‑screen logs.
Open Trace (developer board icon) → enter password → inspect live BLE activity.