@extends('layouts.app') @section('title', 'Download Gateway') @section('content')
Connect your hardware to SeismicDetect platform
This token is required to authenticate your gateway with our servers.
{{ $user->api_token }}
No API token generated yet
# 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
# 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
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.
Connect your ESP32/Arduino via USB cable
Linux: /dev/ttyUSB0
Windows: COM3
macOS: /dev/cu.usbserial
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' }}";
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}'