nccgroup/umap2

GreatFET support

Closed this issue · 2 comments

Hi,

I decided to open a new issue just in case somebody can shed a little bit of light on this. The problem is exactly like #31, and I have already commented there as well, but it is currently closed. The main problem I am having is that GreatFET does not connect to the computer as a serial connection like GoodFET or Facedancer 21, so it does not have any tty assigned to it. The error and its exception are obvious since there is no /dev/ttyUSB0 to connect to.

$ umap2scan -P fd:/dev/ttyUSB0 
[ALWAYS] Scanning host for supported devices
[INFO  ] Loading physical interface: fd:/dev/ttyUSB0
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/serial/serialposix.py", line 322, in open
    self.fd = os.open(self.portstr, os.O_RDWR | os.O_NOCTTY | os.O_NONBLOCK)
FileNotFoundError: [Errno 2] No such file or directory: '/dev/ttyUSB0'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/v/.local/bin/umap2scan", line 8, in <module>
    sys.exit(main())
  File "/home/v/.local/lib/python3.8/site-packages/umap2/apps/scan.py", line 80, in main
    app.run()
  File "/home/v/.local/lib/python3.8/site-packages/umap2/apps/scan.py", line 42, in run
    phy = self.load_phy(self.options['--phy'])
  File "/home/v/.local/lib/python3.8/site-packages/umap2/apps/base.py", line 66, in load_phy
    s = Serial(dev_name, 115200, parity=PARITY_NONE, timeout=2)
  File "/usr/local/lib/python3.8/dist-packages/serial/serialutil.py", line 244, in __init__
    self.open()
  File "/usr/local/lib/python3.8/dist-packages/serial/serialposix.py", line 325, in open
    raise SerialException(msg.errno, "could not open port {}: {}".format(self._port, msg))
serial.serialutil.SerialException: [Errno 2] could not open port /dev/ttyUSB0: [Errno 2] No such file or directory: '/dev/ttyUSB0'

dmesg's output does not help either.

[ 3163.722217] usb 1-2: new high-speed USB device number 5 using xhci_hcd
[ 3163.891946] usb 1-2: New USB device found, idVendor=1d50, idProduct=60e6, bcdDevice= 1.00
[ 3163.891951] usb 1-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 3163.891953] usb 1-2: Product: GreatFET
[ 3163.891955] usb 1-2: Manufacturer: Great Scott Gadgets
[ 3163.891956] usb 1-2: SerialNumber: 000000000000000057cc67e630aa7857

There is a /dev/ path created called /dev/greatfet-oneX-Y, where X and Y are two variable numbers, but you can not write to it and umap2 crashes as well.

$ umap2scan -P fd:/dev/greatfet-one1-2 
[ALWAYS] Scanning host for supported devices
[INFO  ] Loading physical interface: fd:/dev/greatfet-one1-2
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/serial/serialposix.py", line 398, in _reconfigure_port
    orig_attr = termios.tcgetattr(self.fd)
termios.error: (25, 'Inappropriate ioctl for device')

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/v/.local/bin/umap2scan", line 8, in <module>
    sys.exit(main())
  File "/home/v/.local/lib/python3.8/site-packages/umap2/apps/scan.py", line 80, in main
    app.run()
  File "/home/v/.local/lib/python3.8/site-packages/umap2/apps/scan.py", line 42, in run
    phy = self.load_phy(self.options['--phy'])
  File "/home/v/.local/lib/python3.8/site-packages/umap2/apps/base.py", line 66, in load_phy
    s = Serial(dev_name, 115200, parity=PARITY_NONE, timeout=2)
  File "/usr/local/lib/python3.8/dist-packages/serial/serialutil.py", line 244, in __init__
    self.open()
  File "/usr/local/lib/python3.8/dist-packages/serial/serialposix.py", line 332, in open
    self._reconfigure_port(force_update=True)
  File "/usr/local/lib/python3.8/dist-packages/serial/serialposix.py", line 401, in _reconfigure_port
    raise SerialException("Could not configure port: {}".format(msg))
serial.serialutil.SerialException: Could not configure port: (25, 'Inappropriate ioctl for device')

GreatFET supports UART and other kinds of serial connection to the board, but using these as a roundabout to talk with the device is futile as well, even if it now has an actual /dev/tty path.

$ umap2scan -P fd:/dev/ttyUSB0 
[ALWAYS] Scanning host for supported devices
[INFO  ] Loading physical interface: fd:/dev/ttyUSB0
[INFO  ] Facedancer resetting...
Traceback (most recent call last):
  File "/home/v/.local/bin/umap2scan", line 8, in <module>
    sys.exit(main())
  File "/home/v/.local/lib/python3.8/site-packages/umap2/apps/scan.py", line 80, in main
    app.run()
  File "/home/v/.local/lib/python3.8/site-packages/umap2/apps/scan.py", line 42, in run
    phy = self.load_phy(self.options['--phy'])
  File "/home/v/.local/lib/python3.8/site-packages/umap2/apps/base.py", line 68, in load_phy
    phy = Max342xPhy(self, s)
  File "/home/v/.local/lib/python3.8/site-packages/umap2/phy/facedancer/max342x_phy.py", line 73, in __init__
    self.device = Facedancer(serial_port)
  File "/home/v/.local/lib/python3.8/site-packages/umap2/phy/facedancer/facedancer.py", line 14, in __init__
    self.reset()
  File "/home/v/.local/lib/python3.8/site-packages/umap2/phy/facedancer/facedancer.py", line 33, in reset
    raise Exception("Facedancer reset fault.")
Exception: Facedancer reset fault.

The old issue was closed by @shtry, so I was wondering if they could get it to work or they just abandoned the project. I am curious and adamant to get it to work (changing code as little as possible) and given umap's compatibility with Facedancer, I think this is highly feasible, but I currently lack the understanding to do so. I would be delighted if any of the devs could share their experience with this device.

Thanks in advance.

There is a fork of this project at usb-tools/nu-map that supports the GreatFET and other new hardware. I recommend you try that, as I don't think it's likely those changes will be merged back here in the near term.

Thanks @spinkham, although that tool is even less developed than this one, but we'll see how it ends up working out. I'll try and help there. Thanks a lot.