Error trying to connect to muse from Android devices


When trying to connect to Android devices using the Muse Android library, it connects then abruptly disconnects.
Please help.

Is there anything I could add to the code to fix it?

Thank you very much for any assistance that could be extended.

Config and Details
Phone Models: Tested on Samsung Note Edge and Asus Zenphone
Libmuse Version: Android 1.3.0
Muse Charge Level: 5
Relative Error Logs:

I/Muse Headband( 4791): Muse 00:06:66:68:B8:44 CONNECTING -> CONNECTED
W/libmuse native( 4791): Connection lost (underlying error: std::exception)
I/Muse Headband( 4791): Muse 00:06:66:68:B8:44 CONNECTED -> DISCONNECTED
W/bt-btif ( 811): bta_jv_rfc_port_to_cb(port_handle:0x1b):jv handle:0x0 not FOUND


I’m experiencing the same issue.
Connection lasts for about 1 second, I receive only one packet (ALPHA_ABSOLUTE).
Android devices:

  • Tablet Asus Nexus 7, Android 4.2.
  • Phone Xiaomi Redmi Note 2, Android 5.0.2.
  • Libmuse 1.3.
    Battery state:
  • 2/5
  • 4/5
  • 5/5
    Often this issue lasts for hours, but seldom Muse works properly.

I’ve noticed that sometimes, while connected, Muse disconnects when I take it off.


Sounds like you’ve got a flat battery on the Muse. Charge it up for half an hour and try again. Also test it with the sample app from the SDK download to make sure your own code isn’t at fault.


It not helps.
A minute ago I’ve charged a black Muse to 4/5 and it disconnects.
bootloader ver: 7.2.4
firmware build: 56
firmware type: consumer
firmware ver: 7.8.0
hardware ver: 15.0
protocol ver: 2

Error repeating with another, white Muse, charged to 3/5.
bootloader ver: 7.2.5
firmware build: 45
firmware ver: 7.2.5
hardware ver: 18.0
protocol ver: 2

Also there are Bluetooth pairing errors sometimes.


Does it connect ok with the Interaxon Calm app?


runAsynchroneously MUST be invoked on the UI thread. And I was trying to do it from an IntentService.


I have problem connecting with MUSE thru blue tooth. I have followed all the instructions posted and no success. No connection at all even with the muse app.


Hi I am having the same problem as you had Miha-x64.

Currently I am running the muse.runAsync task inside my surfaceCreated method. It runs for about 4-5 seconds and is responsive but then i get and exception.
I am not sure what you mean but it needs to run int he UI thread.

@Override [B]public void [/B]surfaceCreated(SurfaceHolder holder) {
try [/B]{
} [B]catch [/B](Exception e) { Log.[I]e[/I]([B]“Muse Headband”[/B], e.toString()); }

02-03 11:00:35.529 21439-21475/com.matthewschwegler.musepong I/System.out: Inside updateAccelerometer!
02-03 11:00:35.549 21439-21475/com.matthewschwegler.musepong I/System.out: Inside receiveMuseDataPacket!
02-03 11:00:35.550 21439-21475/com.matthewschwegler.musepong W/libmuse native: Connection lost (underlying error: std::exception)
02-03 11:00:35.551 21439-21475/com.matthewschwegler.musepong I/Muse Headband: Muse 00:06:66:70:0B:31 CONNECTED -> DISCONNECTED