Difference between revisions of "ZPUI emulator setup"

From ZeroPhone
Jump to: navigation, search
(Added emulator instructions)
 
 
(13 intermediate revisions by the same user not shown)
Line 1: Line 1:
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.
+
[http://zpui.readthedocs.io/en/latest/setup.html#emulator '''!!! The most up-to-date instructions have now been moved to ZPUI documentation! !!!'''] This page will no longer have instructions after some point in the future.
 +
 
 +
 
 +
 
 +
[[File:ZPUI_Emulator.png|306px|thumb|Emulator window screenshot]]
 +
If you want to develop ZPUI apps, but don't yet have the ZeroPhone hardware, there's an option to use the emulator with a Linux PC - it's going to use your screen and keyboard, instead of requiring ZeroPhone hardware. The emulator works very well for app development, as well as for ZPUI core feature development.  
  
 
== System requirements ==
 
== System requirements ==
  
* Some kind of Linux - has to have git, python and python-pip
+
* Some kind of Linux - there are install instructions for Ubuntu, Debian and OpenSUSE, but it will likely work with other systems, too
* Graphical environment - the output uses Pygame
+
* Graphical environment (the emulator is based on Pygame)
* Keyboard - used for input (can easily be the same keyboard that's used for the system)
+
* A keyboard (the same keyboard that you're using for the system will work great)
  
 
== Ubuntu/Debian installation ==  
 
== Ubuntu/Debian installation ==  
  
git clone https://github.com/ZeroPhone/pyLCI
+
Assuming Python 2 is the default Python version:
cd pyLCI
+
 
 +
<nowiki>
 +
sudo apt-get update
 +
sudo apt-get install python-pip git python-dev build-essential python-pygame
 +
sudo pip install luma.emulator
 +
git clone https://github.com/ZeroPhone/ZPUI
 +
cd ZPUI
 +
./setup_emulator.sh
 +
python main.py</nowiki>
 +
 
 +
== OpenSUSE installation ==
 +
 
 +
<nowiki>
 +
sudo zypper install python2-pip git python2-devel gcc python2-curses python2-pygame #If python2- version is not available, try python- and report on IRC - can't test it now
 +
sudo pip2 install luma.emulator
 +
git clone https://github.com/ZeroPhone/ZPUI
 +
cd ZPUI
 
./setup_emulator.sh
 
./setup_emulator.sh
python main.py
+
python2 main.py</nowiki>
  
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 ==
  
== TODO ==
+
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)
+
* [https://github.com/ZeroPhone/ZPUI/issues/new Open an issue on GitHub]
* 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.
+
* Email me - emails are accessible on the main page
* 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).
 
  
 
== Credits ==
 
== Credits ==
  
Most of the emulator research and work was done by Doug, a ZeroPhone contributor. The input driver was done by Arsenijs.
+
Most of the emulator research and work was done by Doug, and later refactored by Brian Dunlay. The input driver was done by Arsenijs. OpenSUSE instructions were compiled with help of piajesse ([https://hackaday.io/piajesse @Hackaday.io])

Latest revision as of 17:53, 28 November 2017

!!! The most up-to-date instructions have now been moved to ZPUI documentation! !!! This page will no longer have instructions after some point in the future.


Emulator window screenshot

If you want to develop ZPUI apps, but don't yet have the ZeroPhone hardware, there's an option to use the emulator with a Linux PC - it's going to use your screen and keyboard, instead of requiring ZeroPhone hardware. The emulator works very well for app development, as well as for ZPUI core feature development.

System requirements

  • Some kind of Linux - there are install instructions for Ubuntu, Debian and OpenSUSE, but it will likely work with other systems, too
  • Graphical environment (the emulator is based on Pygame)
  • A keyboard (the same keyboard that you're using for the system will work great)

Ubuntu/Debian installation

Assuming Python 2 is the default Python version:

sudo apt-get update
sudo apt-get install python-pip git python-dev build-essential python-pygame
sudo pip install luma.emulator
git clone https://github.com/ZeroPhone/ZPUI
cd ZPUI
./setup_emulator.sh
python main.py

OpenSUSE installation

sudo zypper install python2-pip git python2-devel gcc python2-curses python2-pygame #If python2- version is not available, try python- and report on IRC - can't test it now
sudo pip2 install luma.emulator
git clone https://github.com/ZeroPhone/ZPUI
cd ZPUI
./setup_emulator.sh
python2 main.py

In case of problems

You can either:

Credits

Most of the emulator research and work was done by Doug, and later refactored by Brian Dunlay. The input driver was done by Arsenijs. OpenSUSE instructions were compiled with help of piajesse (@Hackaday.io)