# Anyone use the Mopidy Touchscreen Front end?

**URL:** <https://discourse.mopidy.com/t/anyone-use-the-mopidy-touchscreen-front-end/327>\
**Category:** Pi MusicBox (archive)\
**Created:** [November 17, 2014, 2:36am UTC](https://discourse.mopidy.com/t/anyone-use-the-mopidy-touchscreen-front-end/327 "2014-11-17T02:36:22Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![lumihei](https://avatars.discourse-cdn.com/v4/letter/l/958977/32.png) [@lumihei](https://discourse.mopidy.com/u/lumihei)\
**Post date:** [November 18, 2014, 7:10pm UTC](https://discourse.mopidy.com/t/anyone-use-the-mopidy-touchscreen-front-end/327/4 "2014-11-18T19:10:27Z")

</div>

Hi MattR,

I have the same set-up with the same touchscreen, but additionally with an Hifiberry DAC.  
I had the same issue as you and was able to resolve at least the issue with the touchscreen and get that one working. I did however do this under Raspbian in the end since I wasn’t able to get it done under musicbox (you might want to try this under musicbox though - probably you can get it done).  
If you want to try with musicbox, you might need to enable ssh first or get yourself access to a console.

Here is what I figured out with a lot of support by @9and3r …

First get yourself to be root - keeps you from having to type “sudo …” all the time, and aparently the extension of 9and3r only works with root priviledges anyway. Would therefore start this way:  
log in with the normal user

```
    sudo passwd root
    <type your pass, hit enter x2>
su
--> now you're root and can login as root next time

```

First get the touchscreen working under the console. To do so, follow this tutorial:

> **[GitHub - ISO-B/pmb-pitft: Small Python program for Pi MusicBox to use with...](https://github.com/ISO-B/pmb-pitft)**
>
> Small Python program for Pi MusicBox to use with Adafruit PiTFT - 2.8" - GitHub - ISO-B/pmb-pitft: Small Python program for Pi MusicBox to use with Adafruit PiTFT - 2.8"

In the file /etc/modprobe.d/pitft.conf I changed he line “rotate” to 90.

When this is all done, I would follow the tutorial from Adafruit of this page, but only the part above the “automagic calibration”:

> **[Adafruit PiTFT - 2.8" Touchscreen Display for Raspberry Pi](https://learn.adafruit.com/adafruit-pitft-28-inch-resistive-touchscreen-display-raspberry-pi/resistive-touchscreen-manual-install-calibrate)**
>
> Is this not the cutest little display for the Raspberry Pi? It features a 2.8" display with 320x240 16-bit color pixels and a resistive touch overlay. The plate uses the high speed SPI interface on the Pi and can use the mini display as a console, X...

Then do the manual calibration from the same page (after the automagic calibration part). Skip the X Calibration as you won’t need it.

If you want the bootmessages to show on the screen, follow this portion of the howto:

> **[Adafruit PiTFT - 2.8" Touchscreen Display for Raspberry Pi](https://learn.adafruit.com/adafruit-pitft-28-inch-resistive-touchscreen-display-raspberry-pi/console-configuration)**
>
> Is this not the cutest little display for the Raspberry Pi? It features a 2.8" display with 320x240 16-bit color pixels and a resistive touch overlay. The plate uses the high speed SPI interface on the Pi and can use the mini display as a console, X...

The last hint on the same page you should follow even if you don’t want to see the bootmessages. (set screen blank time to indefinite to not let it turn off automatically)

Add this to your /etc/profile:

```
TSLIB_FBDEVICE="/dev/fb1" 
TSLIB_TSDEVICE="/dev/input/touchscreen"
SDL_FBDEV="/dev/fb1"

```

Now you need to apply some changes to the plugin to pipe the output to the touchscreen and to ensure the touchscreen calibration gets applied / saved:

- First get the sources:

Now, change the following file: /root/mopidy-touchscreen/mopidy-touchscreen/touch-screen.py  
BEFORE it says “pygame.init()” (somewhere around line 28) add the following 4 lines:

```
os.environ['SDL_VIDEODRIVER'] = 'fbcon'
os.environ["SDL_FBDEV"] = "/dev/fb1"
os.environ["SDL_MOUSEDEV"] = "/dev/input/touchscreen"
os.environ["SDL_MOUSEDRV"] = "TSLIB"

```

Now you need to save this and go back to the folder /root/mopidy-touchscreen. There you install this changed version of the plugin - in the folder, type:

```
python setup.py install develop

```

When this is done, I would reboot once more - and try to run mopidy as user root. Either by editing the file /etc/init.d/mopidy … and changing the user and group definitions in there, or even better since you can watch the output on the console, directly as root:

```
mopidy

```

If you want to get more debug info to look at things, you can add “-v” (-vv and -vvv also works for even more info).  
The first time you run it directly, it will create a new config file under the root folder under /root/.config/mopidy/mopidy.conf and exit. The mopidy version run directly will not know about the file under /etc/mopidy/…, so ensure you got the right config in there.

When you start it up, the console should show on your screen. At least with Raspbian it now always does it for me (reinstalled a couple of times as per method above). With MusicBox I did not get it working.

When I run the touchscreen however, I still run into the issue that GStreamer does not want to play my music any longer:

> [@Issue with GStreamer, music not playing, strange error message](https://discourse.mopidy.com/t/issue-with-gstreamer-music-not-playing-strange-error-message/324/4):
>
> PPPS.: tried running it again as user “mopidy”, part of group “audio” - still having the same error messages. Therefore can’t be related to user “root” running mopidy I believe. Any ideas? Before I start reinstalling it yet again, it would be great to have some other ideas I could try out - yet mine are gone…

This is not yet resolved for me - in case anyone could help me fix this, I would greatly appreciate this.

Hope this helped to point you into the right directions.

---

_[View the full topic](https://discourse.mopidy.com/t/anyone-use-the-mopidy-touchscreen-front-end/327)._
