Difference between revisions of "ZPUI emulator setup"

From ZeroPhone
Jump to: navigation, search
m (Admin moved page PyLCI emulator setup to ZPUI emulator setup: Renaming pyLCI to ZPUI)
Line 1: Line 1:
[[File:PyLCI_Emulator.png|306px|thumb|Emulator window screenshot]]
+
[[File:ZPUI_Emulator.png|306px|thumb|Emulator window screenshot]]
If you want to develop pyLCI apps, but don't yet have the ZeroPhone hardware, there's an option to use the emulator - that's going to work with your screen and keyboard, instead of the real ZeroPhone hardware. While some Raspbian-specific apps will not function on other Linux distros (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.
+
If you want to develop ZPUI apps, but don't yet have the ZeroPhone hardware, there's an option to use the emulator - that's going to work with your screen and keyboard, instead of the real ZeroPhone hardware. While some Raspbian-specific apps will not function on other Linux distros (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 ==
 
== System requirements ==
Line 16: Line 16:
 
sudo apt-get install python-pip git python-dev build-essential python-pygame
 
sudo apt-get install python-pip git python-dev build-essential python-pygame
 
sudo pip install luma.emulator
 
sudo pip install luma.emulator
git clone https://github.com/ZeroPhone/pyLCI
+
git clone https://github.com/ZeroPhone/ZPUI
cd pyLCI
+
cd ZPUI
 
./setup_emulator.sh
 
./setup_emulator.sh
 
python main.py</nowiki>
 
python main.py</nowiki>
Line 26: Line 26:
 
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 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
 
sudo pip2 install luma.emulator
git clone https://github.com/ZeroPhone/pyLCI
+
git clone https://github.com/ZeroPhone/ZPUI
cd pyLCI
+
cd ZPUI
 
./setup_emulator.sh
 
./setup_emulator.sh
 
python2 main.py</nowiki>
 
python2 main.py</nowiki>
Line 35: Line 35:
 
You can either:  
 
You can either:  
  
* [https://github.com/ZeroPhone/pyLCI/issues/new Open an issue on GitHub]
+
* [https://github.com/ZeroPhone/ZPUI/issues/new Open an issue on GitHub]
 
* Email me - emails are accessible on the main page
 
* Email me - emails are accessible on the main page
  
 
== TODO ==
 
== TODO ==
  
* Help add more installation instructions (have to be verified, though theoretically it should *just work* without apt, using some other package manager)
+
* Help add more installation instructions (have to be verified, though theoretically it should *just work* when using some other package manager)
* 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). [https://github.com/ZeroPhone/pyLCI/issues/10 This is the relevant GH issue that desribes the problem better.]
 
  
 
== Credits ==
 
== Credits ==
  
Most of the emulator research and work was done by Doug. The input driver was done by Arsenijs. OpenSUSE instructions were compiled with help of piajesse ([https://hackaday.io/piajesse @Hackaday.io])
+
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])

Revision as of 00:31, 13 November 2017

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 - that's going to work with your screen and keyboard, instead of the real ZeroPhone hardware. While some Raspbian-specific apps will not function on other Linux distros (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

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:

TODO

  • Help add more installation instructions (have to be verified, though theoretically it should *just work* when using some other package manager)

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)