This project for your testing connection between NodeMCU ESP8266 to Laravel as server. Focus point in this project is how to make connection between NodeMCU ESP8266 to Laravel as server therefore in this project just make a switch for turnon / turnoff led. this project made using JQuery for AJAX to server, MySQL for database and Bootstrap for UI. lets install this project before you run.
--Salam--
- Clone this repository to your directory (must in xampp/htdocs/)
- rename this project according to your wishes
- cd
this project
- Run
composer update
- copy .env.example to .env run
cp .env.example .env
- Generate the application key using
php artisan key:generate
- Set your .env file
- Run database migrations and seed the database using
php artisan migrate --seed
- Split your Terminal
- In one side run
php artisan serve
and anothernpm run dev
- Usually you will got URL
127.0.0.1:8000
and open that URL in your browser
declare variabel host as const char* host
for your IP
String BASE_URL = "http://" + String(host) + "/webiot/public/api";
WiFiClient client;
HTTPClient http;
String url = BASE_URL + "/led";
http.begin(client, url);
String response = http.getString();
now just execute response for HIGH, and LOW led