Libmuse ios error playing back muse file



I’m recording some EEG and museElements data using libmuse on iOS but when I try to read back the file with MuseFileReader I get the following error:

muse_file_reader: level:4 code:2 info:Protcol version 29811 is not supported.

Does anyone know the cause of that error? I’m on an Iphone 5s, iOS 10.1.1, using libmuse version 6.0.0 and Muse1 firmware version 7.8

I’ve pasted some code snippets of file writing below:

self.fileWriter = [IXNMuseFileFactory museFileWriterWithPathString:myFilePath];
[self.fileWriter addAnnotationString:1 annotation:@“fileWriter created”];

-(void)receiveMuseDataPacket:(IXNMuseDataPacket )packet muse:(IXNMuse)muse{
switch (packet.packetType) {
case IXNMuseDataPacketTypeEeg:
[self.fileWriter addDataPacket:IXNMuseDataPacketTypeEeg packet:packet];
case IXNMuseDataPacketTypeAlphaAbsolute:
[self.fileWriter addDataPacket:IXNMuseDataPacketTypeAlphaAbsolute packet:packet];
//NSLog(@“alpha packet received:%@”,packet);



-(void)receiveMuseArtifactPacket:(IXNMuseArtifactPacket *)packet muse:(nullable IXNMuse *)muse {

if (!self.sawOneBlink) {
    self.sawOneBlink = YES;
    self.lastBlink = !packet.blink;
if (self.lastBlink != packet.blink) {
    if (packet.blink){
        //[self.fileWriter addAnnotationString:1 annotation:@"blink"];
        [self.fileWriter addArtifactPacket:IXNMuseDataPacketTypeArtifacts packet:packet];
    self.lastBlink = packet.blink;


and file reading:

IXNMuseFileReader *fileReader =
[IXNMuseFileFactory museFileReaderWithPathString:myFilePath];
IXNResult *res = [fileReader gotoNextMessage];
while (res && ![[res info] isEqualToString:@“EOF.”]) {

    IXNMessageType type = [fileReader getMessageType];
    // more stuff below but it crashes here // 


The problem is intermittent and difficult to pinpoint the cause, although I think it might have something to do with the blink logging.
I also noticed this error message at some point, possibly related:

[libprotobuf ERROR 3rdparty/protobuf/src/google/protobuf/] Can’t parse message of type “interaxon.muse_data.MuseDataCollection” because it is missing required fields: (cannot determine missing fields for lite message)

Any leads much appreciated.
PS Sorry for the weird code formatting! I wasn’t sure how to get this to display properly.



I found the cause of the problem, and I’m a little embarrassed to admit it was a really rookie mistake.
In case anyone else is ever struggling to decipher that error in the future, make sure that what you’re trying to read is really a .muse file… :smiley: