Draft
[WIP] Update dashboard to use dark mode theme and fix mobile app connection#57
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
MASH IoT Device Dashboard Improvements
Tasks Overview
Dark Mode Theme Updates
QR Code Modal Implementation
https://mash-app.com/pair?device={device_id}Sensor Data Connection Fix
Testing
Original prompt
Can you make sure its in dark mode theme (dark) Do not add a white background or anything related to light background this is to match with the other pages.
Also, I noticed that in the dashboard, the Connect Mobile App is permanently on the bottom of the screen and not shown as Modal. I like the design/UI but the floating QR at the bottom right should open this modal instead. Then you must remove the redundant QR connection that generates with that Floating QR Icon and use the modal version of that Connect Mobile App QR that was on below dashboard.
Also, fix the issue where we connect using the Mobile App using QR from the IoT,
Alright I think I know the issue, when we use the test_arduino.py, it reset the connection and the RPI can now show the sensor data.
From the test_arduino.py:
(venv) mash@mash:~/MASH-IoT/scripts $ python3 test_arduino.py
M.A.S.H. IoT - Arduino Connection Test
Initializing connection (auto-detect ON, auto-reconnect ON)...
Connecting to Arduino...
INFO:app.core.serial_comm:[SERIAL] Scanning for Arduino...
INFO:app.core.serial_comm:[SERIAL] Found Arduino: /dev/ttyUSB0 (USB2.0-Ser!)
INFO:app.core.serial_comm:[SERIAL] Connecting to /dev/ttyUSB0...
INFO:app.core.serial_comm:[SERIAL] ✓ Connected to Arduino on /dev/ttyUSB0 @ 9600 baud
Connection successful!
Port: /dev/ttyUSB0
Baud: 9600
Listening for sensor data (press Ctrl+C to stop)...
INFO:app.core.serial_comm:[SERIAL] Listen loop started
INFO:app.core.serial_comm:[SERIAL] Started listening thread
Test will run for 50 packets or until Ctrl+C
Try unplugging and replugging Arduino to test auto-reconnect!
Watch for: 🔴 DISCONNECTED → 🟢 CONNECTED messages
============================================================
🟢 CONNECTED - Arduino is online
[Packet #1] Received at 23:16:05
🍄 Fruiting Room:
Temperature: 21°C
Humidity: 61.7%
CO2: 912 ppm
🌱 Spawning Room:
Temperature: 21.3°C
Humidity: 53.9%
CO2: 861 ppm
📊 Testing room-specific data methods:
get_fruiting_room_data(): {'temp': 21, 'humidity': 61.7, 'co2': 912}
get_spawning_room_data(): {'temp': 21.3, 'humidity': 53.9, 'co2': 861}
[Packet #2] Received at 23:16:10
🍄 Fruiting Room:
Temperature: 20.8°C
Humidity: 62.4%
CO2: 912 ppm
🌱 Spawning Room:
Temperature: 21°C
Humidity: 54.7%
CO2: 1038 ppm
[Status Check] 🟢 CONNECTED | Packets received: 2
[Packet #3] Received at 23:16:15
🍄 Fruiting Room:
Temperature: 20.6°C
Humidity: 63%
CO2: 910 ppm
🌱 Spawning Room:
Temperature: 20.8°C
Humidity: 55.4%
CO2: 1076 ppm
From the http://192.168.1.16:5000/api/latest_data
{
"arduino_connected": true,
"backend_connected": false,
"fruiting_actuators": {
"exhaust_fan": false,
"humidifier_fan": false,
"intake_fan": false,
"led": false,
"mist_maker": false
},
"fruiting_condition": "Critical",
"fruiting_condition_class": "error",
"fruiting_data": {
"co2": 995,
"humidity": 63.2,
"temp": 20.8
},
"spawning_actuators": {
"exhaust_fan": false
},
"spawning_condition": "Critical",
"spawning_condition_class": "error",
"spawning_data": {
"co2": 1063,
"humidity": 55.3,
"temp": 21.1
},
"uptime": "0h 57m",
"warmup_complete": true,
"warmup_remaining": 0
}
But when we tried to connect the mobile app with QR scanning, the sensor doesn't register again.
{
"arduino_connected": true,
"backend_connected": false,
"fruiting_actuators": {
"exhaust_fan": false,
"humidifier_fan": false,
"intake_fan": false,
"led": false,
"mist_maker": false
},
"fruiting_condition": "Sensor Error",
"fruiting_condition_class": "error",
"fruiting_data": null,
"spawning_actuators": {
"exhaust_fan": false
},
"spawning_condition": "Sensor Error",
"spawning_condition_class": "error",
"spawning_data": null,
"uptime": "1h 1m",
"warmup_complete": true,
"warmup_remaining": 0
}
It might be an issue with the connection of the http requests.
The user has attached the following file paths as relevant context:
- .github\copilot-instructions.md
- .github\copilot-instructions.md
- rpi_gateway\app\web\templates\alerts.html
- rpi_gateway\app\web\templates\dashboard.html
- rpi_gateway\app\core\serial_comm.py
- lib\presentation\screens\devices\device_connection_screen.dart
[Chronological Review: The conversation began with the ...Created from VS Code.
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.