etwow-utils

Etwow GT Auto-lock System

A non-destructive auto-lock system for Etwow GT electric scooters that provides automatic locking/unlocking based on BLE proximity detection.

License Version Platform

🎯 Overview

Before this project

---
config:
  theme: 'dark'
---
graph LR
subgraph scooter 
    direction LR
    A[Etwow BT Module] <--> C[Etwow Display] --> Controller --> Motor
end 

After this project

---
config:
  theme: 'dark'
---
graph LR
subgraph scooter
    A[Etwow BT Module] <--> B[UART Inline Module]
    B <--> C[Etwow Display]
    C --> Controller 
    Controller --> Motor
end 
    D[BLE Tag] -.->|Proximity| B

style B fill:blue
style D fill:blue

Using the ETWOW uart command codes from https://github.com/simonrey1/etwowconnect2/tree/main. Huge thanks !

This project implements an inline auto-lock system that:

πŸ”§ How It Works

The system consists of two main components:

1. ESP32 Controller (firmware/etwow.ino)

2. BLE Badge (firmware/badge.ino)

πŸ› οΈ Hardware Requirements

See docs/bom.md for the complete bill of materials. Key components:

πŸš€ Quick Start

1. Setup Development Environment

# Clone the repository
git clone <repository-url>
cd etwow-utils

# Run the setup script
./scripts/setup.sh

2. Configure the System

# Copy environment template
cp .env.example .env

# Edit configuration
nano firmware/controller/include/config.h
# Update TARGET_BADGE_MAC with your badge's MAC address

3. Build and Flash Firmware (simple)

# Build both controller and badge (simple)
./scripts/build.sh

# Or build individually
./scripts/build.sh --controller-only
./scripts/build.sh --badge-only

# Upload to devices (specify correct ports)
./scripts/build.sh --upload --port /dev/ttyUSB0
./scripts/build.sh --badge-only --upload --port /dev/ttyACM0

4. Test the System

# Run validation tests
./scripts/test.sh

# Test individual components with examples
# See firmware/examples/ for testing tools

For detailed setup instructions, see docs/quick-start.md.

βš™οΈ Configuration

RSSI Thresholds (Default)

Pin Configuration

Edit firmware/controller/include/pins.h to match your hardware:

πŸ§ͺ Testing & Development

The project includes comprehensive testing tools:

Automated Testing

# Run full test suite
./scripts/test.sh

# Validate project structure
./scripts/validate.sh

Development Examples

Examples have been removed for the simple layout. Use the simple sketches directly.

Manual Testing

πŸ”’ Safety Features

πŸ”‹ Power Management

πŸ“‹ Installation Checklist

πŸ› Troubleshooting

Badge not detected

UART communication issues

Power issues

Build issues

πŸ“„ License

This project is open source. See LICENSE file for details.

🀝 Contributing

Contributions welcome! Please:

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Run tests: ./scripts/test.sh
  5. Submit a pull request

πŸ“š Documentation

Key docs in docs/:

⚠️ Disclaimer

This is a DIY project. Use at your own risk. Always follow local laws and regulations regarding electric scooter modifications. The authors are not responsible for any damage or injury resulting from the use of this system.