{"action":"created","issue":{"url":"https://api.github.com/repos/omwah/pixy_rpi/issues/2","labels_url":"https://api.github.com/repos/omwah/pixy_rpi/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/omwah/pixy_rpi/issues/2/comments","events_url":"https://api.github.com/repos/omwah/pixy_rpi/issues/2/events","html_url":"https://github.com/omwah/pixy_rpi/issues/2","id":91468653,"number":2,"title":"'int' object is not iterable","user":{"login":"alduxvm","id":8823379,"avatar_url":"https://avatars.githubusercontent.com/u/8823379?v=3","gravatar_id":"","url":"https://api.github.com/users/alduxvm","html_url":"https://github.com/alduxvm","followers_url":"https://api.github.com/users/alduxvm/followers","following_url":"https://api.github.com/users/alduxvm/following{/other_user}","gists_url":"https://api.github.com/users/alduxvm/gists{/gist_id}","starred_url":"https://api.github.com/users/alduxvm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alduxvm/subscriptions","organizations_url":"https://api.github.com/users/alduxvm/orgs","repos_url":"https://api.github.com/users/alduxvm/repos","events_url":"https://api.github.com/users/alduxvm/events{/privacy}","received_events_url":"https://api.github.com/users/alduxvm/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-06-27T14:05:04Z","updated_at":"2015-06-27T16:53:32Z","closed_at":null,"body":"Hi!\r\n\r\nI'm getting this output when testing the echo.py:\r\n\r\n```\r\npython echo.py \r\nTraceback (most recent call last):\r\n  File \"echo.py\", line 6, in <module>\r\n    num_blocks = p.getBlocks()\r\n  File \"/home/pi/pixy_rpi/pixy.py\", line 42, in getBlocks\r\n    if not self._getStart():\r\n  File \"/home/pi/pixy_rpi/pixy.py\", line 74, in _getStart\r\n    w = self.link.getWord()\r\n  File \"/home/pi/pixy_rpi/pixy_spi.py\", line 49, in getWord\r\n    w = self.getByte(PIXY_SYNC_BYTE)\r\n  File \"/home/pi/pixy_rpi/pixy_spi.py\", line 63, in getByte\r\n    _, c = wiringpi2.wiringPiSPIDataRW(0, struct.pack('B', out))\r\nTypeError: 'int' object is not iterable\r\n```\r\n\r\nI used pip to install wiringpi2 (sudo pip install wiringpi2) and I enabled the spi via raspi-config. \r\n\r\nAny ideas?"},"comment":{"url":"https://api.github.com/repos/omwah/pixy_rpi/issues/comments/116099852","html_url":"https://github.com/omwah/pixy_rpi/issues/2#issuecomment-116099852","issue_url":"https://api.github.com/repos/omwah/pixy_rpi/issues/2","id":116099852,"user":{"login":"alduxvm","id":8823379,"avatar_url":"https://avatars.githubusercontent.com/u/8823379?v=3","gravatar_id":"","url":"https://api.github.com/users/alduxvm","html_url":"https://github.com/alduxvm","followers_url":"https://api.github.com/users/alduxvm/followers","following_url":"https://api.github.com/users/alduxvm/following{/other_user}","gists_url":"https://api.github.com/users/alduxvm/gists{/gist_id}","starred_url":"https://api.github.com/users/alduxvm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alduxvm/subscriptions","organizations_url":"https://api.github.com/users/alduxvm/orgs","repos_url":"https://api.github.com/users/alduxvm/repos","events_url":"https://api.github.com/users/alduxvm/events{/privacy}","received_events_url":"https://api.github.com/users/alduxvm/received_events","type":"User","site_admin":false},"created_at":"2015-06-27T16:53:32Z","updated_at":"2015-06-27T16:53:32Z","body":"ok, changing getByte function to:\r\n```\r\n    def getByte(self, out=0x00):\r\n        \"\"\" return uint8_t \"\"\"\r\n        # Using file handles doesn't work too well\r\n        #os.write(self.fd, struct.pack('B', out))\r\n        #c = os.read(self.fd, 1)\r\n        # Requires a fixed version of wiringpi2 SPI function\r\n        c = wiringpi2.wiringPiSPIDataRW(0, struct.pack('B', out))\r\n        ret = struct.unpack('B', c)[0]\r\n        return ret\r\n```\r\n\r\nand then testing again:\r\n\r\n```\r\n~/pixy_rpi $ python echo.py \r\nTraceback (most recent call last):\r\n  File \"echo.py\", line 6, in <module>\r\n    num_blocks = p.getBlocks()\r\n  File \"/home/pi/pixy_rpi/pixy.py\", line 42, in getBlocks\r\n    if not self._getStart():\r\n  File \"/home/pi/pixy_rpi/pixy.py\", line 74, in _getStart\r\n    w = self.link.getWord()\r\n  File \"/home/pi/pixy_rpi/pixy_spi.py\", line 49, in getWord\r\n    w = self.getByte(PIXY_SYNC_BYTE)\r\n  File \"/home/pi/pixy_rpi/pixy_spi.py\", line 64, in getByte\r\n    ret = struct.unpack('B', c)[0]\r\nstruct.error: unpack requires a string argument of length 1\r\n```\r\n\r\n:S "}}