SmartBLESensor is a Flutter application for monitoring Bluetooth Low Energy (BLE) sensors. It supports real-time data streaming, visual dashboards, history logging, and CSV exports, making it suitable for lab experiments, industrial monitoring, and personal projects.
- Automatic device discovery with RSSI-based sorting
- One-tap connection and automatic navigation back to the dashboard
- Unified feedback for connection state, RSSI, and errors
- Works with any float-based sensor payload
- Multi-series line chart with tooltips and pinch zoom
- Scrollable monitoring layout prevents bottom overflow on small screens
- Live KPI cards showing the latest readings for each characteristic
- History logging with per-second snapshots and multi-characteristic aggregation
- CSV export with multi-column output, clipboard preview, and file save modes
- UUID configuration management with add, edit, and delete operations
- One-click cleanup for history data or per-characteristic caches
lib/
|-- main.dart
|-- models/
| |-- sensor_data.dart
| |-- device_info.dart
| |-- bluetooth_state.dart
| |-- uuid_config.dart
| `-- sensor_record.dart
|-- providers/
| |-- bluetooth_provider.dart
| |-- sensor_data_provider.dart
| `-- sensor_recording_provider.dart
|-- services/
| |-- bluetooth_service.dart
| |-- uuid_config_service.dart
| |-- csv_export_service.dart
| `-- sensor_recording_service.dart
`-- screens/
|-- home_screen.dart (Devices / Monitor / Records tabs)
`-- device_scan_screen.dart
The docs/ directory contains optional static-site assets (for example, GitHub Pages). Keep or publish them when required.
- Flutter 3.x / Dart 3.x
- State management: Provider
- BLE library:
flutter_blue_plus - Charting:
fl_chart - Local storage:
shared_preferences - Permissions:
permission_handler
# Check the local Flutter installation
flutter doctor
# Install dependencies
flutter pub get
# Run on a connected device or emulator
flutter run
# Build a release APK (optional)
flutter build apk --release- Open the Devices tab and start scanning.
- Select the target device from the RSSI-sorted list and tap Connect.
- After a successful connection the app returns to the Monitor tab automatically.
- On the Monitor tab, tap the gear icon to open the characteristic selector.
- Choose one or more saved UUID configurations and apply the selection.
- Tap Start Listening to stream notifications and populate charts, KPI cards, and history logs.
- The layout scrolls vertically so charts and controls remain accessible on compact screens.
- Add: Use the New Configuration button inside the selector dialog, then provide a name, optional service UUID, required characteristic UUID, and notes.
- Edit: Tap the edit icon, adjust the fields, and save; changes are applied instantly.
- Delete: Tap the delete icon, confirm the action, and the configuration is removed along with any active selection.
- All updates are persisted with
SharedPreferences, and the selector stays in sync with the monitoring view.
- Switch to the Records tab to review captured samples grouped by characteristic.
- Use the play/pause action to start or stop recording. The status card tracks record counts, characteristic coverage, and the latest timestamp.
- Tap Export CSV to preview multi-column data or save it to disk. The dialog summarises record count, characteristic names, destination path, and file size.
- Use the floating delete button to clear the persisted history when required—the data service resets both storage and UI counters.
flutter testThis command runs the unit tests, including coverage for the multi-channel CSV exporter.
| Issue | Resolution |
|---|---|
| No devices found | Ensure Bluetooth and location permissions are granted; toggle the system Bluetooth radio and rescan. |
| Frequent disconnects | Confirm the device supports BLE notify and is not already connected to another client. |
| Chart remains empty | Verify that at least one characteristic is selected and listening is active; double-check UUID values. |
| CSV export fails | Check storage permissions and free space, then retry. |
-
v1.4.0 (2025-01-21)
- 调整监控界面展示,实时卡片聚焦关键数据
- 新增特征单位输入并覆盖实时监控、记录与导出
- 版本号更新为
1.4.0+4,重新构建发布 APK
-
v1.3.0 (2025-01-17)
- Added CSV copy/save options with file metadata feedback
- Made the monitoring page scrollable to eliminate bottom overflow issues
- Enabled editing and deleting UUID configurations directly from the selector
-
v1.2.0 (2024-12-26)
- RSSI-based device sorting and improved connection feedback
- Initial CSV export and UUID management features
-
v1.1.0 (2024-12-25)
- Core BLE connection flow and real-time charts
- History logging and Material Design 3 themed UI
-
v1.0.0 (2024-12-24)
- Project bootstrap
- Fork the repository and create a feature branch (
git checkout -b feature/your-change). - Implement the change, run formatting, and execute any relevant tests.
- Commit and push (
git commit -am "feat: add awesome feature"), then open a pull request. - Provide screenshots or screen recordings for UI-facing updates.
SmartBLESensor is distributed under the MIT License. Use, modify, and share it freely.