Python - Errores conexion puerto seriall

   
Vista:

Errores conexion puerto seriall

Publicado por Aitor (1 intervención) el 11/08/2016 11:23:58
Hola instale el serialpy hace varios días y no consigo echarlo andar, he por internet y no encuentro la solución.

Cuando intento ejecutar este código:
1
2
import serial
arduino = serial.Serial('/dev/cu.Repleo-PL2303-00002314', baudrate=9600, timeout=1.0)

Me da el error que biene a continuación, con otros códigos que me he bajado de internet creo que el error es el mismo:

1
2
3
4
5
6
Traceback (most recent call last):
  File "/Users/aitor/Google Drive/Python/serial/serial/serial.py", line 1, in <module>
    import serial
  File "/Users/aitor/Google Drive/Python/serial/serial/serial.py", line 2, in <module>
    arduino = serial.Serial('/dev/cu.Repleo-PL2303-00002314', baudrate=9600, timeout=1.0)
AttributeError: 'module' object has no attribute 'Serial'

Respecto a la instalación de pyserial creo que es correcta y sin errores:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
sudo python setup.py install
running install
Checking .pth file support in /Library/Python/2.7/site-packages/
/usr/bin/python -E -c pass
TEST PASSED: /Library/Python/2.7/site-packages/ appears to support .pth files
running bdist_egg
running egg_info
writing pyserial.egg-info/PKG-INFO
writing top-level names to pyserial.egg-info/top_level.txt
writing dependency_links to pyserial.egg-info/dependency_links.txt
reading manifest file 'pyserial.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'pyserial.egg-info/SOURCES.txt'
installing library code to build/bdist.macosx-10.11-intel/egg
running install_lib
running build_py
creating build/bdist.macosx-10.11-intel/egg
creating build/bdist.macosx-10.11-intel/egg/serial
copying build/lib/serial/__init__.py -> build/bdist.macosx-10.11-intel/egg/serial
copying build/lib/serial/aio.py -> build/bdist.macosx-10.11-intel/egg/serial
copying build/lib/serial/rfc2217.py -> build/bdist.macosx-10.11-intel/egg/serial
copying build/lib/serial/rs485.py -> build/bdist.macosx-10.11-intel/egg/serial
copying build/lib/serial/serialcli.py -> build/bdist.macosx-10.11-intel/egg/serial
copying build/lib/serial/serialjava.py -> build/bdist.macosx-10.11-intel/egg/serial
copying build/lib/serial/serialposix.py -> build/bdist.macosx-10.11-intel/egg/serial
copying build/lib/serial/serialutil.py -> build/bdist.macosx-10.11-intel/egg/serial
copying build/lib/serial/serialwin32.py -> build/bdist.macosx-10.11-intel/egg/serial
creating build/bdist.macosx-10.11-intel/egg/serial/threaded
copying build/lib/serial/threaded/__init__.py -> build/bdist.macosx-10.11-intel/egg/serial/threaded
creating build/bdist.macosx-10.11-intel/egg/serial/tools
copying build/lib/serial/tools/__init__.py -> build/bdist.macosx-10.11-intel/egg/serial/tools
copying build/lib/serial/tools/hexlify_codec.py -> build/bdist.macosx-10.11-intel/egg/serial/tools
copying build/lib/serial/tools/list_ports.py -> build/bdist.macosx-10.11-intel/egg/serial/tools
copying build/lib/serial/tools/list_ports_common.py -> build/bdist.macosx-10.11-intel/egg/serial/tools
copying build/lib/serial/tools/list_ports_linux.py -> build/bdist.macosx-10.11-intel/egg/serial/tools
copying build/lib/serial/tools/list_ports_osx.py -> build/bdist.macosx-10.11-intel/egg/serial/tools
copying build/lib/serial/tools/list_ports_posix.py -> build/bdist.macosx-10.11-intel/egg/serial/tools
copying build/lib/serial/tools/list_ports_windows.py -> build/bdist.macosx-10.11-intel/egg/serial/tools
copying build/lib/serial/tools/miniterm.py -> build/bdist.macosx-10.11-intel/egg/serial/tools
creating build/bdist.macosx-10.11-intel/egg/serial/urlhandler
copying build/lib/serial/urlhandler/__init__.py -> build/bdist.macosx-10.11-intel/egg/serial/urlhandler
copying build/lib/serial/urlhandler/protocol_alt.py -> build/bdist.macosx-10.11-intel/egg/serial/urlhandler
copying build/lib/serial/urlhandler/protocol_hwgrep.py -> build/bdist.macosx-10.11-intel/egg/serial/urlhandler
copying build/lib/serial/urlhandler/protocol_loop.py -> build/bdist.macosx-10.11-intel/egg/serial/urlhandler
copying build/lib/serial/urlhandler/protocol_rfc2217.py -> build/bdist.macosx-10.11-intel/egg/serial/urlhandler
copying build/lib/serial/urlhandler/protocol_serve-rfc2217.py -> build/bdist.macosx-10.11-intel/egg/serial/urlhandler
copying build/lib/serial/urlhandler/protocol_socket.py -> build/bdist.macosx-10.11-intel/egg/serial/urlhandler
copying build/lib/serial/urlhandler/protocol_spy.py -> build/bdist.macosx-10.11-intel/egg/serial/urlhandler
copying build/lib/serial/win32.py -> build/bdist.macosx-10.11-intel/egg/serial
byte-compiling build/bdist.macosx-10.11-intel/egg/serial/__init__.py to __init__.pyc
byte-compiling build/bdist.macosx-10.11-intel/egg/serial/aio.py to aio.pyc
byte-compiling build/bdist.macosx-10.11-intel/egg/serial/rfc2217.py to rfc2217.pyc
byte-compiling build/bdist.macosx-10.11-intel/egg/serial/rs485.py to rs485.pyc
byte-compiling build/bdist.macosx-10.11-intel/egg/serial/serialcli.py to serialcli.pyc
byte-compiling build/bdist.macosx-10.11-intel/egg/serial/serialjava.py to serialjava.pyc
byte-compiling build/bdist.macosx-10.11-intel/egg/serial/serialposix.py to serialposix.pyc
byte-compiling build/bdist.macosx-10.11-intel/egg/serial/serialutil.py to serialutil.pyc
byte-compiling build/bdist.macosx-10.11-intel/egg/serial/serialwin32.py to serialwin32.pyc
byte-compiling build/bdist.macosx-10.11-intel/egg/serial/threaded/__init__.py to __init__.pyc
byte-compiling build/bdist.macosx-10.11-intel/egg/serial/tools/__init__.py to __init__.pyc
byte-compiling build/bdist.macosx-10.11-intel/egg/serial/tools/hexlify_codec.py to hexlify_codec.pyc
byte-compiling build/bdist.macosx-10.11-intel/egg/serial/tools/list_ports.py to list_ports.pyc
byte-compiling build/bdist.macosx-10.11-intel/egg/serial/tools/list_ports_common.py to list_ports_common.pyc
byte-compiling build/bdist.macosx-10.11-intel/egg/serial/tools/list_ports_linux.py to list_ports_linux.pyc
byte-compiling build/bdist.macosx-10.11-intel/egg/serial/tools/list_ports_osx.py to list_ports_osx.pyc
byte-compiling build/bdist.macosx-10.11-intel/egg/serial/tools/list_ports_posix.py to list_ports_posix.pyc
byte-compiling build/bdist.macosx-10.11-intel/egg/serial/tools/list_ports_windows.py to list_ports_windows.pyc
byte-compiling build/bdist.macosx-10.11-intel/egg/serial/tools/miniterm.py to miniterm.pyc
byte-compiling build/bdist.macosx-10.11-intel/egg/serial/urlhandler/__init__.py to __init__.pyc
byte-compiling build/bdist.macosx-10.11-intel/egg/serial/urlhandler/protocol_alt.py to protocol_alt.pyc
byte-compiling build/bdist.macosx-10.11-intel/egg/serial/urlhandler/protocol_hwgrep.py to protocol_hwgrep.pyc
byte-compiling build/bdist.macosx-10.11-intel/egg/serial/urlhandler/protocol_loop.py to protocol_loop.pyc
byte-compiling build/bdist.macosx-10.11-intel/egg/serial/urlhandler/protocol_rfc2217.py to protocol_rfc2217.pyc
byte-compiling build/bdist.macosx-10.11-intel/egg/serial/urlhandler/protocol_serve-rfc2217.py to protocol_serve-rfc2217.pyc
byte-compiling build/bdist.macosx-10.11-intel/egg/serial/urlhandler/protocol_socket.py to protocol_socket.pyc
byte-compiling build/bdist.macosx-10.11-intel/egg/serial/urlhandler/protocol_spy.py to protocol_spy.pyc
byte-compiling build/bdist.macosx-10.11-intel/egg/serial/win32.py to win32.pyc
creating build/bdist.macosx-10.11-intel/egg/EGG-INFO
installing scripts to build/bdist.macosx-10.11-intel/egg/EGG-INFO/scripts
running install_scripts
running build_scripts
creating build/bdist.macosx-10.11-intel/egg/EGG-INFO/scripts
copying build/scripts-2.7/miniterm.py -> build/bdist.macosx-10.11-intel/egg/EGG-INFO/scripts
changing mode of build/bdist.macosx-10.11-intel/egg/EGG-INFO/scripts/miniterm.py to 755
copying pyserial.egg-info/PKG-INFO -> build/bdist.macosx-10.11-intel/egg/EGG-INFO
copying pyserial.egg-info/SOURCES.txt -> build/bdist.macosx-10.11-intel/egg/EGG-INFO
copying pyserial.egg-info/dependency_links.txt -> build/bdist.macosx-10.11-intel/egg/EGG-INFO
copying pyserial.egg-info/top_level.txt -> build/bdist.macosx-10.11-intel/egg/EGG-INFO
zip_safe flag not set; analyzing archive contents...
creating 'dist/pyserial-3.1.1-py2.7.egg' and adding 'build/bdist.macosx-10.11-intel/egg' to it
removing 'build/bdist.macosx-10.11-intel/egg' (and everything under it)
Processing pyserial-3.1.1-py2.7.egg
Removing /Library/Python/2.7/site-packages/pyserial-3.1.1-py2.7.egg
Copying pyserial-3.1.1-py2.7.egg to /Library/Python/2.7/site-packages
pyserial 3.1.1 is already the active version in easy-install.pth
Installing miniterm.py script to /usr/local/bin
 
Installed /Library/Python/2.7/site-packages/pyserial-3.1.1-py2.7.egg
Processing dependencies for pyserial==3.1.1
Finished processing dependencies for pyserial==3.1.1

Respecto al nombre del puerto /dev/cu.Repleo-PL2303-00002314, creo que es correcto, ya que es el mismo que utilizo para conectar con Arduino.

Con lo cual estoy en uno de mis últimos pasos de mi programa y no se por donde tirar, no se lo que puedo tener mal, o que estoy haciendo mal.

Espero vuestras sugerencias, un saludo y muchas gracias de antemano.
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder