Muse 2016: Reading Data From Muse UDP Port Using Python



Hi experts,

I am currently trying to develop a python script that is able to retrieve data from the UDP port ( that Muse Direct is giving out data to. I have gotten the connection from python to the UDP port to work, however nothing is appearing out.

Am I missing some parts anywhere? i got the codes from the developer section on the Muse website.


import argparse
import math

from pythonosc import dispatcher
from pythonosc import osc_server

def eeg_handler(unused_addr, args, ch1, ch2, ch3, ch4):
    print("EEG (uV) per channel: ", ch1, ch2, ch3, ch4)

if __name__ == "__main__":
    parser = argparse.ArgumentParser()
                        help="The ip to listen on")
                        help="The port to listen on")
    args = parser.parse_args()

    dispatcher = dispatcher.Dispatcher()"/debug", print)"/muse/eeg", eeg_handler, "EEG")

    server = osc_server.ThreadingOSCUDPServer(
        (args.ip, args.port), dispatcher)
    print("Serving on {}".format(server.server_address))




In the above post you stated you’re sending to UDP 7000, but listening on UDP 5000.


ops sorry let me correct my question. thank you for mentioning.


Hi again, has anyone managed to done what I am trying to do successfully, its been almost a week already and i am still facing the errors listed above. and yes, both ports (Muse Direct and python) are locahost:7000.


hi, i’m having the same problem as you had, did you make any progress?
thank you


Have you tried temporarily disabling your firewall?


hi did you manage to solve it? just run into the same problem …


Same for me. I am able to receive messages in C++ (using library called oscpack), but not in Python. I have ver. 2016 and using Muse Direct on Windows 10 for streaming data. Actually, with this setup, one shall replace osc path, for instance, “/muse/eeg”, with “Person0/eeg”. But event that did not help in Python. Curious what could be wrong here…


Solved it by creating custom OSC output target in Muse Direct.