Hi all,
could you please provide me with example how to catch jsonp request for certain sensor data in arduino and send the data to my server? I have been searching this last days but I didnt find any clear example how to do this. thx you
Hi all,
could you please provide me with example how to catch jsonp request for certain sensor data in arduino and send the data to my server? I have been searching this last days but I didnt find any clear example how to do this. thx you
(deleted)
matej:
catch jsonp request for certain sensor data in arduino and send the data to my server
Do you mean the Arduino is acting as an HTTP server and receiving an HTTP containing some JSON data? It would probably help you, as well as clarifying the problem for anyone trying to help you, if you explained where the Arduino fits within your overall solution, and the sequence of things that you intend to happen in terms of events happening at the boundary of your Arduino.
Ok I did more reserach and found that jsonp is not need because I can do json cross domain request simply by using
$('#container').load('http://google.com'); // SERIOUSLY!
$.ajax({
url: 'myarduinoip',
type: 'GET',
success: function(res) {
do stuff here...
}
});
I just want to have my web server not hosted by arduino. I want to read sensors data every 5 seconds without using any database just by using json requests.
I have never done this so all I know is how to send json request (cross domain) to arduino requesting sensor data.
I dont know what to do on arduino side. I think that arduino should be configured as a web server and my page will be a client.
If you could just help me how to handle json in arduino i would be very thankful.
If you want your client to retrieve data from the Arduino by making HTTP requests, your Arduino will be acting as a web server. There are plenty of examples showing how to host a web server on an Arduino. You would need to extract the request parameters from the HTTP request, get the data to be returned and then return it in the right format. That requires you to do some research to understand what the right format is.