Camera Snapshots
Cameras are just devices. A snapshot is a JPEG or PNG image uploaded via HTTP; its URL is stored alongside your telemetry data. There is no separate video subsystem - snapshots are event-driven images tied to your existing device workflow.
Use cases include security cameras capturing motion events, machine-vision boards inspecting products on a conveyor, wildlife cameras triggered by PIR sensors, and agricultural monitors checking crop health.
How It Works
Section titled “How It Works”┌────────────────┐ ┌──────────────────┐│ Camera Device │ │ SiliconWit.IO ││ (ESP32-CAM, │ 1. POST image bytes │ ││ Raspberry Pi,│ ──────────────────────────► │ /api/devices/ ││ etc.) │ 2. Get back snapshot URL │ {id}/snapshot ││ │ ◄────────────────────────── │ (cloud storage) ││ │ │ ││ │ 3. MQTT telemetry with │ Dashboard ││ │ snapshot_url field │ renders ││ │ ──────────────────────────► │ thumbnail │└────────────────┘ └──────────────────┘- Your device captures an image and sends the raw bytes via HTTP POST
- SiliconWit.IO stores the image and returns a public CDN URL
- Your device includes that URL in its next MQTT telemetry message
- The dashboard renders the URL as a clickable thumbnail
API Reference
Section titled “API Reference”Upload a Snapshot
Section titled “Upload a Snapshot”POST /api/devices/{device_id}/snapshotHeaders:
| Header | Value | Required |
|---|---|---|
Authorization | Bearer YOUR_ACCESS_TOKEN | Yes |
Content-Type | image/jpeg or image/png | Yes |
Body: Raw image bytes (max 500 KB)
Success Response (200):
{ "success": true, "url": "https://cdn.siliconwit.io/snapshots/{device_id}/{id}.jpg", "id": "a1b2c3d4-..."}Error Responses:
| Status | Meaning | Common Cause |
|---|---|---|
| 400 | Bad Request | Missing device ID, unsupported content type, empty body |
| 401 | Unauthorized | Missing or invalid access token |
| 403 | Forbidden | Device is paused |
| 413 | Payload Too Large | Image exceeds 500 KB |
| 429 | Too Many Requests | Daily snapshot limit reached |
| 503 | Service Unavailable | Storage backend temporarily unavailable |
Including the URL in Telemetry
Section titled “Including the URL in Telemetry”After uploading, include the returned URL in your MQTT telemetry payload:
{ "temperature": 23.5, "snapshot_url": "https://cdn.siliconwit.io/snapshots/{device_id}/{id}.jpg"}The dashboard automatically detects fields ending in _url that point to image files and renders them as clickable thumbnails.
Plan Limits
Section titled “Plan Limits”| Plan | Snapshots per Day | Data Retention |
|---|---|---|
| Free | 10 | 7 days |
| Starter | 50 | 90 days |
| Business | 200 | 1 year |
| Scale | 500 | 2 years |
| Enterprise | Admin-set | Custom |
The daily limit resets on a rolling 24-hour window. If you hit the limit, the API returns 429 Too Many Requests.
Quick Test with curl
Section titled “Quick Test with curl”Upload a test image from your terminal:
curl -X POST "https://siliconwit.io/api/devices/YOUR_DEVICE_ID/snapshot" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -H "Content-Type: image/jpeg" \ --data-binary @photo.jpgThen publish telemetry with the returned URL:
mosquitto_pub \ -h mqtt.siliconwit.io \ -p 8883 \ --capath /etc/ssl/certs \ -u "YOUR_DEVICE_ID" \ -P "YOUR_ACCESS_TOKEN" \ -t "d/YOUR_DEVICE_ID/t" \ -m '{"snapshot_url": "https://cdn.siliconwit.io/snapshots/YOUR_DEVICE_ID/abc123.jpg"}'Dashboard Display
Section titled “Dashboard Display”Snapshot URLs in telemetry appear in two places:
- Latest Reading panel - shows a thumbnail of the most recent snapshot
- Data table - each row with a snapshot URL shows a clickable thumbnail that opens the full image
No extra configuration is needed. Any telemetry field whose value is a URL pointing to an image on cdn.siliconwit.io is automatically rendered as a thumbnail.
Data Retention
Section titled “Data Retention”Snapshots follow the same retention rules as your telemetry data. When the retention period expires:
- A warning email is sent with a 3-day grace period
- After the grace period, expired snapshots are deleted from both storage and the database
Upgrading your plan extends the retention period for all existing data, including snapshots.
- Use JPEG for photos. JPEG files are typically 5-10x smaller than PNG for photographic content, keeping you well under the 500 KB limit.
- Resize before uploading. A 640x480 JPEG at 80% quality is usually under 100 KB - plenty for event monitoring.
- Add motion detection. Capture only when something changes rather than on a fixed timer. This conserves your daily quota and makes the data more meaningful.
- Include context fields. Send additional telemetry alongside the snapshot URL (temperature, motion score, timestamp) to make each event searchable and alertable.
Next Steps
Section titled “Next Steps”- ESP32-CAM Snapshots Tutorial - Full Arduino + Python walkthrough
- Topics & Payloads - MQTT message format reference
- Dashboard Alerts - Trigger alerts based on telemetry values