ESP32 details on webpage

Im trying to add information to a webpage. Im going down the route of processor and placeholders.

A basic item i am trying to output onto the webpage is ETH.locaIP for example.

I am trying to convert ETH.localIP to a string using this

String IPx;
IPx = ETH.localIP().toString();

then was hoping to use this:

 processor(const String& var){
  if(var == "IPTEST"){
    return IPx;
  }}

Then use %IPTEST% in the HTML.

I am using PROGMEM = R"rawliteral method for all webpages

The error i get is
IPx = ETH.localIP().toString();
^~~
exit status 1
Compilation error: 'IPx' does not name a type

Is there another method and where am i going wrong? once i can handle one i can deal with the rest.

What more could information could you possibly need?

Basically i need ETH.localIP() to show on webpage

I cam calling the page using :

  server.on("/testing", HTTP_GET, [](AsyncWebServerRequest *request){
    request->send_P(200, "text/html", testing_html, processor);
  });

are there any simple examples to show a value on a website

All of the error message would be useful to.

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