I got the following error when trying to read the sequences of a set of camera in a loop.
Recorder error: (GetSequences) Internal error - Server unreachable. Reason: ProtocolError - , 0 - 0
Attached with the code snippet of my function, which iterate a list of camera Item and add their respective sequence(s) into a collection.
For instance, the ListOfSeqSource consists of three camera items.
Sometimes one or two out of them are able to retrieve from the VMS,
but never all of them.
The second code snippet shows how the error is capture by registering to the Environment manager.
//ListOfSeqSource is list of item : List<item> with Kind == Camera
ListOfSeqSource.RemoveAll(x => x.FQID.Kind != Kind.Camera);
foreach (var seqSource in ListOfSeqSource)
{
List<object> ListOfSeqDataInOneSource = new List<object>();
var thisSeqDataSource = new SequenceDataSource(seqSource);
ListOfSeqDataInOneSource = thisSeqDataSource.GetData(
DateTime.Now,
new TimeSpan(30, 0, 0, 0), //read all data from 30 days before
10, //10 files max
new TimeSpan(0),
0);
if (ListOfSeqDataInOneSource.Count == 0) continue;
//Add result into collection
_viewModel.AllSequenceCollection.AddRange(ListOfSeqDataInOneSource);
}
}
EnvironmentManager.Instance.RegisterReceiver(RecorderErrorHandler,
new MessageIdFilter(MessageId.Control.RecorderErrorIndication));
private object RecorderErrorHandler(Message message, FQID receiver, FQID sender)
{
RecorderErrorIndicationData data = message.Data as RecorderErrorIndicationData;
string errMsg =
"Recorder error: (" + data.Command + ") " +
data.ErrorText + ", " + data.RecorderWebInterfaceErrorCode +
" - " + data.PtzErrorDetail;
App.CctvLogger.Error(errMsg);
new ConfirmationMessageBox(ButtonLayout.OK, "Recorder Error", errMsg).ShowDialog();
return null;
}
Thanks.