thinglabsoss / superbird-tool

Cross-Platform Spotify Car Thing (superbird) hacking toolkit
43 stars 4 forks source link

Assertation error thing #5

Closed Wackanim closed 1 day ago

Wackanim commented 3 days ago

I am not well versed with this kind of command line thing. I got to the point where I was pretty sure I could flash an image, but when I did, I got an error. I'm not sure what caused it. Here's what it looks like in the command prompt. (I am on windows)

C:\Users\<My name>\Downloads\superbird-tool-main\superbird-tool-main>python superbird_tool.py --restore_device C:\Users\<My name>\Downloads\8.9.2-thinglabs
Spotify Car Thing (superbird) toolkit, v0.1.8, by Thing Labs and Bishop Dynamics
     https://github.com/thinglabsoss/superbird-tool
     Forked from https://github.com/bishopdynamics/superbird-tool

Found device booted in USB Mode (buttons 1 & 4 held at boot)
Entering USB Burn Mode
writing images/superbird.bl2.encrypted.bin at 0xfffa0000
 writing to: 0xfffa0000
AMLC dataSize=16384, offset=65536, seq=0
[DONE]
AMLC dataSize=49152, offset=393216, seq=1
[DONE]
AMLC dataSize=16384, offset=229376, seq=2
[DONE]
AMLC dataSize=49152, offset=180224, seq=3
[DONE]
AMLC dataSize=16384, offset=65536, seq=4
[DONE]
AMLC dataSize=1224048, offset=81920, seq=5
[DONE]
[BL2 END]
Waiting for device...
Make sure you've installed the correct driver using Zadig.
Make sure you've installed the correct driver using Zadig.
Device is now in USB Burn Mode
 executing bulkcmd: "amlmmc part 1"
Traceback (most recent call last):
  File "C:\Users\<My name>\AppData\Local\Programs\Python\Python312\Lib\site-packages\usb\core.py", line 236, in get_interface_and_endpoint
    return self._ep_info[endpoint_address]
           ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
KeyError: 129

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\<My name>\Downloads\superbird-tool-main\superbird-tool-main\superbird_tool.py", line 334, in <module>
    dev = enter_burn_mode(dev)
          ^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\<My name>\Downloads\superbird-tool-main\superbird-tool-main\superbird_device.py", line 138, in enter_burn_mode
    dev.bulkcmd('amlmmc part 1')
  File "C:\Users\<My name>\Downloads\superbird-tool-main\superbird-tool-main\superbird_device.py", line 223, in bulkcmd
    resp = self.device.bulkCmd(command)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\<My name>\AppData\Local\Programs\Python\Python312\Lib\site-packages\pyamlboot\pyamlboot.py", line 590, in bulkCmd
    return self.bulkCmdStat(timeout)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\<My name>\AppData\Local\Programs\Python\Python312\Lib\site-packages\pyamlboot\pyamlboot.py", line 595, in bulkCmdStat
    return self.dev.read(usb.util.ENDPOINT_IN | 1, BULK_REPLY_LEN,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\<My name>\AppData\Local\Programs\Python\Python312\Lib\site-packages\usb\core.py", line 1021, in read
    intf, ep = self._ctx.setup_request(self, endpoint)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\<My name>\AppData\Local\Programs\Python\Python312\Lib\site-packages\usb\core.py", line 113, in wrapper
    return f(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\<My name>\AppData\Local\Programs\Python\Python312\Lib\site-packages\usb\core.py", line 228, in setup_request
    intf, ep = self.get_interface_and_endpoint(device, endpoint_address)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\<My name>\AppData\Local\Programs\Python\Python312\Lib\site-packages\usb\core.py", line 113, in wrapper
    return f(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\<My name>\AppData\Local\Programs\Python\Python312\Lib\site-packages\usb\core.py", line 238, in get_interface_and_endpoint
    for intf in self.get_active_configuration(device):
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\<My name>\AppData\Local\Programs\Python\Python312\Lib\site-packages\usb\core.py", line 113, in wrapper
    return f(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\<My name>\AppData\Local\Programs\Python\Python312\Lib\site-packages\usb\core.py", line 252, in get_active_configuration
    bConfigurationValue=self.backend.get_configuration(self.handle)
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\<My name>\AppData\Local\Programs\Python\Python312\Lib\site-packages\usb\backend\libusb0.py", line 528, in get_configuration
    assert ret == 1
           ^^^^^^^^
AssertionError

am I stupid? what caused this?

Wackanim commented 3 days ago

I reinstalled the USB driver, and now it displays this:

C:\Users\<My name>\Downloads\superbird-tool-main\superbird-tool-main>python superbird_tool.py --restore_device C:\Users\<My name>\Downloads\8.9.2-thinglabs
Spotify Car Thing (superbird) toolkit, v0.1.8, by Thing Labs and Bishop Dynamics
     https://github.com/thinglabsoss/superbird-tool
     Forked from https://github.com/bishopdynamics/superbird-tool

Found device booted in USB Burn Mode (ready for commands)
restoring entire device from dumpfiles in C:\Users\<My name>\Downloads\8.9.2-thinglabs
initializing env subsystem
 executing bulkcmd: "amlmmc env"
Traceback (most recent call last):
  File "C:\Users\<My name>\AppData\Local\Programs\Python\Python312\Lib\site-packages\usb\core.py", line 236, in get_interface_and_endpoint
    return self._ep_info[endpoint_address]
           ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
KeyError: 129

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\<My name>\Downloads\superbird-tool-main\superbird-tool-main\superbird_tool.py", line 357, in <module>
    dev.send_env_file(f'{FOLDER_NAME}/env.txt')
  File "C:\Users\<My name>\Downloads\superbird-tool-main\superbird-tool-main\superbird_device.py", line 275, in send_env_file
    self.send_env(env_data)
  File "C:\Users\<My name>\Downloads\superbird-tool-main\superbird-tool-main\superbird_device.py", line 265, in send_env
    self.bulkcmd('amlmmc env')  # initialize env subsystem
    ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\<My name>\Downloads\superbird-tool-main\superbird-tool-main\superbird_device.py", line 223, in bulkcmd
    resp = self.device.bulkCmd(command)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\<My name>\AppData\Local\Programs\Python\Python312\Lib\site-packages\pyamlboot\pyamlboot.py", line 590, in bulkCmd
    return self.bulkCmdStat(timeout)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\<My name>\AppData\Local\Programs\Python\Python312\Lib\site-packages\pyamlboot\pyamlboot.py", line 595, in bulkCmdStat
    return self.dev.read(usb.util.ENDPOINT_IN | 1, BULK_REPLY_LEN,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\<My name>\AppData\Local\Programs\Python\Python312\Lib\site-packages\usb\core.py", line 1021, in read
    intf, ep = self._ctx.setup_request(self, endpoint)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\<My name>\AppData\Local\Programs\Python\Python312\Lib\site-packages\usb\core.py", line 113, in wrapper
    return f(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\<My name>\AppData\Local\Programs\Python\Python312\Lib\site-packages\usb\core.py", line 228, in setup_request
    intf, ep = self.get_interface_and_endpoint(device, endpoint_address)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\<My name>\AppData\Local\Programs\Python\Python312\Lib\site-packages\usb\core.py", line 113, in wrapper
    return f(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\<My name>\AppData\Local\Programs\Python\Python312\Lib\site-packages\usb\core.py", line 238, in get_interface_and_endpoint
    for intf in self.get_active_configuration(device):
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\<My name>\AppData\Local\Programs\Python\Python312\Lib\site-packages\usb\core.py", line 113, in wrapper
    return f(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\<My name>\AppData\Local\Programs\Python\Python312\Lib\site-packages\usb\core.py", line 252, in get_active_configuration
    bConfigurationValue=self.backend.get_configuration(self.handle)
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\<My name>\AppData\Local\Programs\Python\Python312\Lib\site-packages\usb\backend\libusb0.py", line 528, in get_configuration
    assert ret == 1
           ^^^^^^^^
AssertionError
lmore377 commented 2 days ago

Are you on an AMD system by any chance? The USB controllers on AMD systems are known to be really problematic and don't play nicely with the car thing at all

Wackanim commented 1 day ago

I actually figured it out. turned out I installed the wrong USB driver. completely my fault!