Repository navigation
Troubleshooting
Error: "Python 3.10 or higher is required"
Solution:
python --version
# If < 3.10, install newer Python
# Use python3.10 or python3.11 explicitlyError: "Could not find a version that satisfies the requirement"
Solution:
# Update pip
python -m pip install --upgrade pip
# Install with verbose output
pip install -r requirements.txt -v
# If still fails, try without cache
pip install -r requirements.txt --no-cache-dirError: "Permission denied: /dev/ttyUSB0"
Solution:
# Add user to dialout group
sudo usermod -a -G dialout $USER
# Or run with sudo (not recommended)
sudo python app.pyError: "Serial port COM11 not found"
Solution:
-
Check connected devices:
- Windows: Device Manager → Ports
- Linux:
ls /dev/tty* - macOS:
ls /dev/cu.*
-
Update MODBUS_PORT in
.env -
Verify USB-to-serial adapter is connected
Error: "No response from slave 1"
Checklist:
- Verify sensor power (LED indicator)
- Check A/B wiring polarity (swap if needed)
- Confirm baudrate matches sensor (default 9600)
- Try different slave IDs (1, 2, or 247)
- Test with Modbus diagnostic tool first
Error: "ModuleNotFoundError: No module named 'dash'"
Solution:
# Activate virtual environment first
.venv\Scripts\activate # Windows
source .venv/bin/activate # Linux/macOS
# Verify activation
which python # Should show .venv path
# Reinstall if needed
pip install -r requirements.txtError: "database is locked"
Solution:
# Close all connections
pkill -f app.py
# Check for lock file
rm sensor_data.db-wal sensor_data.db-shm
# Restart application
python app.pyError: "Address already in use: 8050"
Solution:
# Find process using port 8050
netstat -ano | findstr :8050 # Windows
lsof -i :8050 # Linux/macOS
# Kill process
taskkill /PID <PID> /F # Windows
kill -9 <PID> # Linux/macOS
# Or change port in .env
PORT=8051Check:
- Terminal output for Modbus errors
- Database has data:
sqlite3 sensor_data.db "SELECT COUNT(*) FROM data_2025_12;" - Time period selection (try "All data")
- Browser console for JavaScript errors (F12)
Possible causes:
- Wrong register addresses in
.env - Sensor needs calibration
- Data format mismatch (division by 10)
- Electrical interference
Verification:
import minimalmodbus
instrument = minimalmodbus.Instrument('COM11', 1)
instrument.serial.baudrate = 9600
temp = instrument.read_register(1, 0, 4)
print(f"Raw value: {temp}, Actual: {temp/10}")Check:
- Terminal logs for connection errors during gap
- System logs for power events
- Serial cable quality (replace if old)
- USB power management settings (disable selective suspend)
This is normal behavior when viewing long time ranges:
Adaptive downsampling automatically aggregates data for performance:
- 6 hours: Shows 1-minute averages (~360 points)
- 1 day: Shows 5-minute averages (~288 points)
- 1 month: Shows 1-hour averages (~720 points)
- 1 year: Shows 1-day averages (~365 points)
Why this happens:
- Browser cannot efficiently render 1+ million points
- Visual trends are preserved even with aggregation
- Performance is instant regardless of data volume
To see more detail:
- Select shorter time range (< 1 hour for full resolution)
- Use historical replay slider for specific moments
- Check DEBUG_LOGGING=True to see downsampling statistics
Example console output with DEBUG_LOGGING:
📊 Query voor laatste 360 minuten (vanaf 2025-12-09 08:00:00)
→ Aantal relevante tabellen: 1
→ Opgehaalde datapunten: 18720
→ Downsampled: 18720 → 360 punten (-98.1%)
Solutions:
- Increase graph update interval in
callbacks.py - Reduce data retention period
- Use data aggregation for old data
- Close browser developer tools
Monitor memory:
# Windows
tasklist /FI "IMAGENAME eq python.exe"
# Linux
ps aux | grep pythonIf memory grows continuously:
- Restart application daily (cron job)
- Check for database bloat (VACUUM)
- Report issue on GitHub
Optimization:
sqlite3 sensor_data.db
PRAGMA journal_mode=WAL;
PRAGMA synchronous=NORMAL;
ANALYZE;Check:
- Application is running (check terminal)
- Correct URL: http://localhost:8050
- Firewall allows connection
- Try different browser
- Clear browser cache
Solutions:
- Hard refresh: Ctrl+F5
- Disable browser extensions
- Check browser console (F12) for errors
- Try incognito mode
Checklist:
- HOST=0.0.0.0 in
.env - Firewall allows port 8050
- Server and client on same network
- Use server IP, not localhost
- Router allows local connections
Windows Firewall:
netsh advfirewall firewall add rule name="XY-MD02" dir=in action=allow protocol=TCP localport=8050If issue persists:
- Check existing issues: https://github.com/CervezaStallone/XY-MD02_WebApp/issues
- Enable DEBUG=True in
.envfor detailed logs - Create new issue with:
- Python version
- Operating system
- Complete error message
- Steps to reproduce
- Terminal output