|
1 | | -# MeshMapper_Flutter_App |
| 1 | +# MeshMapper Flutter App |
| 2 | + |
| 3 | +Cross-platform wardriving app for MeshCore devices. A Flutter port of the [MeshMapper WebClient](https://github.com/MeshMapper/MeshMapper_WebClient). |
| 4 | + |
| 5 | +## Features |
| 6 | + |
| 7 | +- **Cross-Platform**: Runs on Android, iOS, and Web (Chrome/Edge) |
| 8 | +- **BLE Connectivity**: Connect to MeshCore devices via Bluetooth Low Energy |
| 9 | +- **GPS Tracking**: High-accuracy location tracking with 25m distance filter |
| 10 | +- **Geofencing**: Enforces 150km boundary from Ottawa (service area) |
| 11 | +- **Auto-Power Selection**: Automatically configures TX power based on device model |
| 12 | +- **Real-time Map**: View TX/RX ping markers on OpenStreetMap |
| 13 | +- **API Queue**: Persistent queue with batch upload and retry logic |
| 14 | +- **Dark Mode**: System theme support |
| 15 | + |
| 16 | +## Screenshots |
| 17 | + |
| 18 | +*Coming soon* |
| 19 | + |
| 20 | +## Getting Started |
| 21 | + |
| 22 | +### Prerequisites |
| 23 | + |
| 24 | +- [Flutter SDK](https://flutter.dev/docs/get-started/install) 3.2.0 or higher |
| 25 | +- For Android: Android SDK with API 21+ |
| 26 | +- For iOS: Xcode 14+ and iOS 12+ deployment target |
| 27 | +- For Web: Chrome or Edge browser (Safari not supported for Web Bluetooth) |
| 28 | + |
| 29 | +### Installation |
| 30 | + |
| 31 | +1. Clone the repository: |
| 32 | +```bash |
| 33 | +git clone https://github.com/MeshMapper/MeshMapper_Flutter_App.git |
| 34 | +cd MeshMapper_Flutter_App |
| 35 | +``` |
| 36 | + |
| 37 | +2. Install dependencies: |
| 38 | +```bash |
| 39 | +flutter pub get |
| 40 | +``` |
| 41 | + |
| 42 | +3. Run the app: |
| 43 | +```bash |
| 44 | +# For Android/iOS |
| 45 | +flutter run |
| 46 | + |
| 47 | +# For Web |
| 48 | +flutter run -d chrome |
| 49 | +``` |
| 50 | + |
| 51 | +## Project Structure |
| 52 | + |
| 53 | +``` |
| 54 | +lib/ |
| 55 | +├── main.dart # App entry point |
| 56 | +├── models/ # Data models |
| 57 | +├── services/ # Business logic |
| 58 | +│ ├── bluetooth/ # BLE abstractions |
| 59 | +│ ├── meshcore/ # MeshCore protocol |
| 60 | +│ └── ... # GPS, API, etc. |
| 61 | +├── providers/ # State management |
| 62 | +├── screens/ # Full-page UI |
| 63 | +└── widgets/ # Reusable components |
| 64 | +
|
| 65 | +assets/ |
| 66 | +└── device-models.json # Device database |
| 67 | +
|
| 68 | +docs/ |
| 69 | +├── ARCHITECTURE.md # System design |
| 70 | +└── PORTING_NOTES.md # JS→Dart translation |
| 71 | +``` |
| 72 | + |
| 73 | +## Supported Devices |
| 74 | + |
| 75 | +The app supports 30+ MeshCore device variants including: |
| 76 | + |
| 77 | +- **Ikoka**: Stick, Nano, Handheld (22dBm, 30dBm, 33dBm variants) |
| 78 | +- **Heltec**: V2, V3, V4, T114, T190, E213, E290, MeshPocket |
| 79 | +- **RAK**: 4631, 3x72 |
| 80 | +- **LilyGo**: T-Echo, T-Deck, T-Beam, T-LoRa |
| 81 | +- **Seeed**: Wio E5, Wio Tracker, T1000, Xiao variants |
| 82 | +- And more... |
| 83 | + |
| 84 | +See `assets/device-models.json` for the full list. |
| 85 | + |
| 86 | +## Usage |
| 87 | + |
| 88 | +### Connecting to a Device |
| 89 | + |
| 90 | +1. Tap the Bluetooth icon in the app bar |
| 91 | +2. Tap "Scan" to search for nearby MeshCore devices |
| 92 | +3. Select your device from the list |
| 93 | +4. The app will automatically: |
| 94 | + - Connect via BLE |
| 95 | + - Query device info |
| 96 | + - Configure TX power based on device model |
| 97 | + - Sync time |
| 98 | + - Acquire API slot |
| 99 | + |
| 100 | +### Wardriving |
| 101 | + |
| 102 | +1. Ensure GPS is enabled and permissions granted |
| 103 | +2. Wait for GPS lock (green GPS indicator) |
| 104 | +3. Tap the "PING" button to send a TX ping |
| 105 | +4. Or enable "Auto Ping" to automatically ping every 25m of movement |
| 106 | + |
| 107 | +### Understanding the Map |
| 108 | + |
| 109 | +- **Green markers**: Your TX pings |
| 110 | +- **Colored markers**: RX responses from repeaters (color by repeater ID) |
| 111 | +- **Blue circle**: Your current position |
| 112 | + |
| 113 | +## Critical Safety Notes |
| 114 | + |
| 115 | +⚠️ **PA Amplifier Devices**: The app automatically configures TX power for high-power PA amplifier devices. Do NOT manually override power settings as incorrect values can damage hardware. |
| 116 | + |
| 117 | +⚠️ **Geofence**: Pings are only allowed within 150km of Ottawa. This is enforced both client-side and server-side. |
| 118 | + |
| 119 | +## Development |
| 120 | + |
| 121 | +### Running Tests |
| 122 | + |
| 123 | +```bash |
| 124 | +flutter test |
| 125 | +``` |
| 126 | + |
| 127 | +### Building for Release |
| 128 | + |
| 129 | +```bash |
| 130 | +# Android |
| 131 | +flutter build apk --release |
| 132 | + |
| 133 | +# iOS |
| 134 | +flutter build ios --release |
| 135 | + |
| 136 | +# Web |
| 137 | +flutter build web --release |
| 138 | +``` |
| 139 | + |
| 140 | +## Architecture |
| 141 | + |
| 142 | +The app follows a service-oriented architecture: |
| 143 | + |
| 144 | +- **BluetoothService**: Abstract interface with platform-specific implementations |
| 145 | +- **MeshCoreConnection**: Handles the 10-step connection workflow and protocol |
| 146 | +- **GpsService**: GPS tracking with geofence validation |
| 147 | +- **PingService**: TX/RX ping orchestration |
| 148 | +- **ApiQueueService**: Persistent upload queue with retry logic |
| 149 | + |
| 150 | +See [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md) for details. |
| 151 | + |
| 152 | +## Contributing |
| 153 | + |
| 154 | +Contributions are welcome! Please read the [PORTING_NOTES.md](docs/PORTING_NOTES.md) for guidance on the JavaScript to Dart translation patterns used. |
| 155 | + |
| 156 | +## License |
| 157 | + |
| 158 | +This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details. |
| 159 | + |
| 160 | +## Acknowledgments |
| 161 | + |
| 162 | +- Original [MeshMapper WebClient](https://github.com/MeshMapper/MeshMapper_WebClient) |
| 163 | +- [MeshCore](https://github.com/meshcore-dev/MeshCore) firmware project |
| 164 | +- Flutter and Dart teams |
0 commit comments