atomic14 / diy-esp32-epub-reader

An ESP32 e-reader
MIT License
340 stars 47 forks source link

Error when using EPDiy PCB and a supported epaper #52

Closed martinberlin closed 2 years ago

martinberlin commented 2 years ago

Maybe it's simply a conflict with I2C since EPDiy also uses this interface. Error in log shows the following:

I (536) cpu_start: Starting scheduler on PRO CPU.
I (0) cpu_start: Starting scheduler on APP CPU.
I (541) spiram: Reserving pool of 32K of internal memory for DMA/internal allocations
E (551) i2c: i2c_master_cmd_begin(1164): i2c driver not installed
ESP_ERROR_CHECK failed: esp_err_t 0x103 (ESP_ERR_INVALID_STATE) at 0x4008c860
file: "lib/epdiy/config_reg_v6.h" line 86
func: push_cfg
expression: pca9555_set_value(reg->port, value, 1)
abort() was called at PC 0x4008c863 on core 1  --> Continuous reboot

V6 uses concretely I2C in pca9555.c that is a GPIO expander. The temporal solution might be to instantiate current L58 touch only if the display is LilyGo EPD47. But still it should be possible to instantiate somehow another I2C interface in case we use another touch overlay.

Setup: EPDiy V6

martinberlin commented 2 years ago

Hello @cgreening This error is fixed with my pull request #53 but I just discovered an additional bug that I don't know why it's triggered: Using the V6 PCB and this project as soon as enters deepsleep wakes up automatically. No idea why since I'm not touching any GPIO. Can you imagine why it can be? Serial looks like:

I (240423) main: Saving state I (240423) EPD: Dehydrating EPD I (241373) EPD: Buffer compressed size: 59547 I (244443) EPD: 0 bytes written - retrying buffer save I (247093) EPD: Buffer saved 0 I (247093) EPD: Dehydrated EPD I (247093) SPIFFS: SPIFFS unmounted I (247093) main: Entering deep sleep --> 300 ms and wakes up again: I (14) boot: ESP-IDF 4.3.0 2nd stage bootloader

But this time with the white screen, also is not recovering SPIFFS data, kind of weird :(

cgreening commented 2 years ago

Could be the buttons - are they active low or high? If they are active high then you can use the EXT1 sleep mode - I've not tested it though!

martinberlin commented 2 years ago

That's it. Using BUTONS_ACTIVE_LEVEL=0 on low then it wakes up automatically from deepsleep. Changing it to high it works correctly. It's no problem I can connect the buttons to 3.3V with a resistance. But I would like to find out why it is since I'm not aware that this PCB is using any of the 3 defined GPIOs. (But I might be wrong of course!)

martinberlin commented 2 years ago

epdiy-open-book