Giter Site home page Giter Site logo

hnz1102 / timeleapcam Goto Github PK

View Code? Open in Web Editor NEW
23.0 1.0 1.0 8.23 MB

Time Leap Cam - Super Long Term Time-Lapse Camera and Monitoring by OpenAI

Rust 100.00%
autofocus cloudflare emmc esp32s3 gpt-4o idf kicad line-messaging-api lipo-battery openai

timeleapcam's Introduction

Time Leap Cam

Time Leap Cam - Super Long Term Time-Lapse Camera and Monitoring by OpenAI

Overview

The TIME LEAP CAM is an autofocus camera designed for long-duration time-lapse photography. Named for its ability to "leap" through time, this camera is ideal for monitoring over extended periods. It operates on battery power and features a DeepSleep mode to conserve energy when not actively shooting. Images are stored on a 64GB eMMC within one of eleven designated folders.

Features

  • Autofocus Capability: Ensures clear images over long shooting intervals.
  • Energy Efficiency: Utilizes DeepSleep mode for minimal power consumption (less than 440uA, 1.5mW).
  • Wireless Charging: Supports Qi wireless charging and automatically stops charging when full.
  • Water Resistance: Suitable for outdoor use with splash resistance.
  • Advanced Notifications: Uses OpenAI's GPT-4o for image recognition and sends notifications via LINE when specific conditions are met.
  • Natural Language Configuration: Set notification conditions in multiple languages through a simple interface.
  • Touch-Activated Web Server: Access settings via a browser with automatic return to sleep mode after 5 minutes of inactivity.
  • Time Synchronization: Uses NTP for automatic time adjustment when connected to WiFi, with RTC to maintain time offline.

Specification

  • Resolution: Up to 2592x1944 (QSXGA)
  • Sensor: OV5640 5M pixel sensor
  • SoC Module: ESP32-S3-WROOM-1-N16R8 (160MHz, 512KB SRAM, 16MB Flash, 8MB PSRAM)
  • Battery: 3.7V LiPo 1100mAh
  • Storage: 64GB eMMC
  • Connectivity: WiFi 2.4GHz
  • Charging: Qi wireless charging compatible
  • Dimensions: 78(W) x 79(H) x 68(D) mm Box

Usage

To use the TIME LEAP CAM, place it on a Qi wireless charger to charge power. Configure the camera settings such as shooting interval, time, and resolution through a web browser connected via WiFi. The camera can be activated from sleep mode by touching the screw on the back, which launches the web server for configuration.

Options

  • Folder Selection: Choose from 11 different folders for storing images.
  • Image Resolution: Selectable up to QSXGA (2592x1944).
  • Notification Conditions: Set via natural language input on the configuration screen.

Notes

  • Water Immersion: The camera is not designed to withstand full submersion in water.
  • API Keys Required: To use the image recognition and notification features, obtain API keys from OpenAI, CloudFlare Images, and LINE Messaging API.
  • Internet Connection: Required for using advanced features like image recognition and notifications. Time-lapse functionality is available without WiFi.

For API keys and more information, visit:

How to build from code and Install to the unit.

Using Ubuntu 22.04.3 LTS and ESP-IDF V5.2.1

Prerequisites

Before proceeding with the installation, ensure that your system meets the following requirements:

  • Operating System: Linux-based distribution
  • Required Packages: git, python3, python3-pip, gcc, build-essential, curl, pkg-config, libudev-dev, libtinfo5, clang, libclang-dev, llvm-dev, udev, libssl-dev, python3.10-venv

Installation Steps

1. System Update and Package Installation

Update your system and install the necessary packages using:

sudo apt update && sudo apt -y install git python3 python3-pip gcc build-essential curl pkg-config libudev-dev libtinfo5 clang libclang-dev llvm-dev udev libssl-dev python3.10-venv

2. Rust Installation

Install Rust programming language and Cargo package manager:

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

After installation, activate Rust by sourcing the environment:

. "$HOME/.cargo/env"

3. Additional Tools Installation

Install the following Rust tools:

  • ldproxy
  • espup
  • cargo-espflash

Use the following commands:

cargo install ldproxy
cargo install espup
cargo install cargo-espflash

4. ESP Environment Setup

Run the following command to install and update the Espressif Rust ecosystem:

espup install
espup update

Set up environment variables:

. ./export-esp.sh

5. Udev Rules Configuration

Configure udev rules for device permissions:

sudo sh -c 'echo "SUBSYSTEMS==\"usb\", ATTRS{idVendor}==\"303a\", ATTRS{idProduct}==\"1001\", MODE=\"0666\"" > /etc/udev/rules.d/99-esp32.rules'
sudo udevadm control --reload-rules
sudo udevadm trigger

6. Clone Repository

Clone the TimeLeapCam repository:

git clone https://github.com/hnz1102/timeleapcam.git
cd timeleapcam/code/

7. Setting WiFi SSID, Password, etc.

Change the following the configuration file.

cfg.toml

[timeleapcam]
wifi_ssid = "<Your AP SSID>"  # Set your AP SSID
wifi_psk = "<Your AP Password>" # Set your AP Password
http_server = "" # NOT USED
resolution = "8"
track_id = "0"
timezone_offset = "9"
auto_capture = "false"
idle_in_sleep_time = "300"
duration = "0"
api_key = "<API KEY for openAI>" # Set your OpenAI API Key
model = "gpt-4o"
query_openai = "false"
query_prompt = "If is there somebody, Add in the reply as 'NOTICE' and reason. If is nobody, Just reply is 'NONE'."
post_account = "<Your LINE Account ID>" # Set your LINE Account ID
post_access_token = "<Access Token for LINE Message>" # Set your LINE Access Token
storage_account = "<Your Cloudflare Account ID>" # Set your Cloudflare Account ID
storage_access_token = "Your Cloudflare Access Token>" # Set your Cloudflare Access Token
post_message_trigger = "NOTICE"

8. Build and Flash

Build the project and flash it to your device:

cargo build --release
cargo espflash flash --release --monitor

At the first boot, the device will format the eMMC and create the necessary folders. This process may take a few minutes.

Schematic, PCB Gabar and Container 3D Data

There is a Schematic data in the hardware directory including 3D printing data.

board

Container

Troubleshooting

  • Permission Issues: Ensure udev rules are set correctly and you have the necessary permissions to access the device.
  • Build Errors: Check that all dependencies are installed correctly. If errors persist, try cleaning the project with cargo clean and rebuild.

LICENSE

This source code is licensed under MIT. Other Hardware Schematic documents are licensed under CC-BY-SA V4.0.

This project uses the following libraries and resources:

https://github.com/jlocash/esp-camera-rs

https://github.com/0015/ESP32-OV5640-AF

These libraries are licensed under each library's respective licenses.

timeleapcam's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

liunix61

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.