Skip to content

RAHB-REALTORS-Association/panic-button-esp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

License

Panic Button Logo

πŸ”΄ ESP32 Wi-Fi Panic Button

A standalone ESP32-based Wi-Fi panic button that sends email and/or webhook alerts when pressed. Designed for rapid deployment with a captive portal-based configuration interface, suitable for non-technical environments.

Panic button hardware

πŸ“š Table of Contents

✨ Features

  • Captive portal for Wi-Fi and alert configuration
  • Email (SMTP) and/or webhook alerts when button is pressed
  • EEPROM-stored settings with web-based update support
  • Visual battery monitoring (gauge, percentage, and voltage)
  • Responsive, mobile-friendly web interface
  • Factory reset and test alert functionality
  • Support for ESP32-C6 boards (like FireBeetle 2 ESP32-C6)
  • Configuration validation to ensure at least one alert path is active

πŸ› οΈ Hardware

Optimized for:

FireBeetle ESP32-C6

πŸ”Œ Pinout

Function GPIO Pin
Panic Button 4
Status LED 15
Battery ADC 0

πŸ“¦ Libraries Used

  • ESP Mail Client
  • HTTPClient (for webhook functionality)
  • WiFi
  • WebServer
  • DNSServer
  • EEPROM

πŸš€ Getting Started

  1. Flash the firmware using the Arduino IDE
  2. If no config is stored, the device starts in Setup Mode:
    • Hosts an AP named PanicAlarm_XXXX (XXXX is part of the MAC address)
    • Password: setupalarm
    • Captive portal guides you through configuration
  3. Once configured, the device connects to your Wi-Fi and enters Normal Mode

πŸ”§ Web Interface

Setup Mode

  • Captive portal with pages for Wi-Fi, SMTP, webhook, and location setup
  • Device enters this mode if config is missing or reset

Normal Mode

  • Live status dashboard with battery gauge and diagnostics
  • Config page for updating any setting
  • Alert testing tools for both email and webhook
  • Factory reset with confirmation

πŸ”‹ Battery Monitoring

  • Visual gauge with color coding:
    • Green: > 50%
    • Yellow: 25–50%
    • Red: < 25%
  • Live percentage and voltage display
  • Low battery alerts via email/webhook (if enabled)

🌐 Webhook Integration

Webhook alerts are JSON payloads with:

  • event (e.g. "panic_triggered" or "battery_low")
  • device_id, location
  • battery_level, voltage
  • ip, mac
  • timestamp

πŸ”„ OTA Updates

This device supports automatic Over-The-Air firmware updates via the included OTA update server:

  • Devices check for updates periodically
  • Server verifies device identity and firmware compatibility
  • Updates are downloaded and applied automatically
  • No manual intervention required for managed devices

For hosting your own OTA update server, refer to the OTA Server README for complete setup and usage instructions.

Note: OTA updates preserve all user configurations and settings.

πŸ” Resetting

Access the reset page via the web UI to:

  • Clear all config (Wi-Fi, SMTP, webhook, location)
  • Restart in Setup Mode

πŸ–ΌοΈ UI Preview

Status Page

Configuration Page

πŸ–¨οΈ 3D-Printed Case

This project includes a printable enclosure tailored for the FireBeetle ESP32-C6. All STL and 3MF files are located in the case/v1/ directory:

  • panic_button_case.3mf – complete project layout for slicers
  • case_back.stl
  • case_bottom.stl
  • case_front.stl
  • case_top.stl

Recommended Slicer Settings

  • Material: PLA, PETG, or similar
  • Layer Height: 0.2 mm
  • Infill: β‰₯ 15%
  • Supports: Optional (recommended for top-bottom half alignment when screwed together)
  • Perimeters/Walls: 2 or 3

The top and bottom shells include simple interlocking features. Use supports only if dimensional accuracy matters for your use case.

πŸ“„ License

Firmware: GPLv3 – see LICENSE for details.

OTA Server: AGPLv3 – see ota-server/LICENSE for details.

Case: MIT License – see case/LICENSE for details.

About

A standalone emergency alert system with email, webhook notifications and battery monitoring.

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Contributors 2

  •  
  •