-->
Page 1 of 2

HTML code problem using a 8266NodeMCU 12e and Arduino

PostPosted: Sun Nov 05, 2017 1:51 pm
by Meathome2017
I am trying to get a webpage to auto refresh after a period of one minute to resend the temperature and humidity. The hardware I’m using DHT 22 and I have no problems sending out to the serial monitor every minute but fail miserably trying to write some HTML to send it out as a webpage, the code I’m trying to use is: <meta http-equiv=”refresh” content=”5" /> but then I received an error

client.println("<meta http-equiv="refresh" content="10" ">);
^
exit status 1
expected ')' before 'refresh'
I thought was very standard HTML code but being so new I must be missing something very obvious.
Can any of you guys and girls point me in the right direction.
Thanking you in advance
PS this is my first post so please excuse me if I put it in the wrong place

Re: HTML code problem using a 8266NodeMCU 12e and Arduino

PostPosted: Tue Nov 07, 2017 11:58 pm
by gdsports
Escape the double quotes inside the string.

Code: Select allclient.println("<meta http-equiv=\"refresh\" content=\"10\"">);

Re: HTML code problem using a 8266NodeMCU 12e and Arduino

PostPosted: Wed Nov 08, 2017 9:42 am
by Meathome2017
I did try it as you posted but I now get
DHT22_WiFi_NoLed:78: error: expected primary-expression before ')' token
client.println("<meta http-equiv=\"refresh\" content=\"10\"">);
^
exit status 1
expected primary-expression before ')' token

Any more thoughts?

Re: HTML code problem using a 8266NodeMCU 12e and Arduino

PostPosted: Wed Nov 08, 2017 9:44 am
by Meathome2017
I did try it as you posted but I now get
[code
DHT22_WiFi_NoLed:78: error: expected primary-expression before ')' token
client.println("<meta http-equiv=\"refresh\" content=\"10\"">);
^
exit status 1
expected primary-expression before ')' token
]/code]

Any more thoughts?