Cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Handling App msg queue Full

ANSWERED

Hello,

 

I am recording gyroscope (100Hz), accelerometer (100Hz), and gps positioning. Haven't put in the gps portion yet but I am already getting app msg queue full. I currently record in 100 size batches for both sensors. Any of you ran into this problem? How did you solve it?

 

I was thinking of running them at different batch sizes so when one is appending its batch into a file the other is collecting where one is an even batch size and the other is odd and then match them up later.

 

The time of data collection will be about 30 min so thats about 4 size array *8 bytes * 100 times per second * 1800 seconds or 5.7mb worth of data for just the accelerometer. Too big to hold in a buffer right?

 

What would you recommend?

Best Answer
0 Votes
1 BEST ANSWER

Accepted Solutions

I removed some unnecessary code that helped with data readability to free up some processing time. Seems to do the trick to get both sensors reading at 100hz and updating the files every second. Unfortunately GPS would fail on me after a minute so I had to put that on the companion.

 

If anyone runs into this issue with high data collecting needs, run your batch code something like this:

 

 

function readAccelData()
{
  let fd = fs.openSync(filename, 'a+');
  fs.writeSync(fd, accel.readings.timestamp);
  fs.writeSync(fd, accel.readings.x);
  fs.writeSync(fd, accel.readings.y);
  fs.writeSync(fd, accel.readings.z);
  fs.closeSync(fd);
}

It lumps everything together so once you get it to your computer you will need to parse it into a better format of time, x, y, z, time, x,y,z instead of time,time,time,time.....x,x,x,x......y,y,y,y.....z,z,z,z etc.

 

 

 

View best answer in original post

Best Answer
0 Votes
2 REPLIES 2

I would recommend doing some tests and/or calculations to verify that the hardware and software environment is capable of what you're trying to do. It's a 0.12GHz single-core CPU running an interpreted language. It sounds to me like you're keeping it too busy to allow it to service the other demands on its time.

Peter McLennan
Gondwana Software
Best Answer
0 Votes

I removed some unnecessary code that helped with data readability to free up some processing time. Seems to do the trick to get both sensors reading at 100hz and updating the files every second. Unfortunately GPS would fail on me after a minute so I had to put that on the companion.

 

If anyone runs into this issue with high data collecting needs, run your batch code something like this:

 

 

function readAccelData()
{
  let fd = fs.openSync(filename, 'a+');
  fs.writeSync(fd, accel.readings.timestamp);
  fs.writeSync(fd, accel.readings.x);
  fs.writeSync(fd, accel.readings.y);
  fs.writeSync(fd, accel.readings.z);
  fs.closeSync(fd);
}

It lumps everything together so once you get it to your computer you will need to parse it into a better format of time, x, y, z, time, x,y,z instead of time,time,time,time.....x,x,x,x......y,y,y,y.....z,z,z,z etc.

 

 

 

Best Answer
0 Votes