ZPUI emulator setup

From ZeroPhone
Revision as of 02:27, 24 May 2017 by Admin (talk | contribs)
Jump to: navigation, search

If you want to develop pyLCI apps, but don't yet have the hardware, there's an option to use the emulator. While some Raspbian-specific apps will not function (though will load correctly), it's going to work very well for app development. It uses luma.oled library pygame emulation capabilities and a quick custom input device driver that uses pygame input, so separate input hardware (such as a USB keyboard or keypad) is not necessary for emulation, as it was earlier.

System requirements

  • Some kind of Linux - has to have git, python and python-pip
  • Graphical environment - the output uses Pygame
  • Keyboard - used for input (can easily be the same keyboard that's used for the system)

Ubuntu/Debian installation

git clone https://github.com/ZeroPhone/pyLCI
cd pyLCI
python main.py

The ./setup_emulator.sh script installs python-pip using apt-get (making sure you have it), that's the only option that might interfere with other distros, but I haven't checked, so I can't be sure.

In case of problems

You can either:


  • Help add more installation instructions (have to be verified, though theoretically it should *just work* without apt, using some other package manager)
  • Most of the times, pyLCI needs to be hard-killed (using kill -KILL), since some of the threads don't finish when Ctrl+C or exception happens. This needs to be fixed - at least for the manual launch/emulator mode.
  • Sometimes the emulator fails to start due to threading problems - there's some problem with pygame screen being refreshed from one thread and input scanned from another. That can't be fixed in current architecture, but the problems seem to only appear on pyLCI startup and typically the problem is solved by starting it again (for me, at least).


Most of the emulator research and work was done by Doug. The input driver was done by Arsenijs.