Compare commits
2 commits
f164212c74
...
97346c1b06
Author | SHA1 | Date | |
---|---|---|---|
Nicolas Schmauch | 97346c1b06 | ||
Nicolas Schmauch | e9d30f5f30 |
|
@ -22,13 +22,13 @@
|
||||||
#define CLUSTER "grappe3"
|
#define CLUSTER "grappe3"
|
||||||
#define SENSORS_NUMBER 5
|
#define SENSORS_NUMBER 5
|
||||||
#define DHT22 22
|
#define DHT22 22
|
||||||
//comment for the test part this is the good frequency
|
// comment for the test part this is the good frequency
|
||||||
#define TIME_TO_SLEEP 596
|
#define TIME_TO_SLEEP 596
|
||||||
//#define TIME_TO_SLEEP 28
|
// #define TIME_TO_SLEEP 28
|
||||||
#define US_TO_S_FACTOR 1000000
|
#define US_TO_S_FACTOR 1000000
|
||||||
#define R2 100
|
#define R2 100
|
||||||
#define R3 10
|
#define R3 10
|
||||||
#define VOLTAGE_OUT(Vin) (((Vin)*R3) / (R2 + R3))
|
#define VOLTAGE_OUT(Vin) (((Vin) * R3) / (R2 + R3))
|
||||||
#define VOLTAGE_MAX 4200
|
#define VOLTAGE_MAX 4200
|
||||||
#define VOLTAGE_MIN 3300
|
#define VOLTAGE_MIN 3300
|
||||||
#define ADC_REFERENCE 1100
|
#define ADC_REFERENCE 1100
|
||||||
|
@ -39,7 +39,7 @@
|
||||||
#define ADC_PIN 35
|
#define ADC_PIN 35
|
||||||
#define CONV_FACTOR 1.78
|
#define CONV_FACTOR 1.78
|
||||||
#define READS 20
|
#define READS 20
|
||||||
const long gmtOffset_sec = 3600;
|
const long gmtOffset_sec = 3600;
|
||||||
|
|
||||||
int getAverageChargeLevel();
|
int getAverageChargeLevel();
|
||||||
void setupMQTT(const char *address, int port);
|
void setupMQTT(const char *address, int port);
|
||||||
|
@ -62,8 +62,7 @@ std::tuple<int, int, int> getDate();
|
||||||
*/
|
*/
|
||||||
void writeMsg(char *txt, float *temp, float *hum, int number);
|
void writeMsg(char *txt, float *temp, float *hum, int number);
|
||||||
|
|
||||||
//timeClient.getEpochTime().toCharArray(date, 50); = convertir un string en char
|
// timeClient.getEpochTime().toCharArray(date, 50); = convertir un string en char
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
For test the esp32 signal emission without server Working/fixed/updated :
|
For test the esp32 signal emission without server Working/fixed/updated :
|
||||||
|
|
|
@ -470,7 +470,7 @@ void LocalSave()
|
||||||
|
|
||||||
Serial.print("\n-----------------Save---------------------\n");
|
Serial.print("\n-----------------Save---------------------\n");
|
||||||
|
|
||||||
for (int i = 0; i < 5; i++) // debut de la boucle pour récuperer les valeur dans le tableau puis les enregistrer
|
for (int i = 0; i < 5; i++) // Debut de la boucle pour récuperer les valeurs de la température et de l'humidité dans le tableau puis les enregistrer.
|
||||||
{
|
{
|
||||||
char Temp[5];
|
char Temp[5];
|
||||||
char Humi[5];
|
char Humi[5];
|
||||||
|
@ -480,12 +480,12 @@ void LocalSave()
|
||||||
preferences.putFloat("temp", newTemp);
|
preferences.putFloat("temp", newTemp);
|
||||||
preferences.putFloat("hum", newHum);
|
preferences.putFloat("hum", newHum);
|
||||||
|
|
||||||
Serial.printf("temp: %0.2f\n", newTemp); // print pour vérifier si les valeurs enregistrées sont les bonnes
|
Serial.printf("temp: %0.2f\n", newTemp); // print pour vérifier si les valeurs enregistrées sont les bonnes.
|
||||||
Serial.printf("hum: %0.2f\n", newHum);
|
Serial.printf("hum: %0.2f\n", newHum);
|
||||||
}
|
}
|
||||||
|
|
||||||
Serial.printf("time: %d \n", rawtime);
|
Serial.printf("time: %d \n", rawtime);
|
||||||
Serial.printf("chargelvl: %d\n", chargelvl); // print pour vérifier si les valeurs enregistrées sont les bonnes
|
Serial.printf("chargelvl: %d\n", chargelvl); // print pour vérifier si les valeurs enregistrées sont les bonnes.
|
||||||
preferences.putInt("time", rawtime);
|
preferences.putInt("time", rawtime);
|
||||||
preferences.putInt("chargelvl", chargelvl);
|
preferences.putInt("chargelvl", chargelvl);
|
||||||
preferences.end();
|
preferences.end();
|
||||||
|
|
Loading…
Reference in a new issue