pi-webrtc

Troubleshooting

Common errors, and how to fix them. Errors from the token API come as { "error": { "code", "message" } }.

Token API

Status and codeMeaning
401 key_requiredSend Authorization: Bearer <public key>.
401 key_invalidThe public key does not belong to this worker. Check that it matches the private key in the worker.
401 role_mismatchA device key was used for a viewer, or a viewer key for a device.
400 body_invalidA field in the body is wrong. The message names it.
400 too_many_roomsA device asked for more than MAX_ROOMS_PER_DEVICE rooms.
429 rate_limitedMore than 20 token requests in a minute from one IP address. Wait a minute.
503 key_not_configuredDEVICE_PRIVATE_KEY or VIEWER_PRIVATE_KEY is not set in the worker.

Opening the socket

Status and codeMeaning
401 token_expiredThe token is older than 30 seconds. Get a new one right before you connect.
401 token_usedEach token works once. Get a new one for each connection.
401 token_invalidThe token is broken or comes from another worker.

Closed sockets

Close codeMeaning
4000A newer connection with the same ID and secret took over. The old connection should not reconnect.
4001No ping for too long. Reconnect.
4002Another live connection uses this ID with another secret. Give each device and viewer its own ID. Right after a power cut, it can be the device's last run: wait a minute.

Video does not show

What you seeWhat to do
The device stays waking, then the viewer gets ERROR_CODE_WAKE_TIMEOUTThe device could not reach the SFU. Check that UDP is not blocked. Add TURN for strict networks.
Send a binary ViewerRequest. or Send a binary DeviceRequest...The client and the worker use different message versions. Update the client, or run git submodule update and restart the worker.
ERROR_CODE_VIEWER_LIMITThe device already has MAX_VIEWERS_PER_DEVICE viewers.
ERROR_CODE_ROOM_FULLThe room already has MAX_DEVICES_PER_ROOM devices.
The Camera source is missing on the device simulatorBrowsers allow the camera only on localhost or https. Use Test pattern.

Pages

What you seeWhat to do
/sfu/admin/ answers 404 on a deployed workerSet up Access or ADMIN_KEY.
/sfu/debug/* answers 404 on a deployed workerSet DEBUG_STATE to true. See Debug pages.
/sfu/debug/* answers 401 key_required on a deployed workerSend a device or viewer public key. See Debug pages.
Edit on GitHub

On this page