Frage

Ich habe NFCPy, Pyusb und Libusb auf Mac Lion installiert. Ich verwende den gemeinsamen ACR122U -NFC -Kartenleser und als ich versuchte, eines der Beispiele auszuführen, stürzt es ab. Ich weiß, dass viele Leute denselben Leser mit NFCPY verwenden. Ich weiß nicht, warum es für mich nicht funktioniert.

Python druckt keinen Fehler aus, aber ich kann diese Stapelverfolgung in der Protokolldatei sehen:

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   libusb-1.0.dylib                0x000000010f799bda darwin_reset_device + 10 (darwin_usb.c:1213)
1   libffi.dylib                    0x00007fff87b2fe7c ffi_call_unix64 + 76
2   libffi.dylib                    0x00007fff87b30ae9 ffi_call + 728
3   _ctypes.so                      0x000000010f78033f _ctypes_callproc + 735
4   _ctypes.so                      0x000000010f77afd2 0x10f777000 + 16338
5   org.python.python               0x000000010f360d32 PyObject_Call + 97
6   org.python.python               0x000000010f3e0f63 PyEval_EvalFrameEx + 14353
7   org.python.python               0x000000010f3e3cd8 PyEval_EvalCodeEx + 1996
8   org.python.python               0x000000010f381abf 0x10f359000 + 166591
9   org.python.python               0x000000010f360d32 PyObject_Call + 97
10  org.python.python               0x000000010f3e15ec PyEval_EvalFrameEx + 16026
11  org.python.python               0x000000010f3e3cd8 PyEval_EvalCodeEx + 1996
12  org.python.python               0x000000010f3e3e6c 0x10f359000 + 568940
13  org.python.python               0x000000010f3e0e0a PyEval_EvalFrameEx + 14008
14  org.python.python               0x000000010f3e3df7 0x10f359000 + 568823
15  org.python.python               0x000000010f3e0e0a PyEval_EvalFrameEx + 14008
16  org.python.python               0x000000010f3e3df7 0x10f359000 + 568823
17  org.python.python               0x000000010f3e0e0a PyEval_EvalFrameEx + 14008
18  org.python.python               0x000000010f3e3cd8 PyEval_EvalCodeEx + 1996
19  org.python.python               0x000000010f381abf 0x10f359000 + 166591
20  org.python.python               0x000000010f360d32 PyObject_Call + 97
21  org.python.python               0x000000010f36f6e9 0x10f359000 + 91881
22  org.python.python               0x000000010f360d32 PyObject_Call + 97
23  org.python.python               0x000000010f3ab484 0x10f359000 + 337028
24  org.python.python               0x000000010f3a5b7a 0x10f359000 + 314234
25  org.python.python               0x000000010f360d32 PyObject_Call + 97
26  org.python.python               0x000000010f3e0f63 PyEval_EvalFrameEx + 14353
27  org.python.python               0x000000010f3e3df7 0x10f359000 + 568823
28  org.python.python               0x000000010f3e0e0a PyEval_EvalFrameEx + 14008
29  org.python.python               0x000000010f3e3cd8 PyEval_EvalCodeEx + 1996
30  org.python.python               0x000000010f3e3e6c 0x10f359000 + 568940
31  org.python.python               0x000000010f3e0e0a PyEval_EvalFrameEx + 14008
32  org.python.python               0x000000010f3e3cd8 PyEval_EvalCodeEx + 1996
33  org.python.python               0x000000010f381abf 0x10f359000 + 166591
34  org.python.python               0x000000010f360d32 PyObject_Call + 97
35  org.python.python               0x000000010f36f6e9 0x10f359000 + 91881
36  org.python.python               0x000000010f360d32 PyObject_Call + 97
37  org.python.python               0x000000010f3ab484 0x10f359000 + 337028
38  org.python.python               0x000000010f3a5b7a 0x10f359000 + 314234
39  org.python.python               0x000000010f360d32 PyObject_Call + 97
40  org.python.python               0x000000010f3e0f63 PyEval_EvalFrameEx + 14353
41  org.python.python               0x000000010f3e3df7 0x10f359000 + 568823
42  org.python.python               0x000000010f3e0e0a PyEval_EvalFrameEx + 14008
43  org.python.python               0x000000010f3e3cd8 PyEval_EvalCodeEx + 1996
44  org.python.python               0x000000010f3e3d4d PyEval_EvalCode + 54
45  org.python.python               0x000000010f3fb08f 0x10f359000 + 663695
46  org.python.python               0x000000010f3fb14f PyRun_FileExFlags + 157
47  org.python.python               0x000000010f3fc2a2 PyRun_SimpleFileExFlags + 392
48  org.python.python               0x000000010f40c2af Py_Main + 2715
49  org.python.python               0x000000010f34ee88 0x10f34e000 + 3720

Thread 1:: org.libusb.device-detach
0   libsystem_kernel.dylib          0x00007fff90e2967a mach_msg_trap + 10
1   libsystem_kernel.dylib          0x00007fff90e28d71 mach_msg + 73
2   com.apple.CoreFoundation        0x00007fff90082b6c __CFRunLoopServiceMachPort + 188
3   com.apple.CoreFoundation        0x00007fff9008b2d4 __CFRunLoopRun + 1204
4   com.apple.CoreFoundation        0x00007fff9008aae6 CFRunLoopRunSpecific + 230
5   com.apple.CoreFoundation        0x00007fff9009a7ff CFRunLoopRun + 95
6   libusb-1.0.dylib                0x000000010f79e997 event_thread_main + 631 (darwin_usb.c:369)
7   libsystem_c.dylib               0x00007fff903888bf _pthread_start + 335
8   libsystem_c.dylib               0x00007fff9038bb75 thread_start + 13

Thread 2:: Dispatch queue: com.apple.libdispatch-manager
0   libsystem_kernel.dylib          0x00007fff90e2b7e6 kevent + 10
1   libdispatch.dylib               0x00007fff92d9e5be _dispatch_mgr_invoke + 923
2   libdispatch.dylib               0x00007fff92d9d14e _dispatch_mgr_thread + 54

Thread 3:
0   libsystem_kernel.dylib          0x00007fff90e2b192 __workq_kernreturn + 10
1   libsystem_c.dylib               0x00007fff9038a594 _pthread_wqthread + 758
2   libsystem_c.dylib               0x00007fff9038bb85 start_wqthread + 13

Thread 0 crashed with X86 Thread State (64-bit):
  rax: 0x000000010f7a2320  rbx: 0x0000000000000000  rcx: 0x000000010f985f80  rdx: 0x0000000000000000
  rdi: 0x0000000000000000  rsi: 0x0000000000000001  rbp: 0x00007fff6ef4baa0  rsp: 0x00007fff6ef4ba90
   r8: 0x000000010f48e840   r9: 0x0000000000000000  r10: 0x00007fff6ef4ba00  r11: 0x000000010f795340
  r12: 0xffffffffffffffff  r13: 0x0000000000000001  r14: 0x0000000000000000  r15: 0x00007fff6ef4bab0
  rip: 0x000000010f799bda  rfl: 0x0000000000010246  cr2: 0x0000000000000058
Logical CPU: 1

Jede Hilfe wäre sehr geschätzt, ich bin viele Tage lang daran festgefahren

War es hilfreich?

Lösung

Anschauen die Quelle von darwin_reset_device() in libusb und angesichts der frühzeitigen Funktion (nur 10 Bytes), ist ich vermute, dass entweder dev_handle oder dev_handle->dev an übergeben werden darwin_reset_device() ist Null.

Herauszufinden, warum dies geschieht, ist kompliziert-es gibt viele Code und Ebenen, um Fehler zu beheben (Libusb, Pyusb, NFCPy). Vielleicht können Sie herausfinden, ob jemand anderes NFCPY auf Lion erfolgreich ausführt und was sie anders machen (Xcode -Versionen, NFCPY -Version usw.).

Ein weiterer Vorschlag (aus meiner Erfahrung mit USB -Treibern auf dem Mac): Stecker aus den Stecker jeder USB -Gerät, das mit Ihrem Computer verbunden ist. Dies umfasst Mäuse/Tastaturen von Drittanbietern.

Andere Tipps

Die besten Werkzeuge für die Arbeit mit dem ACR122U und Python sind Pyscard und Rfidiot, das ist ein Wrapper für Pyscard und libnfc. Pyscard kann ziemlich gut damit umgehen. Hier ist ein Beispiel:

http://ludovicrousseau.blogspot.com.br/2010/04/pcsc-Sample-in-python.html

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top