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

AttributeError: 'Ftdi' object has no attribute 'is_connected' #28

Open
sandikodev opened this issue Oct 26, 2020 · 4 comments
Open

AttributeError: 'Ftdi' object has no attribute 'is_connected' #28

sandikodev opened this issue Oct 26, 2020 · 4 comments

Comments

@sandikodev
Copy link

python2 dumpflash.py

Traceback (most recent call last):
  File "dumpflash.py", line 53, in <module>
    flash_image_io = flashimage.IO(options.raw_image_filename, options.start_offset, options.length, options.page_size, options.oob_size, options.pages_per_block, options.slow)
  File "/home/dev/REVERSING/dumpflash/dumpflash/flashimage.py", line 24, in __init__
    self.SrcImage = flashdevice.IO(slow)
  File "/home/dev/REVERSING/dumpflash/dumpflash/flashdevice.py", line 42, in __init__
    if self.ftdi.is_connected:
AttributeError: 'Ftdi' object has no attribute 'is_connected'

please help, thanks

@drdoinstuff
Copy link

drdoinstuff commented Oct 27, 2020

pyFTDI uses language features from python3 that aren't compatible with python2.

See https://eblot.github.io/pyftdi/requirements.html

@sandikodev
Copy link
Author

sandikodev commented Oct 27, 2020

thanks, help alot,
i've tried by this git checkout 20db2d3 running on top of python2 "pyftdi==0.13.4", it might still related. and working fine

then on git checkout with latest commit head "fc0c3e13909c9f08e8a4ad90a5a7e0bc02ae1544"
however like @drdoinstuff said, python2 doesn supported anymore. greatt, loveit
by the way python3 with "pyftdi==0.48.3" BITMODE_MCU still supported
upward to "pyftdi==0.50.0" then it says BITMODE_MCU attribute is missing, dont know why
here's for the little message is:

Traceback (most recent call last):
  File "dumpflash/dumpflash.py", line 53, in <module>
    flash_image_io = flashimage.IO(options.raw_image_filename, options.start_offset, options.length, options.page_size, options.oob_size, options.pages_per_block, options.slow)
  File "/home/dev/REVERSING/dumpflash/dumpflash/flashimage.py", line 24, in __init__
    self.SrcImage = flashdevice.IO(slow)
  File "/home/dev/REVERSING/dumpflash/dumpflash/flashdevice.py", line 43, in __init__
    self.ftdi.set_bitmode(0, self.ftdi.BITMODE_MCU)
AttributeError: 'Ftdi' object has no attribute 'BITMODE_MCU'

then iam just using
python3 with "pyftdi==0.48.3"
working well with fine

so helpfull, thanks....

@sandikodev
Copy link
Author

(vrev) (researchDev) ☁  dumpflash [fc0c3e1] ⚡  python dumpflash/dumpflash.py -c read           

* read_pages: -1 ~ -1
Traceback (most recent call last):
  File "dumpflash/dumpflash.py", line 74, in <module>
    flash_image_io.read_pages(start_page, end_page, False, options.output_filename, seq = sequential_read, raw_mode = options.raw_mode)
  File "/home/dev/REVERSING/dumpflash/dumpflash/flashimage.py", line 177, in read_pages
    data = self.SrcImage.read_page(page, remove_oob)
  File "/home/dev/REVERSING/dumpflash/dumpflash/flashdevice.py", line 391, in read_page
    bytes_to_read += self.__read_data(self.PageSize/2)
  File "/home/dev/REVERSING/dumpflash/dumpflash/flashdevice.py", line 142, in __read_data
    return self.__read(0, 0, count)
  File "/home/dev/REVERSING/dumpflash/dumpflash/flashdevice.py", line 87, in __read
    for _ in range(1, count, 1):
TypeError: 'float' object cannot be interpreted as an integer

what is the count data used for ?
it's okay if i change them to int ?
for _ in range(1, int(count,), 1):

thanks

@drdoinstuff
Copy link

It looks like the project has changed quite a lot bit since you ran into problems. Maybe try again?
I'd guess it's been accidentally assigned some point.

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

2 participants