user67015: I am struggling through a program. I am trying to store my uploaded string into an array then write that array to EEPROM. I run the program, upload the new array and store it in the EEPROM. all values display correctly until I reset or power off the device. I am sure I am overwriting or something obvious, but i am breaking down and asking for help.
The read and write EEPROM subroutines are at the bottom of the code. I call the EEPROM_Write() in server.on after parsing the http get.
EDIT: per feedback, removed all but the function, with the EEPROM.commit(); suggestion included... still not working

void EEPROM_Write(){
Serial.begin(115200);
EEPROM.begin(280);
  // store values in EEPROM
  for (int i = 0; i < pwmarray1Size; i++)
  {
    Serial.println(pwmarray1[i]);
    EEPROM.put( EEPROMStartAdress + (i * sizeof pwmarray1[0]), pwmarray1[i]);
  }
  Serial.println();
  EEPROM.commit();
 // EEPROM.end();
}


user42015: The ESP has no real EEPROM. Instead the EEPROM class for ESPs uses the flash memory. There is a difference in the implementations of this class between Arduinos and ESPs:
On an ESP every data, that you write, will first be placed in a buffer in RAM. You  need to call EEPROM.commit() to actually write that data to the underlying flash memory.
So you need to add
EEPROM.commit();

to the end of your EEPROM_Write() function, or the data will stay in RAM and thus be lost on power cycle or reset.

I think your problem (besides the commit) lies not in your EEPROM_Write() function, but in the EEPROM_Read() function. If it doesn't work correctly, you are just not able to see, if the data gets written correctly. In your code (which can be seen in the edit history), you have this function:
void EEPROM_Read(){
   //load array pwmarray1 with stored values in EPROM
  for (int x = 0; x < pwmarray1Size; x++){
    EEPROM.get(EEPROMStartAdress + (x * sizeof pwmarray1[0]), pwmarray1[x]);
        Serial.print("loading program from EPROM: "); 
    Serial.println(pwmarray1[x]);
    }
}

While in EEPROM_Write() you are calling EEPROM.begin(280) every time, you don't EEPROM.end() it there and you are also not begin the EEPROM in the EEPROM_Read() function. I'm not sure about the underlying implementation, but it started to work for me, when I began and ended the EEPROM object in both functions.
I've written a test code, that I composed party of your code and that for me correctly saves and reads an array via the EEPROM object into the flash memory. It keeps the data over resets and power cycles just correctly. You can control it via Serial Monitor. Just type c (for clearing the array to zero), r (for reading the array from EEPROM/flash) or i (for incrementing all array elements and save them to EEPROM/flash).
#include <EEPROM.h>

#define EEPROM_SIZE 280

int array[60] = {0};
const unsigned arraySize = sizeof array / sizeof array[0];

#define EEPROMStartAdress 0

void setup(){
  Serial.begin(115200);
  Serial.println("///////////////////////////////////////");
  delay(2000);
}

void loop(){
  if(Serial.available()){
    char c = Serial.read();
    switch(c){
      case 'c':
        for(uint8_t i=0;i<arraySize;i++) array[i] = 0;
        EEPROM_Write();
        Serial.println("EEPROM RESET");
        break;
      case 'r':
        EEPROM_Read();
        break;
      case 'i':
        for(uint8_t i=0;i<arraySize;i++) array[i] += 1;
        EEPROM_Write();
        break;
    }
  }
}

void EEPROM_Write(){
  EEPROM.begin(EEPROM_SIZE);
  // store values in EEPROM
  for (int i = 0; i < arraySize; i++)
  {
    EEPROM.put( EEPROMStartAdress + (i * sizeof array[0]), array[i]);
  }
  EEPROM.commit();
  EEPROM.end();
}

void EEPROM_Read(){
  EEPROM.begin(EEPROM_SIZE);
  for (int x = 0; x < arraySize; x++){
    EEPROM.get(EEPROMStartAdress + (x * sizeof array[0]), array[x]);
    Serial.print(" ");
    Serial.print(array[x]);
    }
  Serial.println();
  EEPROM.end();
}

Removing begin() and end() from EEPROM_Read() and also end() from EEPROM_Write() gives me the same results, that you described as your problem.

67015: <p>I am struggling through a program. I am trying to store my uploaded string into an array then write that array to EEPROM. I run the program, upload the new array and store it in the EEPROM. all values display correctly until I reset or power off the device. I am sure I am overwriting or something obvious, but i am breaking down and asking for help.</p>

<p>The read and write EEPROM subroutines are at the bottom of the code. I call the EEPROM_Write() in server.on after parsing the http get.</p>

<p><em>EDIT: per feedback, removed all but the function, with the EEPROM.commit(); suggestion included... still not working</em>
</p>

<pre class="lang-cpp prettyprint-override"><code>void EEPROM_Write(){
Serial.begin(115200);
EEPROM.begin(280);
  // store values in EEPROM
  for (int i = 0; i &lt; pwmarray1Size; i++)
  {
    Serial.println(pwmarray1[i]);
    EEPROM.put( EEPROMStartAdress + (i * sizeof pwmarray1[0]), pwmarray1[i]);
  }
  Serial.println();
  EEPROM.commit();
 // EEPROM.end();
}
</code></pre>
 42015: <p>The ESP has no real EEPROM. Instead the <code>EEPROM</code> class for ESPs uses the flash memory. There is a difference in the implementations of this class between Arduinos and ESPs:</p>
<p>On an ESP every data, that you write, will first be placed in a buffer in RAM. You  need to call <code>EEPROM.commit()</code> to actually write that data to the underlying flash memory.</p>
<p>So you need to add</p>
<pre><code>EEPROM.commit();
</code></pre>
<p>to the end of your <code>EEPROM_Write()</code> function, or the data will stay in RAM and thus be lost on power cycle or reset.</p>
<hr />
<p>I think your problem (besides the commit) lies not in your <code>EEPROM_Write()</code> function, but in the <code>EEPROM_Read()</code> function. If it doesn't work correctly, you are just not able to see, if the data gets written correctly. In your code (which can be seen in the edit history), you have this function:</p>
<pre><code>void EEPROM_Read(){
   //load array pwmarray1 with stored values in EPROM
  for (int x = 0; x &lt; pwmarray1Size; x++){
    EEPROM.get(EEPROMStartAdress + (x * sizeof pwmarray1[0]), pwmarray1[x]);
        Serial.print(&quot;loading program from EPROM: &quot;); 
    Serial.println(pwmarray1[x]);
    }
}
</code></pre>
<p>While in <code>EEPROM_Write()</code> you are calling <code>EEPROM.begin(280)</code> every time, you don't <code>EEPROM.end()</code> it there and you are also not begin the EEPROM in the <code>EEPROM_Read()</code> function. I'm not sure about the underlying implementation, but it started to work for me, when I began and ended the <code>EEPROM</code> object in both functions.</p>
<p>I've written a test code, that I composed party of your code and that for me correctly saves and reads an array via the <code>EEPROM</code> object into the flash memory. It keeps the data over resets and power cycles just correctly. You can control it via Serial Monitor. Just type <code>c</code> (for clearing the array to zero), <code>r</code> (for reading the array from EEPROM/flash) or <code>i</code> (for incrementing all array elements and save them to EEPROM/flash).</p>
<pre><code>#include &lt;EEPROM.h&gt;

#define EEPROM_SIZE 280

int array[60] = {0};
const unsigned arraySize = sizeof array / sizeof array[0];

#define EEPROMStartAdress 0

void setup(){
  Serial.begin(115200);
  Serial.println(&quot;///////////////////////////////////////&quot;);
  delay(2000);
}

void loop(){
  if(Serial.available()){
    char c = Serial.read();
    switch(c){
      case 'c':
        for(uint8_t i=0;i&lt;arraySize;i++) array[i] = 0;
        EEPROM_Write();
        Serial.println(&quot;EEPROM RESET&quot;);
        break;
      case 'r':
        EEPROM_Read();
        break;
      case 'i':
        for(uint8_t i=0;i&lt;arraySize;i++) array[i] += 1;
        EEPROM_Write();
        break;
    }
  }
}

void EEPROM_Write(){
  EEPROM.begin(EEPROM_SIZE);
  // store values in EEPROM
  for (int i = 0; i &lt; arraySize; i++)
  {
    EEPROM.put( EEPROMStartAdress + (i * sizeof array[0]), array[i]);
  }
  EEPROM.commit();
  EEPROM.end();
}

void EEPROM_Read(){
  EEPROM.begin(EEPROM_SIZE);
  for (int x = 0; x &lt; arraySize; x++){
    EEPROM.get(EEPROMStartAdress + (x * sizeof array[0]), array[x]);
    Serial.print(&quot; &quot;);
    Serial.print(array[x]);
    }
  Serial.println();
  EEPROM.end();
}
</code></pre>
<p>Removing <code>begin()</code> and <code>end()</code> from <code>EEPROM_Read()</code> and also <code>end()</code> from <code>EEPROM_Write()</code> gives me the same results, that you described as your problem.</p>
