Web Server Content with string array

ats3788
Posts: 27
Joined: Thu Feb 01, 2018 10:12 am

Web Server Content with string array

Postby ats3788 » Thu Feb 01, 2018 7:09 pm

Hello I try to setup a web server

Something like this works

client.println(HTML_Header[0]);
client.println(HTML_Header[1]);
client.println(HTML_Header[2]);
client.println(HTML_Header[3]);
client.println(HTML_Header[4]);


In a loop like this it's causing a reboot of the ESP32
for(i=0; i<5; i++)
{
client.println(HTML_Header);
}

To do this Serial.println(HTML_Header);
is working

I had the same Problem with the ESP8266

How can I use a String Array in the

ESP_Sprite
Posts: 9764
Joined: Thu Nov 26, 2015 4:08 am

Re: Web Server Content with string array

Postby ESP_Sprite » Fri Feb 02, 2018 3:15 am

Moved General Discussion -> Arduino

ats3788
Posts: 27
Joined: Thu Feb 01, 2018 10:12 am

Re: Web Server Content with string array

Postby ats3788 » Fri Feb 02, 2018 4:20 pm

Hi solved the Problem with using sts:string Class
and every string has less then 30 chars like


std::string HTML_Header[] = { "<!doctype html>",
"<html>",
"<head>",
"<title>Temperature and",
" Humititdy Server</title>",
"<meta charset= \"UTF-8\">"

I don't know if that is working witch char arrays but i think it should

Who is online

Users browsing this forum: No registered users and 126 guests