Commit Graph

337 Commits

Author SHA1 Message Date
PaulVua
d593449171 improve pdp reconnect 2026-01-15 10:39:08 +01:00
PaulVua
c571bbd408 improve pdp reconnect 2026-01-15 10:35:46 +01:00
PaulVua
5742cc7e49 reboot when udp send error 2026-01-15 10:16:29 +01:00
PaulVua
4c552e4a31 more logs 2026-01-14 14:43:00 +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
PaulVua
f679732591 Fix i18n translations not applying properly on database page
Fixed race condition where translations weren't being applied to the database page when French language was selected. The issue was caused by the i18n system loading asynchronously while page content was being rendered.

Changes:
- Added applyTranslationsWhenReady() function that waits for translations to load
- Re-apply translations after dynamic content (sidebar/topbar) is loaded
- Added languageChanged event listener to re-apply translations on language switch
- Ensures all text appears in the selected language (French/English)

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-07 14:42:33 +01:00
PaulVua
857d590b8f Order database table display by insertion order (ROWID) instead of timestamp
Changed the data retrieval query to use ROWID DESC instead of timestamp DESC, ensuring that the most recently inserted data appears first regardless of timestamp field values. This fixes the issue where entries with "not connected" or invalid timestamps would appear in wrong order.

Benefits:
- Most recent database entries always shown at top
- Works correctly even when timestamp is null, "not connected", or incorrect
- Based on actual insertion order rather than timestamp field

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-07 14:38:22 +01:00
PaulVua
141dd68716 Add database cleanup feature to empty all sensor tables
Added a "Danger Zone" section on the database page that allows users to empty all sensor data tables while preserving configuration and timestamp tables. The feature includes:

- New Python script (sqlite/empty_sensor_tables.py) to safely empty sensor tables
- Backend endpoint in launcher.php (empty_sensor_tables)
- Frontend UI with red warning card and confirmation dialog
- Detailed feedback showing deleted record counts per table
- i18n support for French and English

Tables emptied: data_NPM, data_NPM_5channels, data_BME280, data_envea, data_WIND, data_MPPT, data_NOISE, modem_status
Tables preserved: timestamp_table, config_table, envea_sondes_table, config_scripts_table

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-07 14:33:21 +01:00
PaulVua
79a9217307 Add i18n translations for page content (Home, Database, Logs)
Extended internationalization support by adding translation keys and data-i18n attributes to page content. Previously only the sidebar was translated - now the main content of Home, Database, and Logs pages will switch between French and English when the user changes the language selector.

Translation keys added:
- Home page: title, welcome message, PM measures, Linux stats, disk/memory usage
- Database page: all UI labels, buttons, and dropdown options
- Logs page: title, description, log types, and action buttons

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-06 16:42:43 +01:00
PaulVua
fe604791f0 Enable i18n language switching on all pages and hide incomplete features
Added i18n.js script to all main pages (index, database, saraR4, wifi, logs, admin) to enable language switching functionality across the entire application. Commented out Map and Terminal menu items in the sidebar as these pages are not yet ready for production use.

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-06 16:38:28 +01:00
PaulVua
624fb4abbc Add sidebar i18n support and fix language selector visibility
Extended the internationalization system to support sidebar navigation menu with French/English translations. Fixed language selector dropdown styling to improve text visibility with proper contrast (gray background instead of transparent).

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-06 16:29:44 +01:00
PaulVua
163d60bf34 Implement lightweight offline i18n system with French/English support
**Core System:**
- Add i18n.js translation library with data-attribute support
- Create translation files (fr.json, en.json) with offline support
- Store language preference in SQLite config_table
- Add backend endpoints for get/set language

**UI Features:**
- Add language switcher dropdown to topbar (🇫🇷 FR / 🇬🇧 EN)
- Auto-sync language selection across all pages
- Support for static HTML and dynamically created elements

**Implementation:**
- Migrate sensors.html as working example
- Add data-i18n attributes to all UI elements
- Support for buttons, inputs, and dynamic content
- Comprehensive README documentation in html/lang/

**Technical Details:**
- Works completely offline (local JSON files)
- No external dependencies
- Database-backed user preference
- Event-based language change notifications
- Automatic translation on page load

Next steps: Gradually migrate other pages (admin, wifi, index, etc.)

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-05 18:10:06 +01:00
PaulVua
906eaa851d Fix BME280 and sensor cards not displaying
- Refactor sensor card creation to use config_table instead of non-existent config_scripts_table
- Fix BME280 card check: use config.BME280 instead of response["BME280/get_data_v2.py"]
- Fix NOISE card check: use config.NOISE instead of response.i2C_sound
- Fix Envea card check: use config.envea instead of response["envea/read_value_v2.py"]
- Create dedicated createSensorCards() function for cleaner code
- Remove obsolete get_config_scripts_sqlite AJAX call

Now sensor cards properly display based on config_table settings.

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-05 17:49:02 +01:00
PaulVua
954680ef6e Refactor Claude Code settings to use template pattern
- Create .claude/settings.json as project-wide template
- Untrack .claude/settings.local.json for local overrides
- Add .claude/settings.local.json to .gitignore
- Add .claude/README.md documenting the setup

This allows:
- Project defaults versioned in git
- Local customization without conflicts
- Clean separation of shared vs personal settings

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-05 17:33:13 +01:00
PaulVua
1f4d38257e Fix WiFi setup flow and improve hotspot management
- Fix deviceID overwrite bug: preserve manual configuration across reboots
- Use deviceName as hotspot SSID for better device identification
- Implement live WiFi scanning instead of reading stale CSV data
- Improve hotspot management with dynamic connection detection
- Add database status updates on WiFi connection success/failure
- Hide password in logs for better security

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-05 17:27:37 +01:00
Your Name
a38ce79555 update 2026-01-05 15:50:35 +00:00
Your Name
62ef47aa67 update 2025-11-26 09:55:45 +00:00
Your Name
ca7533a344 update 2025-11-26 09:11:04 +00:00
Your Name
403c57bf18 update 2025-11-26 09:00:07 +00:00
Your Name
129b2de68e update 2025-11-11 13:41:44 +00:00
Your Name
d2c88e0d18 update 2025-11-11 13:23:30 +00:00
Your Name
fba5af53cb update 2025-11-05 15:57:11 +01:00
Your Name
04fbf81798 update 2025-11-05 14:50:29 +01:00
Your Name
65beead82b update 2025-11-05 14:44:30 +01:00
Your Name
26ee893a96 update 2025-11-03 18:59:09 +01:00
Your Name
5cf37c3cee update 2025-11-03 17:45:18 +01:00
root
3ecc27fd3e update 2025-11-03 17:42:39 +01:00
AirLab
072fca72cc update 2025-11-03 17:31:13 +01:00
AirLab
c038084343 update 2025-11-03 17:20:37 +01:00
AirLab
6069ab04cf update 2025-10-07 15:03:11 +02:00
AirLab
79f3ede17f Add password protection for critical transmission settings
- Add unlock/lock button for protected settings in admin panel
- Protect AirCarto, uSpot, and miotiq transmission checkboxes
- Require password '123plouf' to enable editing protected checkboxes
- Visual feedback with lock/unlock icons and toast notifications
- Add CLAUDE.md documentation file for development guidance

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-07 14:59:38 +02:00
root
9de903f2db update 2025-10-02 15:53:14 +01:00
Your Name
77fcdaa08e update 2025-09-19 14:08:01 +02:00
Your Name
1fca3091eb update 2025-09-18 16:46:25 +01:00
Your Name
d0b49bf30c update 2025-09-18 16:45:08 +01:00
Your Name
4779f426d9 update 2025-09-18 16:43:49 +01:00
Your Name
9aab95edb6 update 2025-09-09 09:47:45 +02:00
root
fe61b56b5b update 2025-07-22 16:38:41 +01:00
Your Name
25c5a7a65a update 2025-07-22 15:36:36 +02:00
root
4d512685a0 update 2025-07-22 10:39:13 +02:00
root
44b2e2189d update 2025-07-21 12:22:56 +01:00
root
74fc3baece update 2025-07-21 11:11:09 +01:00
Your Name
0539cb67af update 2025-07-02 08:25:29 +01:00
Your Name
98115ab22b update 2025-07-02 08:01:41 +01:00
Your Name
2989a7a9ed update 2025-06-30 15:10:29 +01:00
Your Name
aa458fbac4 update 2025-06-30 14:59:40 +01:00