-
Notifications
You must be signed in to change notification settings - Fork 143
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
EPD super slow in comparison to python library #34
Comments
@str4d: You were using the oldest link from here? https://www.waveshare.com/wiki/File:7.5inch-e-paper-hat-code.7z or did you try their github: https://github.com/waveshare/e-Paper/tree/master/RaspberryPi%26JetsonNano/python/examples ? |
The "Old Python driver" test does indeed use the driver from the oldest link on that wiki page. The "Latest Python driver" test used whatever was in latest master of their repo at the time of testing. |
I suspect that if people want to try to implement the faster updates this would be the place to look: https://github.com/repaper/gratis/. The python "driver" just writes to a FUSE filesystem backed by C. |
Hi there, I may have misunderstood, but the initial reporter said that it was way longer to write on the e-paper using this crate, versus the python equivalent. In my case, I've the epd7in5 (first version) and it was also faaaar longer to put a simple text on the screen than the equivalent python version It tooks ~ 30 seconds in the update_frame() function Here is my quick test : hardware :
let mut delay = Delay;
let mut epd7in5 = Epd7in5::new(&mut spi, busy, dc, rst, &mut delay, None).expect("eink initalize error");
let mut display = Display7in5::default();
println!("here_1 {}", Local::now());
display.set_rotation(DisplayRotation::Rotate0);
draw_text(&mut display, &my_string_utc, 20, 20);
println!("here_2 {}", Local::now());
epd7in5.update_frame(&mut spi, display.buffer(), &mut delay)?;
println!("here_3 {}", Local::now());
epd7in5
.display_frame(&mut spi, &mut delay)
.expect("display frame new graphics");
println!("here_4 {}", Local::now());
let new_delay: u32 = 7000;
println!("Set delay to {} ms", new_delay);
delay.delay_ms(new_delay);
println!("Finished tests - going to sleep");
epd7in5.sleep(&mut spi, &mut delay)
Any idea on how to improve this ? Thanks |
@kburgi Which display are you using? If you have the referenced one (https://www.waveshare.com/wiki/7.5inch_HD_e-Paper_HAT) you should use the epd7in5_hd module not the one you linked above with a slightly different fn update_frame(
&mut self,
spi: &mut SPI,
buffer: &[u8],
delay: &mut DELAY,
) -> Result<(), SPI::Error> {
self.wait_until_idle(spi, delay)?;
self.cmd_with_data(spi, Command::SetRamYAc, &[0x00, 0x00])?;
self.cmd_with_data(spi, Command::WriteRamBw, buffer)?;
self.cmd_with_data(spi, Command::DisplayUpdateControl2, &[0xF7])?;
Ok(())
} It would then be great if you could benchmark the lines here and compare it to the python parts and maybe even check if they skip one of the commands or parts. |
See #33 for more info. But in short:
Tested on a raspberry pi zero w by @str4d
The text was updated successfully, but these errors were encountered: