@extends('layouts.app') @section('title', 'Download Gateway') @section('content')

Your API Token

This token is required to authenticate your gateway with our servers.

@if(isset($user) && $user->hasValidApiToken())
{{ $user->api_token }}
Expires: {{ $user->api_token_expires_at ? $user->api_token_expires_at->format('d F Y') : 'N/A' }}
@else

No API token generated yet

@endif

Installation Methods

Quick Start with Python
# 1. Clone the gateway repository
git clone https://github.com/seismicdetect/gateway.git
cd gateway

# 2. Install dependencies
pip install -r requirements.txt

# 3. Set your API token
export USER_TOKEN={{ isset($user) && $user->api_token ? $user->api_token : 'YOUR_API_TOKEN_HERE' }}

# 4. Run the gateway
python gateway.py
Or using environment file (.env)
# Create .env file
echo "USER_TOKEN={{ isset($user) && $user->api_token ? $user->api_token : 'YOUR_API_TOKEN_HERE' }}" > .env
echo "SERVER_URL={{ url('/') }}" >> .env

# Run gateway
python gateway.py
# Pull the image
docker pull seismicdetect/gateway:latest

# Run the container
docker run -d \
  --name seismic-gateway \
  --device=/dev/ttyUSB0 \
  -e USER_TOKEN={{ isset($user) && $user->api_token ? $user->api_token : 'YOUR_API_TOKEN_HERE' }} \
  -e SERVER_URL={{ url('/') }} \
  seismicdetect/gateway:latest

Binary Version Coming Soon

Standalone binary files for Windows, Linux, and macOS are currently under development.

Please use the 🐍 Python Method above - it's fully functional and works on all operating systems.

Connecting Your Hardware

USB Connection

Connect your ESP32/Arduino via USB cable

Linux: /dev/ttyUSB0 Windows: COM3 macOS: /dev/cu.usbserial

WiFi Connection

Configure ESP32 to send data via WiFi

// ESP32 Code template
const char* ssid = "YOUR_WIFI";
const char* password = "YOUR_PASSWORD";
const char* token = "{{ isset($user) && $user->api_token ? $user->api_token : 'YOUR_TOKEN' }}";

Manual Testing

Test your connection with curl

curl -X POST {{ url('/api/gateway/test') }} \
  -H "X-API-Key: {{ isset($user) && $user->api_token ? $user->api_token : 'YOUR_TOKEN' }}" \
  -d '{"type":"test","value":123}'

Your Connected Devices

@include('devices.partials.list', ['devices' => isset($user) ? $user->devices : collect()])
Add New Device
@endsection