Maxi Stauss
Maxi Stauss

Reputation: 11

Microsoft Band 2 stops working with unknown error: "only 100 simultaneous commands can be sent at once"

I am writing an Android App for the Microsoft Band 2, in which I am collecting sensor data (heart rate and GSR) and return feedback to the wearer through vibration and information on the band screen.

The use case is primarily for economical experiments, which require the app to run for approx. 30 to 60 minutes. During this period, the app collects heart rate at 1 Hz and GSR at 5 Hz.

Based on the Microsoft Band SDK examples, I collect sensor data by calling this function:

private BandHeartRateEventListener mHeartRateEventListener = new BandHeartRateEventListener() {
    @Override
    public void onBandHeartRateChanged(final BandHeartRateEvent event) {
        if (event != null) {
            appendToUI(String.format(" Heart Rate = %d beats per minute\n"
                    + "Quality = %s\n", event.getHeartRate(), event.getQuality()), "hr");
            if (event.getQuality() == HeartRateQuality.LOCKED) {
                addToBandConnector("hr", event.getHeartRate());
                setColor("hr", green);
                updateStatus("hr", event.getHeartRate());
            } else {
                addToBandConnector("hr", 0);
                setColor("hr", orange);
                updateStatus("hr", 0);
            }
        }
    }
};

GSR data is collected in the same way.

After approximately 20 to 30 minutes, no more data is collected from the band. It seems, the onHeartRateChanged() method is not called.

When trying to restart the sensors, the band sdk returns an unknown error: only 100 simultaneous commands can be sent at once!.

To fix this problem, the band itself has to be restarted.

My first intention was to restart the BandClient by calling this every minute or so:

client.disconnect().await();
client.connect().await();

This did not resolve my issue but seems to keep the band alive for a little bit longer. Also, limiting the read-call to a slower rate results in a longer running time, but is not desired since as much data as possible should be recorded.

I did not find any information on this specific error online. It seems to me that the commands are buffered internally in the band and not finished completely.

Some other research group built a similar application in c# to record sensor from the band. This application produces a different error after the same period of time: “Microsoft.Band.BandIOException: an established connection was aborted by the software in your host machine”. Since I am more familiar with java, I'd like to stay with the Android App.

Can someone propose a way to make sure the executed commands are completed or come up with a reason, why this happens?

Additional information: - Microsoft Band SDK: 1.3.20307.2 Please let me know, if more additional information is required.

Upvotes: 1

Views: 87

Answers (0)

Related Questions