Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PySerial having problems with Arduino Yun #19

Closed
mseroczynski opened this issue Oct 8, 2015 · 10 comments
Closed

PySerial having problems with Arduino Yun #19

mseroczynski opened this issue Oct 8, 2015 · 10 comments

Comments

@mseroczynski
Copy link

Hello, I've already had some discussion on this issue on PlatformIO Github - please look at trace log below:
(platformio/platformio-core#294 (comment))

python -m serial.tools.list_ports -v returns:
Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 162, in _run_module_as_main "__main__", fname, loader, pkg_name) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 72, in _run_code exec code in run_globals File "/private/tmp/piotest/lib/python2.7/site-packages/serial/tools/list_ports.py", line 102, in <module> main() File "/private/tmp/piotest/lib/python2.7/site-packages/serial/tools/list_ports.py", line 84, in main iterator = sorted(comports()) File "/private/tmp/piotest/lib/python2.7/site-packages/serial/tools/list_ports_osx.py", line 233, in comports serial_interfaces = scan_interfaces() File "/private/tmp/piotest/lib/python2.7/site-packages/serial/tools/list_ports_osx.py", line 209, in scan_interfaces device = get_string_property(service, "IOCalloutDevice") File "/private/tmp/piotest/lib/python2.7/site-packages/serial/tools/list_ports_osx.py", line 101, in get_string_property output = cf.CFStringGetCStringPtr(CFContainer, 0).decode('mac_roman') AttributeError: 'NoneType' object has no attribute 'decode'

@zsquareplusc
Copy link
Member

can you try again with the latest version from git? I pushed a change that should fix this.

@mseroczynski
Copy link
Author

Ok, with 3.0a1 it's like below:

(piotest)MacBook-Pro-ches:tmp ches$ pip list
pip (7.1.2)
pyserial (3.0a1)
setuptools (18.2)
wheel (0.24.0)
(piotest)MacBook-Pro-ches:tmp ches$ python -m serial.tools.list_ports -v
no ports found
(piotest)MacBook-Pro-ches:tmp ches$ ls /dev/cu*
/dev/cu.Bluetooth-Incoming-Port /dev/cu.usbmodem1421
(piotest)MacBook-Pro-ches:tmp ches$ 

@hoihu
Copy link
Contributor

hoihu commented Oct 9, 2015

What's the output of:
ioreg -c IOSerialBSDClient | grep IOCalloutDevice

@d235j
Copy link

d235j commented Oct 10, 2015

PySerial 2.7 works with Python 2.7, does not work with 3.5. Weird.

@mseroczynski
Copy link
Author

    | | | |   |   |     |           "IOCalloutDevice" = "/dev/cu.usbmodem14141"
      |           "IOCalloutDevice" = "/dev/cu.Bluetooth-Incoming-Port"

@mseroczynski
Copy link
Author

@hoihu Any good news for me?

@hoihu
Copy link
Contributor

hoihu commented Oct 16, 2015

It seems that your Macbook has the proper registry entries.

But it doesn't list any of the callout devices (it should for example also list your cu.Bluetooth-Incoming-Port) - so it's not an issue with your board. On my Imac the cu.Bluetooth-Incoming-Port is listed correctly.

comport() iterates through the registry as apple proposes by using the IOSerialBDSClient service and then through the available IOCalloutDevices (which are mapped as cu.xxxx devices under /dev)

Maybe the Ctypes interface is not working as expected (specifically GetIOServicesByType). I'm running my test under OSX 10.10.3, which version are you using?

There are no additional debug versions available, but you could patch comport() in list_ports_osx.py by adding:

    for service in services:
        print service

this will just print one number per service that was found, but then you have at least a clue that the service has been recognised by the GetIOServicesByType call. If no numbers are showing up then the fault is in the GetIOServicesByType function.

If I find some time I'll do some tests on a Macbook.

@hoihu
Copy link
Contributor

hoihu commented May 1, 2016

@mseroczynski: Based on your reference, your issue is resolved? Can this be closed then?

@mseroczynski
Copy link
Author

Yup, my issue was resolved, thank you!

@hoihu
Copy link
Contributor

hoihu commented May 1, 2016

so please close it then...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants