hnesk / flipper-raw-rfid

A python library for reading and analyzing Flipper Zero raw RFID files (tag.[ap]sk.raw)
MIT License
27 stars 3 forks source link

Getting some errors #1

Open uhlhosting opened 7 months ago

uhlhosting commented 7 months ago

Hi,

thanks for this great work!

I tried to read some files, and I got:

---------------------------------------------------------------------------
UnboundLocalError                         Traceback (most recent call last)
Cell In[64], [line 1](vscode-notebook-cell:?execution_count=64&line=1)
----> [1](vscode-notebook-cell:?execution_count=64&line=1) pad = signal_to_pad(np.tile(binarized_mean_signal,8))
      [3](vscode-notebook-cell:?execution_count=64&line=3) # How long is the signal 1
      [4](vscode-notebook-cell:?execution_count=64&line=4) one_times = pad[:,0]

File [/usr/local/lib/python3.11/site-packages/flipper_raw_rfid/utils.py:66](https://file+.vscode-resource.vscode-cdn.net/usr/local/lib/python3.11/site-packages/flipper_raw_rfid/utils.py:66), in signal_to_pad(signal)
     [63](https://file+.vscode-resource.vscode-cdn.net/usr/local/lib/python3.11/site-packages/flipper_raw_rfid/utils.py:63)     if len(p) == 1:
     [64](https://file+.vscode-resource.vscode-cdn.net/usr/local/lib/python3.11/site-packages/flipper_raw_rfid/utils.py:64)         yield p[0] - position, len(s) - position - 1
---> [66](https://file+.vscode-resource.vscode-cdn.net/usr/local/lib/python3.11/site-packages/flipper_raw_rfid/utils.py:66) return numpy.array(list(it(signal)))

File [/usr/local/lib/python3.11/site-packages/flipper_raw_rfid/utils.py:63](https://file+.vscode-resource.vscode-cdn.net/usr/local/lib/python3.11/site-packages/flipper_raw_rfid/utils.py:63), in signal_to_pad.<locals>.it(s)
     [60](https://file+.vscode-resource.vscode-cdn.net/usr/local/lib/python3.11/site-packages/flipper_raw_rfid/utils.py:60)         yield p[0] - position, p[1] - position
     [61](https://file+.vscode-resource.vscode-cdn.net/usr/local/lib/python3.11/site-packages/flipper_raw_rfid/utils.py:61)         position = p[1]
---> [63](https://file+.vscode-resource.vscode-cdn.net/usr/local/lib/python3.11/site-packages/flipper_raw_rfid/utils.py:63) if len(p) == 1:
     [64](https://file+.vscode-resource.vscode-cdn.net/usr/local/lib/python3.11/site-packages/flipper_raw_rfid/utils.py:64)     yield p[0] - position, len(s) - position - 1

UnboundLocalError: cannot access local variable 'p' where it is not associated with a value

any ideas why?

lewiswatson55 commented 5 months ago

I got this issue too running the code on raw data of a pet microchip that my F0 can't scan but when I ran the code on the raw dump of a card I can scan natively the code runs fine. Not sure the reason but I think the raw dumps I have either haven't scanned properly or can't be by the Z0 :(.