Problem with logging and Javascript SDK

Hi, I'm trying to run the logging example for the JavaScript SDK and on the line:

MetaWear.mbl_mw_datasignal_log(accSignal, ref.NULL, MetaWear.FnVoid_VoidP_DataLoggerP.toPointer(function (context, logger) {
accelLogger = logger;
callback(logger.address() ? null : new Error('failed to start logging accel'));
}));

I'm getting .toPointer doesn't exist on a null object. It appears as though I can't get a logger. I've tried a bunch of things and none work. I've had similar problems with the other examples but got things to work by looking at the CPP docs and the code in the javascript SDK. I'm having trouble with this one. I've tried the example verbatim except that I put in the address of my MetaMotion R board and connect to that.

Comments

  • Did you install the latest release (v0.2.0 as of this post)? If so, try deleting the node_modules folder and reinstall.

  • It was an older version of the SDK. Installing the new version fixed the logging example. I then had to go and update the code for reading the data in all of my other code. Thanks!

  • It seems there are a lot of old entries in there maybe based on the dates on the downloaded log and it's taking a long time to download them all. I've tried calling MetaWear.mbl_mw_metawearboard_tear_down(device.board); and MetaWear.mbl_mw_debug_reset(device.board); to see if I can clear out the entries, but it doesn't seem to be working. Is there a sure fire way to delete all of the log entries?

  • use mbl_mw_logging_clear_entries.

    MetaWear.mbl_mw_logging_clear_entries(device.board)
    MetaWear.mbl_mw_debug_reset_after_gc(device.board)
    MetaWear.mbl_mw_debug_disconnect(device.board)
    
This discussion has been closed.