Esp 8266 reading time

Ok, so i'm building a automatic dog feeder through wifi and I have a ESP8266 D1 mini with a code on it that basically just connects to wifi and acts as a server. So basically what I want to achieve is that I can set the feed timer through wifi and don't have to change the code, but I only type it into the search bar.
when I want to command the board to do something I type into the search bar something like this:
http://192.168.43.136:8085/3?key=666666 where "/3" == the command number
in this case the number 3 means 3 blinks of the boards built in led.

The code for it looks something like this:

server.on("/3", [](){
      if(server.arg(0) == web_password) {
      digitalWrite(LED_BUILTIN, LOW);
      delay(2000);
      digitalWrite(LED_BUILTIN, HIGH);
      delay(2000);
      digitalWrite(LED_BUILTIN, LOW);
      delay(2000);
      digitalWrite(LED_BUILTIN, HIGH);
      delay(2000);
      digitalWrite(LED_BUILTIN, LOW);
      delay(2000);
      digitalWrite(LED_BUILTIN, HIGH);
      delay(2000);
      server.send(200, "text/plain", "Blink 3x");
    } else {
      server.send(200, "text/plain", "Fail 3");
    }
  });

Is it somehow possible to read that command number and save it into some variable?
Something like this:

192.168.43.136:8085/2542?key=666666
int x = 2542

so if I wanted to set the time of feeding what I would type into the search bar would be:

http://192.168.43.136:8085/202202120933?key=666666

and the board would know that:
year = 2022
month = 02
day = 12
hour = 09
minute = 33

Or what would u think would be the best way to do something like this?

Sorry if I didn't explain everything very good, I'm not very experienced in arduino and this is like a learning project for me.

thanks

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.