Skip to main content

Camera camera.1

A camera that keeps sending photos (JPEG). The app card shows the latest photo.

← Device types

Use​

For devices that take and send photos, such as an ESP32-CAM.

On the device​

On connecting, the device announces this type with t= in @$ui and sends @$state whenever its state changes. Apps send commands to <cid>@.

@$name My Camera:Living room
@$ui t=camera.1
@$state on=1;interval=100

State keys @$state​

KeyValuesMeaning
on0 / 11 while sending photos, 0 when stopped
interval100 / 200 / 500 / 1000 / 2000 / 5000Interval between photos (ms)

Commands <cid>@​

CommandMeaning
onStart sending
offStop sending
interval={v}Set the interval to {v} ms

{v} is the slider or color value. Even for an unknown command the device should send its current state, so the app does not wait.

Implementation notes​

  • Photos are not state: they go to the <cid>@image tag as binary JPEG (io.signal("@image", buf, len)). Without $, the server does not keep them, and only apps with the card open receive them.
  • With an E2E key, send io.signal_e2e("@image", buf, len, key). The app needs the same key in the card to see photos, and the key stays in that browser. A JPEG sent without a key shows as is.
  • An anonymous connection may send 256 KiB per message and 100 messages per second. A VGA (640x480) JPEG is usually 20–40 KB.
  • A very short interval can slow other devices on the same router. The default of one second is recommended.

Default picture​

This type has no default picture.

Examples​

  • esp32cam — example page on arduino.iosignal.net

Type file​

iosignal/devices/types/camera.1.json (rev 2) · CDN

The screen labels in the type file are in Korean; apps show them as written.