SensorFusion problem


I am trying to use the SensorFusion module, but I get the following error: 

W/System.err: com.mbientlab.metawear.UnsupportedModuleException: Module 'SensorFusion' not supported for this firmware version
W/System.err:     at com.mbientlab.metawear.impl.DefaultMetaWearBoard.getModule(
W/System.err:     at com.mbientlab.metawear.starter.DeviceSetupActivityFragment.onServiceConnected(
W/System.err:     at$ServiceDispatcher.doConnected(
W/System.err:     at$ServiceDispatcher$
W/System.err:     at android.os.Handler.handleCallback(
W/System.err:     at android.os.Handler.dispatchMessage(
W/System.err:     at android.os.Looper.loop(
W/System.err:     at
W/System.err:     at java.lang.reflect.Method.invoke(Native Method)
W/System.err:     at$
W/System.err:     at

I am using the Meta Motion R board with firmware ver. 1.3.3. I have used the sample Metawear Android app and it works without problems, i.e. it opens the SensorFusion module without giving the error. Therefore I am very sure it's not a problem related to board or firmware.

My code for opening the SensorFusion module looks like this:

public class DeviceSetupActivityFragment extends Fragment implements ServiceConnection {
    private MetaWearBoard mwBoard= null;

private SensorFusion sensorFusionModule;
public void onServiceConnected(ComponentName name, IBinder service) {
mwBoard = ((MetaWearBleService.LocalBinder) service).getMetaWearBoard(settings.getBtDevice());

try {
sensorFusionModule = mwBoard.getModule(SensorFusion.class);
catch (UnsupportedModuleException e)

if (sensorFusionModule != null) {


Why do I get this error?
Please help, I'm going crazy because of this problem!!!


  • edited March 2017
    Assuming you are using Android API v2.8.8, can you set a breakpoint at the getModule function and step through it to determine which operand of the boolean "and" expression fails at this line of code:
  • When I step through the code I get that the value of moduleInfo.containsKey(InfoRegister.SENSOR_FUSION.moduleOpcode() evaluates to false so both the first and second operand fails...

    The size of the moduleInfo HashMap is only 24... but when I step through the same code in the sample MetaWear Android App the size of moduleInfo is 25!

    if (moduleInfo.containsKey(InfoRegister.SENSOR_FUSION.moduleOpcode()) && moduleInfo.get(InfoRegister.SENSOR_FUSION.moduleOpcode()).present()) {

  • Ok, I think i know what's going on.  I presume you have used the starter template with your board, then updated the api dependency for sensor fusion support.  You'll need to clear the app cache with app settings or call clearCachedState from your app.
  • Yes that's exactly what I did!  

    I don't know what caused the error? But I've changed the applicationID in the build.gradle file, and now it works!!

    Should I always call clearCachedState?

    Thanks for excellent support!!
  • You only needed it in this case to remove cached information about the board from the previous API.
This discussion has been closed.