licence update

This commit is contained in:
Clément SAILLANT
2025-08-15 22:57:07 +02:00
parent ba2f62d331
commit f604dfd0f4
5 changed files with 78 additions and 7 deletions
+21
View File
@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2025 Clément Saillant
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
+8 -1
View File
@@ -333,10 +333,17 @@ Pour obtenir de l'aide :
## Crédit
Projet original adapté pour PlatformIO. Code source basé sur les exemples et tutoriels de la communauté ESP32/Arduino.
Projet développé et adapté pour PlatformIO par **Clément Saillant (electron-rare)** :
- GitHub : https://github.com/electron-rare
Code source basé sur des exemples et tutoriels de la communauté ESP32/Arduino.
Bibliothèques utilisées :
- PxMatrix par 2dom (Dominic Buchstaller)
- RTClib par Adafruit
- Adafruit GFX Library
- Adafruit BusIO
## Licence
Ce projet est distribué sous licence **MIT**. Voir le fichier `LICENSE` pour le texte complet.
+18 -4
View File
@@ -9,7 +9,7 @@
*
* L'interface web est accessible à l'adresse http://ip_de_l'esp32/
*
* Auteur: GitHub Copilot
* Auteur: Clément Saillant (electron-rare)
* Date: Août 2025
*/
@@ -48,6 +48,13 @@
#include "freertos/queue.h"
#include "freertos/semphr.h"
// Version firmware (uniformisé avec main)
static const char* FIRMWARE_VERSION = "1.0.0"; // garder synchro avec src/main.cpp
// === Personnalisation Auteur / GitHub ===
static const char* AUTHOR_NAME = "Clément Saillant (electron-rare)";
static const char* GITHUB_URL = "https://github.com/electron-rare";
// Pins pour la matrice LED
#define P_LAT 5
#define P_A 19
@@ -383,6 +390,7 @@ int displayFormat = 0;
const char MAIN_page[] PROGMEM = R"rawliteral(
<!DOCTYPE html><html lang="fr"><head>
<meta charset="utf-8" />
<meta name="author" content="__AUTHOR_NAME__">
<title>ESP32 P10 Countdown</title>
<meta name="viewport" content="width=device-width,initial-scale=1" />
<style>
@@ -447,7 +455,7 @@ footer { margin:40px 0 10px; text-align:center; font-size:.6rem; letter-spacing:
</div>
</div>
<div class="card" id="formCard">
<h1>Configuration du Compte à Rebours</h1>
<h1>Configuration du Compte à Rebours <span id="fwVer" style="font-size:.55rem;opacity:.6;vertical-align:middle;"></span></h1>
<form action="/settings" method="POST" id="settingsForm" autocomplete="off">
<div class="grid" style="gap:18px;">
<div class="field">
@@ -598,7 +606,7 @@ footer { margin:40px 0 10px; text-align:center; font-size:.6rem; letter-spacing:
<div class="inline-note">Les modifications sont appliquées immédiatement sur l'afficheur après envoi.</div>
</form>
</div>
<footer>ESP32 P10 RGB Fullscreen Countdown 2025</footer>
<footer>ESP32 P10 RGB Fullscreen Countdown 2025 __AUTHOR_NAME__ (<a href="__GITHUB_URL__" style="color:#4caf50" target="_blank" rel="noopener">GitHub</a>) <a href="/about" style="color:#888">À propos</a></footer>
</div>
<div class="toast" id="toast"></div>
<script>
@@ -678,6 +686,8 @@ form.addEventListener('submit',()=>{ setSaving(true,'ENVOI...'); el('btnSave').d
// Chargement initial depuis l'ESP32
window.addEventListener('load',()=>{
// Injecter version firmware (fourni côté C++ via endpoint futur ou placeholder compilé)
document.getElementById('fwVer').textContent = 'v__FWVER__';
const now=new Date(); const tomorrow=new Date(now.getTime()+86400000); el('date').value=tomorrow.toISOString().split('T')[0]; el('time').value='23:59:59';
fetch('/getSettings').then(r=>r.json()).then(d=>{ el('title').value=d.title; const ds=`${d.year}-${String(d.month).padStart(2,'0')}-${String(d.day).padStart(2,'0')}`; el('date').value=ds; const ts=`${String(d.hour).padStart(2,'0')}:${String(d.minute).padStart(2,'0')}:${String(d.second).padStart(2,'0')}`; el('time').value=ts; el('fontIndex').value=d.fontIndex; el('textSize').value=d.textSize; if(d.blinkEnabled!==undefined){ el('blinkEnabled').value = d.blinkEnabled ? '1' : '0'; } if(d.blinkIntervalMs!==undefined){ el('blinkInterval').value = d.blinkIntervalMs; } if(d.blinkWindow!==undefined){ el('blinkWindow').value = d.blinkWindow; } if(d.marqueeEnabled!==undefined){ el('marqueeEnabled').value = d.marqueeEnabled ? '1':'0'; } if(d.marqueeIntervalMs!==undefined){ el('marqueeInterval').value = d.marqueeIntervalMs; } if(d.marqueeGap!==undefined){ el('marqueeGap').value = d.marqueeGap; } if(d.marqueeMode!==undefined){ el('marqueeMode').value = d.marqueeMode; } if(d.marqueeReturnIntervalMs!==undefined){ el('marqueeReturnInterval').value = d.marqueeReturnIntervalMs; } if(d.marqueeBouncePauseLeftMs!==undefined){ el('marqueeBouncePauseLeft').value = d.marqueeBouncePauseLeftMs; } if(d.marqueeBouncePauseRightMs!==undefined){ el('marqueeBouncePauseRight').value = d.marqueeBouncePauseRightMs; } if(d.marqueeOneShotDelayMs!==undefined){ el('marqueeOneShotDelay').value = d.marqueeOneShotDelayMs; } if(d.marqueeOneShotStopCenter!==undefined){ el('marqueeOneShotStopCenter').value = d.marqueeOneShotStopCenter? '1':'0'; } if(d.marqueeOneShotRestartSec!==undefined){ el('marqueeOneShotRestart').value = d.marqueeOneShotRestartSec; } if(d.marqueeAccelEnabled!==undefined){ el('marqueeAccelEnabled').value = d.marqueeAccelEnabled? '1':'0'; } if(d.marqueeAccelStartIntervalMs!==undefined){ el('marqueeAccelStart').value = d.marqueeAccelStartIntervalMs; } if(d.marqueeAccelEndIntervalMs!==undefined){ el('marqueeAccelEnd').value = d.marqueeAccelEndIntervalMs; } if(d.marqueeAccelDurationMs!==undefined){ el('marqueeAccelDuration').value = d.marqueeAccelDurationMs; } if(d.brightness!==undefined){ if(parseInt(d.brightness,10)===-1){ el('brightnessMode').value='auto'; el('brightnessHidden').value='-1'; } else { el('brightnessMode').value='manual'; el('brightness').value=d.brightness; el('brightnessHidden').value=d.brightness; } } const color=rgbToHex(d.colorR,d.colorG,d.colorB); el('colorPicker').value=color; updateColor(color); syncFieldsToPreview(); setSaving(false,'PRÊT'); showToast('Paramètres chargés'); }).catch(()=>{ showToast('Échec chargement paramètres',false); setSaving(false,'HORS LIGNE'); syncFieldsToPreview(); });
});
@@ -1255,7 +1265,11 @@ void set_ESP32_Access_Point() {
// Gestionnaire de la page principale
void handleRoot() {
server.send(200, "text/html", MAIN_page);
String page = MAIN_page;
page.replace("v__FWVER__", String(FIRMWARE_VERSION));
page.replace("__AUTHOR_NAME__", String(AUTHOR_NAME));
page.replace("__GITHUB_URL__", String(GITHUB_URL));
server.send(200, "text/html", page);
}
// Gestionnaire des paramètres actuels en JSON
+17 -1
View File
@@ -1,6 +1,7 @@
// Découpage pour éviter dépassement de longueur de ligne
static const char MAIN_page[] =
"<!DOCTYPE html><html lang='fr'><head><meta charset='UTF-8'><meta name='viewport' content='width=device-width,initial-scale=1'>"
"<meta name='author' content='Clément Saillant (electron-rare)'>"
"<title>ESP32 P10 Clock</title><style>body{font-family:Arial,Helvetica,sans-serif;margin:0;padding:1rem;background:#111;color:#eee}"
"h1{text-align:center;color:#4caf50;font-size:1.4rem;margin:.2rem 0}fieldset{border:1px solid #333;border-radius:6px;margin:0 0 1rem;padding:.8rem}"
"legend{padding:0 .5rem;color:#4caf50;font-weight:bold}label{display:block;margin-top:.5rem;font-size:.85rem}"
@@ -16,5 +17,20 @@ static const char MAIN_page[] =
"<form id='scrollForm' onsubmit=\"return send('scrollForm')\"><fieldset><legend>Texte défilant</legend><input type='hidden' name='sta' value='setScrollingText'><label>Texte (150 max)<input name='input_Scrolling_Text' maxlength='150' value='ESP32 RGB CLOCK'></label><button>Enregistrer</button></fieldset></form>"
"<form id='modeForm' onsubmit=\"return send('modeForm')\"><fieldset><legend>Mode</legend><input type='hidden' name='sta' value='setDisplayMode'><label>Mode<select name='input_Display_Mode'><option value='1'>Statique</option><option value='2'>Cyclique</option></select></label><button>Appliquer</button></fieldset></form>"
"<form id='countForm' onsubmit=\"return send('countForm')\"><fieldset><legend>Countdown</legend><input type='hidden' name='sta' value='setCountdown'><label>Actif<select name='countdown_Active'><option value='false'>Non</option><option value='true'>Oui</option></select></label><div class='grid'><div><label>Année<input name='countdown_Year' type='number' min='2024' max='2099'></label></div><div><label>Mois<input name='countdown_Month' type='number' min='1' max='12'></label></div><div><label>Jour<input name='countdown_Day' type='number' min='1' max='31'></label></div><div><label>Heure<input name='countdown_Hour' type='number' min='0' max='23'></label></div><div><label>Minute<input name='countdown_Minute' type='number' min='0' max='59'></label></div><div><label>Seconde<input name='countdown_Second' type='number' min='0' max='59'></label></div></div><label>Titre<input name='countdown_Title' maxlength='50' value='NEW YEAR'></label><button>Appliquer Countdown</button></fieldset></form>"
"<div class='section-actions'><a class='link-btn' href='/settings?sta=resetSystem'>Redémarrer</a></div><div class='footer'>Firmware Web Minimal &copy; 2025</div></body></html>";
"<div class='section-actions'><a class='link-btn' href='/settings?sta=resetSystem'>Redémarrer</a></div><div class='footer'>Firmware Web Minimal &copy; 2025<br>Projet par Clément Saillant (<a href='https://github.com/electron-rare' style='color:#4caf50' target='_blank' rel='noopener'>electron-rare</a>)<br><a href='/about' style='color:#888'>À propos / Licence</a></div></body></html>";
static const char ABOUT_page[] =
"<!DOCTYPE html><html lang='fr'><head><meta charset='UTF-8'><title>À propos</title><style>body{font-family:Arial;background:#111;color:#eee;padding:1rem;line-height:1.4}a{color:#4caf50}code{background:#222;padding:2px 4px;border-radius:3px}</style></head><body>"
"<h1>À propos</h1>"
"<p><strong>Projet :</strong> ESP32 P10 RGB 32x16 Digital Clock (PlatformIO)</p>"
"<p><strong>Auteur :</strong> Clément Saillant (<a href='https://github.com/electron-rare' target='_blank' rel='noopener'>electron-rare</a>)</p>"
"<h2>Crédits</h2><ul>"
"<li>Panneau piloté via <em>PxMatrix</em></li>"
"<li>RTC via <em>RTClib</em> (Adafruit)</li>"
"<li>Rendu texte via <em>Adafruit GFX</em></li>"
"</ul>"
"<h2>Licence</h2><p>Ce projet est distribué sous licence MIT. Voir le fichier <code>LICENSE</code> dans le dépôt.</p>"
"<pre style='background:#222;padding:.7rem;border-radius:6px;overflow:auto;font-size:.7rem'>MIT License\n\nCopyright (c) 2025 Clément Saillant\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\n... (version abrégée, texte complet dans le dépôt) ...\n</pre>"
"<p><a href='/'>&larr; Retour</a></p>"
"</body></html>";
+14 -1
View File
@@ -49,6 +49,9 @@ static inline bool isFastBoot(){
#include <freertos/task.h>
#include <driver/timer.h>
// Version firmware globale
static const char* FIRMWARE_VERSION = "1.0.0"; // Modifier ici lors d'une nouvelle release
// Prototypes des tâches FreeRTOS
void DisplayTask(void *pvParameters);
void WebServerTask(void *pvParameters);
@@ -57,6 +60,7 @@ void WiFiTask(void *pvParameters);
// Prototypes des gestionnaires web
void handleRoot();
void handleSettings();
void handleAbout();
void handleCaptivePortal();
void handleNotFound();
@@ -481,6 +485,11 @@ void handleRoot() {
server.send(200, "text/html", MAIN_page);
}
// Page À propos
void handleAbout(){
server.send(200, "text/html", ABOUT_page);
}
// Gestionnaire des paramètres
void handleSettings() {
String incoming_Settings = server.arg("key");
@@ -759,6 +768,7 @@ void prepare_and_start_The_Server() {
// Routes principales
server.on("/", handleRoot);
server.on("/settings", handleSettings);
server.on("/about", handleAbout);
// Routes communes pour le portail captif
server.on("/generate_204", handleRoot); // Android
@@ -795,7 +805,10 @@ void setup() {
delay(isFastBoot() ? 100 : 1000);
Serial.begin(115200);
Serial.println("\n=== ESP32 P10 RGB Digital Clock ===");
Serial.println("Version: PlatformIO Compatible with Cascade Support");
Serial.print("Version: PlatformIO Compatible with Cascade Support - v");
Serial.println(FIRMWARE_VERSION);
Serial.println("Author: Clément Saillant (electron-rare) - https://github.com/electron-rare");
Serial.println("License: MIT");
// Affichage de la configuration des panneaux
Serial.println("\n--- Configuration Panneaux ---");