OpenSDK  V4.2.0
Error Code

Get the error codes via OpenSDK_GetLastErrorCode and get the error code information via OpenSDK_GetLastErrorDesc. The API only returns 0 and -1 by default (except some special API). The error code of SDK is listed according to modules. Major and frequently-occurred error codes are shown below.
error code is defined in the header file of OpenNetStreamError.h.
return via information callback function, refer to header file of INS_ErrorCode.h for details.

error code format{xbbbbb}, x represents the module type of error code, bbbbb represent what the error is, the value of x is shown below:

0correct conditioncorrect
1network exceptionThis error is the same with network or configuration information error, so CURL ErrorCode is still available, for example, DNS is not configured.
2user operation errorUser level error code. It is usually caused by improper usage of SDK by the users.
3platform server errorThe error returned by OpenApi. For details, refer to error code of server port
4system resource exceptionUsually caused by inadequate system resource, e.g., inadequate memory.
5get stream exceptionerror code of streaming module
6method not supportedSDK unsupported
7push errorpush relevant error information
9undefined errorerror code without specific definition

The following table shows the definition of the detailed error code value.

Network Level
OPEN_SDK_COULDNT_RESOLVE_HOST100006unable to resolve to specified remote hostHere it refers that the domain name of the platform fails to be resolved. The reason maybe that the DNS is not configured or the device is disconnected.
OPEN_SDK_COULDNT_CONNECT100007the remote host is unavailableHere it refers to failing to access the platform. It may be caused by incorrect platform address.
OPEN_SDK_OPERATION_TIMEOUT100028request timed out

The expiry time is 20s. Request timed out. Check the address configuration of the platform.

User Operation Level
OPEN_SDK_BAD_PARAMS200001Invalid incoming parameter of API
OPEN_SDK_SESSION_INVALID200002The current session doesn't exist or has been released.incoming value of SessionId error or the Session has been deleted.
OPEN_SDK_VIDEO_RECORD_NOT_EXIST200003No video file exists in the specified period.
OPEN_SDK_VIDEO_RECORD_SEARCHING200004Searching video records...
OPEN_SDK_STOP_ALARM_REC_FAILED200005Failed to disable alarm.
OPEN_SDK_PERMANENT_KEY_INVALID200006Incorrect verificaiton code.
OPEN_SDK_PIC_DECRYPT_FAILED200007Failed to decode the picture.
OPEN_SDK_PIC_CONTENT_INVALID200008Invalid picture content.
OPEN_SDK_PIC_NO_NEED_DECRYPT200009The picture doesn't need to be decoded.
OPEN_SDK_PIC_COULDNT_ALLOC_BUFFERS200010Failed to allocate memory of picture resources.

Insufficient memory or the picture size is too large.

OPEN_SDK_RESPINFO_BAD300001The information requested to return. json cannot resolve it.It may be caused by the configuration problem ofPlatformAddr.
OPEN_SDK_RESPINFO_INVALID300002Incorrect return information format of the request.
OPEN_SDK_ACCESSTOKEN_INVALID310002accesstoken exception or accesstoken has been expired.
OPEN_SDK_SIGNATURE_ERROR310008Incoming parameter error. System displaying signature error.
OPEN_SDK_USERID_PHONE_UNBIND310014The third-party userId and phone under APPKEY are unbound.
OPEN_SDK_CHANNEL_NOT_EXIST320001The channel doesn't exist.The channel corresponds with a specific camera.
OPEN_SDK_USER_NOTOWN_DEVICE320018The user doesn't have the device.

System Resource Level
OPEN_SDK_COULDNT_CREATE_THREAD400001Failed to create a thread.
OPEN_SDK_COULDNT_ALLOC_BUFFERS400002Failed to apply memory resources.

Streaming Function Level
OPEN_SDK_NS_OPERATIONCODE_FAILED500045Failed to get operation code.It will report this error if users enabled terminal binding.
OPEN_SDK_NS_STREAM_LIMIT500410Limit of streaming channel number The device connection number reaches upper limit.
OPEN_SDK_NS_DEV_NO_ONLINE503121Device offline
OPEN_SDK_NS_PERMANENTKEY_EXCEPTION502012Input key again. 1. Clear-text key and MD5 key mismatched. Verification code error.
OPEN_SDK_NS_VTDU_TIMEOUT502021Stream media sending or receiving signal timed out.Check the device network status. It is usually caused by network problems.
OPEN_SDK_NS_VTDU_CLIENT_TIMEOUT502025vtduThe client receiving response timed out.

The camera and DVR/NVR may have connection problems.

Unsupported Level
OPEN_SDK_DEV_NOT_SUPPORT600001Only support device of version 1.7.
OPEN_SDK_API_NO_IMPLEMENT600002The API is not realized.

Push message level error.
OPEN_SDK_PUSH_PARAM_ERROR710001Invalid incoming parameters.
OPEN_SDK_PUSH_DATA_UNINIT_ERROR710002The data is uninitialized.Initialize by calling the API Init first.
OPEN_SDK_PUSH_NO_REGISTER_ERROR710003Unregistered on the push system.Call register API first.
OPEN_SDK_PUSH_NO_MQTT_CREATE_ERROR710004Push object hasn't been created.

You haven't call create API.

OPEN_SDK_PUSH_MQTT_DISCONNECTED_ERROR720003sdk disconnected with push server. Network disconnected or unstable network.
OPEN_SDK_PUSH_MQTT_MAX_MESSAGES_ERROR720004The number of the received push messages reaches upper limit.
OPEN_SDK_PUSH_MQTT_NULL_PARAMETER_ERROR720006The incoming parameter is empty pointer.

OPEN_SDK_PUSH_MQTT_VERSION_INVALID_ERROR730001Connection fails. Unsupported by the protocol version.
OPEN_SDK_PUSH_MQTT_IDENTIFIER_ERROR730002Connection fails, the only ID is incorrect.
OPEN_SDK_PUSH_MQTT_SERVER_UNAVAILABLE_ERROR730003Connection fails. The service doesn't exist.
OPEN_SDK_PUSH_MQTT_BAD_USERNAME_PASSWORD_ERROR730004Connection fails. Incorrect mqtt username and password.
OPEN_SDK_PUSH_MQTT_NOT_AUTHORIZED_ERROR730005Connection fails. Unauthorized.

OPEN_SDK_PUSH_PLATFORM_RESPINFO_BAD740001The information returned by the request cannot be resolved normally by json.It may be caused by invalid configuration of PlatformAddr.
OPEN_SDK_PUSH_PLATFORM_RESPINFO_INVALID740002The format of the informaiton returned by the request is incorrect.
OPEN_SDK_PUSH_PLATFORM_SESSION_INVALID_ERROR740003Invalid session.The session might has been released.

It may be caused by invalid configuration of PlatformAddr.

OPEN_SDK_PUSH_COULDNT_CREATE_THREAD750001Failed to create the thread.
OPEN_SDK_PUSH_COULDNT_ALLOC_BUFFERS750002Failed to apply memory resources.

OPEN_SDK_PUSH_COULDNT_RESOLVE_HOST760006The specified remote host is not been resolved.Here it refers that the platform domain fails to be resolved normally. It may be caused by unconfigured DNS or disconnected device.
OPEN_SDK_PUSH_COULDNT_CONNECT760007The remote host is unavailableHere it refers that the platform is inaccessible. It may be caused by the configuration error of the platform address.
OPEN_SDK_PUSH_OPERATION_TIMEOUT760028Request timed out. The expiry time is 20s.

Sending request to platform timed out. Failed to access the EZVIZ OPEN platform. Check the configured address or the network.

Undefined Level
OPEN_SDK_ALLOCSESSION_FAILED900001AllocSession failed.
OPEN_SDK_SEARCH_RECORD_FAILED900002Failed to search playback records.
OPEN_SDK_START_ALARM_REC_FAILED900003Failed to enable alarm.