• 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

SIM800L HTTP POST

Q&A Forum › Category: ESP32 › SIM800L HTTP POST
0 Vote Up Vote Down
NUR AZLIN AIRUL AZLIN MOHAMED ZOHDI asked 3 years ago

Hi Rui & Sara
this example of yours is extracted from the SIM800L tutorial to send data using URL encoded type in the HTTP POST.

$api_key_value = "tPmAT5Ab3j7F9";

$api_key= $sensor = $location = $value1 = $value2 = $value3 = "";

if ($_SERVER["REQUEST_METHOD"] == "POST") {
    $api_key = test_input($_POST["api_key"]);
    if($api_key == $api_key_value) {
        $sensor = test_input($_POST["sensor"]);
        $location = test_input($_POST["location"]);
        $value1 = test_input($_POST["value1"]);
        $value2 = test_input($_POST["value2"]);
        $value3 = test_input($_POST["value3"]);

My Question: How to send in TEXT format in ESP32 and receive in PHP at the server
Question Tags: sim800 http post text php
3 Answers
0 Vote Up Vote Down
Rui Santos Staff answered 3 years ago

Hi, what do you mean send in TEXT format? I’m not sure if I understand what you are looking for…

  1. Basically you can modify the SQL table with a new row with TEXT type content
  2. Then in your Arduino code, you would send a string variable to that newly created database field
  3. Finally, you need to receive in a similar variable the POST $_POST[“value1”] parameter that you are sending to from your Arduino board

Regards,
Rui

0 Vote Up Vote Down
NUR AZLIN AIRUL AZLIN MOHAMED ZOHDI answered 3 years ago

Sorry about that.
Actually, what I was looking for is to send text file with the SIM800L to the webserver, since my data is 100 rows per transaction.  I managed to use your tutorial to send 1 row at a time, takes about 1.5sec per row.
I wish I could send the text file in one shot.

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

Got it, now I know what you mean. 
Unfortunately I don’t have any tutorials on that subject, but you would need to create a POST request that would send your .txt file:
https://stackoverflow.com/questions/68115055/how-to-post-multipart-form-data-file-and-text-from-esp32-to-a-server
That link should help

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.