# RePaper eInk Development Board for ARM + GNU/Linux

## Overview

Danger: 

![](https://cdn-learn.adafruit.com/assets/assets/000/013/005/medium800/lcds___displays_IMG_20131219_095248.jpg?1387419195)

Now you can add eInk displays to your favorite single-board Linux computers! This tutorial will show you how to wire and run the RePaper eInk displays in the Adafruit shop on a Raspberry Pi or BBB  
  
The RePaper development boards from Pervasive Displays come with a driver board that is powered from 3V and has level shifting on all the I/O pins so it can be used with 5V microcontrollers such as the Arduino. The PCB also has a lot of driver circuitry required to keep the display running smoothly such a temperature sensor, FLASH memory and ZIF socket. All signals are broken out to a 20 male socket header on the left. A 20 pin socket/socket cable is included to make wiring easier and there's also some extra-long header so you can plug these wires into a header or a breadboard.   
  
The displays are available in 1.44", 2" and 2.7" diagonal sizes with resolutions of 128x96, 200x96 and 264x176 pixels. These are intended for use as small dynamic signage in grocery stores since a barcode displayed on it can be scanned by a laser barcode-reader. The display does not require any power to keep the image and will stay 'on' without any power connection for many days before slowly fading. Of course, its also daylight readable and is very high contrast. This makes it excellent for data-logging applications, outdoor displays, or any other ultra-low power usages   
  
RePaper/PDI have provided a suite of example code for Raspberry Pi and BeagleBone Black.

# RePaper eInk Development Board for ARM + GNU/Linux

## Assembly and Wiring

Danger: 

The eInk development board comes completely assembled. All you need to do is attach the eInk display and the breakout cable.

![](https://cdn-learn.adafruit.com/assets/assets/000/012/841/medium800/lcds___displays_2013_04_20_IMG_1653-1024.jpg?1386577047)

# Attach the Display
## Open the Socket
Lift the front edge of the flex connector socket and raise it to the vertical position as shown on the left.![lcds___displays_2013_04_20_IMG_1665-1024.jpg](https://cdn-learn.adafruit.com/assets/assets/000/012/842/medium640/lcds___displays_2013_04_20_IMG_1665-1024.jpg?1386577112)

## Insert the Flex Connector
Gently slide the flex connector (contact side down) into the socket.  
  
Make sure that the display is aligned with the outline on the silkscreen.![lcds___displays_2013_04_20_IMG_1658-1024.jpg](https://cdn-learn.adafruit.com/assets/assets/000/012/844/medium640/lcds___displays_2013_04_20_IMG_1658-1024.jpg?1386577383)

![lcds___displays_2013_04_20_IMG_1659-1024.jpg](https://cdn-learn.adafruit.com/assets/assets/000/012/845/medium640/lcds___displays_2013_04_20_IMG_1659-1024.jpg?1386577411)

![lcds___displays_2013_04_20_IMG_1662-1024.jpg](https://cdn-learn.adafruit.com/assets/assets/000/012/846/medium640/lcds___displays_2013_04_20_IMG_1662-1024.jpg?1386577447)

## Close the Socket
Gently push the socket closed to lock the flex connector in place.![lcds___displays_2013_04_20_IMG_1666-1024.jpg](https://cdn-learn.adafruit.com/assets/assets/000/012/847/medium640/lcds___displays_2013_04_20_IMG_1666-1024.jpg?1386577953)

![lcds___displays_2013_04_20_IMG_1667-1024.jpg](https://cdn-learn.adafruit.com/assets/assets/000/012/848/medium640/lcds___displays_2013_04_20_IMG_1667-1024.jpg?1386577976)

## Remove the protective film
Lift the white tab and gently peel back the protective film from the display.![lcds___displays_2013_04_20_IMG_1674-1024.jpg](https://cdn-learn.adafruit.com/assets/assets/000/012/849/medium640/lcds___displays_2013_04_20_IMG_1674-1024.jpg?1386578115)

![lcds___displays_2013_04_20_IMG_1675-1024.jpg](https://cdn-learn.adafruit.com/assets/assets/000/012/850/medium640/lcds___displays_2013_04_20_IMG_1675-1024.jpg?1386578137)

Danger: 

# Attach the Breakout Cable
## Locate Pin 1
Pin 1 is marked with a white dot on the connector. There will be a red wire connected to that pin.![lcds___displays_2013_04_20_IMG_1678-1024.jpg](https://cdn-learn.adafruit.com/assets/assets/000/012/852/medium640/lcds___displays_2013_04_20_IMG_1678-1024.jpg?1386578242)

## Insert the cable

- Flip the cable over so that the white dot is facing down.  
- Center the connector in the socket with Pin 1 on the side marked with a circled "1" on the board.

![lcds___displays_2013_04_20_IMG_1681-1024.jpg](https://cdn-learn.adafruit.com/assets/assets/000/012/853/medium640/lcds___displays_2013_04_20_IMG_1681-1024.jpg?1386578373)

![lcds___displays_2013_04_20_IMG_1680.jpeg](https://cdn-learn.adafruit.com/assets/assets/000/012/856/medium640/lcds___displays_2013_04_20_IMG_1680.jpeg?1386578496)

Danger: 

# RePaper eInk Development Board for ARM + GNU/Linux

## Wiring the Raspberry Pi

Danger: 

![](https://cdn-learn.adafruit.com/assets/assets/000/012/857/medium800/lcds___displays_IMG_4522.jpg?1386579360)

## Connections:
Start by connecting Pin 1 of the breakout cable (red wire) to the header pin for 3.3v.  
  
Continue making connections in the order listed below. There are duplicate wire colors, so don't mix them up!  
  
Make connections to:  

- (Red #1) -\> P1-01   
- (Green #6) -\> not used (ext ADC required)  
- (Yellow #7) -\> P1-23   
- (Orange #8) -\> P1-22   
- (Brown #9) -\> P1-12   
- (Black #10) -\> P1-18   
- (Red #11) -\> P1-16   
- (White #12) -\> P1-10   
- (Grey #13) -\> P1-08   
- (Purple #14) -\> P1-21   
- (Blue #15) -\> P1-19   
- (Orange #18) -\> P1-26   
- (Brown #19) -\> P1-24   
- (Black #20) -\> P1-25   

![lcds___displays_IMG_4514.jpg](https://cdn-learn.adafruit.com/assets/assets/000/012/858/medium640/lcds___displays_IMG_4514.jpg?1386580033)

![lcds___displays_IMG_4516.jpg](https://cdn-learn.adafruit.com/assets/assets/000/012/859/medium640/lcds___displays_IMG_4516.jpg?1386580123)

![](https://cdn-learn.adafruit.com/assets/assets/000/012/924/medium800/lcds___displays_IMG_4518.jpg?1387026762)

Now you are done wiring and ready to test the display!

# RePaper eInk Development Board for ARM + GNU/Linux

## Wiring the BeagleBone Black

Danger: 

![](https://cdn-learn.adafruit.com/assets/assets/000/012/482/medium800/lcds___displays_IMG_4528.jpg?1385536286)

## Insert the header segments
Insert the double-sided male header sections into the BeagleBone's headers. You can use both sides to create a nice stand for the display. ![lcds___displays_IMG_4524.jpg](https://cdn-learn.adafruit.com/assets/assets/000/012/485/medium640/lcds___displays_IMG_4524.jpg?1385536755)

## Connections:
Start by connecting Pin 1 of the breakout cable (red wire) to the header pin for 3.3v.  
  
Continue making connections in the order listed below. There are duplicate wire colors, so don't mix them up!  
  
Make connections to:  

- (Red #1) -\> P9-03  
- (Green #6) -\> -?- P9-39 (not yet)  
- (Yellow #7) -\> P9-22  
- (Orange #8) -\> P9-27  
- (Brown #9) -\> P9-14  
- (Black #10) -\> P9-26  
- (Red #11) -\> P9-12  
- (White #12) -\> P9-23  
- (Grey #13) -\> P9-15  
- (Purple #14) -\> P9-21  
- (Blue #15) -\> P9-18  
- (Orange #18) -\> - Vcc P9-04  
- (Brown #19) -\> P9-17  
- (Black #20) -\> P9-01  

![lcds___displays_IMG_4526.jpg](https://cdn-learn.adafruit.com/assets/assets/000/012/491/medium640/lcds___displays_IMG_4526.jpg?1385537651)

![lcds___displays_IMG_4531.jpg](https://cdn-learn.adafruit.com/assets/assets/000/012/926/medium640/lcds___displays_IMG_4531.jpg?1387026946)

![](https://cdn-learn.adafruit.com/assets/assets/000/012/496/medium800/lcds___displays_IMG_4533.jpg?1385538834)

Now you are done wiring and ready to test the display!

# RePaper eInk Development Board for ARM + GNU/Linux

## Driver and Examples

Danger: 

![](https://cdn-learn.adafruit.com/assets/assets/000/013/003/medium800/lcds___displays_IMG_4653_copy.jpg?1387417716)

# Compiling
These test programs should compile with no additional libraries, but the EPD driver needs the fuse development library installed. And a few examples make us of the Python Imaging Library (PIL) ## **Raspberry Pi**
```auto
sudo apt-get install libfuse-dev python-imaging

# For the Twitter Demo
sudo apt-get install python-setuptools 
sudo easy_install pip

git clone https://github.com/repaper/gratis.git
cd gratis/PlatformWithOS
make rpi
sudo make rpi-install
```

## **BeagleBone Black**
```auto
sudo opkg install libfuse-dev python-imaging

# For the Twitter demo
opkg install python-pip python-setuptools

# Extra item for BeagleBone
# The program uses device tree files to access the GPIOs
git clone https://github.com/nomel/beaglebone.git
cp -p beaglebone/gpio-header/generated/gpio-P9.* /lib/firmware

git clone https://github.com/repaper/gratis.git
cd gratis/PlatformWithOS
make bb
sudo make bb-install
```

# EPD fuse
This allows the display to be represented as a virtual directory of files, which are:  
```auto
File         Read/Write   Description
--------     -----------  ---------------------------------
version      Read Only    The driver version number
panel        Read Only    String describing the panel and giving 
                          its pixel width and height
current      Read Only    Binary image that  matches the currently 
                          displayed image (big endian)
display      Read Write   Image being assembled for next display 
                          (big endian)
temperature  Read Write   Set this to the current temperature in Celsius
command      Write Only   Execute display operation
BE           Directory    Big endian version of current and display
LE           Directory    Little endian version of current and display

Command   Byte   Description
--------  -----  --------------------------------
'C'       0x43   Clear the EPD, set `current` to all zeros, `display` 
                 is not affected
'U'       0x5A   Erase `current` from EPD, output `display` to EPD, 
                 copy display to `current`
```

Notes:

- The default bit ordering for the display is big endian i.e. the top left pixel is the value 0x80 in the first byte.
- The `BE` directory is the same as the root `current` and `display`.
- The `LE` directory `current` and `display` reference the top left pixel as 0x01in the first byte.
- The `current_inverse` and `display_inverse` represent black as zero (0) and white as one (1) while those item without the suffix represent the display's natural coding (0=\>white, 1=\>black)
- The particular combination of `BE/display_inverse` is used in the Python EPD demo since it fits better with the Imaging library used.

 **Set Panel Size in FUSE Configuration**
```auto
cat /etc/default/epd-fuse
```

Expected Output:

```auto
# Default settings for epd-fuse file is sourced by /bin/sh from
# /etc/init.d/epd-fuse

# Options to pass to epd_fuse
#EPD_MOUNTPOINT=/dev/epd
#EPD_SIZE=2.0
#EPD_OPTS=
```

Note: All the configurations are commented out and represent the default settings. If your panel is NOT the 2.0", then you must change this configuration.  
  
How to edit the configuration file:

```auto
sudo nano /etc/default/epd-fuse
```

Uncomment the **EPD\_SIZE** and change the value to your panel size (either **2.7** or **1.44** ). Save and exit.

 **Start the Driver** ```auto
sudo service epd-fuse start
cat /dev/epd/panel
```

Expected Output for a 2.7" panel:

```auto
EPD 2.7 264x176
```

# Python Demo Programs - directory "demo"
## Drawing Demo
Draw some lines, graphics and text:  
```auto
python demo/DrawDemo.py
```

Danger: 

![](https://cdn-learn.adafruit.com/assets/assets/000/012/942/medium800/lcds___displays_IMG_4656.jpg?1387181761)

## Image demo

- Accepts a lists of image files on the command line.  
- Converts them to grey scale to ensure formats like PNG, JPEG and GIF will work.  
- Inverts the image since the E-Ink panel is reverse (i.e. black on white).  
- Converts image to single bit (PIL "1" mode).  
- Display the middle of the image (using crop function).  
- Delay.  
- Display the re-sized image.  
- Delay before fetching next file.

_Note: if scratch is installed on the system, the following commands will show some cartoon animals. The images when re-sized will be distorted if the aspect ration of the original image is not the same as the display._

```auto
python demo/ImageDemo.py /usr/share/scratch/Media/Costumes/Animals/cat*
python demo/ImageDemo.py /usr/share/scratch/Media/Costumes/Animals/d*.png
```

![](https://cdn-learn.adafruit.com/assets/assets/000/012/943/medium800/lcds___displays_IMG_4653.jpg?1387181816)

## Twitter Demo
Setup easy\_install and use it to get pip, then use pip to get tweepy. Copy the sample configuration an edit to include your authentication information. Rather than using the basic authentication it is better to set up a Twitter App and generate a token for this. The token generation is quick at
[https://dev.twitter.com/](https://dev.twitter.com/ "Link: https://dev.twitter.com/").   
  
After creating the App, just click the button to create an access token.

  
Use **Ctrl-C** to stop this program.  

```auto
sudo pip install tweepy

# setup the config
cp demo/tweepy_auth.py-SAMPLE demo/tweepy_auth.py

# *** edit the config
nano demo/tweepy_auth.py

# run the demo (this watches for linux)
python demo/TwitterDemo.py linux
```

![](https://cdn-learn.adafruit.com/assets/assets/000/012/944/medium800/lcds___displays_IMG_4652.jpg?1387181863)

## Partial Demo

  

Display random overlapping rectangles using partial update. First argument is number of rectangle to generate before updating the EPD, second number is the number of frames to display before the program exits.
```auto
python demo/PartialDemo.py 3 20
```

![](https://cdn-learn.adafruit.com/assets/assets/000/012/946/medium800/lcds___displays_IMG_4654.jpg?1387181936)

## Counter Demo

  

Display a 4 digit hex counter uses partial update to only change the updated digits. This will look somewhat strange as the display inversion will make the counter appear to go through a sequence like: 0000 0001 0000 0001 ...delay... 0001 0002 0001 0002

  

Use **Ctrl-C** to stop this program.
```auto
python demo/CounterDemo.py 3 20
```

![](https://cdn-learn.adafruit.com/assets/assets/000/012/945/medium800/lcds___displays_IMG_4657.jpg?1387181898)

# RePaper eInk Development Board for ARM + GNU/Linux

## FAQ

Danger: 

### 

The default driver compile is for a COG 1 (Computer On Glass, version 1). Your RePaper screen may be a COG 2.  
You can check this my carefully lifting the display and looking on the back of it. Look for a barcode starting with "TEM" or "VEM".   
If the seventh character of the barcode is 'B', then you have a COG 2. Follow these instructions for building the driver:

## Raspberry Pi
```auto
make rpi-clean
make COG_VERSION=V2 rpi
sudo make COG_VERSION=V2 rpi-install
sudo reboot
```

After reboot make sure it is showing a "COG 2"```auto
% cat /dev/epd/panel
EPD 2.7 264x176 COG 2
% echo C > /dev/epd/command
```

## BeagleBone Black
```auto
make bb-clean
make COG_VERSION=V2 bb
make COG_VERSION=V2 bb-install
reboot
```

### 

See [https://forums.adafruit.com/viewtopic.php?f=22&t=105673](https://forums.adafruit.com/viewtopic.php?f=22&t=105673) for a possible fix!


## Featured Products

### RePaper - 1.44" Graphic eInk Development Board

[RePaper - 1.44" Graphic eInk Development Board](https://www.adafruit.com/product/1347)
Ever since the Kindle eReader came out, we've been wanting a nice small graphical eInk display that is easy to use with a microcontroller. And finally our desires have been fulfilled with the rePaper 1.44" development board from Pervasive Displays! We're excited to offer this very...

No Longer Stocked
[Buy Now](https://www.adafruit.com/product/1347)
[Related Guides to the Product](https://learn.adafruit.com/products/1347/guides)
### RePaper - 2.0" Graphic eInk Development Board

[RePaper - 2.0" Graphic eInk Development Board](https://www.adafruit.com/product/1316)
Ever since the Kindle eReader came out, we've been wanting a nice small graphical eInk display that is easy to use with a microcontroller. And finally our desires have been fulfilled with the rePaper 2.0" development board from Pervasive Displays! We're excited to offer this very...

No Longer Stocked
[Buy Now](https://www.adafruit.com/product/1316)
[Related Guides to the Product](https://learn.adafruit.com/products/1316/guides)
### RePaper - 2.7" Graphic eInk Development Board

[RePaper - 2.7" Graphic eInk Development Board](https://www.adafruit.com/product/1346)
Ever since the Kindle eReader came out, we've been wanting a nice small graphical eInk display that is easy to use with a microcontroller. And finally our desires have been fulfilled with the rePaper 2.7" development board from Pervasive Displays! We're excited to offer this very...

No Longer Stocked
[Buy Now](https://www.adafruit.com/product/1346)
[Related Guides to the Product](https://learn.adafruit.com/products/1346/guides)
### Raspberry Pi Model B 512MB RAM

[Raspberry Pi Model B 512MB RAM](https://www.adafruit.com/product/998)
Adafruit ships the **Raspberry Pi Model B 512MB RAM** as of 10/18/2012.  
  
The Raspberry Pi® is a single-board computer developed in the UK by the Raspberry Pi Foundation with the intention of stimulating the teaching of basic computer science in schools. The Raspberry...

No Longer Stocked
[Buy Now](https://www.adafruit.com/product/998)
[Related Guides to the Product](https://learn.adafruit.com/products/998/guides)
### BeagleBone Black - Rev B

[BeagleBone Black - Rev B](https://www.adafruit.com/product/1278)
**[Adafruit is no longer shipping the BeagleBone Black Rev B, it has been replaced with the Rev C as of 5/12/14](https://www.adafruit.com/products/1876) - the Rev C now has 4G flash and also comes with Debian, it also costs slightly more. There are no exchanges or...**

No Longer Stocked
[Buy Now](https://www.adafruit.com/product/1278)
[Related Guides to the Product](https://learn.adafruit.com/products/1278/guides)

## Related Guides

- [MAX31855 Thermocouple Sensor Python Library](https://learn.adafruit.com/max31855-thermocouple-python-library.md)
- [RePaper eInk Development Board](https://learn.adafruit.com/repaper-eink-development-board.md)
- [Run an X-Carve CNC Machine Wirelessly with a Raspberry Pi](https://learn.adafruit.com/control-an-xcarve-cnc-machine-wirelessly-with-a-raspberry-pi.md)
- [Adafruit 1.54" eInk Display Breakouts](https://learn.adafruit.com/adafruit-1-54-eink-display-breakouts.md)
- [Microsoft Azure Cost Monitor](https://learn.adafruit.com/azure-cost-monitor.md)
- [Adafruit 2.4" PiTFT HAT with Resistive Touchscreen Mini Kit](https://learn.adafruit.com/adafruit-2-4-pitft-hat-with-resistive-touchscreen-mini-kit.md)
- [USB Audio Cards with a Raspberry Pi ](https://learn.adafruit.com/usb-audio-cards-with-a-raspberry-pi.md)
- [Reverse Engineering a Bluetooth Low Energy Light Bulb](https://learn.adafruit.com/reverse-engineering-a-bluetooth-low-energy-light-bulb.md)
- [Playing sounds and using buttons with Raspberry Pi](https://learn.adafruit.com/playing-sounds-and-using-buttons-with-raspberry-pi.md)
- [Adafruit's Raspberry Pi Lesson 9. Controlling a DC Motor](https://learn.adafruit.com/adafruit-raspberry-pi-lesson-9-controlling-a-dc-motor.md)
- [Raspberry Pi LED Matrix Display](https://learn.adafruit.com/raspberry-pi-led-matrix-display.md)
- [Character LCD with Raspberry Pi or BeagleBone Black](https://learn.adafruit.com/character-lcd-with-raspberry-pi-or-beaglebone-black.md)
- [apt.adafruit.com](https://learn.adafruit.com/apt-adafruit-com.md)
- [MagTag AR Tarot Card Reading](https://learn.adafruit.com/magtag-tarot-cards.md)
- [No-Code Pool Party Notifier](https://learn.adafruit.com/pool-party-notification-device.md)
