{"action":"created","issue":{"url":"https://api.github.com/repos/walac/pyusb/issues/76","labels_url":"https://api.github.com/repos/walac/pyusb/issues/76/labels{/name}","comments_url":"https://api.github.com/repos/walac/pyusb/issues/76/comments","events_url":"https://api.github.com/repos/walac/pyusb/issues/76/events","html_url":"https://github.com/walac/pyusb/issues/76","id":47771053,"number":76,"title":"[Errno 16] Resource busy","user":{"login":"alexroot-","id":8659959,"avatar_url":"https://avatars.githubusercontent.com/u/8659959?v=3","gravatar_id":"","url":"https://api.github.com/users/alexroot-","html_url":"https://github.com/alexroot-","followers_url":"https://api.github.com/users/alexroot-/followers","following_url":"https://api.github.com/users/alexroot-/following{/other_user}","gists_url":"https://api.github.com/users/alexroot-/gists{/gist_id}","starred_url":"https://api.github.com/users/alexroot-/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexroot-/subscriptions","organizations_url":"https://api.github.com/users/alexroot-/orgs","repos_url":"https://api.github.com/users/alexroot-/repos","events_url":"https://api.github.com/users/alexroot-/events{/privacy}","received_events_url":"https://api.github.com/users/alexroot-/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":12,"created_at":"2014-11-04T21:53:38Z","updated_at":"2015-05-21T14:51:35Z","closed_at":null,"body":"Hi guys,\r\nI'm not sure if i made a mistake...\r\nI'm always getting this error and no solution worked for me :(\r\nMy software: Python 2.7.8, libusb 1.0.19-1 and the current PyUSB version from this rep...\r\nI'm working on Arch Linux Arm (Raspberry Pi model B)\r\nHer's my udev rule:\r\n```\r\nUBSYSTEMS==\"usb\", ATTRS{idVendor}==\"04f2\", ATTRS{idProduct}==\"0402\", GROUP=users\", MODE=\"0660\"\r\n```\r\nFrom https://github.com/itdaniher/WeDoMore/issues/4\r\n\r\nAnd a testcode:\r\n```\r\n#!/usr/bin/python2\r\n\r\nimport usb.core\r\nimport usb.util\r\nimport sys\r\n\r\ndef getData():\r\n    VENDOR_ID = 0x04f2\r\n    PRODUCT_ID = 0x0402\r\n    DATA_SIZE = 1\r\n    device = usb.core.find(idVendor=VENDOR_ID, idProduct=PRODUCT_ID)\r\n    if device is None:\r\n        sys.exit(\"Could not find Keyboard\")\r\n\r\n    if device.is_kernel_driver_active(0):\r\n        try:\r\n                device.detach_kernel_driver(0)\r\n                print \"kernel driver detached\"\r\n        except usb.core.USBError as e:\r\n                sys.exit(\"Could not detach kernel driver: %s\" % str(e))\r\n    else:\r\n        print \"no kernel driver attached\"\r\n    try:\r\n        usb.util.claim_interface(device, 0)\r\n        print \"claimed device\"\r\n    except:\r\n        sys.exit(\"Could not claim the device: %s\" % str(e))\r\n    try:\r\n        device.set_configuration()\r\n        device.reset()\r\n    except usb.core.USBError as e:\r\n        sys.exit(\"Could not set configuration: %s\" % str(e))\r\n```\r\nWhen I execute my script:\r\n```\r\n$sudo python2 ./test.py\r\nno kernel driver attached\r\nclaimed device\r\nCould not set configuration: [Errno 16] Resource busy\r\n```\r\n\r\nCan you tell me whats wrong?\r\nThanks :)\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/walac/pyusb/issues/comments/104306742","html_url":"https://github.com/walac/pyusb/issues/76#issuecomment-104306742","issue_url":"https://api.github.com/repos/walac/pyusb/issues/76","id":104306742,"user":{"login":"hediented","id":12331300,"avatar_url":"https://avatars.githubusercontent.com/u/12331300?v=3","gravatar_id":"","url":"https://api.github.com/users/hediented","html_url":"https://github.com/hediented","followers_url":"https://api.github.com/users/hediented/followers","following_url":"https://api.github.com/users/hediented/following{/other_user}","gists_url":"https://api.github.com/users/hediented/gists{/gist_id}","starred_url":"https://api.github.com/users/hediented/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hediented/subscriptions","organizations_url":"https://api.github.com/users/hediented/orgs","repos_url":"https://api.github.com/users/hediented/repos","events_url":"https://api.github.com/users/hediented/events{/privacy}","received_events_url":"https://api.github.com/users/hediented/received_events","type":"User","site_admin":false},"created_at":"2015-05-21T14:51:35Z","updated_at":"2015-05-21T14:51:35Z","body":"I was using the same code to try to read from my device and when i ran my script i got : \r\n```\r\nno kernel driver attached\r\nCould not claim the device\r\n```\r\nand if i try to run \r\n```\r\nendpoint = device[0][(0,0)][0]\r\ndata = device.read(endpoint.bEndpointAddress,0x0040)\r\n```\r\ni get  *resource busy error*.  I am really a beginner in this so i would really appreciate some advice on what to do next."}}