Uncaught InternalError: Timeout (Magnetometer)

Posted on
  • I'm using the magOn event to report magnetometer readings. As shown in the example for the Door Controlled Light, I defined a global variable zero and calibrate the sensor with the readings of an initial Puck.mag() call. However, when I try and use Puck.mag() out of the convenience of a setWatch function upon a button press, I get the above error message.

    Can anyone tell me what's wrong here?

    setWatch(function() {
      zero = Puck.mag()
    }, BTN, {edge:"rising", debounce:50, repeat:true});
    

    and I receive something like

    Uncaught InternalError: Timeout (Magnetometer)
     at line 9 col 12
      Puck.mag();
               ^
    in function called from system
    
  • Are you using up to date (1v92) firmware?

    Also, the only time I've come across this before has been when the battery is almost flat - the main processor works fine but the magnetometer stops working slightly before the ARM has trouble.

    Please could you check Puck.getBatteryPercentage() just to make sure?

  • Says 1v88. Battery level is shown as 100, but I know that can't be true.

    Is there a video for firmware updates using iOS? Watched the Android one, but the iOS app looks quite different.

  • Upgraded to 1v92. That fixed it.

  • Great! I'm afraid there isn't a video for iOS - I'll make a note to create one.

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

Uncaught InternalError: Timeout (Magnetometer)

Posted by Avatar for badryan @badryan

Actions