user69980: this is my first Project on an ESP.
I found a Code for a coffee-grinder-timer, which is programmed for a ESP8266, but unfortunately meanwhile the Sonoff changed to the ESP8285 with internal Flash.
I presume this is the reason for a memory problem. By default the times are according to the code 1000ms and 2000ms, but on the WebPage are the following times are displayed:

Singleshot: 16711680ms
Doubleshot: 807611680ms

Beside this problem I can't change these values by pressing the save-button.
what is my mistake?
// Libraries
#include <ESP8266WiFi.h>
#include <ESP8266WebServer.h>
#include <TTBOUNCE.h>
#include <EEPROM.h>
extern "C" {
#include "user_interface.h"
}

//======SERVER PART======================================================
const char* ssid     = "SSID";
const char* password = "password";
ESP8266WebServer server ( 80 );
char htmlResponse[3000];
//======LOKALER PART======================================================
os_timer_t myTimer;
bool tickOccured;
bool timerrunning;
int RelaisPin = 13;                 // GPIO13 Blaue LED auf dem Sonoff
TTBOUNCE b = TTBOUNCE(0); 

int time_ss = 1000;
int time_ds = 2000;

void handleRoot() {

  snprintf ( htmlResponse, 3000,
"<!DOCTYPE html>\
<html lang=\"en\">\
  <head>\
    <meta charset=\"utf-8\">\
    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\
  </head>\
  <body>\
          <h1>Zeiten für Singleshot und Doubleshot</h1>\
          <h3>Singleshot: %d% ms </h3>\
          <input type='text' name='date_ss' id='date_ss' size=2 autofocus> ms \
          <h3>Doubleshot: %d% ms</h3>\
          <input type='text' name='date_ds' id='date_ds' size=2 autofocus> ms \
          <div>\
          <br><button id=\"save_button\">Save</button>\
          </div>\
    <script src=\"https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js\"></script>\    
    <script>\
      var ds;\
      var ss;\
      $('#save_button').click(function(e){\
        e.preventDefault();\
        ss = $('#date_ss').val();\
        ds = $('#date_ds').val();\        
        $.get('/save?ss=' + ss + '&ds=' + ds, function(data){\
          console.log(data);\
        });\
        location.reload();\
      });\      
    </script>\
  </body>\
</html>",

time_ss,
time_ds
); 

   server.send ( 200, "text/html", htmlResponse );  

}


void handleSave() {
  if (server.arg("ss")!= ""){
    Serial.println("Singleshot: " + server.arg("ss"));
    time_ss = server.arg("ss").toInt();
    eeWriteInt(0, server.arg("ss").toInt());
  }
    if (server.arg("ds")!= ""){
    Serial.println("Doubleshot: " + server.arg("ds"));
    time_ds = server.arg("ds").toInt();
    eeWriteInt(4, server.arg("ds").toInt());
  }
  
}

// start of timerCallback
void timerCallback(void *pArg) {
Serial.println("Tick OccurredCB");
      tickOccured = true;
}

void setup() {
//======SERVER PART======================================================
  // Start serial
  Serial.begin(115200);
  delay(100);
WiFi.mode(WIFI_STA);
  // Connecting to a WiFi network
  Serial.println();
  Serial.println();
  Serial.print("Connecting to ");
  Serial.println(ssid);

  WiFi.begin(ssid, password);

  while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    Serial.print(".");
  }

  Serial.println("");
  Serial.println("WiFi connected");  
  Serial.println("IP address: ");
  Serial.println(WiFi.localIP());

  server.on ( "/", handleRoot );
  server.on ("/save", handleSave);

  server.begin();
  Serial.println ( "HTTP server started" );
//======LOKALER PART======================================================
  os_timer_setfn(&myTimer, timerCallback, NULL);
  pinMode(RelaisPin, OUTPUT);       // GPIO13 als Ausgang definieren
  b.attachClick(click);         //attach the click method to the click event
  b.attachDoubleClick(doubleClick);//attach the double click method to the double click event
  b.attachPress(press);        //attach the press method to the press event
  delay(50);
  digitalWrite(RelaisPin, HIGH);  // turn LED ON
  tickOccured = false;
  timerrunning = false;
   EEPROM.begin(8);  //Initialize EEPROM 
   time_ss = eeGetInt(0);
   time_ds = eeGetInt(4);
}

void loop() {
//======SERVER PART======================================================
  server.handleClient();
//======LOKALER PART======================================================
  b.update();
  delay(10);

   if (tickOccured == true)
 {
    Serial.println("Timer ausgelaufen");
    tickOccured = false;
    digitalWrite(RelaisPin, HIGH);
    os_timer_disarm(&myTimer);
    timerrunning = false;
 }
 
 yield();  // or delay(0);
}


void click(){
  if (!timerrunning)
  {
    Serial.println("Clicked");
    digitalWrite(RelaisPin, LOW);  // turn LED ON
    os_timer_arm(&myTimer, time_ss, false);
    timerrunning = true;
  }
  else
    {
    Serial.println("ABORT!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
    tickOccured = false;
    digitalWrite(RelaisPin, HIGH);
    os_timer_disarm(&myTimer);
    timerrunning = false;
    }
}

void doubleClick(){
    if (!timerrunning)
  {
    Serial.println("DoubleClicked");
    digitalWrite(RelaisPin, LOW);  // turn LED ON
    os_timer_arm(&myTimer, time_ds, false);
    timerrunning = true;
  }
    else
    {
    Serial.println("ABORT!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
    tickOccured = false;
    digitalWrite(RelaisPin, HIGH);
    os_timer_disarm(&myTimer);
    timerrunning = false;
    }
}

void press(){
  if (!timerrunning)
  {
    Serial.println("long_Clicked");
    digitalWrite(RelaisPin, LOW);  // turn LED ON
    os_timer_arm(&myTimer, time_ds-time_ss, false);
    timerrunning = true;
  }
 else
    {
    Serial.println("ABORT!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
    tickOccured = false;
    digitalWrite(RelaisPin, HIGH);
    os_timer_disarm(&myTimer);
    timerrunning = false;
    }
}

 void eeWriteInt(int pos, int val) {
    byte* p = (byte*) &val;
    EEPROM.write(pos, *p);
    EEPROM.write(pos + 1, *(p + 1));
    EEPROM.write(pos + 2, *(p + 2));
    EEPROM.write(pos + 3, *(p + 3));
    EEPROM.commit();
}

int eeGetInt(int pos) {
  int val;
  byte* p = (byte*) &val;
  *p        = EEPROM.read(pos);
  *(p + 1)  = EEPROM.read(pos + 1);
  *(p + 2)  = EEPROM.read(pos + 2);
  *(p + 3)  = EEPROM.read(pos + 3);
  return val;
}


user70020: At least one problem is this:
          <h3>Singleshot: %d% ms </h3>\

If you want a literal percent sign, you would need to double it, a form of escaping:
          <h3>Singleshot: %d%% ms </h3>\

It's not entirely clear how this implementation of snprintf handles %<space>, but experiments here show that it isn't being forgiving and merely interpreting it as %%.
In C and C++ and by proxy "arduino", adjacent string literals are concatenated at compile time into one logical string literal, so you can do that rather than \, which you may find cleaner.
It should also be possible to just .print the chunks of your payload to the stream rather than to cobble together one large string as a payload.

69980: <p>this is my first Project on an ESP.
I found a Code for a coffee-grinder-timer, which is programmed for a ESP8266, but unfortunately meanwhile the Sonoff changed to the ESP8285 with internal Flash.
I presume this is the reason for a memory problem. By default the times are according to the code 1000ms and 2000ms, but on the WebPage are the following times are displayed:</p>
<ul>
<li>Singleshot: 16711680ms</li>
<li>Doubleshot: 807611680ms</li>
</ul>
<p>Beside this problem I can't change these values by pressing the save-button.
what is my mistake?</p>
<pre><code>// Libraries
#include &lt;ESP8266WiFi.h&gt;
#include &lt;ESP8266WebServer.h&gt;
#include &lt;TTBOUNCE.h&gt;
#include &lt;EEPROM.h&gt;
extern &quot;C&quot; {
#include &quot;user_interface.h&quot;
}

//======SERVER PART======================================================
const char* ssid     = &quot;SSID&quot;;
const char* password = &quot;password&quot;;
ESP8266WebServer server ( 80 );
char htmlResponse[3000];
//======LOKALER PART======================================================
os_timer_t myTimer;
bool tickOccured;
bool timerrunning;
int RelaisPin = 13;                 // GPIO13 Blaue LED auf dem Sonoff
TTBOUNCE b = TTBOUNCE(0); 

int time_ss = 1000;
int time_ds = 2000;

void handleRoot() {

  snprintf ( htmlResponse, 3000,
&quot;&lt;!DOCTYPE html&gt;\
&lt;html lang=\&quot;en\&quot;&gt;\
  &lt;head&gt;\
    &lt;meta charset=\&quot;utf-8\&quot;&gt;\
    &lt;meta name=\&quot;viewport\&quot; content=\&quot;width=device-width, initial-scale=1\&quot;&gt;\
  &lt;/head&gt;\
  &lt;body&gt;\
          &lt;h1&gt;Zeiten für Singleshot und Doubleshot&lt;/h1&gt;\
          &lt;h3&gt;Singleshot: %d% ms &lt;/h3&gt;\
          &lt;input type='text' name='date_ss' id='date_ss' size=2 autofocus&gt; ms \
          &lt;h3&gt;Doubleshot: %d% ms&lt;/h3&gt;\
          &lt;input type='text' name='date_ds' id='date_ds' size=2 autofocus&gt; ms \
          &lt;div&gt;\
          &lt;br&gt;&lt;button id=\&quot;save_button\&quot;&gt;Save&lt;/button&gt;\
          &lt;/div&gt;\
    &lt;script src=\&quot;https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js\&quot;&gt;&lt;/script&gt;\    
    &lt;script&gt;\
      var ds;\
      var ss;\
      $('#save_button').click(function(e){\
        e.preventDefault();\
        ss = $('#date_ss').val();\
        ds = $('#date_ds').val();\        
        $.get('/save?ss=' + ss + '&amp;ds=' + ds, function(data){\
          console.log(data);\
        });\
        location.reload();\
      });\      
    &lt;/script&gt;\
  &lt;/body&gt;\
&lt;/html&gt;&quot;,

time_ss,
time_ds
); 

   server.send ( 200, &quot;text/html&quot;, htmlResponse );  

}


void handleSave() {
  if (server.arg(&quot;ss&quot;)!= &quot;&quot;){
    Serial.println(&quot;Singleshot: &quot; + server.arg(&quot;ss&quot;));
    time_ss = server.arg(&quot;ss&quot;).toInt();
    eeWriteInt(0, server.arg(&quot;ss&quot;).toInt());
  }
    if (server.arg(&quot;ds&quot;)!= &quot;&quot;){
    Serial.println(&quot;Doubleshot: &quot; + server.arg(&quot;ds&quot;));
    time_ds = server.arg(&quot;ds&quot;).toInt();
    eeWriteInt(4, server.arg(&quot;ds&quot;).toInt());
  }
  
}

// start of timerCallback
void timerCallback(void *pArg) {
Serial.println(&quot;Tick OccurredCB&quot;);
      tickOccured = true;
}

void setup() {
//======SERVER PART======================================================
  // Start serial
  Serial.begin(115200);
  delay(100);
WiFi.mode(WIFI_STA);
  // Connecting to a WiFi network
  Serial.println();
  Serial.println();
  Serial.print(&quot;Connecting to &quot;);
  Serial.println(ssid);

  WiFi.begin(ssid, password);

  while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    Serial.print(&quot;.&quot;);
  }

  Serial.println(&quot;&quot;);
  Serial.println(&quot;WiFi connected&quot;);  
  Serial.println(&quot;IP address: &quot;);
  Serial.println(WiFi.localIP());

  server.on ( &quot;/&quot;, handleRoot );
  server.on (&quot;/save&quot;, handleSave);

  server.begin();
  Serial.println ( &quot;HTTP server started&quot; );
//======LOKALER PART======================================================
  os_timer_setfn(&amp;myTimer, timerCallback, NULL);
  pinMode(RelaisPin, OUTPUT);       // GPIO13 als Ausgang definieren
  b.attachClick(click);         //attach the click method to the click event
  b.attachDoubleClick(doubleClick);//attach the double click method to the double click event
  b.attachPress(press);        //attach the press method to the press event
  delay(50);
  digitalWrite(RelaisPin, HIGH);  // turn LED ON
  tickOccured = false;
  timerrunning = false;
   EEPROM.begin(8);  //Initialize EEPROM 
   time_ss = eeGetInt(0);
   time_ds = eeGetInt(4);
}

void loop() {
//======SERVER PART======================================================
  server.handleClient();
//======LOKALER PART======================================================
  b.update();
  delay(10);

   if (tickOccured == true)
 {
    Serial.println(&quot;Timer ausgelaufen&quot;);
    tickOccured = false;
    digitalWrite(RelaisPin, HIGH);
    os_timer_disarm(&amp;myTimer);
    timerrunning = false;
 }
 
 yield();  // or delay(0);
}


void click(){
  if (!timerrunning)
  {
    Serial.println(&quot;Clicked&quot;);
    digitalWrite(RelaisPin, LOW);  // turn LED ON
    os_timer_arm(&amp;myTimer, time_ss, false);
    timerrunning = true;
  }
  else
    {
    Serial.println(&quot;ABORT!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!&quot;);
    tickOccured = false;
    digitalWrite(RelaisPin, HIGH);
    os_timer_disarm(&amp;myTimer);
    timerrunning = false;
    }
}

void doubleClick(){
    if (!timerrunning)
  {
    Serial.println(&quot;DoubleClicked&quot;);
    digitalWrite(RelaisPin, LOW);  // turn LED ON
    os_timer_arm(&amp;myTimer, time_ds, false);
    timerrunning = true;
  }
    else
    {
    Serial.println(&quot;ABORT!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!&quot;);
    tickOccured = false;
    digitalWrite(RelaisPin, HIGH);
    os_timer_disarm(&amp;myTimer);
    timerrunning = false;
    }
}

void press(){
  if (!timerrunning)
  {
    Serial.println(&quot;long_Clicked&quot;);
    digitalWrite(RelaisPin, LOW);  // turn LED ON
    os_timer_arm(&amp;myTimer, time_ds-time_ss, false);
    timerrunning = true;
  }
 else
    {
    Serial.println(&quot;ABORT!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!&quot;);
    tickOccured = false;
    digitalWrite(RelaisPin, HIGH);
    os_timer_disarm(&amp;myTimer);
    timerrunning = false;
    }
}

 void eeWriteInt(int pos, int val) {
    byte* p = (byte*) &amp;val;
    EEPROM.write(pos, *p);
    EEPROM.write(pos + 1, *(p + 1));
    EEPROM.write(pos + 2, *(p + 2));
    EEPROM.write(pos + 3, *(p + 3));
    EEPROM.commit();
}

int eeGetInt(int pos) {
  int val;
  byte* p = (byte*) &amp;val;
  *p        = EEPROM.read(pos);
  *(p + 1)  = EEPROM.read(pos + 1);
  *(p + 2)  = EEPROM.read(pos + 2);
  *(p + 3)  = EEPROM.read(pos + 3);
  return val;
}
</code></pre>
 70020: <p>At least one problem is this:</p>
<pre><code>          &lt;h3&gt;Singleshot: %d% ms &lt;/h3&gt;\
</code></pre>
<p>If you want a literal percent sign, you would need to double it, a form of escaping:</p>
<pre><code>          &lt;h3&gt;Singleshot: %d%% ms &lt;/h3&gt;\
</code></pre>
<p>It's not entirely clear how this implementation of snprintf handles %&lt;space&gt;, but experiments here show that it isn't being forgiving and merely interpreting it as %%.</p>
<p>In C and C++ and by proxy &quot;arduino&quot;, adjacent string literals are concatenated at compile time into one logical string literal, so you can do that rather than \, which you may find cleaner.</p>
<p>It should also be possible to just .print the chunks of your payload to the stream rather than to cobble together one large string as a payload.</p>
