Skip to content

riskyprsty/sic6_assignment

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ESP32 Micropython Ubidots Project ✨


forthebadge

MicroPython Badge Espressif Badge

PENS - UNI022 forthebadge

ESP32 + ESP32CAM Ubidots Micropython Monitoring Projects
This project is an assignment for Samsung Innovation Campus Batch 6 (SIC 6)

Developed with ❤️ by The Hash Slinging Slasher Team at
UNI022

Table of Contents
  1. Dashboard Links ✨
  2. About The Project
  3. Dashboard Screenshot 📷
  4. Flask Server API Documentation
  5. Usage

Dashboard Links ✨

📌 Monitoring Dashboard URL :

https://sic6.tribone.my.id

🌐 Ubidots Dashboard URL :

https://stem.ubidots.com/app/dashboards/public/dashboard/jF07t8gcQSrJqPXWmpCxxpuVLqKNBSLNvRhIn_x-I8A

About The Project


This project is an assignment for the Samsung Innovation Campus (SIC) Batch 6 created by the team UNI022 - The Hash Slinging Slasher. This project is an IoT project that connects microcontroller devices with the Ubidots platform. It utilizes the ESP32 connected to several sensors, including the ESP32 CAM, to transmit live video feeds in real-time to the Ubidots dashboard.

This IoT system also integrates several communication protocols simultaneously, such as MQTT to connect with the Ubidots platform and the HTTP protocol to connect to the Rest API created with Python Flask. In addition to sending data to Ubidots, the microcontroller also sends data to the Rest API for data logging, which is then stored in the MongoDB database.

Concept

Diagrams

Project Structure

/docs # Contains project documentation
└── ....
/esp32 # Contains ESP32 micropython source code
├── lib/ # External libraries
├── boot.py
└── main.py
/esp32cam # Contains ESP32CAM micropython source code
├── lib/ # External libraries
├── boot.py
└── main.py
/flask_server # Contains Flask Server source code
├── templates/ # Contains HTML Pages for sic6.tribone.my.id
├── server_forwarder.py # Obsolete forwarder server for ESPCAM (not used)
└── server.py # Main source code for Flask Server

Dashboard Screenshot 📷

Monitoring Dashboard Website

SIC6 Accessible via https://sic6.tribone.my.id

Ubidots Dashboard


Accessible via https://stem.ubidots.com/app/dashboards/public/dashboard/jF07t8gcQSrJqPXWmpCxxpuVLqKNBSLNvRhIn_x-I8A

Flask Server API Documentation

Base URL

http://sic6.tribone.my.id

Upload Image

Endpoint

POST http://sic6.tribone.my.id/upload

Description

Receives a base64-encoded image from an ESP32-CAM and saves it as esp32cam.jpg.

Request Example

{
  "image": "/9j/4AAQSkZJRgABAQEAAAAAAAD..."
}

Response Example

Success (200)

{
  "message": "Gambar diterima!"
}

Error (400)

{
  "error": "No image received"
}

Insert Single Data

Endpoint

POST http://sic6.tribone.my.id/insert_data_one

Description

Inserts a single data into MongoDB

Request Example

{
    "data_sensor": {
        "location": {
            "value": var,
            "context": {
                "lat": lat,
                "lng": lon
            }
        },
        "satellite": {
            "value": sat
        },
        "altitude": {
            "value": alt
        },
        "temperature": {
            "value": temp
        },
        "humidity": {
            "value": hum
        },
        "distance": {
            "value": dist
        }
    }
}

Response Example

Success (200)

{
  "message": "Data berhasil dimasukkan ke database",
  "inserted_id": "...."
}

Error (400)

{
  "error": "Invalid JSON format"
}

Insert Multiple Data

Endpoint

POST http://sic6.tribone.my.id/insert_data_many

Description

Inserts multiple data into MongoDB

Request Example

{
    "data_sensor_1": {
        ......
    },
    "data_sensor_2": {
        ......
    },
    ...
}

Response Example

Success (200)

{
  "message": "Data berhasil dimasukkan ke database"
}

Error (400)

{
  "error": "Invalid JSON format"
}

Delete All Data

Endpoint

GET http://sic6.tribone.my.id/delete_all_data

Description

Deletes all data from MongoDB Collection

Response Example

Success (200)

{
  "message": "Data berhasil dihapus"
}

Usage

Diagram

Wiring

Wiring

GPS NEO 6M ESP32
VCC 3.3V
RX TX2 (GPIO 17)
TX RX2 (GPIO 16)
GND GND
HC-SR04 ESP32
VCC VIN
TRIG GPIO 5
ECHO GPIO 18
GND GND
DHT22 ESP32
VCC 3.3V
OUT GPIO 15
GND GND
OLED ESP32
Vin 3.3V
SCL GPIO 22
SDA GPIO 21
GND GND
LED Indicator ESP32
+ GPIO 27
- GND

About

SIC 6 Assignment 2 - UNI022

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors