Do you have control over the format of the data being sent? Could you add a prefix to the temperature so that the last line becomes, for example:
temp=29<span> ...
If so, and if you have the data in a C string (e.g. char buffer[MAX_STR_LEN]), you could use the functions strstr() and atoi() to find the "temp=" tag, move past it and convert the temperature string to an integer.
Do you have any code written so far to receive this HTML? If so, please post it.
First off all I doesn't have control to this data format. I am using ESP8266 module as I said and I am sending very simple AT commands to receive this data...
AT+CIPMUX=1
AT+CIPSTART=0,"TCP","IPADDRESS",PORT
AT+CIPSEND=0,96
and then> GET "WebsiteAddress" HTTP/1.0
after that I get this data... I can't add prefix or suffix around temp value, but is there another way to read it???
Another thing. This data contains every time 567 characters. When temp is e.g. 5, it contains 566 characters or if temp is e.g -20, it contains 568 characters.
Daduka:
ThingSpeak. I am getting this HTML output:
That is a HTTP response you get after sending a HTTP request.
And a HTTP response consists of
HTTP header lines (multiple lines)
one empty line (which signals the end of the HTTP header)
contents of what you requested (the contents transmitted by HTTP protocol)
So it's clear what you have to do:
skip header lines until the first empty line
read the contents following the empty line
If you want to be 'fail safe' then also check for "200 OK" in the first header line of the response code. It's the server status code of what will follow, and only if the status code is "200 OK" you will get what you have requested.
Can you please type for me code for that? I am trying to write something but no luck... Please help me I am beginner in ARDUINO programming and your help will give me good experience
Daduka:
Can you please type for me code for that? I am trying to write something but no luck... Please help me I am beginner in ARDUINO programming and your help will give me good experience
If you would consider posting the working code so far, then I might consider writing some additional code for that existing sketch to read out the data from the "+IPD" response code.
But I won't write a completely new sketch for you.