I'm currently building an Android Things application that communicates with an ONVIF IP camera following this youtube tutorial
I can talk to the camera and I can get services and device information but when I try to retrieve profiles, it responds with D/RESPONSE: Response{protocol=http/1.1, code=500, message=Internal Server Error
What would cause this response?
onCreate
currentDevice = OnvifDevice("192.168.1.5","admin","password")
currentDevice.listener = this
currentDevice.getServices()
Log.d("REQUEST", "Get services");
requestPerformed
override fun requestPerformed(response: OnvifResponse) {
//method called when response is received from camera
Log.d("RESPONSE", response.parsingUIMessage);
if (response.request.type == OnvifRequest.Type.GetServices) {
Log.d("REQUEST", "Get device information");
currentDevice.getDeviceInformation()
}
else if (response.request.type == OnvifRequest.Type.GetDeviceInformation) {
Log.d("REQUEST", "Get profiles");
currentDevice.getProfiles()
}
else if (response.request.type == OnvifRequest.Type.GetProfiles) {
Log.d("REQUEST", "Get stream URI");
currentDevice.mediaProfiles.firstOrNull()?.let {
currentDevice.getStreamURI(it)
}
}
else if (response.request.type == OnvifRequest.Type.GetStreamURI) {
Log.d("REQUEST", "Get get video stream");
currentDevice.rtspURI?.let { uri ->
val surfaceView = findViewById<SurfaceView>(R.id.surfaceView)
vlcVideoLibrary = VlcVideoLibrary(this, this, surfaceView)
vlcVideoLibrary?.play(uri)
}
}
}