Light Sensor stop working

Hi,

I'm having a problem with the light sensor, the value suddenly fall to zero, and it never goes up until i restart the sensor.
The problem shows up with the metawear app, and with my custom app, I've tried in two different Android phones.
But i've tried with an iPhone too, and it works fine with the iOS app.

Here is a screenshot: http://imgur.com/a/HAIvk

Comments

  • The metawear app shows 75% battery level
  • Please provide board specs and light sensor settings.

    How long does it take for the values to drop to 0? Is it as fast as shown in your screen shot? How are you using the sensor?
  • edited August 2017
    It's a Metatracker board.
    Yes, it's fast, between 0 - 2 seconds. 
    I'm using the sensor to stream the data:

    lightModule = mwBoard.getModule(AmbientLightLtr329.class);
    lightModule.configure()
    .gain(AmbientLightLtr329.Gain.LTR329_8X)
    .integrationTime(AmbientLightLtr329.IntegrationTime.LTR329_TIME_300MS)
    .measurementRate(AmbientLightLtr329.MeasurementRate.LTR329_RATE_500MS)
    .commit();
    lightModule.illuminance().addRouteAsync(new RouteBuilder() {
    @Override
    public void configure(RouteComponent source) {
    source.stream(new Subscriber() {
    @Override
    public void apply(Data data, Object... env) {
    float light_actual = data.value(Float.class);
    		//Introducimos el dato en el array para calcular la media
    lightArray[pos] = light_actual;

    float media_actual = mediaArrayLuz(lightArray);
    //Calculamos el % de desviacion de la toma respecto a la media
    float porcentaje = 100 - (data.value(Float.class) / media_actual * 100);

    //enviamos todos los datos a la distanceactivity para que los muestre
    sendBroadcastLight(light_actual, media_actual, porcentaje);
    }
    });
    }
    }).continueWith(task -> {
    if (task.isFaulted() || task.isCancelled()) {
    Log.i(LOG_TAG, "Error al crear ruta de lightModule : " + task.getError());
    } else {
    Log.i(LOG_TAG, "Comienza la captura de luz");
    Log.i(LOG_TAG, "Minutos de calculo de media de luz : " + MINUTOS_MEDIA_LUZ);
    Log.i(LOG_TAG, "Numero de muestras de luz a guardar : " + lightArray.length);
    lightModule.illuminance().start();
    }
    return null;
    });
  • What values are you getting from the iOS app?

    Also, what I mean is how is the sensor itself being used?  Are you simply shining a light on it or doing something more complex?
  • edited August 2017
    The iOS app gave me normal values for the room where i did the tests. It's iluminated with fluorescent light, with values between 300 - 350 luxes (same values that the Android app when it worked).

    I'm trying to use the sensor to determine when a person carrying the board is in a dark room, or hiding. I've made tests to write down the lux value in the street, in a room fully iluminated, and dark rooms with low light. I've never pointed directly a light to the board apart from the light of the room where I'm working.
  • edited August 2017
    Hrm...in your android code, can you log the result of the bytes method in the Subscriber?

    Log.i("myapp", Arrays.toString(data.bytes()));
  • This all the time, since first log.
    I/myapp: [0, 0, 0, 0]


  • I haven't had a chance to look into this further.  Will try to get around to this by the week's end.
  • Ok, no problem. Thanks for the help.
  • edited August 2017
    I tried streaming illuminance data from a MetaTracker in the office and I am not able to reproduce your issue using the same settings and with the app. At this point, I am not sure what could be the problem given that everything is working fine on the iOS app. My only suggestions are to try resetting the board (both soft reset and pulling the battery) and reflashing the firmware.
  • Ok, I'll do it on monday, and i'll let you know if it worked. Thanks.
  • It didn't work, the sensor keeps failing.
  • With a previous version of the firmware maybe it works.
    Is it possible to install a previous version of the firmware on the board?
    How can I do that?

    Thanks. 
  • You'll have to manually upload it yourself.  Send me the hardware revision and model number of the bugged board.
This discussion has been closed.