Creating your own IoT Cloud from scratch using php, Mysql, ESP12E

Creating your own IoT Cloud from scratch using php, Mysql, ESP12E – Part 2

Introduction:

In this tutorial, we will be Creating your own IoT Cloud from scratch using php, Mysql, ESP12E. This is part 2 of tutorial series. If you are seeing this tutorial directly then I will recommend you to read the Introduction of this tutorial first.

Part 2 of " Creating your own IoT Cloud from scratch using php, Mysql, ESP12E ", We will be creating two tables named 'weather' and 'led' respectively. We will use weather table to store the temperature and humidity coming from a DHT11 sensor using nodemcu. The table led will be used to control the three LED connected to our ESP12E. Then we will insert some dummy data into database.

We will finally create php api to insert, delete, update, read data into our mysql database. In the first part we already created the database and acquired database username, database password, database name and host. This is going to be useful for our database configuration file.

(Important : For those who have already gone through first part of this tutorial. To avoid confusion, I am giving the index of this chapter with information for this chapter.

  1. Chapter 2 - Detailed introduction, instructions and full video of the tutorial.
  2. Chapter 2.1 - Source Code of weather updating php api.
  3. Chapter 2.2 - Source code of led controlling php api.

)

Also we will be making the code for the api. The code will be made in php. I have given separate files, which you can copy and paste and use it for your own research or project.

Video

Please watch the below video. I have explained step by step process to create database and create php apis along with detailed explanation of each and every api.

You can find the codes mentioned in the video in the following links:

  1. Weather php API Code
  2. LED php API code

Support me by by subscribing to my YouTube channel by hitting the below button.

youtube-iotmonk-subscribe

Please login to get access to the quiz
Creating your own IoT Cloud from scratch using php, Mysql, ESP12E – Part 1 (Prev Lesson)
(Next Lesson) Creating your own IoT cloud from scratch using php, Mysql, ESP12E – Part 2.1
Back to Creating your own IoT Cloud from scratch using php, Mysql, ESP12E

Comments ( 16 )

  • KARTHIK H

    Please contact me as soon as possible i have many questions

  • Ashraf

    i m facing some issue regarding data base can you contact me

  • Mohamed tarek

    Thanks very much for this helpful terial
    but the esp led response is to late it take 30 second to on or off
    as I see in the trial it’s on and off fast with you

  • RAJESH

    I Need a help in API Code for Water level indicator

  • Gaurav bedge

    hello i need your help in connecting cloudmqtt to website and data base.
    the only difference is my node mcu is sending data to cloudmqtt broker (im using mqtt protocol here.) instead of php api.sample php is available on cloudmqtt documentation https://www.cloudmqtt.com/docs.html

  • Vivek rayan

    i am getting the o/p as “unexpected ‘<' " in postman app . can u please help me out from this error. i have followed all the steps as u mentioned

    • There is a typo in your code. Please check it again.

  • Venkatesan

    how to show phpadmin data on screen into html view ??

    • You can login to webhost and see the phpmyadmin screen directly.

  • Dheeraj Saxena

    I follow your tutorial that is great.I’m facing problem in my project. I have installed apache2 server on ubuntu 16.04 it is working fine.I installed mysql(Ver 14.14 Distrib 5.7.24) and php(7.0.32). I created database as you suggested and able to do sql operation from command line. I hosted locally all api’s and website from your code to /var/www/html/logger/api/ folder. Than change dbconfig as per my user login and database used with ‘local’. than i run script in browser http://localhost/logger/weather/insert.php it is giving json output {“success”:0,”message”:”Parameter(s) are missing. Please check the request”}. Than I run in postman tool and send get command-http://localhost/myweb/logger/weather/insert.php?temp=55.5&hum=12.5
    It is not giving any message and data is also not inserted.

    under Header I got following message:
    access-control-allow-origin →*
    connection →close
    content-length →0
    content-type →application/json; charset=UTF-8
    date →Thu, 25 Oct 2018 03:41:58 GMT
    server →Apache/2.4.18 (Ubuntu)

    Could you please help me in this regard.
    Thanks in advance.
    Dheeraj

  • Dheeraj Saxena

    Please ignore my previous mail there are some folder error in typing here is the correct one.
    I follow your tutorial that is great.I’m facing problem in my project. I have installed apache2 server on ubuntu 16.04 it is working fine.I installed mysql(Ver 14.14 Distrib 5.7.24) and php(7.0.32). I created database as you suggested and able to do sql operation from command line. I hosted locally all api’s and website from your code to /var/www/html/myweb/logger/weather/ folder. Than change dbconfig as per my user login and database used with ‘local’. than i run script in browser http://localhost/myweb/logger/weather/insert.php it is giving json output {“success”:0,”message”:”Parameter(s) are missing. Please check the request”}. Than I run in postman tool and send get command-http://localhost/myweb/logger/weather/insert.php?temp=55.5&hum=12.5
    It is not giving any message and data is also not inserted.

    under Header I got following message:
    access-control-allow-origin →*
    connection →close
    content-length →0
    content-type →application/json; charset=UTF-8
    date →Thu, 25 Oct 2018 03:41:58 GMT
    server →Apache/2.4.18 (Ubuntu)

    Could you please help me in this regard.
    Thanks in advance.
    Dheeraj

Post a Reply