Fetching data from Node.Js Server
i want fetch json data(time , date) node.js server esp8266-01 using http method.
i have used software serial definition as
#include<softwareserial.h>
softwareserial ser(a8,a9); // connect tx , rx of esp8266 (a8 for tx a9 rx) of atmega2560.
in code have written
ser.print(string("get ") + "/details http/1.1/\r\n" +
"192.168.1.11"+ "\r\n" +
"connection: close\r\n\r\n");
// read lines of reply server , print them serial
serial.println("respond:");
while(ser.available()){
string line = ser.readstringuntil('\r');
serial.print(line);
}
serial.println();
serial.println("closing connection");
where ser defined function esp8266-01
192.168.1.11 local server ip address have fetch json data(data , time in case).
but not able fetch date , time data.
thank you.
i have used software serial definition as
#include<softwareserial.h>
softwareserial ser(a8,a9); // connect tx , rx of esp8266 (a8 for tx a9 rx) of atmega2560.
in code have written
ser.print(string("get ") + "/details http/1.1/\r\n" +
"192.168.1.11"+ "\r\n" +
"connection: close\r\n\r\n");
// read lines of reply server , print them serial
serial.println("respond:");
while(ser.available()){
string line = ser.readstringuntil('\r');
serial.print(line);
}
serial.println();
serial.println("closing connection");
where ser defined function esp8266-01
192.168.1.11 local server ip address have fetch json data(data , time in case).
but not able fetch date , time data.
thank you.
what rest service url defined in node js?
post whole code, if code contains other logics create new code show issue.
post whole code, if code contains other logics create new code show issue.
Arduino Forum > Using Arduino > Project Guidance > Fetching data from Node.Js Server
arduino
Comments
Post a Comment