Hi,Jean-Pierre,
I plan to run phwhisper on Linux system through jupyter. I can find the phwhisper device through “lsusb”, as follows:
shitou@shitou-virtual-machine:~/Desktop$ lsusb
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 002: ID 2b3e:c610 NewAE Technology Inc. PhyWhisperer-USB
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 003: ID 0e0f:0002 VMware, Inc. Virtual USB Hub
Bus 002 Device 002: ID 0e0f:0003 VMware, Inc. Virtual Mouse
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
The contents of the script file to be called are as follows:
import phywhisperer.usb as pw
phy = pw.Usb()
phy.con()
phy.addpattern = True #Adds captured data back, otherwise we capture 'after'
phy.set_power_source("off")
phy.reset_fpga()
phy.set_pattern([0x40, 0x00])
phy.arm()
phy.set_power_source("5V")
#wait a second for device enumeration, 'capturing' LED goes out
raw = phy.read_capture_data()
# WARNING:root:Capture FIFO overflow. Capture stopped when overflow detected.
packets = phy.split_packets(raw)
printPackets = pw.USBSimplePrintSink(highspeed=phy.get_usb_mode() == 'HS')
for packet in packets:
printPackets.handle_usb_packet(ts=packet['timestamp'], buf=bytearray(packet['contents']), flags=0)
Copy the script to jupyter edit area. After running, the error message is as follows:
Traceback (most recent call last):
File "/home/shitou/.local/lib/python3.8/site-packages/phywhisperer/interface/naeusb.py", line 287, in txrx
response = self.get_possible_devices(payload)
File "/home/shitou/.local/lib/python3.8/site-packages/phywhisperer/interface/naeusb.py", line 409, in get_possible_devices
raise IOError("Failed to find USB backend. Check libusb drivers installed, check for path issues on library, and check for 32 vs 64-bit issues.")
OSError: Failed to find USB backend. Check libusb drivers installed, check for path issues on library, and check for 32 vs 64-bit issues.
---------------------------------------------------------------------------
OSError Traceback (most recent call last)
<ipython-input-6-9f2332ac45d8> in <module>
2
3 phy = pw.Usb()
----> 4 phy.con()
5 phy.addpattern = True #Adds captured data back, otherwise we capture 'after'
6 phy.set_power_source("off")
~/.local/lib/python3.8/site-packages/phywhisperer/usb.py in con(self, PID, sn, program_fpga)
113
114 self.usb = NAE.NAEUSB()
--> 115 self.usb.con(idProduct=[PID], serial_number=sn)
116 self._llint = LLINT.PhyWhispererUSB(self.usb)
117
~/.local/lib/python3.8/site-packages/phywhisperer/interface/naeusb.py in con(self, idProduct, connect_to_first, serial_number)
529 """
530
--> 531 devlist = self.get_possible_devices(idProduct)
532
533 snlist = [d['sn'] + " (" + d['product'] + ")\n" for d in devlist]
~/.local/lib/python3.8/site-packages/phywhisperer/interface/naeusb.py in get_possible_devices(self, idProduct)
522
523 def get_possible_devices(self, idProduct):
--> 524 return self.usbseralizer.get_possible_devices(idProduct)
525
526 def con(self, idProduct=[0xACE2], connect_to_first=False, serial_number=None):
~/.local/lib/python3.8/site-packages/phywhisperer/interface/naeusb.py in get_possible_devices(self, idProduct)
123 """Get a list of connected USB devices."""
124 cmdpacket = self.make_cmd(self.GET_POSSIBLE_DEVICES, idProduct)
--> 125 return self.process_rx(self.txrx(tx=cmdpacket))
126
127 def process_rx(self, inp):
~/.local/lib/python3.8/site-packages/phywhisperer/interface/naeusb.py in process_rx(self, inp)
143
144 if resp == self.ERROR:
--> 145 raise payload
146
147 return payload
OSError: Failed to find USB backend. Check libusb drivers installed, check for path issues on library, and check for 32 vs 64-bit issues.
shitou