A comprehensive iOS application for monitoring and optimizing network performance using AI-driven anomaly detection and environmental sensor correlation.
PulseOne is an MVP for a network analyzer/healer system that:
- Monitors network performance metrics in real-time
- Collects environmental sensor data (temperature, humidity, motion, etc.)
- Uses AI/ML to detect anomalies and predict issues
- Provides intelligent recommendations for network healing
- Correlates environmental factors with network degradation
iOS App (SwiftUI)
β
Cloud Services (Firestore, Firebase)
β
Raspberry Pi (Data Collector + ML)
β
Arduino (Sensors)
- Frontend: SwiftUI (iOS 16+)
- Backend: Firebase/Firestore
- AI: Gemini API (replaceable with your own)
- ML Models:
- Isolation Forest for anomaly detection
- Time-series analysis (LSTM Autoencoder/Prophet)
- Correlation modeling (Random Forest/Gradient Boosting)
- Data Collection:
- Network: speedtest-cli, iperf3, ping
- Sensors: DHT11, MPU6050, current sensors via Arduino
- Health Score Ring - Overall network health (0-100)
- Real-time Metrics - Latency, packet loss, throughput, jitter
- Active Alerts - Current anomalies detected by ML
- Sensor Status - Quick view of all connected sensors
- Quick Actions - Refresh data, trigger AI analysis
- Live Charts - Historical trends for all network metrics
- Time Range Selector - 1h, 6h, 24h, 7d views
- Summary Statistics - Average latency, packet loss, etc.
- Real-time Updates - Live data streaming from Firestore
- Sensor Cards - Temperature, humidity, motion, vibration, power
- Environmental Insights - AI-detected correlations
- Device Management - Connected Arduino devices
- Health Indicators - Normal/abnormal sensor readings
- Anomaly Feed - Chronological list of detected issues
- Severity Filtering - Critical, warning, info
- Pattern Detection - Recurring issues and trends
- Root Cause Analysis - ML-driven explanations
- Resolution Tracking - Resolved vs active anomalies
- Agent Status - Current state (idle, analyzing, acting)
- Action History - Log of automated healing actions
- Manual Analysis - Request AI insights on-demand
- Model Metrics - Version, accuracy, performance
- Device Configuration - Raspberry Pi connection
- Notification Preferences - Alert severity levels
- Data Retention - Storage duration settings
- AI Configuration - Model and API settings
- Xcode 15.0+
- iOS 16.0+ device or simulator
- Firebase project
- Gemini API key (or your own AI endpoint)
-
Clone the repository
cd /Users/joelin/Local/PulseOne -
Add files to Xcode project
./add_to_xcode.sh
Or manually add the folders in Xcode (see SETUP.md)
-
Install Firebase SDK
- Open
PulseOne.xcodeprojin Xcode - Go to File β Add Package Dependencies
- Add
https://github.com/firebase/firebase-ios-sdk - Select
FirebaseCoreandFirebaseFirestore
- Open
-
Configure Gemini API
- Open
PulseOne/Services/GeminiService.swift - Replace
YOUR_GEMINI_API_KEYwith your API key - Or replace the entire service with your own AI endpoint
- Open
-
Build and Run
- Press
Cmd+Bto build - Press
Cmd+Rto run on simulator/device
- Press
- latency: Double (ms)
- throughputDown: Double (Mbps)
- throughputUp: Double (Mbps)
- packetLoss: Double (%)
- signalStrength: Double (dBm)
- jitter: Double (ms)
- healthScore: Double (computed)- sensorType: enum (temperature, humidity, motion, vibration, powerDraw)
- value: Double
- unit: String
- isNormal: Bool (computed)- type: enum (latencySpike, packetLoss, temperatureAnomaly, etc.)
- severity: enum (critical, warning, info)
- description: String
- rootCause: String?
- recommendedAction: String?
- isResolved: Bool- actionType: enum (diagnosticRun, networkRestart, etc.)
- success: Bool
- beforeMetrics: [String: Double]?
- afterMetrics: [String: Double]?
- aiResponse: String?/network_metrics/{id}
- timestamp, latency, throughput_down, throughput_up,
packet_loss, signal_strength, jitter, device_id
/sensor_data/{id}
- timestamp, sensor_type, value, unit, device_id, arduino_id
/anomalies/{id}
- timestamp, type, severity, description, root_cause,
recommended_action, is_resolved, device_id
/agent_actions/{id}
- timestamp, action_type, description, success, anomaly_id,
before_metrics, after_metrics, ai_response
/agent_state/current
- status, current_task, last_action_timestamp,
model_version, accuracy_score
- Network metrics via speedtest-cli, iperf3, ping
- Sensor readings via Arduino (serial/MQTT)
- Store to Firestore with timestamps
- Isolation Forest - Statistical outlier detection
- LSTM Autoencoder - Time-series anomalies
- Prophet - Trend-based detection
- Threshold alerts - Rule-based triggers
- Random Forest to learn sensor β network relationships
- Identify environmental factors affecting performance
- TensorFlow Lite models on Raspberry Pi
- Edge Impulse for sensor fusion
- Real-time scoring and alerting
Default: raspberry_pi_001
Change in:
- ViewModels (DashboardViewModel, NetworkMonitorViewModel, etc.)
- Settings view (runtime configuration)
- Network metrics: Configurable in Settings (default: 60s)
- Real-time updates: Via Firestore listeners
Defined in model classes:
- Latency: >50ms triggers warning
- Packet Loss: >1% triggers warning
- Temperature: 15-35Β°C normal range
- Humidity: 30-70% normal range
(Add screenshots of each main screen)
PulseOne/
βββ Models/ # Data models (Codable, Firestore-compatible)
βββ Services/ # Firebase, Gemini API services
βββ ViewModels/ # ObservableObject view models
βββ Views/ # SwiftUI views
βββ Components/ # Reusable UI components
βββ ContentView.swift
βββ PulseOneApp.swift
- Create model in
Models/ - Add service methods in
Services/FirestoreService.swift - Create ViewModel in
ViewModels/ - Build View in
Views/ - Add to navigation in
ContentView.swift
Add sample documents to Firestore:
// Example network metric
{
timestamp: new Date(),
latency: 45.2,
throughput_down: 120.5,
throughput_up: 25.3,
packet_loss: 0.5,
signal_strength: -65,
jitter: 8.2,
device_id: "raspberry_pi_001"
}- Move API keys to secure storage (Keychain)
- Use environment variables for sensitive config
- Implement Firebase Authentication
- Add Firestore security rules
- Validate all sensor inputs
- Add authentication (Firebase Auth)
- Implement push notifications
- Add historical data export
- Create healing action automation rules
- Build watchOS companion app
- Add widget support
- Implement on-device ML inference
- Add network topology visualization
- Create custom chart interactions
- Add voice commands (Siri)
- "Cannot find X in scope" β Add files to Xcode project (see SETUP.md)
- Firebase errors β Check GoogleService-Info.plist is added
- Chart errors β Set deployment target to iOS 16.0+
- No data showing β Check Firestore collections exist
- AI not responding β Verify Gemini API key
- Sensors offline β Check Arduino/Pi connectivity
MIT License - see LICENSE file
Contributions welcome! Please:
- Fork the repository
- Create a feature branch
- Submit a pull request
For questions or support, please open an issue.
Built with β€οΈ for better network monitoring