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

Creating your own IoT cloud from scratch using php, Mysql, ESP12E – Part 2.1

Introduction

This is Part 2.1 of  "Creating your own IoT cloud from scratch using php, Mysql, ESP12E ".  If you are seeing this tutorial directly then I will recommend you to read the Introduction of this tutorial first.

So in the previous chapter, you already have seen the video. In this chapter, you will get the source code. Simply follow the instructions step by step in the video and the instructions in the below code.

(Note : The chapter 2.1 (the current chapter) contains code of only 'weather'. For code of 'led' visit chapter 2.2)

(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.

)

Code

Below php api is for 'weather' table.

1. Create a new folder named 'api'. Then inside the 'api' folder, create  a new folder again and name it 'weather'

2. After that copy and paste this following programming in notepad++ or any code editor and save it as 'dbconfig.php'. Don't forget to replace your database credentials in the below code.

3. Then copy and paste the below code and save it as 'db_connect.php'.

4. Copy and paste the below code and save it as 'delete.php'.

5. After that copy and paste the below program and save it as 'insert.php'.

6. Make a new file and copy and paste this program below and save it as 'read_all.php'.

7. Save the below file as 'specific.php'.

8. The copy and paste the below program and save it as 'update.php'.

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 2 (Prev Lesson)
(Next Lesson) Creating your own IoT cloud from scratch using php, Mysql, ESP12E – Part 2.2
Back to Creating your own IoT Cloud from scratch using php, Mysql, ESP12E

Comments ( 10 )

  • Samo

    Hi,

    thanks for your great video tutorials. I went step by step. Copy yours codes to notepad++ and save it like in tutorials. But when I test it with Postman, he give me

    Unexpected ‘W’. I dont find mistakes. Do you know what is wrong?

    Thanks you for your comment

    • Please crosscheck again while copy pasting. That is where majority of the people make mistakes. Thank you for your appreciation. Please share this website with your friends. 🙂

      • Kumanan

        Hi ! i too getting error on post man posting ” unexpected ‘>’.

        • I think, you didn’t set the php version. Please check it once again.

  • Abdallah Arshad

    whenever i run the microcontroller it keeps saying parse object() failed and closing connection it never reaches the part where the led is controlled

    • Most of the time its minor things you miss. Please just don’t copy paste things. I have explained everything in video. Carefully watch it again. A lot of people have already executed it successfully.

  • Renan Oliveira

    Please post the arduino IDE code
    Thanks !

    • Please check the other page, code is already given.

  • Hi,
    Thank you for such a great tutorial, I follower your step by step but when I am inserting the values from ‘insert.php’ ; The values are not storing in my database instead of that it showing……
    {
    “success”: 0,
    “message”: “Something has been wrong”
    }
    but the readall.php & delete.php were working properly…
    please help me

    • Hi manishk, Please check the api and the values you are passing. Mostly it is typos.

Post a Reply