Build a GPS tracker using Neo 6m Module, ESP8266, nodejs, mongodb and EJS Hey Everyone, I hope you guys are safe and sound. In this tutorial we are going to “ Build a GPS tracker using Neo 6m Module, ESP8266, nodejs, mongodb and EJS ”.
- Introduction
- Tech Stack Overview
- Architecture
- Installations Overview (Not actual installation video) a. Arduino b. ESP8266 Libraries c. Arduino Json and HTTP client library installation and version d. Mongodb e. Nodejs f. NPM g. VS code
- Creating a Webserver using nodejs, ejs and mongodb.
- Create api to accept data from IoT device.
- Exposing end point url using ngrok.
- Testing the API using postman.
- GPS and Wemos device connection
- Programming wemos device
- Sending data from wemos to backend server
- Do’s and Don’t
- Neo 6m GPS module
- Wemos d1 mini
- Micro USB cable
- One to one connectors
- Arduino
- Downlad - https://www.arduino.cc/en/main/software
- ESP8266 Libraries
- Download - https://arduino.esp8266.com/stable/package_esp8266com_index.json
- Install Library
- Arduino Json and HTTP client library installation and version
- Install Library
- Google Maps API Key
- How to get google maps api key - https://developers.google.com/maps/documentation/embed/get-api-key
- Nodejs & NPM
- Download - https://nodejs.org/en/download/
- Add to path
- Command to run program – npm start
- Exiting the nodejs – Ctrl + C
- Install libraries – npm install
- Mongodb
- Download - https://www.mongodb.com/try/download/community
- Create DB folder in c - > data - > db
- Ngrok
- Download - https://ngrok.com/download
- Add to path
- Command to start ngrok – http ngrok <port_number> (Ex : http ngrok 3000)
- VS code
- Download - https://code.visualstudio.com/download
- Postman
- Download - https://www.postman.com/downloads/
- Clone this repository either by downloading it or by using git clone.
git clone https://github.com/vikkey321/--Build-a-GPS-tracker-using-Neo-6m-Module--ESP8266--nodejs--mongodb-and-EJS- - Extract the folder and navigate inside the code
CD Extracted_folder_name - Now, edit the map api in map.ejs in the views folder and paste your goole maps javascript api key.
src="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&callback=initMap&libraries=&v=weekly" - Install the libraries
npm install - Install nodemon
npm install nodemon - Start the server (Also make sure that your mongodb is running in the background)
npm start - Your webserver is running on 3000 port
localhost:3000
- You can find the code in the folder "arduino_code".
- Replace your SSID and Password with your wifi name and password
#define STASSID "SSID" #define STAPSK "PWD" - Replace the ngrok url in the below lines
const char* host = "YOUR_ngrok_url http.begin("YOUR_ngrok_url/addgpsdata"); - Directly program your arduino board