{"action":"opened","issue":{"url":"https://api.github.com/repos/intel-iot-devkit/mraa/issues/170","labels_url":"https://api.github.com/repos/intel-iot-devkit/mraa/issues/170/labels{/name}","comments_url":"https://api.github.com/repos/intel-iot-devkit/mraa/issues/170/comments","events_url":"https://api.github.com/repos/intel-iot-devkit/mraa/issues/170/events","html_url":"https://github.com/intel-iot-devkit/mraa/issues/170","id":61694637,"number":170,"title":"SPI on MBMax with python strangeness","user":{"login":"tripzero","id":1034370,"avatar_url":"https://avatars.githubusercontent.com/u/1034370?v=3","gravatar_id":"","url":"https://api.github.com/users/tripzero","html_url":"https://github.com/tripzero","followers_url":"https://api.github.com/users/tripzero/followers","following_url":"https://api.github.com/users/tripzero/following{/other_user}","gists_url":"https://api.github.com/users/tripzero/gists{/gist_id}","starred_url":"https://api.github.com/users/tripzero/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tripzero/subscriptions","organizations_url":"https://api.github.com/users/tripzero/orgs","repos_url":"https://api.github.com/users/tripzero/repos","events_url":"https://api.github.com/users/tripzero/events{/privacy}","received_events_url":"https://api.github.com/users/tripzero/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-03-14T20:55:39Z","updated_at":"2015-03-14T20:55:39Z","closed_at":null,"body":"Using the latest(as of this writing) mraa master on the minnowboard max I see some strange issues.  The following works:\r\n\r\n$python\r\n>> import mraa\r\n>> spi = mraa.Spi(0)\r\n\r\nhowever, if I create a script, it fails (test.py):\r\n\r\n#!/usr/bin/env python\r\nimport mraa\r\nspi = mraa.Spi(0)\r\n\r\n$python test.py\r\nTraceback (most recent call last):\r\n  [snip]\r\n    self.spiDev = mraa.Spi(0)\r\n  File \"/usr/lib/python2.7/dist-packages/mraa.py\", line 806, in __init__\r\n    this = _mraa.new_Spi(*args)\r\nValueError: Error initialising SPI bus\r\n\r\nHowever, if I run it with ipython, it works:\r\n\r\n$ipython test.py\r\n\r\nsuccess!\r\n\r\nSyslog documents the unsuccessful and successful attempts:\r\n\r\nMar 14 13:43:48 kev-MinnowBoard-MAX-B3-PLATFORM libmraa[9353]: gpio: Failed to open export for writing\r\nMar 14 13:43:48 kev-MinnowBoard-MAX-B3-PLATFORM libmraa[9353]: spi: failed to set-up spi sclk multiplexer\r\nMar 14 13:43:53 kev-MinnowBoard-MAX-B3-PLATFORM libmraa[9354]: libmraa version v0.6.1-5-g3b3b940 initialised by user 'kev' with EUID 1000\r\n\r\n\r\nThis sort of issue screams race condition, but I will defer to the expertise of the mraa team."}}