Skip to content

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.

┌────────────────┐ ┌──────────────────┐
│ 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 │
└────────────────┘ └──────────────────┘
  1. Your device captures an image and sends the raw bytes via HTTP POST
  2. SiliconWit.IO stores the image and returns a public CDN URL
  3. Your device includes that URL in its next MQTT telemetry message
  4. The dashboard renders the URL as a clickable thumbnail
POST /api/devices/{device_id}/snapshot

Headers:

HeaderValueRequired
AuthorizationBearer YOUR_ACCESS_TOKENYes
Content-Typeimage/jpeg or image/pngYes

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:

StatusMeaningCommon Cause
400Bad RequestMissing device ID, unsupported content type, empty body
401UnauthorizedMissing or invalid access token
403ForbiddenDevice is paused
413Payload Too LargeImage exceeds 500 KB
429Too Many RequestsDaily snapshot limit reached
503Service UnavailableStorage backend temporarily unavailable

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.

PlanSnapshots per DayData Retention
Free107 days
Starter5090 days
Business2001 year
Scale5002 years
EnterpriseAdmin-setCustom

The daily limit resets on a rolling 24-hour window. If you hit the limit, the API returns 429 Too Many Requests.

Upload a test image from your terminal:

Terminal window
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.jpg

Then publish telemetry with the returned URL:

Terminal window
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"}'

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.

Snapshots follow the same retention rules as your telemetry data. When the retention period expires:

  1. A warning email is sent with a 3-day grace period
  2. 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.