Error Codes

Last Updated on : 2024-03-25 01:58:49download

This topic describes the error codes for operations supported by the IPC SDK. Certain error codes apply to P2P SDK.

Error codes for P2P SDK

Error code Description Possible cause
0 No error has occurred. -
-1 The SDK is uninitialized. -
-3 A connection timeout error has occurred. Reconnection is recommended. -
-5 The parameter is invalid. -
-11 The session is invalid. -
-12 The connection is closed by the device. -
-13 The session has been closed. -
-14 The session is closed by an IPC. -
-16 The listener is interrupted. -
-19 The connection is interrupted. The break() method has been called.
-23 The number of sessions has reached the upper limit. -
-24 The preconnection is invalid. -
-25 The preconnection is closed. -
-26 The preconnection is activated. -
-29 The system has run out of memory. -
-30 The API request failed. -
-31 The preconnection is not supported. -
-100 The peer end has terminated the peer-to-peer (P2P) communication. -
-102 The device runs in privacy mode and the requested session is closed. -
-103 Failed to create a data sending thread. The requested session is closed. -
-104 The maximum number of sessions has been reached. The requested session is closed. -
-105 The authentication failed. The requested session is closed. Reconnection is recommended. -
-106 The session is closed as expected. The return value of recv() is -13. -
-108 A zombie session that cannot be terminated or rolled back has occurred due to a malfunction or deadlock. The session is closed forcibly. No data communication occurs in a period of more than 20 minutes.
-109 You have called the open API to manually closed a session. -
-110 You have called the open API to exit the P2P module. -
-111 You have called the open API to make the device run in privacy mode. -
-113 The device is processing a call. -
-114 Failed to request application resources. -
-1000 The request parameter is invalid. -
-1001 The API request failed. -
-1002 Invalid data has been returned in the response. -
-1010 The parameters of the method are invalid. -
-1011 Failed to call the API method. -
-1020 The device information is empty. Check whether the list of devices has been returned.
-1021 P2pType is not supported. A device or configuration error has occurred.

Error codes for IPC SDK

Error code Description Possible cause
-1300 The request parameter is invalid. -
-1301 The API request failed. -
-1302 Invalid data has been returned in the response. -
-1303 Required parameters are missing in the IPC SDK API response. Check the configuration of the device or pair it again.
-1310 The parameters of the method are invalid. -
-1311 Failed to call the API method. -
-1320 The service API is not implemented. -
-1321 The API call is blocked. -
-1330 Failed to create the file. The path or file name is incorrect.
-1331 Failed to write the file to a local directory. System error. Please try again later.
-1332 Failed to compress the image. System error. Please try again later.
-1340 Failed to save data to the system album. Check whether permissions on the system album are granted.
-1350 The device information is empty. Check whether the list of devices has been returned.
-1360 The Camera object is uninitialized or destroyed. -
-1361 Failed to create the Camera object. Check whether the device type is correct.
-1362 The Camera connection has an exception or is not created. -
-1363 The video talk parameters are not set for the Camera object. Check whether the device is connected, or try again.
-1364 Failed to bind Camera with the view object. Check the API method for implementing the view object. -
-1370 Failed to create the Network Video Recorder (NVR) object. -
-1371 The connection to the NVR is not supported. -
-1372 The NVR does not support the one-channel connection. Check whether the device configuration is correct.
-1373 The parentId of the sub-device does not match the devId of the main device NVR. Check whether the device configuration is correct.
-1374 The nodeId of the sub-device is empty. -
-1375 The sub-device channel is not associated with the IPC SDK. -
-1376 The main device NVR has been connected. When the sub-device called disconnect(), an error message has been returned. -
-1390 The locally connected device is offline. -
-1391 An error has occurred while processing constructor parameters for direct connection between the app and the device. -
-1392 Failed to directly connect to the device over a local area network (LAN). -
-1400 The data point (DP) is not supported. Configure the DP on the Tuya IoT Development Platform.
-1401 The format of the DP sent is invalid. -
-1402 The DP query timed out. -
-1430 PTZ control is not supported. Configure the DP on the Tuya IoT Development Platform.
-1431 Site favorites cannot be added during panoramic auto-patrol and site favorite auto-patrol. -
-1432 The number of site favorites is less than 2, so site favorite auto-patrol cannot be enabled. -
-1440 Failed to stop previewing. The device is running in the non-previewing state. -
-1500 The message attachment type is not supported. -
-1530 Failed to download the encrypted image. Check your secretKey or the URL of the encrypted image.
-1600 Failed to get the user information. -
-2000 The cloud storage configuration configDataTag is empty in the response. Invalid data has been returned in the response.
-2001 The authentication information for cloud storage is empty. Make an API request to get the time slice first.
-2002 Failed to parse the URL for playing cloud-stored resources. -
-2003 Cloud storage does not include any information about extracted frames. -
-2300 Failed to process doorbell calls.
  • The call event is ended. For example, it is hung up or rejected.
  • For more information, see the description of error code -2306.
-2301 The doorbell call was answered by another user when an API request was made to answer it. -
-2302 The doorbell call was canceled on the device when an API request was made to answer it. -
-2303 The doorbell call timed out when an API request was made to answer it. -
-2304 The doorbell call had been answered when an API request was made to answer it again. -
-2305 An API request was made to hang up a doorbell call after it was not answered. -
-2306 The device type is not supported. Example: doorbell
-2600 The device does not support continuous playback. -
-10000 The Camera object is not created. -
-10001 The device is not connected. The camera operations were performed when the device was not connected or was disconnected.
-10002 The session is invalid. -
-10003 A timeout error has occurred. -
-10004 The P2P connection is canceled. Check whether P2P API requests have been made in the correct sequence.
-10006 The device is offline. -
-10007 The operation is canceled by the user. -
-10008 A global device error has occurred. -
-20001 The command is invalid. -
-20002 The parameter is invalid. -
-20003 The data is invalid. The media information of cloud storage has exceptions.
-20004 The cloud-stored video playback task in the starting state is interrupted by the Stop operation. Check whether cloud storage API requests have been made in the correct sequence.
-20005 The operation is not allowed. -
-20006 The current SDK version does not support the specified protocol. Updating to the latest SDK is recommended.
-20007 The device service is busy. The device is on a call.
-20008 The system has run out of memory. -
-30001 Failed to download the file. -
-30002 The device is not in the playback state. Check whether playback API requests are made in the correct sequence. For example, an error will occur if the method of playback with a specified speed is called prior to the method of enabling playback.
-30003 Failed to set the playback speed. -
-30004 The device is not in the cloud-stored video playback state. Check whether cloud storage API requests are made in the correct sequence. For example, an error will occur if the method of cloud-stored video playback with a specified speed is called prior to the method of enabling cloud-stored video previewing.
-30005 Failed to delete playback data. -
-30006 The duration of the video clips to be downloaded for playback exceeds the upper limit or is 0. Check the number of time slices for videos to be downloaded and played back from the device.
-30007 Playback images can only be .jpg files. -
-30008 A status error has occurred while downloading video clips for playback. -
-30010 A curl connection error has occurred. -
-30011 No records were found for the current status. Check whether the recording methods are made in the correct sequence. For example, an error will occur if the method of stopping recording is called prior to the method of starting recording.
-30012 The specified audio and video parameters are incorrect. -
-30013 Failed to write to the MP4 file header. -
-30014 Failed to write to the MP4 file trailer. -
-30050 Failed to enable the video talk feature. -
-30060 An error has occurred while processing the response from the device. -
-30061 An error has occurred while transferring data. An error has occurred while uploading and downloading data. Probably the network or device is disconnected.
-30062 The file does not exist. -
-30063 Failed to create a local file. Check whether the path exists.
-30064 The number of downloaded files exceeds the upper limit or is 0. -
-30065 Failed to delete the file. The error message is returned by the device. Check the device logs for troubleshooting.
-30100 The name of the uploaded file exceeds the length limit. -
-30080 mjpeg2jpeg is not supported. -
-30081 The MJPEG format is not supported. -
-30082 The first I-frame is not received. -
-30083 Only MJPEG streams are supported. -
-30090 The cloud-stored video clips have changes in audio and video parameters and cannot be downloaded. -
-40000 A global error of CameraSDK has occurred. -
-40001 The request parameter is empty. -
-40002 Failed to parse JSON. -
-40200 A global error has occurred while processing media streams. -
-40201 The network request timed out. -
-40202 An error has occurred while parsing the media stream packet. Media stream data is incomplete, and more data is required.
-40203 Decoding timed out. -
-40205 The operation is canceled by the user during media streaming. -
-40300 A global error has occurred while decoding the data. -
-40301 The request parameters for decoding are incorrect. -
-40302 The response parameters for decoding are incorrect. -
-40303 The pixel format is not supported. Check whether the pixel format of streams from the device is supported by the mobile phone.
-40400 A global error of cloud storage has occurred. -
-40401 The URL of the cloud-based resource is inaccessible. -
-40402 The cloud storage metadata does not exist. Cloud storage data for the specified period does not exist.
-40600 A global error of recording has occurred. -
-40800 A global error of uploading and downloading has occurred. -
-41000 A global device error has occurred. -
-41001 The device is not responding. -

Error codes of closing connection for P2P SDK

  • To troubleshoot the problems, analyze the debug logs or offline logs and retrieve close_reason and close_reason_local.
  • If close_reason is 4, close_reason_local is valid. You can use close_reason_local to further analyze the cause of locally closed connection.
  • close_reason is defined in the following table.

    close_reason Description
    1 Failed to initialize communication over Interactive Connectivity Establishment (ICE).
    2 The Datagram Transport Layer Security (DTLS) handshake failed.
    3 The connection is manually canceled with break().
    4 The connection is locally closed with disconnect().
    5 The connection is closed by the peer end and the disconnect() signal is received.
    9 DTLS authentication failed.
    10 Failed to create an ICE, UPD, or TCP connection.
    11 The P2P library is reset.
    12 The number of sessions has reached the upper limit.
    13 The response to activation or hangup of the preconnection session timed out.
    14 A timeout error has occurred while getting the token.
    15 The preconnection session has been closed.
    16 The preconnection is not supported by the peer end.
    17 The API request failed.
    18 The preconnection signal is lost.
  • close_reason_local is defined in the following table.

    close_reason_local Description
    2 The listener for sessions is triggered. But the device runs in privacy mode, so the requested session is closed.
    3 Failed to create a data sending thread. The requested session is closed.
    4 The maximum number of sessions has been reached. The requested session is closed.
    5 The authentication failed. The requested session is closed.
    6 The session has been closed as expected.
    8 No data communication occurs in a period of more than 20 minutes. The session is closed forcibly.
    9 You have called the open API to manually close a session, for example, during a firmware over-the-air (OTA) update.
    10 You have called the open API to exit the P2P module.
    11 You have called the open API to make the device run in privacy mode.
    13 The device is processing a call.
    14 Failed to request application resources.