pibooth-oled-display


Namepibooth-oled-display JSON
Version 2.0.3 PyPI version JSON
download
home_pagehttps://github.com/DJ-Dingo/pibooth-oled-display
SummaryPibooth Plugin to manage small OLED displays (via I2c or SPI). Show various counters (e.g., photos taken), display time-date, text, logos, and animated GIFs.
upload_time2023-08-12 16:00:23
maintainer
docs_urlNone
authorKenneth Nicholas Jørgensen
requires_python>=3.6
licenseGPLv3
keywords raspberry pi camera raspberry pi camera photobooth selfiecam pygame pil pillow pibooth pibooth plugin oled display luma.oled oled
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ====================
pibooth-oled-display
====================

|PythonVersions| |PypiPackage| |Downloads|

``pibooth-oled-display`` is a plugin for the `pibooth`_ application.

.. image:: https://raw.githubusercontent.com/DJ-Dingo/pibooth-oled-display/master/templates/Pibooth_OLED-I2c_3V3_main.png
   :align: center
   :alt: I2c 3v3 OLED display simple setup x 2

| Add 1 or 2 small OLED display (**Monochrome or Color**) through **I2c** or **SPI**. 

(parallel mode will not be suported). 

| **Features**

It can show up to 3 lines of **Text**, with or without **Counters**, with numbers of ``Photos Taken``, ``Printed Photos``, ``Forgotten Photos``, ``Remaining Duplicates``. Or ``Date-Time``, ``Text_Only`` or an ``Empty`` line.

.. image:: https://raw.githubusercontent.com/DJ-Dingo/pibooth-oled-display/master/templates/main_oled.png
   :align: center
   :alt: OLED display examples

| There is also an option for showing your own or default pibooth state images for each `States`_

| And it is able of showing Image or Animated Gif with your own **Logo**, like **Pibooth Logo**, 

.. |image1| image:: https://raw.githubusercontent.com/DJ-Dingo/pibooth-oled-display/master/pibooth_oled_display/oled_display/logo/A01_Pibooth_128x64.gif
   :alt: OLED display examples

.. |image2| image:: https://raw.githubusercontent.com/DJ-Dingo/pibooth-oled-display/master/pibooth_oled_display/oled_display/logo/A03_Beer.gif
   :alt: OLED display examples


|image1| |image2|

.. Note:: Text / Counters can be ``Sized``, ``Centered``, or moved ``Right`` or ``Down``, to match the display. Changes can be made in the `Pibooth Menu`_ or in the `config.cfg`_ file.

**Don't be scared by this long manual, it´s there to cover all the different OLED displays on the marked. If you only have an 3v3 I2c 
OLED display all you need is 4 wires to your Pi, and installing the plugin.**

-----------------------------------------------------------

.. contents::

---------------------

Requirements
------------

Hardware
^^^^^^^^

* 1 x Raspberry Pi 3 Model B (or higher).
* 1 x I2c safe Logic Level Converter (**If you are using 5v displays**).  
* 1 x OLED-display, with **I2c** or **SPI** (See the list of `Tested OLED Displays`_).

.. |image5| image:: https://raw.githubusercontent.com/DJ-Dingo/pibooth-oled-display/master/templates/0-91-0-96-1-3-OLED.png
   :alt: OLED display

|image5|

Tested OLED Displays
^^^^^^^^^^^^^^^^^^^^

* Here is the list of supported displays by the luma.oled driver

=============== ========================== =========== ===== =====
OLED displays    Display Resolutions         TESTED     SPI   I2C
=============== ========================== =========== ===== =====
- sh1106        128x64                     **Working**     X     X
- ssd1306       128x32, 128x64             **Working**     X     X
- ssd1309                                  not tested
- ssd1322                                  not tested
- ssd1325                                  not tested
- ssd1327                                  not tested
- ssd1331                                  not tested
- ssd1362                                  not tested
=============== ========================== =========== ===== =====

| **SPI** are a little faster than **I2c**, but also uses more wires to the raspberry pi.
| Personally I use **I2c** 3v3 displays, since it is only 4 wires to the Pi. 

Most common OLED displays are these 3 (I prefer size 0.96, 1.3 or higher″)

* **ssd1306 128x32** 0.91″ 128X32 white Display
* **ssd1306 128x64** 0.96″ 128X64 white Display
* **sh1106  128x64** 1.3″  128X64 white Display

--------------------------------------

Install
-------
::

   $ pip3 install pibooth-oled-display


--------------------------------------

I2c Configuration
-----------------

Enabling I2c interface on the Raspberry Pi
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

| **The I2C peripheral is not turned on by default.**

There are two methods to enable I2c.
 

| (**Be aware that newer Raspberry PI OS systems can have a different way to turn on I2c**).

I recommend checking the `official Raspberry Pi documentation`_ or the latest resources provided by the Raspberry Pi community. They will provide the most accurate instructions for configuring the I2C interface on your specific version of the Raspberry Pi.

**Raspberry Pi Configuration via Desktop GUI**  
 
* You can use the Desktop GUI by heading to the Pi **Start Menu > Preferences > Raspberry Pi Configuration**.
* A window will pop up with different tabs to adjust settings. What we are interested is the **Interfaces** tab.
* Click on the tab and select **Enable** for I2C. Click on the **OK** button to **save**.
* We recommend restarting your Pi to ensure that the changes to take effect.
* Click on the Pi Start Menu > Preferences > Shutdown. Since we just need to restart, click on the Restart button.

 
**raspi-config Tool via Terminal**

Again, we can use raspi-config to enable it.

* Run **sudo raspi-config**
* Use the down arrow to select **5 Interfacing Options**
* Arrow down to **P5 I2C**
* Select **yes** when it asks you to enable **I2C**
* Also select **yes** if it asks about automatically loading the kernel module.
* Use the right arrow to select the **<Finish>** button.
* Select **yes** when it asks to reboot.

The system will reboot. when it comes back up, log in and enter the following command in terminal

``ls /dev/*i2c*``   
 
The Pi should respond with

``/dev/i2c-1``        
 
Which represents the user-mode I2C interface.


How to find your I2c addresss
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

| **You need to know the address of your I2c.**

You can find it writing this command in the command line:

``sudo i2cdetect -y 1``
 
In this case the address of the display is **0x3C**.


.. |image7| image:: https://raw.githubusercontent.com/DJ-Dingo/pibooth-oled-display/master/templates/i2cdetect-y1.png
   :alt: Detect I2C Address

|image7|

How to change I2c address
^^^^^^^^^^^^^^^^^^^^^^^^^

| **Only if needed**:

* On most displays you can solder a (short circuit) on the back of the OLED display, to change the address.

(**check the manual of your display, or search the internet**)

--------------------------------------

SPI Configuration
-----------------

Enabling SPI interface on the Raspberry Pi
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

| **The SPI peripheral is not turned on by default.**

There are two methods to adjust the settings.

| (**Be aware that newer Raspberry PI OS systems can have a different way to turn on SPI**).

I recommend checking the `official Raspberry Pi documentation`_ or the latest resources provided by the Raspberry Pi community. They will provide the most accurate instructions for configuring the SPI interface on your specific version of the Raspberry Pi.


**Raspberry Pi Configuration via Desktop GUI**

* You can use the Desktop GUI by heading to the Pi **Start Menu > Preferences > Raspberry Pi Configuration**.
* A window will pop up with different tabs to adjust settings. What we are interested is the **Interfaces tab**.
* Click on the tab and select **Enable** for **SPI**. Click on the **OK** button to save.
* We recommend restarting your Pi to ensure that the changes to take effect.
* Click on the Pi **Start Menu > Preferences > Shutdown**. Since we just need to **restart**, click on the Restart button.

**raspi-config Tool via Terminal**

Again, we can use raspi-config to enable it.

* Run **sudo raspi-config**
* Use the down arrow to select **3 Interfacing Options**
* Arrow down to **P4 SPI**
* Select yes when it asks you to enable **SPI**
* Also select **yes** if it asks about automatically loading the kernel module.
* Use the right arrow to select the **<Finish>** button.
* Select **yes** when it asks to reboot.

The system will reboot. when it comes back up, log in and enter the following command in terminal.

``ls /dev/spidev*``

| This command lists the SPI devices available in the /dev directory.
| If SPI is enabled, you should see output similar to 

``/dev/spidev0.0`` 
``/dev/spidev0.1``
If SPI is not enabled, you will see an error message or no output.

--------------------------------------

I2c Circuit diagram and wiring - (ONLY with 3v3 displays)
---------------------------------------------------------

I2c Circuit diagram - (ONLY with 3v3 displays) 
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

| Here is the diagram for hardware connections **without** an Logic Level Converter.

**IMPORTANT** **use ONLY 3v3** 

The Vcc and GND on the OLED displays are not always the same, so it is verry important that you check Vcc and GND is set correctly.

.. image:: https://raw.githubusercontent.com/DJ-Dingo/pibooth-oled-display/master/templates/Pibooth%20OLED-I2c%203V_Sketch2_bb.png
   :align: center
   :alt:  OLED I2c Circuit diagram - (ONLY with 3v3 displays)


I2c Wire - (ONLY with 3v3 displays)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

3v3 only. **IMPORTANT CHECK YOUR DISPLAY FOR THE RIGHT CONNECTION**


============ ======== ========================
Display Pins RPi-PINs Info                      
============ ======== ========================
VCC 3v3      PIN 1    3v3 ONLY
GND (Ground) PIN 6    Ground pin of the module
SCL (Clock)  PIN 5    Acts as the clock pin.
SDA (Data)   PIN 3    Data pin of the module.
============ ======== ========================

----------------------------------------------------

I2c Circuit diagram - (5v displays) with an Logic Level Converter
-----------------------------------------------------------------

I2C circuit diagram - (5v displays)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Here is the diagram for hardware connections **with** and Logic Level Converter.
**IMPORTANT** The Vcc and GND on the OLED display are not always the same, so it is verry important that you check Vcc and GND is set correctly.

.. image:: https://raw.githubusercontent.com/DJ-Dingo/pibooth-oled-display/master/templates/Pibooth_OLED-I2c_Sketch_bb_1.png
   :align: center
   :alt:  I2C circuit diagram - (5v displays)

I2c wire - (5v displays)
^^^^^^^^^^^^^^^^^^^^^^^^

**IMPORTENT**: If you use 5v to power the OLED display 
*most OLEDs can also run on 3v3, check your manual.*

Since the Raspberry Pi GPIO only handle 3.3v, it will therefore be a good idea to use a **Logic Level Converter** when using 5v to power the display, so you don't fryed your pi.

.. |image9| image:: https://raw.githubusercontent.com/DJ-Dingo/pibooth-oled-display/master/templates/level_converter.png
   :alt: I2c wire - (5v displays) 4-channel Logic Level converter

|image9|

**IMPORTANT CHECK YOUR DISPLAY FOR THE RIGHT CONNECTION**

| OLED-I2c to the **HV** (High Level) side, on the Level Converter HV.  

*(Display >> level converter HV side)*

============ =============== =========================================
Display Pins Level converter Info                      
============ =============== =========================================
GND          GND             **Dsplay GND to the level converter GND**
VCC          HV  (HV )       **Display VC to the level converter HV**
SCL (Clock)  HV2 (HV2)       **SCL <> HV2  on the Level Converter**
SDA (Data)   HV1 (HV1)       **SDA <> HV1 on the Level Converter**
============ =============== =========================================

| RPi (**BOARD numbering scheme**) to **LV** (Low Level) side, on the Level Converter. 

*(Raspberry Pi >> Level converter LV side)*

===== ===== =============== ==========================================
 RPi  Pins  Level converter Info                      
===== ===== =============== ==========================================
GND   Pin 6 GND             **RPi GND to GND on the level converter**
3.3v  Pin 1 LV  (LV )       **RPi (3v3) to LV on the Level Converter**
5v    Pin 2 HV  (HV )       **RPi (5v) to HV on the Level Converter**
SCL   Pin 5 LV2 (LV2)       **SCL <> LV2 on the Level Converter**
SDA   Pin 3 LV1 (LV1)       **SDA <> LV1 on the Level Converter**
===== ===== =============== ==========================================

----------------------------------------------------


SPI Circuit diagram and Wiring 
------------------------------

SPI circuit diagram (ONLY with 3v3 displays)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Here is the diagram for hardware connections **without** and **Logic Level Converter**. 

If your OLED display use 5v instead of 3v3, it demands an 8 Channel Logic Level Converter, you should get one or you risk frye your pi.

**IMPORTANT** The Vcc and GND on an OLED display are not always the same, so it is **verry important** that you check Vcc and GND is set correctly.

.. image:: https://raw.githubusercontent.com/DJ-Dingo/pibooth-oled-display/master/templates/Pibooth_OLED-SPI_1.png
   :align: center
   :alt:  SPI circuit diagram (ONLY with 3v3 displays)



SPI wire setup - (ONLY with 3v3 displays)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

======== ============ ========== ============== ============================================================
7 Pins   Remarks      RPi-PIN    RPi GPIO       Info
======== ============ ========== ============== ============================================================
VCC      Power Pin    PIN 1      3V3            3V3 ONLY - CHECK YOUR DISPLAY
GND      Ground       PIN 6      GND            Ground pin of the module
D0, SCL  Clock        PIN 23     GPIO 11 (SCLK) Acts as the clock pin.
D1, SDA  MOSI         PIN 19     GPIO 10 (MOSI) Data pin of the module.
RST      Reset        PIN 22     GPIO 25        Resets the module, useful during SPI
DC, A0   Data/Command PIN 18     GPIO 24        Data Command pin. Used for SPI protocol
CS       Chip Select  PIN 24     GPIO 8 (CE0)   Useful when more than one module is used under SPI protocol
                      PIN 26     GPIO 7 (CE1)   Useful when more than one module is used under SPI protocol
======== ============ ========== ============== ============================================================

**If you have a 8 pins OLED display with "Vin" connect 3v3 to Vin and leave VCC empty.** *(or check the internet for more info on how to setup your display)*

----------------------------------------------------


SPI wire - (5v display) with a Logic Level Converter 
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

You will need a 8 channel Logic Level Converter to use SPI with 5v. Or you can use 2 x 4 channels Logic Level Converters.

| Same princip as `I2c Circuit diagram - (5v displays) with an Logic Level Converter`_ 

* You take the needed GPIO PINs from the Raspberry Pi, and wire them to the LV side of the Logic Level Converters.
* The same goes for 3v3 wire, that goes to the LV side of the level converters. 
* You also need to wire the 5v from the Raspberry Pi to the HV side of the level converter. 
* And last you need GND (Ground) from the Raspberry Pi to GND one or both sides of the level converters.

----------------------------------------------------

States
------

States images
^^^^^^^^^^^^^
.. image:: https://raw.githubusercontent.com/DJ-Dingo/pibooth-oled-display/master/templates/state_photos.png
   :align: center
   :alt:  OLED State pictures

| If you need to change states images or add missing resolutions to fit your display

Look at `How to show your own States images`_.

| These states are showing on the display, if **Show state pictures** is activated

| ``´choose´`` ``´chosen´`` ``´preview´`` ``´capture´``

``´processing´`` ``´print´`` ``´finish´`` ``´failsafe´``


States description
^^^^^^^^^^^^^^^^^^
.. image:: https://raw.githubusercontent.com/DJ-Dingo/pibooth-oled-display/master/templates/state-sequence-oled-i2c.png
   :align: center
   :alt:  State sequence

----------------------------------------------------

Setup in Pibooth Menu
---------------------

OLED Display - (SETUP) - Pibooth Menu
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

| You enter the menu by using Esc on your keyboard. 

Be aware that this plugin can sometimes make the reaction to enter the menu slow (2-3 sec).

| At the first time you make changes in the Menu, a configuration file is generated in ``'~/.config/pibooth/pibooth.cfg'``

which permits to configure the behavior of the plugin.

.. image:: https://raw.githubusercontent.com/DJ-Dingo/pibooth-oled-display/master/templates/menu_oled_display_setup_1.png
   :align: center
   :alt: OLED Display - (Setup) - Pibooth Menu



OLED Display - (MODIFY) - Pibooth Menu
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

| You enter the menu by using Esc on you keyboard. 

Be aware that this plugin can sometimes make the reaction to enter the menu slow (2-3 sec).

| At the first time you make changes in the Menu, a configuration file is generated in ``'~/.config/pibooth/pibooth.cfg'``

which permits to configure the behavior of the plugin.

.. image:: https://raw.githubusercontent.com/DJ-Dingo/pibooth-oled-display/master/templates/menu_oled_display_modify.png
   :align: center
   :alt: OLED Display - (Modify) - Pibooth Menu


--------------------------------------

Setup in config.cfg
-------------------

| Options are also available by editing the configuration file.
| But it is easier to `Setup in Pibooth Menu`_ 

under **Oled display - (setup)** and **Oled display - (modify)**

Edit config.cfg by using the command line or a text editor

::

   $ pibooth --config
   

OLED DISPLAY - (SETUP) - config.cfg
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

``config.cfg``

| [OLED DISPLAY - (SETUP)]
| # Choose OLED device - ``'ssd1306 (Default)', 'ssd1309', 'ssd1322', 'ssd1325', 'ssd1327', 'ssd1331', 'ssd1362', 'sh1106'``
| # Required by 'oled_display' plugin

oled_devices = ``ssd1306``

| # Display connection ``'I2c' or 'SPI'``
| # Required by 'oled_display' plugin

oled_i2c_or_spi = ``I2c``

| # I2c address ``(Default=0x3c)``
| # Required by 'oled_display' plugin

oled_port_address = ``0x3c``

| # Change SPI device number ``'0', '1' or '2' (Default = 0)``
| # Required by 'oled_display' plugin

oled_spi_device_number = ``0``

| # Change the I2c or SPI port number - ``(I2c = '1' - SPI = '0', '1', '2')``
| # Required by 'oled_display' plugin

oled_port = ``1``

| # SPI only GPIO DC PIN ``(Default=24)``
| # Required by 'oled_display' plugin

oled_spi_gpio_dc_pin = ``24``

| # SPI only GPIO RST PIN ``(Default=25)``
| # Required by 'oled_display' plugin

oled_spi_gpio_rst_pin = ``25``

| # Change screen WIDTH - ``'32', '48', '64', '80', '96', '128(Default)', '160', '240', '256', '320'``
| # Required by 'oled_display' plugin

oled_width = ``128``

| # Change screen HEIGHT - ``'32', '48', '64(Default)', '80', '96', '128', '160', '240', '256', '320'``
| # Required by 'oled_display' plugin

oled_height = ``64``

| # Color mode - ``'1 = Monochrome (Default)', 'RGB', 'RGBA'``
| # Required by 'oled_display' plugin

oled_color_mode = ``1``

| # Rotate screen - ``'0 (Default)', '1', '2', '3'``
| # Required by 'oled_display' plugin

oled_rotate = ``0``


------------------------------------------


OLED DISPLAY - (MODIFY) - config.cfg
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

| [OLED DISPLAY - (MODIFY)]
| # Show state pictures - ``'Yes' or 'No'``
| # Required by 'oled_display' plugin - (See `States`_ for more info on how it works)

oled_states_pictures = ``Yes``

| # Show Logo or Animated Gif (instead of text) - ``'Yes' or 'No'``

| # Required by 'oled_display' plugin

| # See `How to show your own Logo`_ and `How to show your own Animated Gif`_

oled_showlogo = ``No``

| # Logo or Animated Gif in the folder ``'~/.config/pibooth/oled_display/logo/'``
| # Required by 'oled_display' plugin

oled_logos = ``128x64_Pibooth_2.gif``

| # FPS (Frames Per Second) speed for Animated Gif
| # Required by 'oled_display' plugin

oled_animated_fps = ``15``

------------------------------------

| # Text-1 - Counters, Text, Date-Time - Could be either ``'Taken_Photo', 'Printed', 'Forgotten', 'Remaining_Duplicates', 'Date-Time', 'Empty', 'Text_Only'``
| # Required by 'oled_display' plugin - (Also see `How to change the Date-Time format`_, when using **Date-Time**)

oled_counter_type1 = ``Taken_Photo``

| # Text-1 Font - You can add more fonts 'Truetype(.ttf)' or 'Opentype(.otf)', in the folder ``'~/.config/pibooth/oled_display/fonts/'``

| # Required by 'oled_display' plugin

oled_font_1 = ``DejaVuSerif-Bold.ttf``

| # Text-1 Color - uses HTML color names. E.g. ``'White', 'Red', 'Cyan', 'Silver', 'Blue', 'Grey', 'DarkBlue', 'Black', 'LightBlue', 'Orange', 'Purple', 'Brown', 'Yellow', 'Maroon', 'Lime', 'Green', 'Magenta', 'Olive'.``

| *(On Monochrome displays colors will be converted to 'White')*

| # Required by 'oled_display' plugin

oled_text1_color = ``white``

| # Text-1 - Text with space after to use with counter, or leave empty for counter only

| # Required by 'oled_display' plugin

oled_text_1 = ``"Photos  "``

| # Text-1 - Center text on display ``'Yes' or 'No'``
| # Required by 'oled_display' plugin

oled_text_1_center = ``No``

| # Text-1 Size - 19 is default if 3 x text/counters are used on the display at the same time
| # Required by 'oled_display' plugin

oled_size_1 = ``19``

| # Text-1 - Move text 'Right' on display
| # Required by 'oled_display' plugin

oled_text1_right = ``0``

| # Text-1 - Move text 'Down' on display
| # Required by 'oled_display' plugin

oled_text1_down = ``0``

------------------------------------

| # Text-2 - Counters, Text, Date-Time - Could be either ``'Taken_Photo', 'Printed', 'Forgotten', 'Remaining_Duplicates', 'Date-Time', 'Empty', 'Text_Only'``
| # Required by 'oled_display' plugin - (Also see `How to change the Date-Time format`_, when using **Date-Time**)

oled_counter_type2 = ``Printed``

| # Text-2 Font - You can add more fonts 'Truetype(.ttf)' or 'Opentype(.otf)', in the folder ``'~/.config/pibooth/oled_display/fonts/'``
| # Required by 'oled_display' plugin

oled_font_2 = ``DejaVuSerif-Bold.ttf``

| # Text-2 Color - uses HTML color names. E.g. ``'White', 'Red', 'Cyan', 'Silver', 'Blue', 'Grey', 'DarkBlue', 'Black', 'LightBlue', 'Orange', 'Purple', 'Brown', 'Yellow', 'Maroon', 'Lime', 'Green', 'Magenta', 'Olive'.`` 
| *(On Monochrome displays colors will be converted to 'White')*
| # Required by 'oled_display' plugin

oled_text2_color = ``white``

| # Text-2 - Text with space after to use with counter, or leave empty for counter only
| # Required by 'oled_display' plugin

oled_text_2 = ``"Printed "``

| # Text-2 - Center text on display ``'Yes' or 'No'``
| # Required by 'oled_display' plugin

oled_text_2_center = ``No``

| # Text-2 Size - 19 is default if 3 x text/counters are used on the display at the same time
| # Required by 'oled_display' plugin

oled_size_2 = ``19``

| # Text-2 - Move text 'Right' on display
| # Required by 'oled_display' plugin

oled_text2_right = ``0``

| # Text-2 - Move text 'Down' on display
| # Required by 'oled_display' plugin

oled_text2_down = ``23``


----------------------------------------------------

| # Text-3, Counter, Date-Time - Could be either ``'Taken_Photo', 'Printed', 'Forgotten', 'Remaining_Duplicates', 'Date-Time', 'Empty', 'Text_Only'``
| # Required by 'oled_display' plugin - (Also see `How to change the Date-Time format`_, when using **Date-Time**)

oled_counter_type3 = ``Remaining_Duplicates``

| # Text-3 Font - You can add more fonts 'Truetype(.ttf)' or 'Opentype(.otf)', in the folder ``'~/.config/pibooth/oled_display/fonts/'``
| # Required by 'oled_display' plugin

oled_font_3 = ``DejaVuSerif-Bold.ttf``

| # Text-3 Color - uses HTML color names. E.g. ``'White', 'Red', 'Cyan', 'Silver', 'Blue', 'Grey', 'DarkBlue', 'Black', 'LightBlue', 'Orange', 'Purple', 'Brown', 'Yellow', 'Maroon', 'Lime', 'Green', 'Magenta', 'Olive'.``
| *(On Monochrome displays colors will be converted to 'White')*
| # Required by 'oled_display' plugin

oled_text3_color = ``white``

| # Text-3 - Text with space after to use with counter, or leave empty for counter only
| # Required by 'oled_display' plugin

oled_text_3 = ``"Remain "``

| # Text-3 - Center text on display ``'Yes' or 'No'``
| # Required by 'oled_display' plugin

oled_text_3_center = ``No``

| # Text-3 Size - 19 is default if 3 x text/counters are used on the display at the same time
| # Required by 'oled_display' plugin

oled_size_3 = ``19``

| # Text-3 - Move text 'Right' on display
| # Required by 'oled_display' plugin

oled_text3_right = ``0``

| # Text-3 - Move text 'Down' on display
| # Required by 'oled_display' plugin

oled_text3_down = ``46``


----------------------------------------------------

How to use Date-Time / Logo / Animated Gif
------------------------------------------

How to change the Date-Time format
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

| See all the Date-Time format codes in the following file 

`Date-Time_Format_Codes.rst`_ 

You can also find the file **Date-Time_Format_Codes.rst** in your local pibooth config folder ``~/.config/pibooth/oled_display/`` after you run the plugin the first time.

* Choose Date_Time in the menu - (If you leave the text field empty, the Default will be used = **%H:%M:%S**).
* Or use semething like this **%d/%m - %H:%M:%S** in the text field to display the date and time.

Remember to set the size of the text to match the display, after you set your Date-Time format codes.

----------------------------------------------------

How to show your own Logo
^^^^^^^^^^^^^^^^^^^^^^^^^

| **LOGO** - choose **Yes** in the Pibooth Menu under **Logo instead of text** 

| *(Default Logo is the Pibooth logo in resolutions 128x32 or 128x64).* 

Also look at `How to show your own Animated Gif`_ as logo.

| Add a new Logo or Animated gif, same resolution as your display ( or lower).

* Logo path = ``~/.config/pibooth/oled_display/logo/``

| (pibooth-oled-display support many different image type extensions)

If you add an images with the same name and File extension(s) as some of the default images, only the user images will be showing.

**When adding new Logo, you need to restart Pibooth to load it into the logo database. If you delete a user logo that is still in the configuration a default Pibooth Logo will be showing on the display**

----------------------------------------------------

How to show your own Animated Gif
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

| You can add Animated Gif in the folder ``~/.config/pibooth/oled_display/logo/``

An choose **Yes** in **Logo instead of text** in the Pibooth Menu

On Monochrome displays (black & white) you need the Animated Gif to have a Black bagground. The reason for that is that the luma.oled drivers converts transperent to white color, when using ``color mode 1``.

| Some Animated Gifs with transperent bagground work, but in general they don´t.

| So do some test with Animated Gif´s in the same resolution or less as your display. 

All images will be centered automatic on the display. 

| ?. Can i use an Animated Gif with colors on an Monochrome display = **Yes**

But they are not always showing correct, as they will be converted to Black and White or grayscale.

**When adding new Animated Gif, you need to restart Pibooth to load them into the Logo database. If you delete a user Animated that is still in the configuration a default Pibooth Logo will be showing on the display**


----------------------------------------------------

How to show your own States images
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

| **STATES** - choose **Yes** in the Pibooth Menu under **Show state pictures** 

| *(Default States images are already provided with these display resolutions):*

| ``128 x 32 pixels`` ``128 x 64 pixels`` ``128 x 128 pixels``

| ``160 x 128 pixels`` ``192 x 64 pixels`` ``256 x 64 pixels``

``256 x 128 pixels`` ``256 x 256 pixels`` ``320 x 240 pixels``

| Add new ``.png`` States images, same resolution as your display, to each folders.

* States path = ``~/.config/pibooth/oled_display/states/``

**When adding a new states images, it will automatic be used instead of default.**

There are 8 folders, and you need 11 ``.png`` images with the static names "folder and resolution".
Here is an examble on how you should name your states images if you have an display with resolution 128 x 64. 
You should make images with the same resolution as you display and use the static names with resolution as below, and put them in every folder under each states. 

Examples : 128x32 = ``processing_128x32.png`` 128x64 = ``processing_128x64.png``

| List of file names for a display with 128x64 resolution

| `states/capture/ <https://github.com/DJ-Dingo/pibooth-oled-display/tree/master/pibooth_oled_display/oled_display/states/capture>`_  ``capture_128x64.png``

| `states/choose/ <https://github.com/DJ-Dingo/pibooth-oled-display/tree/master/pibooth_oled_display/oled_display/states/choose>`_ ``choose_128x128.png``

| `states/failure/ <https://github.com/DJ-Dingo/pibooth-oled-display/tree/master/pibooth_oled_display/oled_display/states/failure>`_ ``failure_128x64.png``

| `states/finished/ <https://github.com/DJ-Dingo/pibooth-oled-display/tree/master/pibooth_oled_display/oled_display/states/finished>`_ ``finished_128x64.png``

| **layout needs 4 ``.png`` images named like this**

| `states/layout/ <https://github.com/DJ-Dingo/pibooth-oled-display/tree/master/pibooth_oled_display/oled_display/states/layout>`_ ``layout1_128x64.png``, ``layout2_128x64.png``, ``layout3_128x64.png``, ``layout4_128x64.png``

| `states/preview/ <https://github.com/DJ-Dingo/pibooth-oled-display/tree/master/pibooth_oled_display/oled_display/states/preview>`_ ``preview_128x64.png``

| `states/printer/ <https://github.com/DJ-Dingo/pibooth-oled-display/tree/master/pibooth_oled_display/oled_display/states/printer>`_ ``printer_128x64.png``

`states/processing/ <https://github.com/DJ-Dingo/pibooth-oled-display/tree/master/pibooth_oled_display/oled_display/states/processing>`_ ``processing_128x64.png``

| You can see the origial gimp files in the **origin** folder `Here <https://github.com/DJ-Dingo/pibooth-oled-display/tree/master/pibooth_oled_display/oled_display/states>`_ under each folder.

| `states/capture/origin/ <https://github.com/DJ-Dingo/pibooth-oled-display/tree/master/pibooth_oled_display/oled_display/states/capture/origin>`_ ``capture_128x64.xcf``

| `states/choose/origin/ <https://github.com/DJ-Dingo/pibooth-oled-display/tree/master/pibooth_oled_display/oled_display/states/choose/origin>`_ ``choose_128x64.xcf``

| `states/failure/origin/ <https://github.com/DJ-Dingo/pibooth-oled-display/tree/master/pibooth_oled_display/oled_display/states/failure/origin>`_ ``failure_128x64.xcf``

| `states/finished/origin/ <https://github.com/DJ-Dingo/pibooth-oled-display/tree/master/pibooth_oled_display/oled_display/states/finished/origin>`_ ``finished_128x64.xcf``

| **Layout has 4 ``.xcf`` files, inside each folder for your resolution** 

| `states/layout/origin/ <https://github.com/DJ-Dingo/pibooth-oled-display/tree/master/pibooth_oled_display/oled_display/states/layout/origin>`_ ``layout1_128x64.xcf`` ``layout2_128x64.xcf`` ``layout3_128x64.xcf`` ``layout4_128x64.xcf``

| `states/preview/origin/ <https://github.com/DJ-Dingo/pibooth-oled-display/tree/master/pibooth_oled_display/oled_display/states/preview/origin>`_ ``preview_128x64.xcf``

| `states/printer/origin/ <https://github.com/DJ-Dingo/pibooth-oled-display/tree/master/pibooth_oled_display/oled_display/states/printer/origin>`_ ``printer_128x64.xcf``

`states/processing/origin/ <https://github.com/DJ-Dingo/pibooth-oled-display/tree/master/pibooth_oled_display/oled_display/states/processing/origin>`_ ``processing_128x64.xcf``

| If you are using an OLED display with other resolution than already supplied,

you need to make a new images and put it in each states folder or display will be empty if states is activated.

| You can convert images with the free `GIMP`_ or online services like (`this page`_).

If you have an monochrome display with the resolution 128x64, you can convert or make an image to that resolution (in 8-bit mode). 

**When adding new States images, you need to restart Pibooth to load them into the States database. If you delete a user State image the default Pibooth States images will be showing on the display**


----------------------------------------------------

How to add your own Fonts
^^^^^^^^^^^^^^^^^^^^^^^^^

| You can add new Fonts to your local oled_display Fonts folder.

``~/.config/pibooth/oled_display/fonts/``

* Supported font types are ´´.ttf´´ or ´´otf´´ 

| Fonts will be added as extra font in the Fonts database automatic.

| If you add fonts that has the same name as some of the default fonts, 

only the user Fonts will be showing in the menu.

You can download free fonts online, on sites like `fontspace.com <https://www.fontspace.com/>`_

**When adding new fonts, you need to restart Pibooth to load them into the fonts database. If you delete a user Font that is still in the configuration the default Font 'DejaVuSerif-Bold.ttf' will be used on the display**

----------------------------------------------------


Tips & Tricks
-------------

How to use 2 x OLED displays at the same time
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

How to install the second display plugin "pibooth_oled_display_2.py"
====================================================================

* The extra plugin for display 2 **"pibooth_oled_display_2.py"** is automatic in the folder ``~/.config/pibooth/oled_display/`` after you run the plugin the first time.
* You can activate the plugin by adding path to the file, to custom plugins in the config.cfg file under [GENERAL].

Open the config.cfg with this command, and find the line "plugins ="
::

   $ pibooth --config

| # Path to custom plugin(s) not installed with pip (list of quoted paths accepted)

``plugins = '~/.config/pibooth/oled_display/pibooth_oled_display_2.py'``

| Now you will have an extra plugin option in pibooth settings, with 

**Oled display 2 - (Setup)** and **Oled display 2 - (modify)**

* Go to the menu and setup your new second display. If you are using I2c, you new display 2 need its own I2c addresses (**standard 0x3d**). 
* If you use SPI, you need to have 2 displays with the CS (**Chip Select**) option (this funktion has not yet been tested, but should work).


.. image:: https://raw.githubusercontent.com/DJ-Dingo/pibooth-oled-display/master/templates/add_extra_oled_display_2.png
   :align: center
   :alt:  Add an extra OLED display settings


Setup 2 x I2c OLED displays - (Showing seperate things on each display)
=======================================================================

* You will need 2 x I2c OLED displays with different I2c addresses. defaults are ``0x3c`` on display 1, and ``0x3d`` on display 2. 
* On most displays you can change the I2c address on the back of your OLED display with some soldering.
   
* Or you can get an **8 Channel I2C Muti-Channel Expansion Development Board** to convert the default address to an new address and then use up 8 x I2c displays at the same time.

Setup 2 x SPI OLED displays - (Showing seperate things on each display)
=======================================================================

| **I dont know if it work, as i have not testet it yet. But it should work.** 

*And if it work, it will only work if you have the CS PIN on the displays*.

* Both the displays uses the same PINs/GPIOs, except the CS (Chip Select) PIN
* On display 1. Put a wire from the CS PIN to GPIO 8 (pin24) to choose CE0.
* On display 2. Put a wire from the CS PIN to GPIO 7 (pin26) to choose CS1. 

**Check online for more info about your displays on how to set them up.**

* According to LUMA.oled driver documentation, you should choose **port 0** for display 1 and **port 1** for display 2.
* You can do that in the pibooth menu. An maybe also try change the SPI device number to 0,1 or 2 to make it work.

Can i use SPI1 ? (e.g.SPI and SPI1 together on the pi)
======================================================

| **The short answer is no. I tryed, but with no luck**

*I dont think it is suported by the luma.oled drivers.*

* So only SPI (SPI0) can be used.

Setup 2 x OLED displays - (Showing the same things on each display)
===================================================================

| If you want to show the exact same things on 2 or more displays, you dont need the second plugin.

* On the I2c displays, you just use the same port address (0x3c etc.), and wire them to the same GPIO PINs.
* On the SPI displays, you just use the same CS port address (CE0 etc.), and wire them to the same GPIO PINs.

----------------------------------------------------

How to use a OLED displays with only 6 pins I2c/SPI
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

| **SPI** Most 6 PINs displays works out of the box with SPI. 

* but unfortunately you can only use one display in pibooth, as there is no CS pin on the display.

| **I2c** Can be used with some soldering tricks on the back of the displays, and some extra component.

* It also works when using 2 displays in pibooth.

.. image:: https://raw.githubusercontent.com/DJ-Dingo/pibooth-oled-display/master/templates/6PIN_SPI_I2C.png
   :align: center
   :alt:  Change 6PIN SPI to I2c

| To choose I2c port address, you need to solder a wire from

* DC >> VCC = for I2C address 0x3c
* DC >> GND = for I2C address 0x3d

| You will also need to make a "pull-up and reset circuit" or "reset pull-up circuit."

So you need a 10k resistor, and a 47nf or 100nf capacitor (Ceramic or Electrolytic)

* Reset pin >> 10k resistor >> VCC
* Reset pin >> 47nF or 100nF capacitor (condensator) >> GND (Ground)

.. |image11| image:: https://raw.githubusercontent.com/DJ-Dingo/pibooth-oled-display/master/templates/Reset_pull-up_circuit.jpg
   :width: 20%
   :alt:  Reset pull-up circuit

|image11|

The purpose of this circuit is to provide a stable voltage level and proper reset functionality for the Reset pin of the OLED display. The 10k resistor connected between the Reset pin and VCC is the pull-up resistor, which ensures that the Reset pin remains at a high logic level when it is not actively driven low.

The 47nF or 100nF capacitor connected between the Reset pin and ground serves to stabilize the reset signal by filtering out any noise or voltage fluctuations. It helps ensure that the reset signal is clean and reliable, preventing false triggering or erratic behavior.

By using this pull-up and reset circuit, you are ensuring that the OLED display receives a proper reset signal and is able to turn on reliably. It is a common practice to include these components to ensure the correct functioning of cheap displays with reset pins.



.. --- Links ------------------------------------------------------------------

.. _`pibooth`: https://pypi.org/project/pibooth
.. _`pibooth_oled_display`: 
.. _`official Raspberry Pi documentation`: https://www.raspberrypi.com/documentation/
.. _`Date-Time_Format_Codes.rst`: https://github.com/DJ-Dingo/pibooth-oled-display/blob/master/pibooth_oled_display/oled_display/Date-Time_Format_Codes.rst
.. _`this page`: https://online-converting.com/image/
.. _`Download Here`: https://github.com/DJ-Dingo/pibooth-oled-display/tree/master/templates/xcf_files
.. _`GIMP`: https://www.gimp.org/
.. _`Pibooth Menu`: #oled-display-modify-pibooth-menu
.. _`config.cfg`: #oled-display-modify-config-cfg

.. |PythonVersions| image:: https://img.shields.io/badge/python-3.6+-red.svg
   :target: https://www.python.org/downloads
   :alt: Python 3.6+

.. |PypiPackage| image:: https://badge.fury.io/py/pibooth-oled-display.svg
   :target: https://pypi.org/project/pibooth-oled-display
   :alt: PyPi package

.. |Downloads| image:: https://img.shields.io/pypi/dm/pibooth-oled-display?color=purple
   :target: https://pypi.org/project/pibooth-oled-display
   :alt: PyPi downloads

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/DJ-Dingo/pibooth-oled-display",
    "name": "pibooth-oled-display",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": "",
    "keywords": "raspberry pi,camera,raspberry pi camera,photobooth,selfiecam,pygame,pil,pillow,pibooth,pibooth plugin,oled display,luma.oled,oled",
    "author": "Kenneth Nicholas J\u00f8rgensen",
    "author_email": "",
    "download_url": "https://github.com/DJ-Dingo/pibooth-oled-display/archive/2.0.3.tar.gz",
    "platform": "unix",
    "description": "====================\npibooth-oled-display\n====================\n\n|PythonVersions| |PypiPackage| |Downloads|\n\n``pibooth-oled-display`` is a plugin for the `pibooth`_ application.\n\n.. image:: https://raw.githubusercontent.com/DJ-Dingo/pibooth-oled-display/master/templates/Pibooth_OLED-I2c_3V3_main.png\n   :align: center\n   :alt: I2c 3v3 OLED display simple setup x 2\n\n| Add 1 or 2 small OLED display (**Monochrome or Color**) through **I2c** or **SPI**. \n\n(parallel mode will not be suported). \n\n| **Features**\n\nIt can show up to 3 lines of **Text**, with or without **Counters**, with numbers of ``Photos Taken``, ``Printed Photos``, ``Forgotten Photos``, ``Remaining Duplicates``. Or ``Date-Time``, ``Text_Only`` or an ``Empty`` line.\n\n.. image:: https://raw.githubusercontent.com/DJ-Dingo/pibooth-oled-display/master/templates/main_oled.png\n   :align: center\n   :alt: OLED display examples\n\n| There is also an option for showing your own or default pibooth state images for each `States`_\n\n| And it is able of showing Image or Animated Gif with your own **Logo**, like **Pibooth Logo**, \n\n.. |image1| image:: https://raw.githubusercontent.com/DJ-Dingo/pibooth-oled-display/master/pibooth_oled_display/oled_display/logo/A01_Pibooth_128x64.gif\n   :alt: OLED display examples\n\n.. |image2| image:: https://raw.githubusercontent.com/DJ-Dingo/pibooth-oled-display/master/pibooth_oled_display/oled_display/logo/A03_Beer.gif\n   :alt: OLED display examples\n\n\n|image1| |image2|\n\n.. Note:: Text / Counters can be ``Sized``, ``Centered``, or moved ``Right`` or ``Down``, to match the display. Changes can be made in the `Pibooth Menu`_ or in the `config.cfg`_ file.\n\n**Don't be scared by this long manual, it\u00b4s there to cover all the different OLED displays on the marked. If you only have an 3v3 I2c \nOLED display all you need is 4 wires to your Pi, and installing the plugin.**\n\n-----------------------------------------------------------\n\n.. contents::\n\n---------------------\n\nRequirements\n------------\n\nHardware\n^^^^^^^^\n\n* 1 x Raspberry Pi 3 Model B (or higher).\n* 1 x I2c safe Logic Level Converter (**If you are using 5v displays**).  \n* 1 x OLED-display, with **I2c** or **SPI** (See the list of `Tested OLED Displays`_).\n\n.. |image5| image:: https://raw.githubusercontent.com/DJ-Dingo/pibooth-oled-display/master/templates/0-91-0-96-1-3-OLED.png\n   :alt: OLED display\n\n|image5|\n\nTested OLED Displays\n^^^^^^^^^^^^^^^^^^^^\n\n* Here is the list of supported displays by the luma.oled driver\n\n=============== ========================== =========== ===== =====\nOLED displays    Display Resolutions         TESTED     SPI   I2C\n=============== ========================== =========== ===== =====\n- sh1106        128x64                     **Working**     X     X\n- ssd1306       128x32, 128x64             **Working**     X     X\n- ssd1309                                  not tested\n- ssd1322                                  not tested\n- ssd1325                                  not tested\n- ssd1327                                  not tested\n- ssd1331                                  not tested\n- ssd1362                                  not tested\n=============== ========================== =========== ===== =====\n\n| **SPI** are a little faster than **I2c**, but also uses more wires to the raspberry pi.\n| Personally I use **I2c** 3v3 displays, since it is only 4 wires to the Pi. \n\nMost common OLED displays are these 3 (I prefer size 0.96, 1.3 or higher\u2033)\n\n* **ssd1306 128x32** 0.91\u2033 128X32 white Display\n* **ssd1306 128x64** 0.96\u2033 128X64 white Display\n* **sh1106  128x64** 1.3\u2033  128X64 white Display\n\n--------------------------------------\n\nInstall\n-------\n::\n\n   $ pip3 install pibooth-oled-display\n\n\n--------------------------------------\n\nI2c Configuration\n-----------------\n\nEnabling I2c interface on the Raspberry Pi\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n| **The I2C peripheral is not turned on by default.**\n\nThere are two methods to enable I2c.\n \n\n| (**Be aware that newer Raspberry PI OS systems can have a different way to turn on I2c**).\n\nI recommend checking the `official Raspberry Pi documentation`_ or the latest resources provided by the Raspberry Pi community. They will provide the most accurate instructions for configuring the I2C interface on your specific version of the Raspberry Pi.\n\n**Raspberry Pi Configuration via Desktop GUI**  \n \n* You can use the Desktop GUI by heading to the Pi **Start Menu > Preferences > Raspberry Pi Configuration**.\n* A window will pop up with different tabs to adjust settings. What we are interested is the **Interfaces** tab.\n* Click on the tab and select **Enable** for I2C. Click on the **OK** button to **save**.\n* We recommend restarting your Pi to ensure that the changes to take effect.\n* Click on the Pi Start Menu > Preferences > Shutdown. Since we just need to restart, click on the Restart button.\n\n \n**raspi-config Tool via Terminal**\n\nAgain, we can use raspi-config to enable it.\n\n* Run **sudo raspi-config**\n* Use the down arrow to select **5 Interfacing Options**\n* Arrow down to **P5 I2C**\n* Select **yes** when it asks you to enable **I2C**\n* Also select **yes** if it asks about automatically loading the kernel module.\n* Use the right arrow to select the **<Finish>** button.\n* Select **yes** when it asks to reboot.\n\nThe system will reboot. when it comes back up, log in and enter the following command in terminal\n\n``ls /dev/*i2c*``   \n \nThe Pi should respond with\n\n``/dev/i2c-1``        \n \nWhich represents the user-mode I2C interface.\n\n\nHow to find your I2c addresss\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n| **You need to know the address of your I2c.**\n\nYou can find it writing this command in the command line:\n\n``sudo i2cdetect -y 1``\n \nIn this case the address of the display is **0x3C**.\n\n\n.. |image7| image:: https://raw.githubusercontent.com/DJ-Dingo/pibooth-oled-display/master/templates/i2cdetect-y1.png\n   :alt: Detect I2C Address\n\n|image7|\n\nHow to change I2c address\n^^^^^^^^^^^^^^^^^^^^^^^^^\n\n| **Only if needed**:\n\n* On most displays you can solder a (short circuit) on the back of the OLED display, to change the address.\n\n(**check the manual of your display, or search the internet**)\n\n--------------------------------------\n\nSPI Configuration\n-----------------\n\nEnabling SPI interface on the Raspberry Pi\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n| **The SPI peripheral is not turned on by default.**\n\nThere are two methods to adjust the settings.\n\n| (**Be aware that newer Raspberry PI OS systems can have a different way to turn on SPI**).\n\nI recommend checking the `official Raspberry Pi documentation`_ or the latest resources provided by the Raspberry Pi community. They will provide the most accurate instructions for configuring the SPI interface on your specific version of the Raspberry Pi.\n\n\n**Raspberry Pi Configuration via Desktop GUI**\n\n* You can use the Desktop GUI by heading to the Pi **Start Menu > Preferences > Raspberry Pi Configuration**.\n* A window will pop up with different tabs to adjust settings. What we are interested is the **Interfaces tab**.\n* Click on the tab and select **Enable** for **SPI**. Click on the **OK** button to save.\n* We recommend restarting your Pi to ensure that the changes to take effect.\n* Click on the Pi **Start Menu > Preferences > Shutdown**. Since we just need to **restart**, click on the Restart button.\n\n**raspi-config Tool via Terminal**\n\nAgain, we can use raspi-config to enable it.\n\n* Run **sudo raspi-config**\n* Use the down arrow to select **3 Interfacing Options**\n* Arrow down to **P4 SPI**\n* Select yes when it asks you to enable **SPI**\n* Also select **yes** if it asks about automatically loading the kernel module.\n* Use the right arrow to select the **<Finish>** button.\n* Select **yes** when it asks to reboot.\n\nThe system will reboot. when it comes back up, log in and enter the following command in terminal.\n\n``ls /dev/spidev*``\n\n| This command lists the SPI devices available in the /dev directory.\n| If SPI is enabled, you should see output similar to \n\n``/dev/spidev0.0`` \n``/dev/spidev0.1``\nIf SPI is not enabled, you will see an error message or no output.\n\n--------------------------------------\n\nI2c Circuit diagram and wiring - (ONLY with 3v3 displays)\n---------------------------------------------------------\n\nI2c Circuit diagram - (ONLY with 3v3 displays) \n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n| Here is the diagram for hardware connections **without** an Logic Level Converter.\n\n**IMPORTANT** **use ONLY 3v3** \n\nThe Vcc and GND on the OLED displays are not always the same, so it is verry important that you check Vcc and GND is set correctly.\n\n.. image:: https://raw.githubusercontent.com/DJ-Dingo/pibooth-oled-display/master/templates/Pibooth%20OLED-I2c%203V_Sketch2_bb.png\n   :align: center\n   :alt:  OLED I2c Circuit diagram - (ONLY with 3v3 displays)\n\n\nI2c Wire - (ONLY with 3v3 displays)\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n3v3 only. **IMPORTANT CHECK YOUR DISPLAY FOR THE RIGHT CONNECTION**\n\n\n============ ======== ========================\nDisplay Pins RPi-PINs Info                      \n============ ======== ========================\nVCC 3v3      PIN 1    3v3 ONLY\nGND (Ground) PIN 6    Ground pin of the module\nSCL (Clock)  PIN 5    Acts as the clock pin.\nSDA (Data)   PIN 3    Data pin of the module.\n============ ======== ========================\n\n----------------------------------------------------\n\nI2c Circuit diagram - (5v displays) with an Logic Level Converter\n-----------------------------------------------------------------\n\nI2C circuit diagram - (5v displays)\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nHere is the diagram for hardware connections **with** and Logic Level Converter.\n**IMPORTANT** The Vcc and GND on the OLED display are not always the same, so it is verry important that you check Vcc and GND is set correctly.\n\n.. image:: https://raw.githubusercontent.com/DJ-Dingo/pibooth-oled-display/master/templates/Pibooth_OLED-I2c_Sketch_bb_1.png\n   :align: center\n   :alt:  I2C circuit diagram - (5v displays)\n\nI2c wire - (5v displays)\n^^^^^^^^^^^^^^^^^^^^^^^^\n\n**IMPORTENT**: If you use 5v to power the OLED display \n*most OLEDs can also run on 3v3, check your manual.*\n\nSince the Raspberry Pi GPIO only handle 3.3v, it will therefore be a good idea to use a **Logic Level Converter** when using 5v to power the display, so you don't fryed your pi.\n\n.. |image9| image:: https://raw.githubusercontent.com/DJ-Dingo/pibooth-oled-display/master/templates/level_converter.png\n   :alt: I2c wire - (5v displays) 4-channel Logic Level converter\n\n|image9|\n\n**IMPORTANT CHECK YOUR DISPLAY FOR THE RIGHT CONNECTION**\n\n| OLED-I2c to the **HV** (High Level) side, on the Level Converter HV.  \n\n*(Display >> level converter HV side)*\n\n============ =============== =========================================\nDisplay Pins Level converter Info                      \n============ =============== =========================================\nGND          GND             **Dsplay GND to the level converter GND**\nVCC          HV  (HV )       **Display VC to the level converter HV**\nSCL (Clock)  HV2 (HV2)       **SCL <> HV2  on the Level Converter**\nSDA (Data)   HV1 (HV1)       **SDA <> HV1 on the Level Converter**\n============ =============== =========================================\n\n| RPi (**BOARD numbering scheme**) to **LV** (Low Level) side, on the Level Converter. \n\n*(Raspberry Pi >> Level converter LV side)*\n\n===== ===== =============== ==========================================\n RPi  Pins  Level converter Info                      \n===== ===== =============== ==========================================\nGND   Pin 6 GND             **RPi GND to GND on the level converter**\n3.3v  Pin 1 LV  (LV )       **RPi (3v3) to LV on the Level Converter**\n5v    Pin 2 HV  (HV )       **RPi (5v) to HV on the Level Converter**\nSCL   Pin 5 LV2 (LV2)       **SCL <> LV2 on the Level Converter**\nSDA   Pin 3 LV1 (LV1)       **SDA <> LV1 on the Level Converter**\n===== ===== =============== ==========================================\n\n----------------------------------------------------\n\n\nSPI Circuit diagram and Wiring \n------------------------------\n\nSPI circuit diagram (ONLY with 3v3 displays)\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nHere is the diagram for hardware connections **without** and **Logic Level Converter**. \n\nIf your OLED display use 5v instead of 3v3, it demands an 8 Channel Logic Level Converter, you should get one or you risk frye your pi.\n\n**IMPORTANT** The Vcc and GND on an OLED display are not always the same, so it is **verry important** that you check Vcc and GND is set correctly.\n\n.. image:: https://raw.githubusercontent.com/DJ-Dingo/pibooth-oled-display/master/templates/Pibooth_OLED-SPI_1.png\n   :align: center\n   :alt:  SPI circuit diagram (ONLY with 3v3 displays)\n\n\n\nSPI wire setup - (ONLY with 3v3 displays)\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n======== ============ ========== ============== ============================================================\n7 Pins   Remarks      RPi-PIN    RPi GPIO       Info\n======== ============ ========== ============== ============================================================\nVCC      Power Pin    PIN 1      3V3            3V3 ONLY - CHECK YOUR DISPLAY\nGND      Ground       PIN 6      GND            Ground pin of the module\nD0, SCL  Clock        PIN 23     GPIO 11 (SCLK) Acts as the clock pin.\nD1, SDA  MOSI         PIN 19     GPIO 10 (MOSI) Data pin of the module.\nRST      Reset        PIN 22     GPIO 25        Resets the module, useful during SPI\nDC, A0   Data/Command PIN 18     GPIO 24        Data Command pin. Used for SPI protocol\nCS       Chip Select  PIN 24     GPIO 8 (CE0)   Useful when more than one module is used under SPI protocol\n                      PIN 26     GPIO 7 (CE1)   Useful when more than one module is used under SPI protocol\n======== ============ ========== ============== ============================================================\n\n**If you have a 8 pins OLED display with \"Vin\" connect 3v3 to Vin and leave VCC empty.** *(or check the internet for more info on how to setup your display)*\n\n----------------------------------------------------\n\n\nSPI wire - (5v display) with a Logic Level Converter \n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nYou will need a 8 channel Logic Level Converter to use SPI with 5v. Or you can use 2 x 4 channels Logic Level Converters.\n\n| Same princip as `I2c Circuit diagram - (5v displays) with an Logic Level Converter`_ \n\n* You take the needed GPIO PINs from the Raspberry Pi, and wire them to the LV side of the Logic Level Converters.\n* The same goes for 3v3 wire, that goes to the LV side of the level converters. \n* You also need to wire the 5v from the Raspberry Pi to the HV side of the level converter. \n* And last you need GND (Ground) from the Raspberry Pi to GND one or both sides of the level converters.\n\n----------------------------------------------------\n\nStates\n------\n\nStates images\n^^^^^^^^^^^^^\n.. image:: https://raw.githubusercontent.com/DJ-Dingo/pibooth-oled-display/master/templates/state_photos.png\n   :align: center\n   :alt:  OLED State pictures\n\n| If you need to change states images or add missing resolutions to fit your display\n\nLook at `How to show your own States images`_.\n\n| These states are showing on the display, if **Show state pictures** is activated\n\n| ``\u00b4choose\u00b4`` ``\u00b4chosen\u00b4`` ``\u00b4preview\u00b4`` ``\u00b4capture\u00b4``\n\n``\u00b4processing\u00b4`` ``\u00b4print\u00b4`` ``\u00b4finish\u00b4`` ``\u00b4failsafe\u00b4``\n\n\nStates description\n^^^^^^^^^^^^^^^^^^\n.. image:: https://raw.githubusercontent.com/DJ-Dingo/pibooth-oled-display/master/templates/state-sequence-oled-i2c.png\n   :align: center\n   :alt:  State sequence\n\n----------------------------------------------------\n\nSetup in Pibooth Menu\n---------------------\n\nOLED Display - (SETUP) - Pibooth Menu\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n| You enter the menu by using Esc on your keyboard. \n\nBe aware that this plugin can sometimes make the reaction to enter the menu slow (2-3 sec).\n\n| At the first time you make changes in the Menu, a configuration file is generated in ``'~/.config/pibooth/pibooth.cfg'``\n\nwhich permits to configure the behavior of the plugin.\n\n.. image:: https://raw.githubusercontent.com/DJ-Dingo/pibooth-oled-display/master/templates/menu_oled_display_setup_1.png\n   :align: center\n   :alt: OLED Display - (Setup) - Pibooth Menu\n\n\n\nOLED Display - (MODIFY) - Pibooth Menu\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n| You enter the menu by using Esc on you keyboard. \n\nBe aware that this plugin can sometimes make the reaction to enter the menu slow (2-3 sec).\n\n| At the first time you make changes in the Menu, a configuration file is generated in ``'~/.config/pibooth/pibooth.cfg'``\n\nwhich permits to configure the behavior of the plugin.\n\n.. image:: https://raw.githubusercontent.com/DJ-Dingo/pibooth-oled-display/master/templates/menu_oled_display_modify.png\n   :align: center\n   :alt: OLED Display - (Modify) - Pibooth Menu\n\n\n--------------------------------------\n\nSetup in config.cfg\n-------------------\n\n| Options are also available by editing the configuration file.\n| But it is easier to `Setup in Pibooth Menu`_ \n\nunder **Oled display - (setup)** and **Oled display - (modify)**\n\nEdit config.cfg by using the command line or a text editor\n\n::\n\n   $ pibooth --config\n   \n\nOLED DISPLAY - (SETUP) - config.cfg\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n``config.cfg``\n\n| [OLED DISPLAY - (SETUP)]\n| # Choose OLED device - ``'ssd1306 (Default)', 'ssd1309', 'ssd1322', 'ssd1325', 'ssd1327', 'ssd1331', 'ssd1362', 'sh1106'``\n| # Required by 'oled_display' plugin\n\noled_devices = ``ssd1306``\n\n| # Display connection ``'I2c' or 'SPI'``\n| # Required by 'oled_display' plugin\n\noled_i2c_or_spi = ``I2c``\n\n| # I2c address ``(Default=0x3c)``\n| # Required by 'oled_display' plugin\n\noled_port_address = ``0x3c``\n\n| # Change SPI device number ``'0', '1' or '2' (Default = 0)``\n| # Required by 'oled_display' plugin\n\noled_spi_device_number = ``0``\n\n| # Change the I2c or SPI port number - ``(I2c = '1' - SPI = '0', '1', '2')``\n| # Required by 'oled_display' plugin\n\noled_port = ``1``\n\n| # SPI only GPIO DC PIN ``(Default=24)``\n| # Required by 'oled_display' plugin\n\noled_spi_gpio_dc_pin = ``24``\n\n| # SPI only GPIO RST PIN ``(Default=25)``\n| # Required by 'oled_display' plugin\n\noled_spi_gpio_rst_pin = ``25``\n\n| # Change screen WIDTH - ``'32', '48', '64', '80', '96', '128(Default)', '160', '240', '256', '320'``\n| # Required by 'oled_display' plugin\n\noled_width = ``128``\n\n| # Change screen HEIGHT - ``'32', '48', '64(Default)', '80', '96', '128', '160', '240', '256', '320'``\n| # Required by 'oled_display' plugin\n\noled_height = ``64``\n\n| # Color mode - ``'1 = Monochrome (Default)', 'RGB', 'RGBA'``\n| # Required by 'oled_display' plugin\n\noled_color_mode = ``1``\n\n| # Rotate screen - ``'0 (Default)', '1', '2', '3'``\n| # Required by 'oled_display' plugin\n\noled_rotate = ``0``\n\n\n------------------------------------------\n\n\nOLED DISPLAY - (MODIFY) - config.cfg\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n| [OLED DISPLAY - (MODIFY)]\n| # Show state pictures - ``'Yes' or 'No'``\n| # Required by 'oled_display' plugin - (See `States`_ for more info on how it works)\n\noled_states_pictures = ``Yes``\n\n| # Show Logo or Animated Gif (instead of text) - ``'Yes' or 'No'``\n\n| # Required by 'oled_display' plugin\n\n| # See `How to show your own Logo`_ and `How to show your own Animated Gif`_\n\noled_showlogo = ``No``\n\n| # Logo or Animated Gif in the folder ``'~/.config/pibooth/oled_display/logo/'``\n| # Required by 'oled_display' plugin\n\noled_logos = ``128x64_Pibooth_2.gif``\n\n| # FPS (Frames Per Second) speed for Animated Gif\n| # Required by 'oled_display' plugin\n\noled_animated_fps = ``15``\n\n------------------------------------\n\n| # Text-1 - Counters, Text, Date-Time - Could be either ``'Taken_Photo', 'Printed', 'Forgotten', 'Remaining_Duplicates', 'Date-Time', 'Empty', 'Text_Only'``\n| # Required by 'oled_display' plugin - (Also see `How to change the Date-Time format`_, when using **Date-Time**)\n\noled_counter_type1 = ``Taken_Photo``\n\n| # Text-1 Font - You can add more fonts 'Truetype(.ttf)' or 'Opentype(.otf)', in the folder ``'~/.config/pibooth/oled_display/fonts/'``\n\n| # Required by 'oled_display' plugin\n\noled_font_1 = ``DejaVuSerif-Bold.ttf``\n\n| # Text-1 Color - uses HTML color names. E.g. ``'White', 'Red', 'Cyan', 'Silver', 'Blue', 'Grey', 'DarkBlue', 'Black', 'LightBlue', 'Orange', 'Purple', 'Brown', 'Yellow', 'Maroon', 'Lime', 'Green', 'Magenta', 'Olive'.``\n\n| *(On Monochrome displays colors will be converted to 'White')*\n\n| # Required by 'oled_display' plugin\n\noled_text1_color = ``white``\n\n| # Text-1 - Text with space after to use with counter, or leave empty for counter only\n\n| # Required by 'oled_display' plugin\n\noled_text_1 = ``\"Photos  \"``\n\n| # Text-1 - Center text on display ``'Yes' or 'No'``\n| # Required by 'oled_display' plugin\n\noled_text_1_center = ``No``\n\n| # Text-1 Size - 19 is default if 3 x text/counters are used on the display at the same time\n| # Required by 'oled_display' plugin\n\noled_size_1 = ``19``\n\n| # Text-1 - Move text 'Right' on display\n| # Required by 'oled_display' plugin\n\noled_text1_right = ``0``\n\n| # Text-1 - Move text 'Down' on display\n| # Required by 'oled_display' plugin\n\noled_text1_down = ``0``\n\n------------------------------------\n\n| # Text-2 - Counters, Text, Date-Time - Could be either ``'Taken_Photo', 'Printed', 'Forgotten', 'Remaining_Duplicates', 'Date-Time', 'Empty', 'Text_Only'``\n| # Required by 'oled_display' plugin - (Also see `How to change the Date-Time format`_, when using **Date-Time**)\n\noled_counter_type2 = ``Printed``\n\n| # Text-2 Font - You can add more fonts 'Truetype(.ttf)' or 'Opentype(.otf)', in the folder ``'~/.config/pibooth/oled_display/fonts/'``\n| # Required by 'oled_display' plugin\n\noled_font_2 = ``DejaVuSerif-Bold.ttf``\n\n| # Text-2 Color - uses HTML color names. E.g. ``'White', 'Red', 'Cyan', 'Silver', 'Blue', 'Grey', 'DarkBlue', 'Black', 'LightBlue', 'Orange', 'Purple', 'Brown', 'Yellow', 'Maroon', 'Lime', 'Green', 'Magenta', 'Olive'.`` \n| *(On Monochrome displays colors will be converted to 'White')*\n| # Required by 'oled_display' plugin\n\noled_text2_color = ``white``\n\n| # Text-2 - Text with space after to use with counter, or leave empty for counter only\n| # Required by 'oled_display' plugin\n\noled_text_2 = ``\"Printed \"``\n\n| # Text-2 - Center text on display ``'Yes' or 'No'``\n| # Required by 'oled_display' plugin\n\noled_text_2_center = ``No``\n\n| # Text-2 Size - 19 is default if 3 x text/counters are used on the display at the same time\n| # Required by 'oled_display' plugin\n\noled_size_2 = ``19``\n\n| # Text-2 - Move text 'Right' on display\n| # Required by 'oled_display' plugin\n\noled_text2_right = ``0``\n\n| # Text-2 - Move text 'Down' on display\n| # Required by 'oled_display' plugin\n\noled_text2_down = ``23``\n\n\n----------------------------------------------------\n\n| # Text-3, Counter, Date-Time - Could be either ``'Taken_Photo', 'Printed', 'Forgotten', 'Remaining_Duplicates', 'Date-Time', 'Empty', 'Text_Only'``\n| # Required by 'oled_display' plugin - (Also see `How to change the Date-Time format`_, when using **Date-Time**)\n\noled_counter_type3 = ``Remaining_Duplicates``\n\n| # Text-3 Font - You can add more fonts 'Truetype(.ttf)' or 'Opentype(.otf)', in the folder ``'~/.config/pibooth/oled_display/fonts/'``\n| # Required by 'oled_display' plugin\n\noled_font_3 = ``DejaVuSerif-Bold.ttf``\n\n| # Text-3 Color - uses HTML color names. E.g. ``'White', 'Red', 'Cyan', 'Silver', 'Blue', 'Grey', 'DarkBlue', 'Black', 'LightBlue', 'Orange', 'Purple', 'Brown', 'Yellow', 'Maroon', 'Lime', 'Green', 'Magenta', 'Olive'.``\n| *(On Monochrome displays colors will be converted to 'White')*\n| # Required by 'oled_display' plugin\n\noled_text3_color = ``white``\n\n| # Text-3 - Text with space after to use with counter, or leave empty for counter only\n| # Required by 'oled_display' plugin\n\noled_text_3 = ``\"Remain \"``\n\n| # Text-3 - Center text on display ``'Yes' or 'No'``\n| # Required by 'oled_display' plugin\n\noled_text_3_center = ``No``\n\n| # Text-3 Size - 19 is default if 3 x text/counters are used on the display at the same time\n| # Required by 'oled_display' plugin\n\noled_size_3 = ``19``\n\n| # Text-3 - Move text 'Right' on display\n| # Required by 'oled_display' plugin\n\noled_text3_right = ``0``\n\n| # Text-3 - Move text 'Down' on display\n| # Required by 'oled_display' plugin\n\noled_text3_down = ``46``\n\n\n----------------------------------------------------\n\nHow to use Date-Time / Logo / Animated Gif\n------------------------------------------\n\nHow to change the Date-Time format\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n| See all the Date-Time format codes in the following file \n\n`Date-Time_Format_Codes.rst`_ \n\nYou can also find the file **Date-Time_Format_Codes.rst** in your local pibooth config folder ``~/.config/pibooth/oled_display/`` after you run the plugin the first time.\n\n* Choose Date_Time in the menu - (If you leave the text field empty, the Default will be used = **%H:%M:%S**).\n* Or use semething like this **%d/%m - %H:%M:%S** in the text field to display the date and time.\n\nRemember to set the size of the text to match the display, after you set your Date-Time format codes.\n\n----------------------------------------------------\n\nHow to show your own Logo\n^^^^^^^^^^^^^^^^^^^^^^^^^\n\n| **LOGO** - choose **Yes** in the Pibooth Menu under **Logo instead of text** \n\n| *(Default Logo is the Pibooth logo in resolutions 128x32 or 128x64).* \n\nAlso look at `How to show your own Animated Gif`_ as logo.\n\n| Add a new Logo or Animated gif, same resolution as your display ( or lower).\n\n* Logo path = ``~/.config/pibooth/oled_display/logo/``\n\n| (pibooth-oled-display support many different image type extensions)\n\nIf you add an images with the same name and File extension(s) as some of the default images, only the user images will be showing.\n\n**When adding new Logo, you need to restart Pibooth to load it into the logo database. If you delete a user logo that is still in the configuration a default Pibooth Logo will be showing on the display**\n\n----------------------------------------------------\n\nHow to show your own Animated Gif\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n| You can add Animated Gif in the folder ``~/.config/pibooth/oled_display/logo/``\n\nAn choose **Yes** in **Logo instead of text** in the Pibooth Menu\n\nOn Monochrome displays (black & white) you need the Animated Gif to have a Black bagground. The reason for that is that the luma.oled drivers converts transperent to white color, when using ``color mode 1``.\n\n| Some Animated Gifs with transperent bagground work, but in general they don\u00b4t.\n\n| So do some test with Animated Gif\u00b4s in the same resolution or less as your display. \n\nAll images will be centered automatic on the display. \n\n| ?. Can i use an Animated Gif with colors on an Monochrome display = **Yes**\n\nBut they are not always showing correct, as they will be converted to Black and White or grayscale.\n\n**When adding new Animated Gif, you need to restart Pibooth to load them into the Logo database. If you delete a user Animated that is still in the configuration a default Pibooth Logo will be showing on the display**\n\n\n----------------------------------------------------\n\nHow to show your own States images\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n| **STATES** - choose **Yes** in the Pibooth Menu under **Show state pictures** \n\n| *(Default States images are already provided with these display resolutions):*\n\n| ``128 x 32 pixels`` ``128 x 64 pixels`` ``128 x 128 pixels``\n\n| ``160 x 128 pixels`` ``192 x 64 pixels`` ``256 x 64 pixels``\n\n``256 x 128 pixels`` ``256 x 256 pixels`` ``320 x 240 pixels``\n\n| Add new ``.png`` States images, same resolution as your display, to each folders.\n\n* States path = ``~/.config/pibooth/oled_display/states/``\n\n**When adding a new states images, it will automatic be used instead of default.**\n\nThere are 8 folders, and you need 11 ``.png`` images with the static names \"folder and resolution\".\nHere is an examble on how you should name your states images if you have an display with resolution 128 x 64. \nYou should make images with the same resolution as you display and use the static names with resolution as below, and put them in every folder under each states. \n\nExamples : 128x32 = ``processing_128x32.png`` 128x64 = ``processing_128x64.png``\n\n| List of file names for a display with 128x64 resolution\n\n| `states/capture/ <https://github.com/DJ-Dingo/pibooth-oled-display/tree/master/pibooth_oled_display/oled_display/states/capture>`_  ``capture_128x64.png``\n\n| `states/choose/ <https://github.com/DJ-Dingo/pibooth-oled-display/tree/master/pibooth_oled_display/oled_display/states/choose>`_ ``choose_128x128.png``\n\n| `states/failure/ <https://github.com/DJ-Dingo/pibooth-oled-display/tree/master/pibooth_oled_display/oled_display/states/failure>`_ ``failure_128x64.png``\n\n| `states/finished/ <https://github.com/DJ-Dingo/pibooth-oled-display/tree/master/pibooth_oled_display/oled_display/states/finished>`_ ``finished_128x64.png``\n\n| **layout needs 4 ``.png`` images named like this**\n\n| `states/layout/ <https://github.com/DJ-Dingo/pibooth-oled-display/tree/master/pibooth_oled_display/oled_display/states/layout>`_ ``layout1_128x64.png``, ``layout2_128x64.png``, ``layout3_128x64.png``, ``layout4_128x64.png``\n\n| `states/preview/ <https://github.com/DJ-Dingo/pibooth-oled-display/tree/master/pibooth_oled_display/oled_display/states/preview>`_ ``preview_128x64.png``\n\n| `states/printer/ <https://github.com/DJ-Dingo/pibooth-oled-display/tree/master/pibooth_oled_display/oled_display/states/printer>`_ ``printer_128x64.png``\n\n`states/processing/ <https://github.com/DJ-Dingo/pibooth-oled-display/tree/master/pibooth_oled_display/oled_display/states/processing>`_ ``processing_128x64.png``\n\n| You can see the origial gimp files in the **origin** folder `Here <https://github.com/DJ-Dingo/pibooth-oled-display/tree/master/pibooth_oled_display/oled_display/states>`_ under each folder.\n\n| `states/capture/origin/ <https://github.com/DJ-Dingo/pibooth-oled-display/tree/master/pibooth_oled_display/oled_display/states/capture/origin>`_ ``capture_128x64.xcf``\n\n| `states/choose/origin/ <https://github.com/DJ-Dingo/pibooth-oled-display/tree/master/pibooth_oled_display/oled_display/states/choose/origin>`_ ``choose_128x64.xcf``\n\n| `states/failure/origin/ <https://github.com/DJ-Dingo/pibooth-oled-display/tree/master/pibooth_oled_display/oled_display/states/failure/origin>`_ ``failure_128x64.xcf``\n\n| `states/finished/origin/ <https://github.com/DJ-Dingo/pibooth-oled-display/tree/master/pibooth_oled_display/oled_display/states/finished/origin>`_ ``finished_128x64.xcf``\n\n| **Layout has 4 ``.xcf`` files, inside each folder for your resolution** \n\n| `states/layout/origin/ <https://github.com/DJ-Dingo/pibooth-oled-display/tree/master/pibooth_oled_display/oled_display/states/layout/origin>`_ ``layout1_128x64.xcf`` ``layout2_128x64.xcf`` ``layout3_128x64.xcf`` ``layout4_128x64.xcf``\n\n| `states/preview/origin/ <https://github.com/DJ-Dingo/pibooth-oled-display/tree/master/pibooth_oled_display/oled_display/states/preview/origin>`_ ``preview_128x64.xcf``\n\n| `states/printer/origin/ <https://github.com/DJ-Dingo/pibooth-oled-display/tree/master/pibooth_oled_display/oled_display/states/printer/origin>`_ ``printer_128x64.xcf``\n\n`states/processing/origin/ <https://github.com/DJ-Dingo/pibooth-oled-display/tree/master/pibooth_oled_display/oled_display/states/processing/origin>`_ ``processing_128x64.xcf``\n\n| If you are using an OLED display with other resolution than already supplied,\n\nyou need to make a new images and put it in each states folder or display will be empty if states is activated.\n\n| You can convert images with the free `GIMP`_ or online services like (`this page`_).\n\nIf you have an monochrome display with the resolution 128x64, you can convert or make an image to that resolution (in 8-bit mode). \n\n**When adding new States images, you need to restart Pibooth to load them into the States database. If you delete a user State image the default Pibooth States images will be showing on the display**\n\n\n----------------------------------------------------\n\nHow to add your own Fonts\n^^^^^^^^^^^^^^^^^^^^^^^^^\n\n| You can add new Fonts to your local oled_display Fonts folder.\n\n``~/.config/pibooth/oled_display/fonts/``\n\n* Supported font types are \u00b4\u00b4.ttf\u00b4\u00b4 or \u00b4\u00b4otf\u00b4\u00b4 \n\n| Fonts will be added as extra font in the Fonts database automatic.\n\n| If you add fonts that has the same name as some of the default fonts, \n\nonly the user Fonts will be showing in the menu.\n\nYou can download free fonts online, on sites like `fontspace.com <https://www.fontspace.com/>`_\n\n**When adding new fonts, you need to restart Pibooth to load them into the fonts database. If you delete a user Font that is still in the configuration the default Font 'DejaVuSerif-Bold.ttf' will be used on the display**\n\n----------------------------------------------------\n\n\nTips & Tricks\n-------------\n\nHow to use 2 x OLED displays at the same time\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nHow to install the second display plugin \"pibooth_oled_display_2.py\"\n====================================================================\n\n* The extra plugin for display 2 **\"pibooth_oled_display_2.py\"** is automatic in the folder ``~/.config/pibooth/oled_display/`` after you run the plugin the first time.\n* You can activate the plugin by adding path to the file, to custom plugins in the config.cfg file under [GENERAL].\n\nOpen the config.cfg with this command, and find the line \"plugins =\"\n::\n\n   $ pibooth --config\n\n| # Path to custom plugin(s) not installed with pip (list of quoted paths accepted)\n\n``plugins = '~/.config/pibooth/oled_display/pibooth_oled_display_2.py'``\n\n| Now you will have an extra plugin option in pibooth settings, with \n\n**Oled display 2 - (Setup)** and **Oled display 2 - (modify)**\n\n* Go to the menu and setup your new second display. If you are using I2c, you new display 2 need its own I2c addresses (**standard 0x3d**). \n* If you use SPI, you need to have 2 displays with the CS (**Chip Select**) option (this funktion has not yet been tested, but should work).\n\n\n.. image:: https://raw.githubusercontent.com/DJ-Dingo/pibooth-oled-display/master/templates/add_extra_oled_display_2.png\n   :align: center\n   :alt:  Add an extra OLED display settings\n\n\nSetup 2 x I2c OLED displays - (Showing seperate things on each display)\n=======================================================================\n\n* You will need 2 x I2c OLED displays with different I2c addresses. defaults are ``0x3c`` on display 1, and ``0x3d`` on display 2. \n* On most displays you can change the I2c address on the back of your OLED display with some soldering.\n   \n* Or you can get an **8 Channel I2C Muti-Channel Expansion Development Board** to convert the default address to an new address and then use up 8 x I2c displays at the same time.\n\nSetup 2 x SPI OLED displays - (Showing seperate things on each display)\n=======================================================================\n\n| **I dont know if it work, as i have not testet it yet. But it should work.** \n\n*And if it work, it will only work if you have the CS PIN on the displays*.\n\n* Both the displays uses the same PINs/GPIOs, except the CS (Chip Select) PIN\n* On display 1. Put a wire from the CS PIN to GPIO 8 (pin24) to choose CE0.\n* On display 2. Put a wire from the CS PIN to GPIO 7 (pin26) to choose CS1. \n\n**Check online for more info about your displays on how to set them up.**\n\n* According to LUMA.oled driver documentation, you should choose **port 0** for display 1 and **port 1** for display 2.\n* You can do that in the pibooth menu. An maybe also try change the SPI device number to 0,1 or 2 to make it work.\n\nCan i use SPI1 ? (e.g.SPI and SPI1 together on the pi)\n======================================================\n\n| **The short answer is no. I tryed, but with no luck**\n\n*I dont think it is suported by the luma.oled drivers.*\n\n* So only SPI (SPI0) can be used.\n\nSetup 2 x OLED displays - (Showing the same things on each display)\n===================================================================\n\n| If you want to show the exact same things on 2 or more displays, you dont need the second plugin.\n\n* On the I2c displays, you just use the same port address (0x3c etc.), and wire them to the same GPIO PINs.\n* On the SPI displays, you just use the same CS port address (CE0 etc.), and wire them to the same GPIO PINs.\n\n----------------------------------------------------\n\nHow to use a OLED displays with only 6 pins I2c/SPI\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n| **SPI** Most 6 PINs displays works out of the box with SPI. \n\n* but unfortunately you can only use one display in pibooth, as there is no CS pin on the display.\n\n| **I2c** Can be used with some soldering tricks on the back of the displays, and some extra component.\n\n* It also works when using 2 displays in pibooth.\n\n.. image:: https://raw.githubusercontent.com/DJ-Dingo/pibooth-oled-display/master/templates/6PIN_SPI_I2C.png\n   :align: center\n   :alt:  Change 6PIN SPI to I2c\n\n| To choose I2c port address, you need to solder a wire from\n\n* DC >> VCC = for I2C address 0x3c\n* DC >> GND = for I2C address 0x3d\n\n| You will also need to make a \"pull-up and reset circuit\" or \"reset pull-up circuit.\"\n\nSo you need a 10k resistor, and a 47nf or 100nf capacitor (Ceramic or Electrolytic)\n\n* Reset pin >> 10k resistor >> VCC\n* Reset pin >> 47nF or 100nF capacitor (condensator) >> GND (Ground)\n\n.. |image11| image:: https://raw.githubusercontent.com/DJ-Dingo/pibooth-oled-display/master/templates/Reset_pull-up_circuit.jpg\n   :width: 20%\n   :alt:  Reset pull-up circuit\n\n|image11|\n\nThe purpose of this circuit is to provide a stable voltage level and proper reset functionality for the Reset pin of the OLED display. The 10k resistor connected between the Reset pin and VCC is the pull-up resistor, which ensures that the Reset pin remains at a high logic level when it is not actively driven low.\n\nThe 47nF or 100nF capacitor connected between the Reset pin and ground serves to stabilize the reset signal by filtering out any noise or voltage fluctuations. It helps ensure that the reset signal is clean and reliable, preventing false triggering or erratic behavior.\n\nBy using this pull-up and reset circuit, you are ensuring that the OLED display receives a proper reset signal and is able to turn on reliably. It is a common practice to include these components to ensure the correct functioning of cheap displays with reset pins.\n\n\n\n.. --- Links ------------------------------------------------------------------\n\n.. _`pibooth`: https://pypi.org/project/pibooth\n.. _`pibooth_oled_display`: \n.. _`official Raspberry Pi documentation`: https://www.raspberrypi.com/documentation/\n.. _`Date-Time_Format_Codes.rst`: https://github.com/DJ-Dingo/pibooth-oled-display/blob/master/pibooth_oled_display/oled_display/Date-Time_Format_Codes.rst\n.. _`this page`: https://online-converting.com/image/\n.. _`Download Here`: https://github.com/DJ-Dingo/pibooth-oled-display/tree/master/templates/xcf_files\n.. _`GIMP`: https://www.gimp.org/\n.. _`Pibooth Menu`: #oled-display-modify-pibooth-menu\n.. _`config.cfg`: #oled-display-modify-config-cfg\n\n.. |PythonVersions| image:: https://img.shields.io/badge/python-3.6+-red.svg\n   :target: https://www.python.org/downloads\n   :alt: Python 3.6+\n\n.. |PypiPackage| image:: https://badge.fury.io/py/pibooth-oled-display.svg\n   :target: https://pypi.org/project/pibooth-oled-display\n   :alt: PyPi package\n\n.. |Downloads| image:: https://img.shields.io/pypi/dm/pibooth-oled-display?color=purple\n   :target: https://pypi.org/project/pibooth-oled-display\n   :alt: PyPi downloads\n",
    "bugtrack_url": null,
    "license": "GPLv3",
    "summary": "Pibooth Plugin to manage small OLED displays (via I2c or SPI). Show various counters (e.g., photos taken), display time-date, text, logos, and animated GIFs.",
    "version": "2.0.3",
    "project_urls": {
        "Download": "https://github.com/DJ-Dingo/pibooth-oled-display/archive/2.0.3.tar.gz",
        "Homepage": "https://github.com/DJ-Dingo/pibooth-oled-display"
    },
    "split_keywords": [
        "raspberry pi",
        "camera",
        "raspberry pi camera",
        "photobooth",
        "selfiecam",
        "pygame",
        "pil",
        "pillow",
        "pibooth",
        "pibooth plugin",
        "oled display",
        "luma.oled",
        "oled"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "96e09130cb5a7718879820c67d35f3b06189fb8d4ecfa0574da25f017cb0d162",
                "md5": "0fdf95c14c7124237adac48c3a892f08",
                "sha256": "cb7b370e322700faa4257fb8464a997aad3e9ec31ecc432c7ed735897f65b080"
            },
            "downloads": -1,
            "filename": "pibooth_oled_display-2.0.3-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "0fdf95c14c7124237adac48c3a892f08",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": ">=3.6",
            "size": 7549216,
            "upload_time": "2023-08-12T16:00:23",
            "upload_time_iso_8601": "2023-08-12T16:00:23.437793Z",
            "url": "https://files.pythonhosted.org/packages/96/e0/9130cb5a7718879820c67d35f3b06189fb8d4ecfa0574da25f017cb0d162/pibooth_oled_display-2.0.3-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-08-12 16:00:23",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "DJ-Dingo",
    "github_project": "pibooth-oled-display",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "pibooth-oled-display"
}
        
Elapsed time: 0.10017s