Skip to content

Interfaces‐en

Michael Paul Coder edited this page Nov 26, 2024 · 2 revisions

Webhook API

The INSPEC provides webhooks for real-time interaction.

Start the webhook API server

cd api
python webhook_server.py

Start the webhook demo

cd api
python webhook_demo.py

Endpoints

Trigger

The trigger webhook is called when REM sleep is detected, allowing external systems to respond by triggering audio, visual, or other types of alerts.

REM

The rem webhook is triggered whenever an eye movement is detected, providing the total eye movement count since REM detection began.

Variance

The variance webhook provides raw data on the variance (amount of change) between the last two video frames.

Bluetooth

The INSPEC advertises a BLE service with the appearance of an Human Interface Device.

GUID: 13370001-763c-4507-99fb-100f72f2300a

Appearance: Human Interface Device

Characteristics

RX

Listens for requests.

GUID: 13370002-763c-4507-99fb-100f72f2300a

TX

Transmits messages.

GUID: 13370003-763c-4507-99fb-100f72f2300

IMAGE

Transmits images.

GUID: 13370004-763c-4507-99fb-100f72f2300a

FILE

Transmits files.

GUID: 13370005-763c-4507-99fb-100f72f2300a

Messages

Variance

The amount of pixels changed in the video feed. Sent at 10 Hz.

Example: 2

REM

Sent when the REM value changes.

Example: rem:2

Trigger

Sent when the algorithm triggers.

Example: trigger:20

IP

The device's IP address. Sent automatically when a BLE connection is established and the WiFi or Access Point is enabled, or when requested.

Example: ip:192.168.1.2

Directories

Sent by request and lists the session directories.

Example: 1,2,3,4

Directory

Sent when requested and returns the directory contents.

Image

The camera image. Sent when requested over multiple packages.

Requests

IP

Requests the devices IP address.

Example: request.ip

Image

Requests the camera image. A snapshot is taken and returned over the image channel.

Example: request.image

Directories

Requests the session directory listings.

Example: request.directories

Directory

Requests the contents of a session directory.

Example: request.directory.0

Update Setting

Updates a setting.

Example: update.setting.LEDs:RGB

Disconnect

Disconnects the BLE connection.

Example: disconnect

HTTP

Video Stream

Streams the video feed if connected via Wi-Fi.

File

SD Card

A new session directory is created if the CreateLogs setting is configured every time the INSPEC is powered on. A Lucid Scribe Data (LSD) file is updated every minute with the variance and REM values. Images with timestamps are created when the variance gets close to the trigger threshold.

INSPEC
Researcher:Researcher
00:00:lsd - 0,0,0,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
00:00:rem - 0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
00:01:lsd - 0,0,32,0,0,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
00:01:rem - 0,0,1,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0