• Skip to main content
  • Skip to primary sidebar

RNTLab.com

The Ultimate Shortcut to Learn Electronics and Programming with Open Source Hardware and Software

  • Courses
  • Forum
    • Forum
    • Ask Question
  • Shop
  • Account
  • Blog
  • Login

how to use GET to put analog value (digitalized) into a Server ?

Q&A Forum › Category: ESP8266 › how to use GET to put analog value (digitalized) into a Server ?
0 Vote Up Vote Down
Hugo Articardi Calabrese asked 7 years ago

Hi Rui.
Congratulatios for your course !
I’m writing from the south of the world…
Let me ask a question…please.
I want to use an ESP to sample an analog signal (200 times a second) an send it to a Server I have hosted in Amazon.
Can you please explain the basic use of GET or POST ?
Also, do you think is posible to to send information without loosing data while sending ? ( I mean during transmition can I sample ?)
Thanks in advance Best Regards. Hugo.
 

6 Answers
0 Vote Up Vote Down
Rui Santos Staff answered 7 years ago

Hi Hugo,
During the transmission, you cannot be reading new values with your ESP32. After a complete HTTP GET or POST request, you can keep reading more values…
But how many HTTP requests do you want to send to your Amazon server per second?
This page explains the difference between the HTTP methods POST vs GET.
In summary, an HTTP POST request sends the information that you want to send to your server in the body of the request.

POST /test/demo_form.php HTTP/1.1
Host: w3schools.com
name1=value1&name2=value2

An HTTP GET request sends the information in the URL (your values are directly inserted in the URL):

/test/demo_form.php?name1=value1&name2=value2

If you are just sending readings, you can choose any method. If you are sending sensitive data or readings, you should only use the POST method.
I hope that helps.
Regards,
Rui

0 Vote Up Vote Down
Hugo Articardi Calabrese answered 7 years ago

Hi Rui.
Thank you for your answer.
I tested Get function and works fine.
But I’m not shure if is the rigth option. I mean… Im trying to save on my Server DB readings of an analog input.
 I want to sample my analog signal at least 200 times per second.
Now I’m sending data as eg. /233/432/433/456/…../432
four char for any sample that is 800 char per second and I can`t loose samples while I’m sending.
Do you think is posible with Get or Post ? Shoul I go to TCP socket conection ? (have you tested ?)
Do you suggest a way to compress such data ???
 
Thanks in advance, Regards. Hugo.
 

0 Vote Up Vote Down
Rui Santos Staff answered 7 years ago

Hi Hugo, I think the GET function is a good option to send any type of data. How are you working with the values in the server db (with PHP?)? 
but do you want to publish 200 readings per second to your server?

0 Vote Up Vote Down
Hugo Articardi Calabrese answered 7 years ago

Hi Rui, Thanks for your answer.
Now I am sampling 120 times per second  and sending to a Server on Amazon each 5 seconds aprox. I don`t use PHP. The Server has a program I developed usin Genexus who saves on a MySQL DB.
I want to be more eficient in the way I send the samples…. Thats the reason of my question.
so I think are 2 points to get better:

  • To make a compression and send more infomation less frecuently.
  • Use a diferent way to send information to the Server.

I don`t know how to improve this two points.
Any suggestion ???
Best Regards. Hugo,

0 Vote Up Vote Down
Rui Santos Staff answered 7 years ago

I’ve never had any application that required sampling that many readings from a single device to a server, so I haven’t looked into any methods to optimize that project. I would probably send the data with and HTTP post encoded in a JSON object.

0 Vote Up Vote Down
Hugo Articardi Calabrese answered 7 years ago

Thanks for your answer, I think Json may be a good option.
I will try it and let you know.
Thanks again.

Primary Sidebar

Login to Ask or Answer Questions

This Forum is private and it’s only available for members enrolled in our Courses.

Login »

Latest Course Updates

  • [New Edition] Build ESP32-CAM Projects eBook – 2nd Edition April 16, 2025
  • [eBook Updated] Learn ESP32 with Arduino IDE eBook – Version 3.2 April 16, 2025

You must be logged in to view this content.

Contact Support - Refunds - Privacy - Terms - MakerAdvisor.com - Member Login

Copyright © 2013-2025 · RandomNerdTutorials.com · All Rights Reserved

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.