Giter Site home page Giter Site logo

e-paper's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

e-paper's Issues

Display problem - smudges on color change

Hello,

I have problem with 2.9inch e-Paper Module (C). After loading sample code (and any other too) my display is showing smudges when the color on the display changes. Have you experienced such thing before? Is any way to fix it?

20200221_140329

20200221_134626 (1)

e-ink 1.54inch B display text

Hi, I have been able to display images but I have not been able to figure out how to display texts.

I thought the function "Paint_DrawString_EN(5, 90, "waveshare", &Font20, BLACK, WHITE);"
should do that but I am wrong.

Please how do I display texts?

Thank You

Cannot wakeup from sleep

The epd2in7b library does not provide any function to wake up from sleep(). Once it is called, reset() for instance does not wake up the screen. Please assist to wake up the screen.
Should we send the command POWER_ON? and something else?

For example, see the program below. We can display text as much as we want until epd.sleep(). Once sleep is called, the program hangs during display of text number 3.

#!/usr/bin/python
# -*- coding:utf-8 -*-

import epd2in7b
from PIL import Image,ImageDraw,ImageFont


print("Clear the screen")
epd = epd2in7b.EPD()
epd.init()
epd.Clear(0xFF) # clears the screen

def display_text(x,y, textblack, textred):

    HBlackimage = Image.new('1', (epd2in7b.EPD_HEIGHT, epd2in7b.EPD_WIDTH), 255) # 264 x 176 
    HRedimage = Image.new('1', (epd2in7b.EPD_HEIGHT, epd2in7b.EPD_WIDTH), 255)  
    drawblack = ImageDraw.Draw(HBlackimage)
    drawred = ImageDraw.Draw(HRedimage)
    
    font36 = ImageFont.truetype('/usr/share/fonts/truetype/wqy/wqy-microhei.ttc', 36)
    drawblack.text((x, y), textblack, font=font36)
    drawred.text((x,y+30), textred, font=font36)

    print("displaying...")
    epd.display(epd.getbuffer(HBlackimage), epd.getbuffer(HRedimage))

# test
print("Display 1: ")
display_text(30, 40, "Hello", "World")
print("Display 2: ")
display_text(30, 40, "Greetz", "@cryptax")

# sleep
epd.sleep()
print("Display 3: ")
display_text(30, 40, "Never", "see")

Library directories include '&' character in path making it difficult to include via pip

Python pip cannot handle an '&' character when pulling from a git repository:
pip install -e 'git+https://github.com/waveshare/e-Paper.git#egg=waveshare-epd&subdirectory=RaspberryPi&JetsonNano/python'

Results in multiple errors when unpacking. There is no reliable way to escape the '&' character.

Suggest removing the '&' character from the path name and changing it to the word "and."

See Pull request #39
#39

[7.5inch_b&c] Python File not found

I am using the 7.5 inch red/black Display with a Raspberry Pi Zero W running the latest Raspbian Stretch. I followed the Manual and while the BCM-C-Example is running nicely, the Python-Code (tried both Python 2 and 3) fails with the following error:

Traceback (most recent call last):
  File "main.py", line 4, in <module>
    import epd7in5b
  File "/home/pi/e-Paper/7.5inch_e-paper_b&c_code/python3/epd7in5b.py", line 51, in <module>
    import epdconfig
  File "/home/pi/e-Paper/7.5inch_e-paper_b&c_code/python3/epdconfig.py", line 48, in <module>
    SPI = spidev.SpiDev(0, 0)
FileNotFoundError: [Errno 2] No such file or directory

Any suggestions?

EPD_2in9.c: Computes wrong value in EPD_SetWindows()

In the function EPD_SetWindows(), the second argument for SPI command SET_RAM_X_ADDRESS_START_END_POSITION is computed as (Xend >> 3) & 0xFF.

However, the IL3820 datasheet indicates a power-on default value of 29, which seems to be for a 240 pixel display.

This suggests that the correct value is ((Xend >> 3) - 1) & 0xFF, which yields a value of 15 (instead of 16) for the 128x296 display.

In other words, the RAM X range contains 16 bytes from 0x0 to 0xF, equivalent to 128 pixels.

LUT color modification

Hi,

I tried to modify the LUT initilisation by modifying values inside them.
But my modification doesn't changed anything on the refresh process,
I am pretty sure that the COG keep is previous LUT in memory and doen't take the new one into account.
I am working on 1inch54 3 colors (B, W, Y) and I would like to optimize the transition time even if some ghosts keep on the screen.
Is anybody try to modify LUT on this screen or another ?

Alexis

关于STM32demo heap大小问题

不知道有没有和Arduino UNO那样子划1024数组大小的STM32demo,因为对于小容量的STM32MCU跑这个demo资源不够。例如STM32L011D4P6这种类型的MCU只有2K的RAM,而demo里面划分的heap已经36K了

Improvement/completion of epd1in54_V2 Code

Hi everyone,
I saw that there is a new version of 1.54(_V2)" Display and that the old code is not possible to use.
But the new version of .ino code is not complete or not so good example.
There is no function like SetFrameMemory() and in the example is not shown:

  • how to update partial
  • how to print Characters
  • Draw lines etc and transfer the type "paint" to "epd"

It would be nice if this could be completed or you couldn't say it is the same display with same functionality.

Best regards
Knowless

Screen not updating

I have a 7.5inch Model B display with the e-Paper HAT on a RPi 3

It was working all the way until August 31st, however since then I have powered off the Pi and have not used the display.

Trying today, I am unable to update the screen, however the epd_7in5bc_test.py test file runs all of the way.

Is this a 'burn-in' issue? I did not clear the screen before powering it off and storing it away.
However if this was the case, I wouldn't think that it would affect the empty white pixels which also do not update

Black areas not rendering correctly- 5.83" screen

I am using a 5.83" waveshare screen with a pi-hat. The HAT is set to "Display Config: B" and "Interface Config: 0"

When I purchased the screen it worked very well and all of the tests in this library worked appropriately. Over the course of my development cycle (about 2 hours of use per day), the display inconsistently renders black areas.

The boxes produced here from the test script should render 100% black
IMG_20191123_162121

The text produced here from my own script following the examples should (and have in the past) rendered 100% black, but now render as pale outlines:
IMG_20191123_162449

This white text on black background should render without any streaks, but renders with vertical streaks:
IMG_20191123_162514

When the screen is refreshing or initializing, the black appears perfectly solid with no defective or gray areas, so I do not think the screen is damaged:
IMG_20191123_164648

What can cause this behavior? Can you offer any suggestions of how to fix this?

Update a half display

I need to display the time and update it every minute. can this be done without updating the entire display? Python 3 + raspi

epd7in5 not working

In the current master branch, both the python and python3 demo codes for the black and white 7.5" model don't work. I haven't tried the bcm version yet, but with wiringPi everything works as intended.
I have all python libraries installed (spidev and RPi.GPIO with pip3, python3-pillow with apt because the pip installation failed) and there are no error messages printed by the program. Instead, main.py seems to run just fine - the only problem is that the display shows no reaction.

I went back to commit dd0f1e8 and tried it again. Now the python code works, so something between then and HEAD broke it.

incomplete sleep sequence causes Vcc shortcut and resets

Arduino Library for Color 2.9 inch e-paper b & c

displays of other sizes and platforms might be concerned as well

original in epd2in9.cpp

void Epd::Sleep() {
  SendCommand(DEEP_SLEEP);
  SendData(0xa5);
}

result

  • the display reaches deep sleep but without switching off power beforehand as prescribed,
    the gate of the hat's charge pump MOSFET might be left in an unusable state,
    overriding the gate pulldown and shortcut Vcc, this also might reset the Arduino

proposal

1. change in epd2in9.cpp

void Epd::Sleep()
{
    SendCommand(VCOM_AND_DATA_INTERVAL_SETTING);
    SendData(0xF7);                         // set border floating VDB 1:0 = 11

    SendCommand(POWER_OFF);                 // power off

    SendCommand(DEEP_SLEEP);                // deep sleep
    SendData(0xa5);

    pinMode(CS_PIN, INPUT);                 // prevent parasitic supply
    pinMode(RST_PIN, INPUT);
    pinMode(DC_PIN, INPUT);

    SpiEnd();                               // optional
}

2. add to epdif.cpp (optional)

void EpdIf::SpiEnd(void)
{
    SPI.end();
}

3. add to epdif.h (optional)

static void SpiEnd(void);

I've done a lot of research, reading, testing, measuring to make these displays run as intended

Incorrect rendering of images that have been drawn over

I am using Pillow to generate an image that is shown on the 7.5" black and white display. Therefore, I have to clear some areas that have already been drawn on by drawing a white rectangle over them: d.rectangle((100, 100, 300, 150), fill=1)
But when the image is shown on the screen, the area that I drew white over is drawn black. This is not a problem with Pillow, as the generated image is correct, but with the representation of the pillow-generated image on the screen. Please see the files attached: one is the image generated by Pillow (as saved in the python code) and one is a photo of what the screen actually shows.
actually-shown
pillow-out

Is it possible to draw an image over an existing one?

I would typically like to draw a background image, and always keep it.
Then, I would like to draw over that image some text.

In the sample code that you provide, epd.display(epd.getbuffer(HBlackimage), epd.getbuffer(HRedimage)) clears the screen and displays a new image. It calls in epd2in7b.py the command DISPLAY_REFRESH. I tried PARTIAL_DISPLAY_REFRESH instead without success.

Could you please explain how to draw one image over another one if that is possible? Thanks.

I am using a 3-color Waveshare 2.7'' screen (B), on a Raspberry Pi Zero W, based on your Python 3 example.

Python partial update on epd_2in9d damaging display?

The python partial update code for epd_2in9d appears to be damaging my display. Instead of flipping changed pixles only(only set pixels that have changed), it updates all pixels, setting black pixels more black at every update, and every white pixel more white. This causes the image to burn into the display, making it hard to erase image.

Compatibility with Arduino nano 33 BLE

Hi everyone,
Hello, everybody,
I would like to use the Arduino Nano 33 Ble. Unfortunately there is a problem with the library pgmspace.h . It can't be used at the moment. Is there a way to bypass the commands or even create support for the library?

This support could be used for the nano ble sense too, because it is the same chip.

Thank you very much.
Best regards,
Knowless

Black screen / no life

Similarly to #18 after maybe 2-3 weeks of using the e-Paper, my display has stopped being able to be updated. At first it was frozen, but now its a black screen with the frozen image very faint. I have tried running the demo code and it still doesn't clear it. Using RPI zero w 7.5in black (no red) display. Thanks.

clarify licensing

The licensing of the content of this repository is unclear; I"m specifically interested in the low-level epdXinY.* files. The files themselves have an MIT license, but there's copies of GPL3 in LICENSE files in the parent directories.

Are these files still MIT licensed? If so, why was the GPL3 license added?

7.5inch-e-paper demo / Debug: e-Paper busy

Hi,

I'm trying to make the 7.5inch e-Paper working, I followed the tutorial on the documentation (https://www.waveshare.com/w/upload/7/74/7.5inch-e-paper-hat-user-manual-en.pdf) without any issue until running the programm.
Both python2 and C (wiringPi example) return same error about e-Paper being busy
Bcm2835 doesn't display any error but does'nt work neither.

7.5inch e-Paper demo
set wiringPi lib success !!!
Debug: e-Paper busy
Debug: e-Paper busy release
clear...
Debug: e-Paper busy
Debug: e-Paper busy release
Paint_NewImage
WidthByte = 80, HeightByte = 384
EPD_WIDTH / 8 = 15
show bmp for window
pixel = 100 * 100
Debug: e-Paper busy
Debug: e-Paper busy release

Im using RPI 3 b, raspbian stretch (latest), having same errors using the shield or the directly the wires.

If you have any idea why I do have this error you're welcome !
(If you need more informations, I'll try to answer you the best as possible)
Thanks !

Add to documentation that font needs to be installed on RPi

On a Raspberry Pi, to use the python3 examples, you also need to install sudo apt-get install fonts-wqy-microhei or you will get an error:

Drawing
traceback.format_exc():
%s Traceback (most recent call last):
  File "main.py", line 22, in <module>
    font24 = ImageFont.truetype('/usr/share/fonts/truetype/wqy/wqy-microhei.ttc', 24)
  File "/usr/local/lib/python3.5/dist-packages/PIL/ImageFont.py", line 280, in truetype
    return FreeTypeFont(font, size, index, encoding, layout_engine)
  File "/usr/local/lib/python3.5/dist-packages/PIL/ImageFont.py", line 145, in __init__
    layout_engine=layout_engine)
OSError: cannot open resource

This should be added to the documentation.

Blinking screen - 2.9inch e-Paper Module (B)

Hello,

I have problem with running 2.9 inch 3-color screen with Module. The problem is that the screen is blinking like on following video: https://youtu.be/-NTjjIM-cio . For this demo I have used epd2in9bc example.

I have written my own ESP8266 library and debugged it with Logic Analyzer and everything seems to be fine according to the diagram from datasheet (https://www.waveshare.com/w/upload/b/bb/2.9inch-e-paper-b-specification.pdf , diagram BWR mode & LUT from OTP)

Is it a common problem? I couldn't find anything on the internet.

P.S. With one of the display struct from GxEPD2 library (GxGDEW029T5) the screen is not blinking, but this seems to not implement 3-color printing.

(De)Capitalization issues in the code

This is an issue no bug or fault. Thus it is somehow annoying ;)
I assume you are developing on the windows platform which does not care for context sensitivity at all. So to you it don't matter if it reads #include <arduino.h> or #include <Arduino.h>.
On Unix/Linux and MacOS plattform it does matter. However context sensitivity is obviously preserved upon uploading your code to github. You see that in the code because in the sketch itself e.g. it reads #include <SPI.h> (correct) while in some header file it reads #include <spi.h>.
This will compile on windows with arduino ide but not on linux/unix/macos.

You will have to correct the non-found headers here. The IDE will report them once you attempt to compile. It has to be #include <Arduino.h> and #include <SPI.h>.
After correcting this it should compile.

For me that is not a problem for I am experienced with programm in (avr) c. But this can become really tough for unexperienced users.

Setting partials not working properly?

I'm trying to adapt this to a pure ATMEGA48 and having some trouble setting the image partial.. Here's my implementation so far

#include "spi.h"
#include <util/delay.h>


// Display resolution
#define EPD_WIDTH       104
#define EPD_HEIGHT      212

#define IMAGE_WIDTH 16
#define IMAGE_HEIGHT 16
#define IF_INVERT_COLOR 0

// EPD2IN13B commands
#define PANEL_SETTING                               0x00
#define POWER_SETTING                               0x01
#define POWER_OFF                                   0x02
#define POWER_OFF_SEQUENCE_SETTING                  0x03
#define POWER_ON                                    0x04
#define POWER_ON_MEASURE                            0x05
#define BOOSTER_SOFT_START                          0x06
#define DEEP_SLEEP                                  0x07
#define DATA_START_TRANSMISSION_1                   0x10
#define DATA_STOP                                   0x11
#define DISPLAY_REFRESH                             0x12
#define DATA_START_TRANSMISSION_2                   0x13
#define VCOM_LUT                                    0x20
#define W2W_LUT                                     0x21
#define B2W_LUT                                     0x22
#define W2B_LUT                                     0x23
#define B2B_LUT                                     0x24
#define PLL_CONTROL                                 0x30
#define TEMPERATURE_SENSOR_CALIBRATION              0x40
#define TEMPERATURE_SENSOR_SELECTION                0x41
#define TEMPERATURE_SENSOR_WRITE                    0x42
#define TEMPERATURE_SENSOR_READ                     0x43
#define VCOM_AND_DATA_INTERVAL_SETTING              0x50
#define LOW_POWER_DETECTION                         0x51
#define TCON_SETTING                                0x60
#define RESOLUTION_SETTING                          0x61
#define GET_STATUS                                  0x71
#define AUTO_MEASURE_VCOM                           0x80
#define READ_VCOM_VALUE                             0x81
#define VCM_DC_SETTING                              0x82
#define PARTIAL_WINDOW                              0x90
#define PARTIAL_IN                                  0x91
#define PARTIAL_OUT                                 0x92
#define PROGRAM_MODE                                0xA0
#define ACTIVE_PROGRAM                              0xA1
#define READ_OTP_DATA                               0xA2
#define POWER_SAVING                                0xE3
/*
unsigned char epaper_get_image(int width) {
	return malloc(8*width);
}*/

void epaper_draw_absolute_pixel(unsigned char* image, int x, int y, int colored) {
	if (x < 0 || x >= IMAGE_WIDTH || y < 0 || y >= IMAGE_HEIGHT) {
        return;
    }
    if (IF_INVERT_COLOR) {
        if (colored) {
            image[(x + y * IMAGE_WIDTH) / 8] |= 0x80 >> (x % 8);
        } else {
            image[(x + y * IMAGE_WIDTH) / 8] &= ~(0x80 >> (x % 8));
        }
    } else {
        if (colored) {
            image[(x + y * IMAGE_WIDTH) / 8] &= ~(0x80 >> (x % 8));
        } else {
            image[(x + y * IMAGE_WIDTH) / 8] |= 0x80 >> (x % 8);
        }
    }
}

void send_command(unsigned char command) {
	PORTB &= ~(1 << PINB1);
	send_recieve_spi_byte(command);

}

void send_data(unsigned char data) {
	PORTB |= (1 << PINB1);
	send_recieve_spi_byte(data);

}

void epaper_clear(unsigned char* image) {
	for (int x = 0; x < EPD_WIDTH; x++) {
        for (int y = 0; y < EPD_HEIGHT; y++) {
            epaper_draw_absolute_pixel(image,x, y, 0);
        }
    }
}

void epaper_init() {
	DDRD &= ~(1 << DDD1);
	DDRB |= (1 << DDB1);
	send_command(BOOSTER_SOFT_START);
	send_data(0x17);
	send_data(0x17);
	send_data(0x17);
	send_command(POWER_ON);
	while(!(PIND &&(1<<PD1)));
    send_command(PANEL_SETTING);
	send_data(0x8F);
	send_data(0x8F);
    send_command(VCOM_AND_DATA_INTERVAL_SETTING);
    send_data(0x37);
    send_command(RESOLUTION_SETTING);
    send_data(0x68);
    send_data(0x00);
    send_data(0xD4);
}

void epaper_display() {
	send_command(DISPLAY_REFRESH);
	while(!(PIND &&(1<<PD1)));
}

void epaper_set_partial_black(unsigned char* buffer_black, int x, int y, int w, int l) {
	send_command(PARTIAL_IN);
	send_command(PARTIAL_WINDOW);
	send_data( x & 0xf8); // X on 8 kordne
	send_data(((x & 0xf8) + w -1) | 0x07);
	send_data(y >> 8);
	send_data(y & 0xff);
	send_data((y + l -1) >> 8);
	send_data((y + l - 1) & 0xff);
	send_data(0x01);
	_delay_ms(2);
	send_command(DATA_START_TRANSMISSION_1);
	if (buffer_black != NULL) {
        for(int i = 0; i < w  / 8 * l; i++) {
            send_data(buffer_black[i]);  
        }  
    } else {
        for(int i = 0; i < w  / 8 * l; i++) {
            send_data(0x00);  
        }  
    }
    _delay_ms(2);
	send_command(PARTIAL_OUT);  
}

void epaper_set_partial_red(unsigned char* buffer_red, int x, int y, int w, int l) {
	send_command(PARTIAL_IN);
	send_command(PARTIAL_WINDOW);
	send_data( x & 0xf8); // X on 8 kordne
	send_data(((x & 0xf8) + w -1) | 0x07);
	send_data(y >> 8);
	send_data(y & 0xff);
	send_data((y + l -1) >> 8);
	send_data((y + l - 1) & 0xff);
	send_data(0x01);
	_delay_ms(2);
	send_command(DATA_START_TRANSMISSION_2);
	if (buffer_red != NULL) {
        for(int i = 0; i < w  / 8 * l; i++) {
            send_data(buffer_red[i]);  
        }  
    } else {
        for(int i = 0; i < w  / 8 * l; i++) {
            send_data(0x00);  
        }  
    }
    _delay_ms(2);
	send_command(PARTIAL_OUT);  
}

and calling it out via

unsigned char image[1024];

	DDRD |= (1<< DDD0);
	PORTD &= ~(1 << PIND0);
	PORTD |= (1 << PIND0);
	_delay_ms(2000);

	init_spi_oneway();
	epaper_init();
	epaper_clear(image);
	epaper_set_partial_black(image,0,0,32,32);
	epaper_set_partial_red(image, 0,0,32,32);

	epaper_display();

This makes a long 32xsomething stripe? In fact, seems that only with values close to 16x16 for the w and h of the partial set, it seems to work fine? Am I doing something wrong in the calculations?

1.54 DEBUG:root:e-Paper busy

When running this file - epd_1in54c_test.py on a raspberry pi 3+
Doubled checked all the wiring

The ink display screen does not change all I get is the debug readout in my ssh terminal

INFO:root:epd1in54c Demo
INFO:root:init and Clear
DEBUG:root:e-Paper busy
DEBUG:root:e-Paper busy release
DEBUG:root:e-Paper busy
DEBUG:root:e-Paper busy release
INFO:root:1.Drawing on the image...
DEBUG:root:Horizontal
Any help or suggestions

Help with image rendering

Hi @waveshare team,
I've been using the 7.5" E-Paper (B, old model) display for quite some now. For my project, I have been using pretty old driver files (from 2018 I think). Now I wanted to update the driver files, but there are some things I don't understand about the new driver files. Could you please provide some extra information about that?

The three-coloured E-Papers now have a function named display(self, blackimage, redimage). This was previously not the case, i.e. the input would just be one buffer. Why is there a need for 2 buffers now and how can I render an image (png for example) with the same dimensions as the display? Before, the function get_frame_buffer (or getbuffer now) would take an image, map each pixel to either red, black and white and save the data in a single buffer. Then the function display_frame would render the image on the E-Paper.

display never reaches deep sleep

Arduino Library for Black and White 2.9 inch e-paper

displays of other sizes and platforms might be concerned as well

original in epd2in9.cpp

void Epd::Sleep() {
    SendCommand(DEEP_SLEEP_MODE);
    WaitUntilIdle();
}

result

  • the display never reaches deep sleep, because a following 0x01 data byte is missing
  • WaitUntilIdle() returns because the display is not sleeping
  • because the display never sleeps it might be damaged, as mentioned in the manual

proposal

1. change in epd2in9.cpp

void Epd::Sleep()
{
    // datasheet prescribes turning off
    // oscillator clock and DC/DC & regulator
    // befor entering sleep
    // but does not tell how to do it

    SendCommand(DEEP_SLEEP_MODE);
    SendData(0x01);                     // 0x01 = deep sleep mode

    pinMode(CS_PIN, INPUT);             // prevent parasitic supply
    pinMode(RST_PIN, INPUT);
    pinMode(DC_PIN, INPUT);

    SpiEnd();                           // optional
}

2. add to epdif.cpp (optional)

void EpdIf::SpiEnd(void)
{
    SPI.end();
}

3. add to epdif.h (optional)

static void SpiEnd(void);

I've done a lot of research, reading, testing, measuring to make these displays run as intended

GrayScale example for 3 color displays

Hi, I recently received my 5.83 (B) display and I'm playing with it. But I discovered that I'm unable to draw any other color than Red/Black/White. But according to specification, this display supports these 8 colors:

  • Black (000)
  • Gray1 (001)
  • Gray2 (010)
  • White (011)
  • Red0 (100)
  • Red1 (101)
  • Red2 (110)
  • Red3 (111)

after a few failed attempts I tried the simplest way just replacing 0x04 with 0x05 on these lines:

but this try failed too.

Am I doing it wrong?

Wake from sleep

Happy National Day!

I have a 2.7inch e-Paper Hat and I'm running Python 3.6 on Raspberry Pi 3B+.

I think I have encounter the same problem as #32

It seems that the programmer forgot to re-open the SPI port after module_exit(self) closes it.
I think it would be better if this line is added in def module_init(self)
self.SPI = spidev.SpiDev(0, 0)

.net core driver support

Hi,
I was wondering if there are any plans in making support for .net core based libraries & examples for the different displays, similar to what already exists for C & Python? I would be happy to help out & contribute. There are a few custom made .net libs out there made for one or two displays, but it would be great to have wider support.

I've been trying to get the "Waveshare ePaper 7.5" (B)" to run with a .net core application on RaspberryPi 3b, but currently without success. Tested with both "unosquare/raspberryio" & Microsoft's own IoT library "System.Device.Gpio", but the display does not respond to any commands (nothing happens). The provided c & python demos run just fine.

The driver library I'm replicating is EPD_7in5bc.c for RaspberryPi. Anyone tried something like this with .net core or mono? I would really like to find a way to debug the commands, to test if they are successful or not.

Lond update and Clear

  1. Why is it so long updated?
  2. Why this cycle?
def Clear(self, color):
        self.send_command(DATA_START_TRANSMISSION_1)
        for i in range(0, self.width // 8 * self.height):
            self.send_data(0x33)
            self.send_data(0x33)
            self.send_data(0x33)
            self.send_data(0x33)
        # self.send_command(POWER_ON)
        # self.wait_until_idle()
        self.send_command(DISPLAY_REFRESH)
        epdconfig.delay_ms(100)
        self.wait_until_idle()

Damaged 1.54inch display?

Hi,

I was playing with demo script for python on raspberry when during code execution the background color of display turned black. Clear function doesn't help. When running original demo I can see that some images are being display for few secondsbut screen goes back to black.
Was my epaper display damaged somehow during code testing?

1.54 in V2

The library does not work, the example is very poor, and this is holding an order of 250 displays.
I fixed the library, but i still need examples for text and shapes.

Please reply asap

How wake epaper display from sleep - using example Python script

Using the test python3 script for 2in9, how do you wake up the display after a sleep within the same script.

I've tried the initialise statement
logging.info("Goto Sleep...")
epd.sleep()
epd.init(epd.lut_full_update) but it returns this error

epd.init(epd.lut_full_update)

File "/home/myapp/epaper_python3/epd2in9.py", line 118, in init
if (epdconfig.module_init() != 0):
File "/home/myapp/epaper_python3/epdconfig.py", line 71, in module_init
self.SPI.max_speed_hz = 4000000
OSError: [Errno 9] Bad file descriptor

Script - e-Paper/RaspberryPi&JetsonNano/python/examples/epd_2in9_test.py

Is this buffer being created correctly?

https://github.com/waveshare/e-Paper/blob/e945bfbbf36877b7b6d46d24608b67d4c3cb33bd/1.54inch_e-paper_code/RaspberryPi/python3/epd1in54.py#L200

The above is happening within a nested loop. As an example, in the one iteration, y could be 0 and x could be 1. On a subsequent execution of the loop, y could increment to 1 and x restart to 0. In both cases, the referenced buffer index would be the same. This would essentially happen numerous times. Maybe I'm missing something else, but that doesn't seem to be right. Is there any reason we need to put the image buffer data into a single dimension array? Why not a two-dim array, like the image data?

Also, while I'm here, I can't find any documentation that states why we need to take the floor division of 8 (// 8) for the height and width of the display. Can you point to where I can find this? I noticed the floor division varies for the displays.

Just bought 7.5inch E-Ink Can't get it to work

Hi all,

As the title says, I have just got through the mail a 7.5inch E-Ink screen. I am running it with a Raspberry Pi and I have connected the e-Paper HAT.

I have downloaded all the relevant libraries and I have used the example python code from the waveshare wiki website and from this github via git clone.

Unfortunately nothing works, the screen has never changed from when I first opened the box. All I get in the terminal is the following:
`
INFO:root:epd7in5 Demo
INFO:root:init and Clear
DEBUG:root:e-Paper busy

`

Any help would be appreciated as I am very keen to get this project up and running!

Kind regards,

James

提升 python Clear() 和 display() 的性能

Python脚本在跑 Clear() 和 display() 时有严重的性能问题,CPU利用率一直位于100%,后面发现是send_data消耗大量性能。
spi_writebyte最多可以输入4096bytes

  • 测试平台:Raspberry Pi Zero W
  • 测试系统:ArchLinux ARM (armv6l Linux 4.19.97-1-ARCH)
  • Python版本:Python 3.8.1
    加入以下代码
    @@ -43,6 +43,7 @@ class EPD:
             self.cs_pin = epdconfig.CS_PIN
             self.width = EPD_WIDTH
             self.height = EPD_HEIGHT
    +        self.SPIMaxDatas = 4096
         
         # Hardware reset
         def reset(self):
    @@ -64,7 +65,29 @@ class EPD:
             epdconfig.digital_write(self.cs_pin, 0)
             epdconfig.spi_writebyte([data])
             epdconfig.digital_write(self.cs_pin, 1)
    -        
    +
    +    @staticmethod
    +    def _chunks(lst, n):
    +        """Yield successive n-sized chunks from lst."""
    +        for i in range(0, len(lst), n):
    +            yield lst[i:i + n]
    +
    +    def _send_large_datas(self, datas):
    +        for data in self._chunks(datas, self.SPIMaxDatas):
    +            self._send_datas(data)    
    +
    +    def _send_datas(self, datas):
    +        epdconfig.digital_write(self.dc_pin, 1)
    +        epdconfig.digital_write(self.cs_pin, 0)
    +        epdconfig.spi_writebyte(datas) 
    +        epdconfig.digital_write(self.cs_pin, 1)
    +
    +    def send_datas(self, datas):
    +        if len(datas) > self.SPIMaxDatas:
    +            self._send_large_datas(datas)
    +        else:
    +            self._send_datas(datas)
    修改Clear() 与 display() 中有关 send_data 的代码,改为 append 到数组
    @@ -153,6 +169,7 @@ class EPD:
     
         def display(self, image):
             self.send_command(0x10)
    +        senddatas = []
             for i in range(0, int(self.width / 4 * self.height)):
                 temp1 = image[i]
                 j = 0
    @@ -173,18 +190,16 @@ class EPD:
                     else:
                         temp2 |= 0x04
                     temp1 = (temp1 << 2) & 0xFF
    -                self.send_data(temp2)
    +                senddatas.append(temp2)
                     j += 1
    -                
    +        self.send_datas(senddatas)
             self.send_command(0x12)
             epdconfig.delay_ms(100)
             self.ReadBusy()
             
         def Clear(self):
             self.send_command(0x10)
    -        for i in range(0, int(self.width / 4 * self.height)):
    -            for j in range(0, 4):
    -                self.send_data(0x33)
    +        self.send_datas([0x33] * int(self.width / 4 * self.height) * 4)
             self.send_command(0x12)
             self.ReadBusy()
测试结果
  • epd5in83_old 为 git clone的版本, epd5in83 为修改版

epd_5in83_test_old.py中仅将epd5in83修改为epd5in83_old

[root@rpi examples]# time python epd_5in83_test.py 
INFO:root:epd5in83 Demo
INFO:root:init and Clear
DEBUG:root:e-Paper busy
DEBUG:root:e-Paper busy release
DEBUG:root:e-Paper busy
DEBUG:root:e-Paper busy release
INFO:root:1.Drawing on the Horizontal image...
DEBUG:root:imwidth = 600  imheight =  448 
DEBUG:root:e-Paper busy
DEBUG:root:e-Paper busy release
INFO:root:2.Drawing on the Vertical image...
DEBUG:root:imwidth = 448  imheight =  600 
DEBUG:root:e-Paper busy
DEBUG:root:e-Paper busy release
INFO:root:3.read bmp file
DEBUG:root:imwidth = 600  imheight =  448 
DEBUG:root:e-Paper busy
DEBUG:root:e-Paper busy release
INFO:root:4.read bmp file on window
DEBUG:root:imwidth = 448  imheight =  600 
DEBUG:root:e-Paper busy
DEBUG:root:e-Paper busy release
INFO:root:Clear...
DEBUG:root:e-Paper busy
DEBUG:root:e-Paper busy release
DEBUG:root:e-Paper busy
DEBUG:root:e-Paper busy release
INFO:root:Goto Sleep...
DEBUG:root:e-Paper busy
DEBUG:root:e-Paper busy release
DEBUG:root:spi end
DEBUG:root:close 5V, Module enters 0 power consumption ...

real	2m2.305s
user	1m11.051s
sys	0m0.360s
[root@rpi examples]# time python epd_5in83_test_old.py 
INFO:root:epd5in83 Demo
INFO:root:init and Clear
DEBUG:root:e-Paper busy
DEBUG:root:e-Paper busy release
DEBUG:root:e-Paper busy
DEBUG:root:e-Paper busy release
INFO:root:1.Drawing on the Horizontal image...
DEBUG:root:imwidth = 600  imheight =  448 
DEBUG:root:e-Paper busy
DEBUG:root:e-Paper busy release
INFO:root:2.Drawing on the Vertical image...
DEBUG:root:imwidth = 448  imheight =  600 
DEBUG:root:e-Paper busy
DEBUG:root:e-Paper busy release
INFO:root:3.read bmp file
DEBUG:root:imwidth = 600  imheight =  448 
DEBUG:root:e-Paper busy
DEBUG:root:e-Paper busy release
INFO:root:4.read bmp file on window
DEBUG:root:imwidth = 448  imheight =  600 
DEBUG:root:e-Paper busy
DEBUG:root:e-Paper busy release
INFO:root:Clear...
DEBUG:root:e-Paper busy
DEBUG:root:e-Paper busy release
DEBUG:root:e-Paper busy
DEBUG:root:e-Paper busy release
INFO:root:Goto Sleep...
DEBUG:root:e-Paper busy
DEBUG:root:e-Paper busy release
DEBUG:root:spi end
DEBUG:root:close 5V, Module enters 0 power consumption ...

real	6m31.419s
user	3m38.717s
sys	1m13.439s

或许可以考虑一下提升getbuffer的性能

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.