0

How can I find what is the serial port assigned to the MindWave USB in Windows8.1? The code I am using has this for Mac OSX:

import platform
import sys, time
from mindwave import bluetooth_headset
import httplib, urllib, urllib2
import json

#serial_port = '/dev/tty.MindWaveMobile-DevA-10'

Here's what my device manager shows: enter image description here

I'd like to know how to change line 10 of http://pastebin.com/jR21F4Xf in order to make it work in Windows. Currently MindWave USB Dongle is connected to COM4.

Here's the config file:

{
    "mindwave_serial_port": "COM4",
    "hue_bridge_addr": "10.0.0.225",
    "user": "mona6_000",
    "send_to_gatd": "True",
    "show_spectrum": "True"
}

Here's what MindWave Manager shows: enter image description here

Here's what I get in PowerShell: enter image description here

I have installed pyserial using easy_install: enter image description here

However I cannot import it in python interactive shell while I don't get any error running my code: enter image description here

Mona Jalal
  • 34,860
  • 64
  • 239
  • 408
  • 1
    Should just be `COM4`, e.g. `connection = serial.Serial(port = 'COM4', ...`. – 101 Dec 09 '15 at 01:11
  • so the code is like http://pastebin.com/jR21F4Xf and I don't know how to change the code to work with the rest of python code. Can you please take a look at it and tell me how to change the line 10? – Mona Jalal Dec 09 '15 at 01:22
  • It's getting the serial port from a config file somewhere. To override that, try adding the line `self.serial_port = 'COM4'` right after the first instance of `self.get_config()`. – 101 Dec 09 '15 at 01:27
  • hi 101, can you please take a look at the update? – Mona Jalal Dec 09 '15 at 01:30
  • That should work then, as it's already `COM4`. So don't change anything. However, it also depends what happens in the function `headset.Headset(self.serial_port)`, which presumably uses pyserial. – 101 Dec 09 '15 at 01:32
  • seems `pyserial` doesn't have a 64 bit version https://pypi.python.org/pypi/pyserial – Mona Jalal Dec 09 '15 at 01:34
  • 1
    Generally people use 32-bit Python, even on 64-bit Windows. – 101 Dec 09 '15 at 01:36
  • So, I installed the pyserial using easy_install. still I have the same problem. Can you please take a look at the screenshots I have added now? – Mona Jalal Dec 09 '15 at 01:51
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/97355/discussion-between-101-and-mona-jalal). – 101 Dec 09 '15 at 01:54

0 Answers0