Go Down

Topic: Plant watering system problem (Read 184 times) previous topic - next topic

Gorkde

Jul 14, 2019, 11:13 pm Last Edit: Jul 14, 2019, 11:31 pm by Gorkde
Something must be wrong with my EEProm routines.....

I had my watering system running for 3 or 4 days and it watered as id shoul but reported an Error today.
Error is reported when the sensor is below a certain minimum treshold or broken OR when he waters 5 times and the sensor does not register a higher wetness than the first time (broken water pipe or dropped from the pot).

So I disconnected it to watchthe EEprom recordings on PC.

I did set the READ flag and uploaded. But in the SerialPlotter it shows water going up always (far more as possible for the seldom times he watered) until it reached max (255).

- So am I right EEprom is not touched when uploading the changed sketch (changed EERead Flag)?

- What is wrong then with my EEprom routines?

- And why was he reporting an wetness Error 5 Times after it worked for 3 days as it should and the pot was wet as I looked?

Any Ideas?



Attached the serial plot with remarks



OH WOW!
I can't post the full code because only 9000 chars are allowed......
So here are only my EEProm routines then.

How can I post the full sketch?


Code: [Select]

void EE_WriteCalib(int CalibWert) {
  EEPROM.update(EECalib, map(CalibWert, 0, 1023, 0, 255));            // Mappe Kalibration von 1024 auf 256 und schreibe in Speicher für Kalibration
}

void EE_WriteValue(int MessWert) {                                    // Schreibt gemessenen Wert ins EEProm
  EEPROM.update(EEWriteAdress, map(MessWert, 0, 1023, 0, 255));       // Mappe Messwert von 1024 auf 256 und schreibe in Speicher
  EEWriteAdress++;                                                    // Adresse hochzählen
  if (EEWriteAdress == EEPROM.length()) {
    // EEWriteAdress = EEData;                                           // Adresse zurücksetzen und von vorne beginnen mit Aufzeichnen oder
    EE_Enable = LOW;                                                  // Aufzeichnung stoppen
  }
}

void EE_SerialPrint() {
  
  // Startstrich im Serial Plotter erzeugen
  Serial.println(255);
  Serial.println(0);
  
  // Daten ausgeben
  for (int i = EEData; i < EEPROM.length(); i++) {                    // Gebe Daten aus von Startwert bis Ende EEProm
    Serial.print(EEPROM.read(i));                                     // Anzeige gelesener Messwert
    Serial.print(" ");                                                // Trennung damit 2. Graph mit Messdaten erstellt wird
    Serial.println(EEPROM.read(EECalib));                             // Kalibrationswert ausgeben
    BlinkPowerEERead();                                               // EEProm "Widergabe aktiviert" Anzeige auf Power LED
    delay(EE_ReadDelay);                                              // Verzögerung vor Ausgabe nächster Wert
  }
}

AWOL

Quote
OH WOW!
So, attach your code.

Gorkde

just edited
 I cant post all becase more than 9000 chars

AWOL

I cant post all becase more than 9000 chars
So, attach your code

Gorkde

#4
Jul 14, 2019, 11:37 pm Last Edit: Jul 15, 2019, 10:38 pm by Gorkde
Ah okkkkkk.... Did not know....

Might be the EERead flag is still set here but was'nt while working and recording. The LED flashes for recording until I got the error.

Also attached the SerialPlot with remarks in the first post while editing it.

Gorkde


Gorkde

I think I found the problem he was only writing to the EEProm he was watering but not when the wetness was ok.

Go Up