Self-inflicted Issue
 Raspberry Pi   Started by Matha Goram   2017-08-09 00:33:02 -04:00   Comments: 4    Viewed: 78

  1. Matha Goram
    Matha Goram Member

    Unable to use PiStorms after performing a fresh install with Jessie (2017-07-05) and PiStorms (4.013). No packages installed after the clean install with Jessie. Of course, changed the hostname and other networking preferences). All interfaces except VNC (XRDP works best for me) enabled. Here is the first IDLE session to conduct a sanity check on the PiStorms module:

    Python 2.7.9 (default, Sep 17 2016, 20:26:04) 
    [GCC 4.9.2] on linux2
    Type "copyright", "credits" or "license()" for more information.
    >>> import PiStorms
    Traceback (most recent call last):
      File "<pyshell#0>", line 1, in <module>
        import PiStorms
      File "/usr/local/lib/python2.7/dist-packages/", line 74, in <module>
        from mindsensorsUI import mindsensorsUI
      File "/usr/local/lib/python2.7/dist-packages/", line 54, in <module>
        class mindsensorsUI():
      File "/usr/local/lib/python2.7/dist-packages/", line 110, in mindsensorsUI
        disp = TFT.ILI9341(24, rst=25, spi=SPI.SpiDev(0,0,max_speed_hz=64000000))
      File "/usr/local/lib/python2.7/dist-packages/", line 43, in __init__
        self.mutex = open("/var/lock/ili9341", "w+")
    IOError: [Errno 13] Permission denied: '/var/lock/ili9341'

    Any suggestions (other than to use the fully baked image for PiStorms as a hardware test - which I will do shortly), please? Thanks!

    Matha Goram, 2017-08-09 00:33:02 -04:00
  2. seth10
    seth10 Member Staff Member

    Ah, thank you for the detailed info! You shouldn't need to download the preset image, please don't spend your time doing that if you don't need to. This should be pretty simple to fix.

    Previously we were seeing issue with the screen "glitching out," the screen going inverted, contrast going up and not being able to restore it, etc. We determined this was the result of multiple processes trying to write to the screen at the same time. To alleviate this issue, we added a lock file in /var/lock, called "ili9341" (the name of the display). When any process tries writing to the screen, it will first check for this file. If it exists, it knows another process is drawing to the display and will wait for it to finish.

    You are seeing this because mindsensorsUI (the class you use to draw to the screen) is trying to open this lock file but is denied permission. The file should be owned by the user pi, but it seems it is owned by the super-user. As such, running the Python shell as the user pi will not work. Please try issuing the command sudo python to launch the interactive shell with super-user permissions. You could also try running sudo chown pi:pi /var/lock/ili9341 to take ownership of the file.

    Sorry for the inconvenience, please let me know if you're still having trouble!

    tl;dr, sudo python

    seth10, 2017-08-10 09:22:46 -04:00
  3. Matha Goram
    Matha Goram Member
    Hello Seth,

    Your suggestions worked flawlessly! No more issues!! smile Thank you very much.

    Matha Goram, 2017-08-14 17:16:28 -04:00
    seth10 likes this.
  4. seth10
    seth10 Member Staff Member
    Glad to hear it :D
    seth10, 2017-08-14 17:30:43 -04:00
  5. (You must log in or sign up to post here)

Log in | Sign up
Tems & Conditions!