Server Quick Start¶
Get the smartap-server running in minutes.
Download¶
Download the appropriate binary for your server:
| Platform | Download |
|---|---|
| Linux x86_64 | smartap-server-linux-amd64 |
| Linux ARM64 (Pi 4/5) | smartap-server-linux-arm64 |
| Linux ARMv7 (Pi 32-bit) | smartap-server-linux-armv7 |
| macOS Apple Silicon | smartap-server-darwin-arm64 |
| macOS Intel | smartap-server-darwin-amd64 |
| Windows x64 | smartap-server-windows-amd64.exe |
# Example for Linux ARM64 (Raspberry Pi 4/5)
wget https://github.com/muurk/smartap/releases/latest/download/smartap-server-linux-arm64
chmod +x smartap-server-linux-arm64
mv smartap-server-linux-arm64 smartap-server
Start the Server¶
Basic Usage (Auto-Generated Certificate)¶
The simplest way to start is with auto-generated certificates:
This will:
- Generate a TLS certificate signed by the embedded Root CA
- Listen on port 443 (requires root/sudo)
- Log all WebSocket messages
Port 443 Requires Root
To bind to port 443, run with sudo:
Or use a higher port with--port 8443 and configure port forwarding.
Custom Port¶
Debug Logging¶
Custom Certificates¶
If you have your own certificates:
# Start with custom certificates
./smartap-server server --cert /path/to/fullchain.pem --key /path/to/privkey.pem
See Custom Certificates for details.
Command Reference¶
smartap-server server [flags]
Flags:
--cert string Path to TLS certificate file (optional, will auto-generate if not provided)
--key string Path to TLS private key file (optional, will auto-generate if not provided)
--host string Server hostname (empty = listen on all interfaces)
--port int Server port (default 443)
--log-level string Log level: debug, info, warn, error (default "info")
Configure DNS¶
Your device tries to connect to evalve.smartap-tech.com. You need to redirect this to your server.
Option A: Router DNS Override (Recommended)¶
- Log into your router admin interface
- Find "Custom DNS" or "DNS Override" settings
- Add entry:
evalve.smartap-tech.com→<your-server-ip> - Also add:
smartap-tech.com→<your-server-ip> - Save and apply
Option B: Pi-hole¶
If running Pi-hole:
# Add to /etc/pihole/custom.list
192.168.1.100 evalve.smartap-tech.com
192.168.1.100 smartap-tech.com
Then restart DNS:
Verify DNS¶
From another device on your network:
Test Device Connection¶
-
Start the server with debug logging:
-
Power cycle your device (the one with injected certificate)
-
Watch the logs for connection:
Expected Output¶
When everything works, you'll see:
╭─────────────────────────────────────────────────────────────────╮
│ Smartap WebSocket Server │
│ smartap-server server │
├─────────────────────────────────────────────────────────────────┤
│ Host: 0.0.0.0 │
│ Port: 443 │
│ TLS: Auto-generated (embedded Root CA) │
│ Log Level: debug │
╰─────────────────────────────────────────────────────────────────╯
INFO Starting Smartap WebSocket Server
INFO Auto-generated server certificate signed by embedded Root CA
INFO Listening on :443
Troubleshooting¶
"Permission denied" on port 443¶
# Run with sudo
sudo ./smartap-server server
# Or use non-privileged port
./smartap-server server --port 8443
Device doesn't connect¶
- Verify DNS resolution:
nslookup evalve.smartap-tech.com - Ensure server is reachable from device's network
- Check firewall allows port 443/8443
- Verify certificate was successfully injected
TLS handshake fails¶
- Device may have wrong certificate - re-run inject-certs
- Certificate domain mismatch - check server logs for details
Device connects but immediately disconnects¶
- This may be normal - protocol not fully understood
- Check server logs for any error messages
- Report findings to help with protocol documentation!
Running as a Service¶
For production use, run as a systemd service:
# /etc/systemd/system/smartap-server.service
[Unit]
Description=Smartap WebSocket Server
After=network.target
[Service]
Type=simple
ExecStart=/usr/local/bin/smartap-server server --log-level info
Restart=always
RestartSec=5
[Install]
WantedBy=multi-user.target
Enable and start:
sudo systemctl daemon-reload
sudo systemctl enable smartap-server
sudo systemctl start smartap-server