MUSE IO Receiver Android


#1

I downloaded the MUSE IO Receiver code from https://sites.google.com/a/interaxon.ca/muse-developer-site/muse-io-receiver and installed on my Android device. (Samsung GT -i9505 )
I have MUSE connected to laptop via UDP port 5001 and edited the Android code to accept the OSP data via the same. But when MUSE is connected to laptop, I don’t get any output in mobile.

I don’t understand how the connection between OSP server and mobile app works. I believe the Android app should act as a OSP listener and receive OSP data from UDP 5001.

I would appreciate your thoughts to figure this.


#2

Hi kalani,

Your Muse headband conects to your laptop via Bluetooth Serial Profile and MUSE-IO receives Muse data and rebroadcast to your local network using OSC messages via TCP or UDP protocol and the port number you specify in its command line (the default is TCP and port 5000).
You must tell MUSE-IO where to send data, and the default is LOCALHOST (IP 127.0.0.1) wich is your own laptop.

On the other side, the Andoid App example muse-io-receiver will be waiting for those OSC messages listening on it’s defaults - I haven’t tested it, by from the source code it seems to me they are; protocol = TCP and port = 5000

So, you must tell MUSE-IO on your laptop to send messages to your Android IP device number on your network (in my case, for example, my Samsung Tablet gets its IP = 192.168.1.42 from the router, so the muse-io command line (in my case) should be:

muse-io --osc osc.tcp://192.168.1.42:5000

If you want to use UDP and port 5001 I believe you’ll have to adapt the muse-io-receiver code before building the Android App, and after that the muse-io command would be:

muse-io --osc osc.udp://yourAndroidIP:5001

HTH, and anyone, please, correct me, if I’m wrong.

Eduardo


#3

Hi Eduardo,

Thank you very much for the reply. As you adviced I changed my muse-io command to muse-io --osc osc.udp://yourAndroidIP:5001. Still the receiver application is not updating with real time data and shows default 0s. I would appreciate any help.

Thanks,
Kalani


#4

Hi kalani,

muse-io-receiver was released by Interaxon just as an example code about 8 months ago, when there was no Android and Apple API’s available (now we have LibMuse for Android and iOS, and muse-io-receiver is kind of obsolete), and many developers were eager to develop something for their mobiles and tablets at that time. Since then (september/2014) nothing was changed in muse-io-receiver, and a lot have been changed in Muse SDK (specially MUSE-IO OSC PATHS)

– take a look at MuseIOReceiver.java code -> OscReceiver Class -> OscEvent … the addressPattern strings are compared to Muse OSC Paths that do no exists anymore.

You haven’t told us what you have edit in the Android code to get the conection via UDP on port 5001, but I believe you have changed the “onCreate” event in BrainwaveValuesActivity.java code to something like this:
[B]this.museReceiver = new MuseIOReceiver(5001, true);[/B]
(I would not change this as a first test, and would leave everything to their defaults, using the very basic muse-io command line)
[B]muse-io --osc osc.tcp://myAndroidIP:5000[/B]

But the following in [B]MuseIOReceiver.java[/B] code must be changed from:

// Once a muse configuration message has been received then I can
// figure out from which muse messages are coming from and then
// start to send the information received to the listeners.
else if (config != null) {
if (addressPattern.equals([B]"/muse/dsp/elements/alpha"[/B]))
this.sendAlpha(config, msg);
else if (addressPattern.equals([B]"/muse/dsp/elements/beta"[/B]))
this.sendBeta(config, msg);
else if (addressPattern.equals([B]"/muse/dsp/elements/theta"[/B]))
this.sendTheta(config, msg);
else if (addressPattern.equals([B]"/muse/dsp/elements/delta"[/B]))
this.sendDelta(config, msg);
else if (addressPattern.equals("/muse/eeg"))
this.sendEeg(config, msg);
else if (addressPattern.equals("/muse/acc"))
this.sendAccel(config, msg);
else if (addressPattern.equals("/muse/batt"))
this.sendBattery(config, msg);
}

to the new OSC Paths:

[B]"/muse/elements/alpha_relative"
"/muse/elements/beta_relative"
"/muse/elements/theta_relative"
"/muse/elements/delta_relative"[/B]

or the Absolute or Session Scores Band Powers, if you wish.

Note: I do not develop for Android. All my comments above are based on my knowledge on similar OOP based languages.


#5

Hey there kalani,

To reiterate what Eduardo said, MuseIOReceiver is deprecated. It was a temporary solution to provide something for mobile developers to work with before LibMuse was released.

If you want to develop a Muse app for Android, please use LibMuse. The example code included with LibMuse demonstrates the setup of the Bluetooth connection and data acquisition, so that’s a great thing to start with.

I’ve placed a note on the MuseIOReceiver page on our developer site indicating that LibMuse should be used instead in most cases.