I am using an FT232 breakout board to control a rotary sensor through Python 2.7
If I plug in the AD2 first, my python code fails due to "no device found".
If I plug in the FT232 first, and establish the connection with Python, everything works OK.
How can I track down the cause and resolve it?
The errors listed follow:
C:\Python27\lib\site-packages\adafruit_gpio-1.0.3-py2.7.egg\Adafruit_GPIO\FT232H.pyc in __init__(self, vid, pid, serial)
148 if serial is None:
149 # Open USB connection for specified VID and PID if no serial is specified.
--> 150 self._check(ftdi.usb_open, vid, pid)
151 else:
152 # Open USB connection for VID, PID, serial.
C:\Python27\lib\site-packages\adafruit_gpio-1.0.3-py2.7.egg\Adafruit_GPIO\FT232H.pyc in _check(self, command, *args)
202 logger.debug('Called ftdi_{0} and got response {1}.'.format(command.__name__, ret))
203 if ret != 0:
--> 204 raise RuntimeError('ftdi_{0} failed with error {1}: {2}'.format(command.__name__, ret, ftdi.get_error_string(self._ctx)))
205
206 def _poll_read(self, expected, timeout_s=5.0):
Here is my code:
# Python program to use FT232H from a USB port to read and program the MA302 encoder
import Adafruit_GPIO.FT232H as FT232H
import binascii
import sys
from time import sleep
# Temporarily disable FTDI serial drivers.
FT232H.use_FT232H()
# Find the first FT232H device.
ft232h = FT232H.FT232H()
q=spi.transfer([0x82, 0xbf]) #write register 2 with 0xdf
sleep(.020)
print "q=";q
Question
mmar56
I am using an FT232 breakout board to control a rotary sensor through Python 2.7
If I plug in the AD2 first, my python code fails due to "no device found".
If I plug in the FT232 first, and establish the connection with Python, everything works OK.
How can I track down the cause and resolve it?
The errors listed follow:
C:\Python27\lib\site-packages\adafruit_gpio-1.0.3-py2.7.egg\Adafruit_GPIO\FT232H.pyc in __init__(self, vid, pid, serial)
148 if serial is None:
149 # Open USB connection for specified VID and PID if no serial is specified.
--> 150 self._check(ftdi.usb_open, vid, pid)
151 else:
152 # Open USB connection for VID, PID, serial.
C:\Python27\lib\site-packages\adafruit_gpio-1.0.3-py2.7.egg\Adafruit_GPIO\FT232H.pyc in _check(self, command, *args)
202 logger.debug('Called ftdi_{0} and got response {1}.'.format(command.__name__, ret))
203 if ret != 0:
--> 204 raise RuntimeError('ftdi_{0} failed with error {1}: {2}'.format(command.__name__, ret, ftdi.get_error_string(self._ctx)))
205
206 def _poll_read(self, expected, timeout_s=5.0):
Here is my code:
# Python program to use FT232H from a USB port to read and program the MA302 encoder
import Adafruit_GPIO.FT232H as FT232H
import binascii
import sys
from time import sleep
# Temporarily disable FTDI serial drivers.
FT232H.use_FT232H()
# Find the first FT232H device.
ft232h = FT232H.FT232H()
q=spi.transfer([0x82, 0xbf]) #write register 2 with 0xdf
sleep(.020)
print "q=";q
Link to comment
Share on other sites
2 answers to this question
Recommended Posts
Archived
This topic is now archived and is closed to further replies.