Sending data to a page using the ESP8266-01 wifi-module from Arduino

0 votes

Hi friends, I've been using my Arduino Uno to put together an attendance system through a rfid reader using an esp8266-01 wifi module. What need is to do is store the unique id number in a database after reading it from a webpage where the rfid card publishes it. The webpage is coded in PHP. And, I've been sending commands to the Wi-Fi module from arduino ide serial monitor through the Uno board.
I initially tried using Serial_ophttp POST method to send it to the webpage and also the GET method, but couldn't get it to work.

    error_reporting(E_ALL ^ E_DEPRECATED);
    $dbhost = 'localhost';
    $dbuser = 'root';
    $dbpass = '';
    $conn = mysql_connect($dbhost, $dbuser, $dbpass);
    if(! $conn ) {
    die('Could not connect: ' . mysql_error());
    //$Data='Data test';
    echo "Data is :" . $Data;
    $sql = "INSERT INTO test_tab (Data) VALUES ('$Data')";
    $retval = mysql_query( $sql, $conn );
    if(! $retval ) {
    die('Could not enter data: ' . mysql_error());
    echo "Entered data successfully\n";

Aug 9, 2018 in IoT (Internet of Things) by Bharani
• 4,550 points

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
0 votes

Well, I think there are some \r \n missing in them and also, the AT+CIPSEND is being sent the wrong length.
You should try sending it again, like this:

GET /test.php?Data=2\r\nHost:\r\n\r\n

Just hit enter to send \r\n and ensure that you select "Both NL & CR" in your serial monitor. And of course, you will need to hit Enter twice at the end.

So, here I am sending 2 as my value and hence, after subtracting the 1 for every \r & \n from the size o your GET(), i.e., 49 will become 49 - 6 = 43.

Try to send the value directly from the URL and make sure that your PHP script is error-free and working. 

answered Aug 9, 2018 by nirvana
• 3,040 points

Related Questions In IoT (Internet of Things)

0 votes
1 answer

How to use the data I receive from Azure IoT Hub?

The payload you receive will be a ...READ MORE

answered Aug 1, 2018 in IoT (Internet of Things) by DataKing99
• 8,100 points
0 votes
1 answer

Transfer Data from Arduino Board to SQL Server

If you want to send it to ...READ MORE

answered Aug 29, 2018 in IoT (Internet of Things) by anonymous2
• 4,260 points
0 votes
1 answer
0 votes
1 answer

Arduino to pubnub cloud using esp8266

With the ESP8266, it always better to ...READ MORE

answered Oct 26, 2018 in IoT (Internet of Things) by Siddhant
• 210 points
0 votes
1 answer

Using ESP8266 for controlling through Arduino

Please explain better your problem. In Arduino-Esp8266 String ...READ MORE

answered Sep 11, 2018 in IoT (Internet of Things) by anonymous2
• 4,260 points
0 votes
1 answer
0 votes
1 answer

Faster communication between two ESP8266 in client-server setup

Try following. Server loop void loop() { // ...READ MORE

answered Jul 13, 2018 in IoT (Internet of Things) by anonymous2
• 4,260 points
0 votes
1 answer

MQTT on ESP8266 with NodeMCU - problems with publishing

Perhaps this was solved by more recent ...READ MORE

answered Aug 13, 2018 in IoT (Internet of Things) by anonymous2
• 4,260 points
0 votes
1 answer

Connect Android Things based Raspberry Pi 3 to wifi network for the first time!

Hey, I think its alright!  Your Raspberry Pi ...READ MORE

answered Jul 18, 2018 in IoT (Internet of Things) by nirvana
• 3,040 points
0 votes
1 answer

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.