I2C Error when using Baro Sensor

Posted on
  • Sometimes i get the following error when powering up the baro sensor:

    
    Uncaught Error: I2C Error: Arbitration (start)
     at line 1 col 43
    Bangle.setBarometerPower(true, "tinyVario");
    

    It seems to be totally random, should i just use "try" and "catch" to repeatedly power up the sensor until i get no error? The sensor still works after this error, but pressure readings are way off.

  • Are you on the latest Bangle.js firmware? (2v14)

    And yes, I'd just try..catch it. From the look of it, even if that code creates an exception, things may still work fine - is that the case?

    How often does it happen? I know there have been intermittent I2C errors on some devices, but generally that was when getting the values, and I think we handle that ok now. I haven't generally seen it when powering the barometer on, but I guess most apps just power it on and leave it on.

    Looking at it, I could add a retry or two in the Espruino firmware itself, which might help to fix this though.

  • 2v14 stable, yes. It happened on 2v13 as well.
    I just turn the barometer on when the app starts. It kind of works after the error, but there seems to be a pressure offset. As far as i know, the barometer chip has some calibration values that are being read at startup, maybe they are not read correctly?

  • As far as i know, the barometer chip has some calibration values that are being read at startup, maybe they are not read correctly?

    That's right, yes... So I guess that could mess things up (although I'd have hoped that if it failed then it would have kept the old values).

    I've just made some changes to make it retry two more times if there's an I2C error, so if you use a cutting edge build now I'd hope that fixes it for you

  • Will try, thanks!

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

I2C Error when using Baro Sensor

Posted by Avatar for RaoulDuke @RaoulDuke

Actions