Skip to main content
Tweeted twitter.com/StackArduino/status/773980252657840128
added 61 characters in body
Source Link
user1424508
  • 397
  • 1
  • 3
  • 9

Hi i'm trying to parse JSON resposne from webserver in my arduino in order to turn on and off a LED light. I'm using the wifi client repeating example to make a get request to my server:

http://arduino.cc/en/Tutorial/WiFiWebClientRepeating

Here is the portion wherewhat I make the GET request and it prints the JSON resposne toget printed back from the serial port:

clientconnecting.println("GET /abc/bze/ ..
HTTP/1.1");1 200 OK
client.println("HostDate: wwwSun, 06 Apr 2014 01:14:37 GMT
Server: Apache
X-Powered-By: PHP/5.abc5.ca");10
client.println("UserCache-AgentControl: ArduinoWiFino-cache
X-Frame-Options: SAMEORIGIN
Set-Cookie: expires=Sun, 06-Apr-2014 03:14:37 GMT; Max-Age=7200; path=/1.1"); httponly
client.println("ConnectionConnection: close");close
client.println();Transfer-Encoding: chunked

My JSON looks like this

Content-Type: application/json

19
{"lightstatus":"on"}
0

However, howHow do i parse the JSON portion of this response only so that I can use it to control my LED?

Thanks

Hi i'm trying to parse JSON resposne from webserver in my arduino in order to turn on and off a LED light. I'm using the wifi client repeating example to make a get request to my server:

http://arduino.cc/en/Tutorial/WiFiWebClientRepeating

Here is the portion where I make the GET request and it prints the JSON resposne to the serial port:

client.println("GET /abc/bze/ HTTP/1.1");
client.println("Host: www.abc.ca");
client.println("User-Agent: ArduinoWiFi/1.1");
client.println("Connection: close");
client.println();

My JSON looks like this

{"lightstatus":"on"}

However, how do i parse the JSON response only so that I can use it to control my LED?

Thanks

Hi i'm trying to parse JSON resposne from webserver in my arduino in order to turn on and off a LED light. I'm using the wifi client repeating example to make a get request to my server:

http://arduino.cc/en/Tutorial/WiFiWebClientRepeating

Here is what I get printed back from the serial port

connecting...
HTTP/1.1 200 OK
Date: Sun, 06 Apr 2014 01:14:37 GMT
Server: Apache
X-Powered-By: PHP/5.5.10
Cache-Control: no-cache
X-Frame-Options: SAMEORIGIN
Set-Cookie: expires=Sun, 06-Apr-2014 03:14:37 GMT; Max-Age=7200; path=/; httponly
Connection: close
Transfer-Encoding: chunked
Content-Type: application/json

19
{"lightstatus":"on"}
0

How do i parse the JSON portion of this response only so that I can use it to control my LED?

Thanks

deleted 19 characters in body
Source Link
sachleen
  • 7.6k
  • 5
  • 40
  • 57

Hi i'm trying to parse JSON resposne from webserver in my arduino in order to turn on and off a LED light. I'm using the wifi client repeating example to make a get request to my server:

http://arduino.cc/en/Tutorial/WiFiWebClientRepeating

Here is the portion where I make the GET request and it prints the JSON resposne to the serial port:

   client.println("GET /abc/bze/ HTTP/1.1");
    client.println("Host: www.abc.ca");
    client.println("User-Agent: ArduinoWiFi/1.1");
    client.println("Connection: close");
    client.println();

My JSON looks like this

{"lightstatus":"on"}

However, how do i parse the JSON response only so that I can use it to control my LED?

Thanks

Hi i'm trying to parse JSON resposne from webserver in my arduino in order to turn on and off a LED light. I'm using the wifi client repeating example to make a get request to my server:

http://arduino.cc/en/Tutorial/WiFiWebClientRepeating

Here is the portion where I make the GET request and it prints the JSON resposne to the serial port:

   client.println("GET /abc/bze/ HTTP/1.1");
    client.println("Host: www.abc.ca");
    client.println("User-Agent: ArduinoWiFi/1.1");
    client.println("Connection: close");
    client.println();

My JSON looks like this

{"lightstatus":"on"}

However, how do i parse the JSON response only so that I can use it to control my LED?

Thanks

Hi i'm trying to parse JSON resposne from webserver in my arduino in order to turn on and off a LED light. I'm using the wifi client repeating example to make a get request to my server:

http://arduino.cc/en/Tutorial/WiFiWebClientRepeating

Here is the portion where I make the GET request and it prints the JSON resposne to the serial port:

client.println("GET /abc/bze/ HTTP/1.1");
client.println("Host: www.abc.ca");
client.println("User-Agent: ArduinoWiFi/1.1");
client.println("Connection: close");
client.println();

My JSON looks like this

{"lightstatus":"on"}

However, how do i parse the JSON response only so that I can use it to control my LED?

Thanks

Source Link
user1424508
  • 397
  • 1
  • 3
  • 9

Parse JSON with arduino to turn on LED

Hi i'm trying to parse JSON resposne from webserver in my arduino in order to turn on and off a LED light. I'm using the wifi client repeating example to make a get request to my server:

http://arduino.cc/en/Tutorial/WiFiWebClientRepeating

Here is the portion where I make the GET request and it prints the JSON resposne to the serial port:

   client.println("GET /abc/bze/ HTTP/1.1");
    client.println("Host: www.abc.ca");
    client.println("User-Agent: ArduinoWiFi/1.1");
    client.println("Connection: close");
    client.println();

My JSON looks like this

{"lightstatus":"on"}

However, how do i parse the JSON response only so that I can use it to control my LED?

Thanks