Commit Graph

139 Commits

Author SHA1 Message Date
PaulVua
c83f8396aa WiFi status: detection live wlan0 au lieu de se fier a la DB
Le WIFI_status en DB peut etre desynchronise (ex: reconnexion
manuelle via SSH). Maintenant get_config_sqlite detecte le vrai
etat de wlan0 via nmcli et corrige la DB si necessaire.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-17 18:09:39 +01:00
PaulVua
83d854b596 Hotspot: scan WiFi depuis cache CSV + timeout scan live + auto-load
En mode hotspot, le scan live est impossible (wlan0 occupée).
Utilise wifi_list.csv (scan au boot) avec notice explicative.
Ajout timeout 10s sur le scan live pour eviter blocage.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-17 17:54:44 +01:00
PaulVua
a0f8b4b8eb Fix hotspot IP: 192.168.43.1 -> 10.42.0.1 (NetworkManager default)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-17 17:50:28 +01:00
PaulVua
8d0507852a Fix forget WiFi: appel bash explicite + disconnect wlan0 avant delete
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-17 17:34:30 +01:00
PaulVua
6e17f39a2c v1.4.5 — Page WiFi: oublier réseau + badge hotspot sidebar + refonte UI
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-17 17:28:46 +01:00
PaulVua
5a2b3bb19d v1.4.4 — Self-test partagé sur Accueil/Capteurs/Admin + test RTC DS3231
Extraction du code self-test dans des fichiers partagés (selftest.js +
selftest-modal.html) pour éviter la duplication. Ajout du bouton Run
Self Test sur les pages index, sensors et admin. Nouveau test RTC qui
vérifie la connexion du module DS3231 et la synchronisation horloge.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-16 17:56:11 +01:00
PaulVua
e0e8a4cefe Database: validation dates + bouton télécharger toute la table
- Empêche le téléchargement par dates si début/fin non renseignées
- Ajoute une carte "Télécharger toute la table" (bypass dates)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-16 09:19:02 +01:00
PaulVua
794b86fb9b Fix self-test bruit: parser le JSON du NSRT MK4 au lieu de texte brut
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 16:02:28 +01:00
PaulVua
7479344df7 Mise à jour capteur bruit: ancien I2C → NSRT MK4 USB
- Nouveau script sound_meter/read.py pour lecture à la demande (JSON)
- launcher.php: appel du script Python au lieu de l'ancien binaire C
- sensors.html: carte USB, suppression boutons start/stop, affichage JSON
- Traductions fr/en: I2C → USB, NSRT MK4

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 15:23:54 +01:00
PaulVua
98b5b43190 v1.4.0 — Mise à jour firmware hors-ligne par upload ZIP
Nouvelle fonctionnalité permettant de mettre à jour le firmware sans
connexion internet, via upload d'un fichier .zip depuis l'interface admin.

Fichiers ajoutés:
- update_firmware_from_file.sh (rsync + exclusions + chown + restart services)
- .update-exclude (liste d'exclusions évolutive, versionnée)
- html/.htaccess (limite upload PHP 50MB)

Fichiers modifiés:
- html/launcher.php (handler upload_firmware)
- html/admin.html (UI upload + barre de progression)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 16:30:51 +01:00
PaulVua
7a7d1c0c3f Ajout bouton Get Data (IMSI) sur la page modem 4G
- Sépare le bouton SIM en deux : Get Data (ICCID) et Get Data (IMSI)
- Ajout fonction getImsiInfo() avec commande AT+CIMI
- Parse la réponse pour extraire le numéro IMSI (15 chiffres)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 11:44:53 +01:00
PaulVua
36d4bac0a5 Fix: Revert to using sudo in launcher.php to support visudo configuration 2026-02-17 17:14:20 +01:00
PaulVua
a208540093 Fix: Remove sudo usage in launcher.php to avoid password prompt; enable logging 2026-02-17 12:54:40 +01:00
PaulVua
8c55798e34 Fix UI: Add button IDs and fix status message selector in screen.html; Capture stderr in launcher.php 2026-02-17 12:51:39 +01:00
PaulVua
cf502abfef Fix: Broaden pkill pattern to match 'screen.py' for stop command 2026-02-17 12:46:39 +01:00
PaulVua
e659696044 Fix: Run screen script with sudo to ensure access to video device 2026-02-17 12:43:28 +01:00
PaulVua
86c2d1eb41 Fix: Correct screen.py path in launcher.php for production environment 2026-02-17 12:33:41 +01:00
PaulVua
aa1b90e3d5 Fix: Apply translations after sidebar load to resolve 'sidebar.screen' display issue 2026-02-17 12:30:14 +01:00
PaulVua
248732bac9 Refine Screen tab: Move above Sensors, add translations 2026-02-17 12:27:39 +01:00
PaulVua
7b0fb0650a Fix Screen tab visibility: Use class selector to handle multiple sidebar instances 2026-02-17 12:23:19 +01:00
PaulVua
3e5ee9c77e Add Screen control features: Screen tab in sidebar, Kivy script, and backend logic 2026-02-17 12:19:05 +01:00
PaulVua
8106af624f fix(mhz19): gestion d'erreurs JSON pour le capteur CO2
Le script get_data.py retourne maintenant toujours du JSON, meme en cas
d'erreur (port serie, absence de donnees). Cote web, les erreurs sont
affichees proprement dans la carte capteur.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 11:08:36 +01:00
PaulVua
198836fa13 feat: intégration capteur CO2 MH-Z19
- Scripts MH-Z19/get_data.py (lecture standalone) et write_data.py (écriture SQLite)
- Table data_MHZ19, config MHZ19, cleanup et service systemd (120s)
- Web UI : carte test sensors, checkbox admin, boutons database + CSV download
- SARA_send_data_v2.py non modifié (sera fait dans un second temps)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 11:04:45 +01:00
PaulVua
ea2642685c fix(ui): logo dynamique ne s'affichait pas (innerHTML n'exécute pas les scripts)
Le script dans topbar.html ne s'exécutait pas car innerHTML ignore les
balises <script>. Déplacé la logique dans un fichier JS séparé
(topbar-logo.js) avec MutationObserver pour détecter l'insertion du topbar.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 10:43:38 +01:00
PaulVua
f8f5300b9b fix: add missing ModuleAir Pro logo image
Le logo ModuleAir n'était pas suivi par git, empêchant
l'affichage sur les capteurs configurés en ModuleAir Pro.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 10:39:54 +01:00
PaulVua
88680f07b0 feat(ui): add full table CSV download on database stats card
Each table row in the stats card now has a download button that exports
the entire table as CSV with proper column headers, generated server-side.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-16 12:18:46 +01:00
PaulVua
20c6a12251 feat(ui): add database stats card on database page
Show table info (entry count, oldest/newest dates, total DB size) in a
new card on the database page, with auto-refresh and i18n support.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-16 12:07:58 +01:00
PaulVua
e20bb0b8fc feat(ui): switch logo dynamically based on device_type
Topbar logo now loads from config: NebuleAir Pro or ModuleAir Pro.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 16:24:47 +01:00
PaulVua
50a8cdd938 feat: add firmware versioning and device_type support (NebuleAir/ModuleAir)
- Add VERSION file (1.0.0) and changelog.json for firmware tracking
- Add device_type config param (nebuleair_pro default, backward compatible via INSERT OR IGNORE)
- Add device_type select in admin.html Protected Settings
- Add version badge and changelog modal in Updates section
- Add get_firmware_version and get_changelog PHP endpoints
- Display firmware version in update_firmware.sh after git pull

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 16:12:18 +01:00
PaulVua
dc1739e033 feat(ui): reorder self-test to run sensor tests before communication
Sensor tests (NPM, BME280, Noise, Envea) now run first, followed by
communication tests (WiFi, Modem, SIM, Signal, Network) with a
visual separator between the two sections.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 17:05:35 +01:00
PaulVua
544eebd715 feat(ui): add NextPM firmware version button on sensors page
Add a "Firmware Version" button next to "Get Data" in the NextPM card
that calls firmware_version.py and displays the result as a badge.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 17:05:10 +01:00
PaulVua
6bdaef8c24 feat(ui): add sensor tests to modem self-test
Add dynamic sensor testing (NPM, BME280, Noise, Envea) to the self-test
based on enabled sensors in config. Results are included in the diagnostic report.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 16:58:45 +01:00
PaulVua
98cb1ea517 feat(ui): replace copy with share modal and download option
- Add new "Share Report" modal with readable textarea
- Add instructions to send logs to contact@aircarto.fr
- Add "Download (.txt)" button to save report as file
- Add "Select All" button for easy manual copy
- Remove complex clipboard API code that wasn't working
- Filename format: logs_nebuleair_{deviceId}_{date}.txt

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-10 11:16:05 +01:00
PaulVua
4ed185de0c fix(ui): fix copy report and add more device info
- Add system info collection at start of test (device ID, name, RTC time, GPS)
- Display device info in logs header
- Fix clipboard copy with fallback for non-HTTPS contexts
- Use execCommand fallback for older browsers
- Use ASCII-safe characters for better compatibility
- Add error handling with manual copy fallback

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-10 11:09:25 +01:00
PaulVua
3d61ce22d3 feat(ui): add copy report functionality to self-test
Add "Copy Report" button that generates a formatted diagnostic report:
- Device info (ID, modem version, timestamp)
- Test results summary with status icons
- Raw AT command responses for debugging
- Detailed execution logs
- Nicely formatted for sharing with manufacturer support

Enhanced logging with raw AT responses displayed in monospace format.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-10 11:03:37 +01:00
PaulVua
3a6b529cba feat(ui): add WiFi/network info to self-test
Add informational network status check at the beginning of self-test:
- Shows connection mode (Hotspot, WiFi, or Ethernet)
- Displays SSID/connection name
- Shows IP address and hostname.local
- Add wifi_status endpoint in launcher.php using nmcli

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-10 10:39:02 +01:00
PaulVua
3c8558ea1d feat(ui): add signal and network tests to self-test
Add two more tests to the modem self-test:
- Test 3: Signal Strength (AT+CSQ) with quality thresholds
- Test 4: Network Connection (AT+COPS?) with operator name lookup
Respects 1 second delay between each AT command.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-10 10:33:51 +01:00
PaulVua
49a4623d85 feat(ui): add modem self-test functionality
Add "Run Self Test" button that opens a modal and runs diagnostic tests:
- Automatically enables modem_config_mode before tests
- Test 1: Modem connection (ATI command)
- Test 2: SIM card detection (AT+CCID? command)
- Respects delays between AT commands
- Always disables modem_config_mode after tests (even on failure)
- Shows real-time progress and detailed logs

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-10 10:28:59 +01:00
PaulVua
d3d72410c1 fix(ui): align signal thresholds with Python implementation
Use correct thresholds: 0=Very poor, 1-24=Poor, 25-26=Good,
27-28=Very good, 29-30=Excellent, 31=Very Strong, 99=No signal.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-10 10:17:33 +01:00
PaulVua
fcfbe4f2d4 feat(ui): improve signal strength display with visual bars
Add colored signal bars (1-5) based on signal power level.
Show signal quality description, RSSI in dBm, and quality index.
Color coding: red (poor) -> orange -> yellow -> green -> blue (excellent).

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-10 10:15:11 +01:00
PaulVua
53e7c77322 feat(ui): improve network connection display with operator lookup
Add operators.json with MCC/MNC codes for common operators.
Parse AT+COPS? response to show operator name, country, technology,
and connection mode in a user-friendly format.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-10 10:10:42 +01:00
PaulVua
20ba897cde feat(ui): improve SIM card info display and switch to English
Add user-friendly alert for SIM card status with ICCID number.
Change all modem/SIM status messages to English.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-10 10:04:22 +01:00
PaulVua
15e43513f4 feat(ui): improve modem info display with user-friendly alerts
Replace raw AT command output with Bootstrap alerts showing modem
connection status and model. Add collapsible section for raw logs.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-10 10:00:43 +01:00
PaulVua
91a4e7c841 wifi hotspot improvements 2026-01-15 16:45:47 +01:00
PaulVua
8291475e36 add cpu power mode 2026-01-15 14:13:41 +01:00
PaulVua
5777b35770 Add WiFi and HDMI power saving features for remote sensors
Implements power saving optimizations to extend battery life on solar-powered remote air quality sensors:

- WiFi Power Saving: Disable WiFi 10 minutes after boot to save ~100-200mA
  - Configurable via web UI checkbox in admin panel
  - WiFi automatically re-enables after reboot for 10-minute configuration window
  - Systemd timer (nebuleair-wifi-powersave.timer) manages automatic disable
  - New wifi/power_save.py script checks database config and disables WiFi via nmcli

- HDMI Disable: Added hdmi_blanking=2 to boot config to save ~20-30mA
  - Automatically configured during installation

- Database: Added wifi_power_saving boolean config (default: disabled)
  - Uses INSERT OR IGNORE for safe updates to existing installations

- UI: Added checkbox control in admin.html for WiFi power saving
  - Includes helpful description of power savings and behavior

- Services: Updated setup_services.sh and update_firmware.sh to manage new timer

Total power savings: ~120-230mA when WiFi power saving enabled

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-13 12:05:21 +01:00
PaulVua
13445d574c Fix device name not showing in page title and sidebar
Fixed race condition issues where device name wasn't displaying properly:

Page title fixes:
- Added document.title update to sensors.html (was missing)
- wifi.html already had it but improved reliability

Sidebar device name fixes:
- Created updateSidebarDeviceName() function with retry logic
- Attempts update immediately, then at 100ms and 500ms delays
- Handles async sidebar loading timing issues
- Added console logging for debugging
- Both sensors.html and wifi.html now reliably show device name

This ensures the device ID/name always appears in:
1. Browser tab title (e.g., "NebuleAir_001")
2. Sidebar footer (bottom of navigation)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-07 15:27:37 +01:00
PaulVua
10f84f0c1b Fix most recent row highlighting by increasing CSS specificity
The light green background for the most recent data row wasn't displaying because Bootstrap's table striping was overriding it.

Changed CSS from targeting the row to targeting individual cells:
- .table .most-recent-row td
- .table-striped .most-recent-row td

Both with !important to override Bootstrap's table styles. Now the first row correctly displays with light green background.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-07 15:00:49 +01:00
PaulVua
4f1b140a75 Replace individual Envea sensor cards with single debug card
Modified the sensors page to display a unified debug view for all Envea gas sensors:

Backend changes:
- Added new 'envea_debug' endpoint in launcher.php
- Calls: /usr/bin/python3 /var/www/nebuleair_pro_4g/envea/read_value_v2.py -d
- Returns raw debug output without parsing

Frontend changes:
- Replaced individual sensor cards with single combined card
- Card displays if any gas sensor is connected
- Shows list of connected sensors (NO2, H2S, NH3, etc.)
- New getENVEA_debug_values() function fetches debug data
- Raw output displayed in scrollable <pre> block
- No JSON parsing, no table formatting - just raw debug text
- Card width set to col-sm-6 for better visibility

This makes it easier to check if all sensors are working correctly by viewing the raw output.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-07 14:56:08 +01:00
PaulVua
a3b2bef5c1 Improve database page layout and highlight most recent data
Layout improvements:
- Reorganized cards to fit 3 across on large screens (col-lg-4)
- View database, download data, and danger zone now on same row
- Added h-100 class to cards for equal height
- Made delete button larger and full-width for better visibility

Button spacing:
- Added mb-2 (margin-bottom) to all measurement trigger buttons
- Improved vertical spacing for better readability

Data visualization:
- Added light green background (#d4edda) to first table row
- First row now highlights the most recent data entry
- Makes it easy to see the latest sensor reading at a glance

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-07 14:48:34 +01:00