Formulus Configuration
Configure Formulus to connect to your Synkronus server.
Overview
Formulus can be configured to connect to your Synkronus server in two ways:
- QR Code Scan (Recommended) - Quick and easy configuration
- Manual Entry - Enter server details manually
QR Code Login
The easiest way to configure Formulus is by scanning a QR code that contains all server connection details.
Prerequisites
- Synkronus CLI installed and configured (see CLI Installation)
- Logged in to the server via CLI
- Know your server's network IP address
Finding Your Server IP
The mobile app needs to connect over the network, so you need your computer's IP address:
# Linux
hostname -I | awk '{print $1}'
# macOS
ifconfig | grep "inet " | grep -v 127.0.0.1 | awk '{print $2}' | head -1
Example output:
192.168.100.7
Important: Use this IP address (not localhost) in the QR code.
Generating a QR Code
Interactive Mode
Run the QR command and follow the prompts:
cd synkronus-cli
./bin/synk qr
Prompts:
Server URL [http://localhost]: http://192.168.100.7
Username [admin]: admin
Password: [enter password]
✓ QR code generated successfully
Output file: 192.168.100.7.png
With Custom Output File
Specify the output filename:
./bin/synk qr -o formulus-login-qr.png
Non-Interactive Mode
Pipe values for automation:
echo -e "http://192.168.100.7\nadmin\nPassword" | ./bin/synk qr -o login-qr.png
Using the QR Code
- Open Formulus app on your device
- Go to Settings (or first-run setup)
- Tap "Scan QR Code" button
- Point camera at QR code
- Settings auto-populate
- Tap "Save" or "Connect"
QR Code Contents
The QR code encodes settings in FRMLS format (Formulus Markup Language Settings):
FRMLS:v:<base64(version)>;s:<base64(serverUrl)>;u:<base64(username)>;p:<base64(password)>;;
What gets configured:
- Server URL
- Username
- Password
The app will automatically:
- Test the connection
- Login with credentials
- Download the app bundle
- Sync available forms
Creating QR Codes for Multiple Users
# Create user first
./bin/synk user create
# Generate QR for each user
echo -e "http://192.168.100.7\nfieldworker1\nPassword1" | ./bin/synk qr -o fieldworker1-qr.png
echo -e "http://192.168.100.7\nsupervisor1\nPassword2" | ./bin/synk qr -o supervisor1-qr.png
Manual Configuration
If you prefer to configure manually or QR code scanning isn't available:
Step 1: Open Settings
- Open Formulus app
- Go to Settings (gear icon or menu)
Step 2: Enter Server Details
- Server URL:
http://YOUR_SERVER_IP(e.g.,http://192.168.100.7) - Username: Your username
- Password: Your password
Important: Use your computer's IP address (not localhost) since your Android device is on a different machine.
Step 3: Test Connection
- Tap "Test Connection" to verify
- Should see "Connection successful" message
Step 4: Save Settings
- Tap "Save"
- Settings are stored locally on device
Server Connection
Connection Requirements
- Device and server on same network (Wi-Fi)
- Server running and accessible
- Port 80 not blocked by firewall
- Correct IP address (not localhost)
Testing Connection
From your computer, test server accessibility:
# Test from computer
curl http://YOUR_IP/health
# Should return: OK
Troubleshooting Connection
Issue: "Connection failed"
Check:
- Server URL is correct (use IP, not localhost)
- Device has network access
- Server is running
- Same network as server
Solution:
# Verify server is running
cd synkronus
docker compose ps
# Test server from device network
curl http://YOUR_IP/health
Authentication
Login Process
After configuration:
- Navigate to Login screen (if not automatic)
- Credentials should be pre-filled (from QR or manual entry)
- Tap "Login"
- Wait for authentication - Token is stored locally
Success indicators:
- ✅ "Login successful" message
- ✅ Redirected to home/dashboard
- ✅ User info displayed
Token Management
- Tokens are stored locally on device
- Tokens auto-refresh when expired
- Logout clears tokens
Changing Credentials
- Go to Settings
- Update username/password
- Test connection
- Save
- Login again with new credentials
Sync Settings
Auto-Sync
Configure automatic synchronization:
- Enable/disable auto-sync
- Sync on WiFi only - Save mobile data
- Sync interval - How often to sync
Manual Sync
- Go to Sync screen
- Tap "Sync Now"
- Watch progress - Upload count, status
Sync Process
- Pull - Download new forms and server data
- Push - Upload pending observations
- Attachments - Upload photos, audio, etc.
- Confirmation - Server acknowledges receipt
Best Practices
Security
- Don't share QR codes publicly - They contain credentials
- Use strong passwords - QR codes encode the actual password
- Rotate credentials - Generate new QR codes when passwords change
- Delete old QR images - Remove from disk after distribution
Distribution
- Print for field workers - Physical handout
- Email securely - Encrypted or password-protected
- Display on screen - For immediate scanning
- Internal documentation - For team reference
Naming Conventions
Use descriptive filenames for QR codes:
# Include environment
./bin/synk qr -o production-login.png
./bin/synk qr -o staging-login.png
# Include user role
./bin/synk qr -o fieldworker-login.png
./bin/synk qr -o supervisor-login.png
Troubleshooting
Issue: QR code won't scan
Possible causes:
- Image too small
- Poor lighting
- Damaged/blurry print
Solutions:
- Display larger on screen
- Improve lighting
- Reprint at higher quality
Issue: "Invalid QR code" error
Possible causes:
- QR contains wrong format
- Corrupted image
Solution:
- Regenerate the QR code
- Verify with a QR reader app first
Issue: Settings won't save
Check:
- All fields filled correctly
- Connection test successful
- App has storage permission
Solution:
- Test connection first
- Save settings
- Restart app
- Verify settings persisted