aceinnolab / Inkycal

Create awesome e-paper dashboards within minutes! Modularity? Check! Python3? Check? Works on Raspberry Pi Zero W? Check! Support for own modules? Check!
https://aceinnolab.github.io/Inkycal/
GNU General Public License v3.0
1.07k stars 123 forks source link

[BUG]: Waveshare 13,3" driver issue #368

Open kalalaa opened 1 month ago

kalalaa commented 1 month ago

Waveshare 13,3" error at new cycle The epd displays the modules at the first start, but it doesn't refresh, and when starts a new cycle it stops with error.

(venv) inky@inkycal:~/Inkycal $ python inky_run.py
13-07-2024 08:25:35 | inkycal.main |  INFO: Inkycal v2.0.4 booting up...
13-07-2024 08:25:35 | inkycal.main |  INFO: Checking if a settings file is present...
13-07-2024 08:25:35 | inkycal.main |  INFO: Looking for settings.json file in /boot folder...
/home/inky/Inkycal/venv/lib/python3.11/site-packages/gpiozero/devices.py:295: PinFactoryFallback: Falling back from lgpio: module 'lgpio' has no attribute 'SET_BIAS_DISABLE'
  warnings.warn(
13-07-2024 08:25:36 | inkycal.custom.openweathermap_wrapper |  INFO: OWM wrapper initialized for API version 2.5, language en and timezone Europe/Budapest.
13-07-2024 08:25:36 | inkycal.main |  INFO: name : Weather size : 680x141 px
13-07-2024 08:25:36 | inkycal.main |  INFO: name : Calendar size : 680x423 px
13-07-2024 08:25:36 | inkycal.main |  INFO: name : Agenda size : 680x376 px
13-07-2024 08:25:36 | inkycal.main |  INFO: Inkycal initialised successfully!
13-07-2024 08:25:36 | inkycal.main |  INFO: Inkycal version: v2.0.4
13-07-2024 08:25:36 | inkycal.main |  INFO: Selected E-paper display: epd_13_in_3_colour
13-07-2024 08:25:36 | inkycal.main |  INFO: Starting new cycle...
13-07-2024 08:25:36 | inkycal.main |  INFO: Timestamp: 08:25:36 13.07.2024
13-07-2024 08:25:42 | inkycal.modules.ical_parser |  INFO: loaded iCalendars from URLs
13-07-2024 08:25:42 | inkycal.modules.inkycal_agenda |  INFO: Managed to parse events from urls
13-07-2024 08:25:42 | inkycal.main |  INFO: All images generated successfully!
13-07-2024 08:25:43 | inkycal.main |  INFO: Attempting to render image on display...
Initialising..Updating display......Done
Sending E-Paper to deep sleep...Done
13-07-2024 08:26:10 | inkycal.main |  INFO: No errors since 1 display updates
13-07-2024 08:26:10 | inkycal.main |  INFO: program started 35 seconds ago
34 minutes left until next refresh
13-07-2024 09:00:00 | inkycal.main |  INFO: Starting new cycle...
13-07-2024 09:00:00 | inkycal.main |  INFO: Timestamp: 09:00:00 13.07.2024
13-07-2024 09:00:16 | inkycal.modules.ical_parser |  INFO: loaded iCalendars from URLs
13-07-2024 09:00:16 | inkycal.modules.inkycal_agenda |  INFO: Managed to parse events from urls
13-07-2024 09:00:16 | inkycal.main |  INFO: All images generated successfully!
13-07-2024 09:00:17 | inkycal.main |  INFO: Attempting to render image on display...
Initialising..Traceback (most recent call last):
  File "/home/inky/Inkycal/inky_run.py", line 43, in <module>
    asyncio.run(run())
  File "/usr/lib/python3.11/asyncio/runners.py", line 190, in run
    return runner.run(main)
           ^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/asyncio/runners.py", line 118, in run
    return self._loop.run_until_complete(task)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "/home/inky/Inkycal/inky_run.py", line 20, in run
    await inky.run()  # If there were no issues, you can run Inkycal nonstop
    ^^^^^^^^^^^^^^^^
  File "/home/inky/Inkycal/inkycal/main.py", line 368, in run
    display.render(im_black, im_colour)
  File "/home/inky/Inkycal/inkycal/display/display.py", line 94, in render
    epaper.init()
  File "/home/inky/Inkycal/inkycal/display/drivers/epd_13_in_3_colour.py", line 110, in init
    self.send_command(0x12)  # SWRESET
    ^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/inky/Inkycal/inkycal/display/drivers/epd_13_in_3_colour.py", line 69, in send_command
    epdconfig.spi_writebyte([command])
  File "/home/inky/Inkycal/inkycal/display/drivers/epdconfig.py", line 94, in spi_writebyte
    self.SPI.writebytes(data)
OSError: [Errno 9] Bad file descriptor
(venv) inky@inkycal:~/Inkycal $
github-actions[bot] commented 1 month ago

Hi there and welcome to Inkycal. Thanks for opening this issue. As this is your first issue in this repository, please read through the contributing guidelines

aceisace commented 1 month ago

Thanks for reporting this issue @kalalaa . It seems there is an issue with the driver file of the 13.3" display. This driver was copied from waveshare directly, but I'll a look into this at the end of today

aceisace commented 1 month ago

@kalalaa Hi there, apologies for getting back at this rather late. Have you tested this with the latest version of Inkycal? From the looks of it i.e. display updating once, but not after that, this was an issue with the earlier version of InkycalOS-Lite v2.0.4, which was corrected a few days ago.

Please let me know if it works for you. If not, please paste the full traceback as you have before. Thank you in advance

kalalaa commented 1 month ago

Hi! The issue is still the same with the latest OS:

inky@inkycal:~ $ cd ~/Inkycal
source venv/bin/activate
git pull
python inky_run.py
hint: Pulling without specifying how to reconcile divergent branches is
hint: discouraged. You can squelch this message by running one of the following
hint: commands sometime before your next pull:
hint: 
hint:   git config pull.rebase false  # merge (the default strategy)
hint:   git config pull.rebase true   # rebase
hint:   git config pull.ff only       # fast-forward only
hint: 
hint: You can replace "git config" with "git config --global" to set a default
hint: preference for all repositories. You can also pass --rebase, --no-rebase,
hint: or --ff-only on the command line to override the configured default per
hint: invocation.
Already up to date.
30-07-2024 11:48:32 | inkycal.main |  INFO: Inkycal v2.0.4 booting up...
30-07-2024 11:48:32 | inkycal.main |  INFO: Checking if a settings file is present...
30-07-2024 11:48:32 | inkycal.main |  INFO: Found settings.json file in /boot/settings.json
/home/inky/Inkycal/venv/lib/python3.9/site-packages/gpiozero/devices.py:295: PinFactoryFallback: Falling back from lgpio: module 'lgpio' has no attribute 'SET_BIAS_DISABLE'
  warnings.warn(
30-07-2024 11:48:32 | inkycal.custom.openweathermap_wrapper |  INFO: OWM wrapper initialized for API version 2.5, language hu and timezone Europe/Budapest.
30-07-2024 11:48:32 | inkycal.main |  INFO: name : Weather size : 680x100 px
30-07-2024 11:48:32 | inkycal.main |  INFO: name : Calendar size : 680x376 px
30-07-2024 11:48:32 | inkycal.main |  INFO: name : Agenda size : 680x464 px
30-07-2024 11:48:32 | inkycal.main |  INFO: Inkycal initialised successfully!
30-07-2024 11:48:32 | inkycal.main |  INFO: Inkycal version: v2.0.4
30-07-2024 11:48:32 | inkycal.main |  INFO: Selected E-paper display: epd_13_in_3_colour
30-07-2024 11:48:32 | inkycal.main |  INFO: Starting new cycle...
30-07-2024 11:48:32 | inkycal.main |  INFO: Timestamp: 11:48:32 30.07.2024
30-07-2024 11:48:35 | inkycal.modules.ical_parser |  INFO: loaded iCalendars from URLs
30-07-2024 11:48:38 | inkycal.modules.ical_parser |  INFO: loaded iCalendars from URLs
30-07-2024 11:48:38 | inkycal.modules.inkycal_agenda |  INFO: Managed to parse events from urls
30-07-2024 11:48:39 | inkycal.main |  INFO: All images generated successfully!
30-07-2024 11:48:40 | inkycal.main |  INFO: Attempting to render image on display...
Initialising..Updating display......Done
Sending E-Paper to deep sleep...Done
30-07-2024 11:49:08 | inkycal.main |  INFO: No errors since 55 display updates
30-07-2024 11:49:08 | inkycal.main |  INFO: program started 36 seconds ago
2 minutes left until next refresh
30-07-2024 11:51:00 | inkycal.main |  INFO: Starting new cycle...
30-07-2024 11:51:00 | inkycal.main |  INFO: Timestamp: 11:51:00 30.07.2024
30-07-2024 11:51:03 | inkycal.modules.ical_parser |  INFO: loaded iCalendars from URLs
30-07-2024 11:51:06 | inkycal.modules.ical_parser |  INFO: loaded iCalendars from URLs
30-07-2024 11:51:06 | inkycal.modules.inkycal_agenda |  INFO: Managed to parse events from urls
30-07-2024 11:51:06 | inkycal.main |  INFO: All images generated successfully!
30-07-2024 11:51:07 | inkycal.main |  INFO: Attempting to render image on display...
Initialising..Traceback (most recent call last):
  File "/home/inky/Inkycal/inky_run.py", line 43, in <module>
    asyncio.run(run())
  File "/usr/lib/python3.9/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/usr/lib/python3.9/asyncio/base_events.py", line 642, in run_until_complete
    return future.result()
  File "/home/inky/Inkycal/inky_run.py", line 20, in run
    await inky.run()  # If there were no issues, you can run Inkycal nonstop
  File "/home/inky/Inkycal/inkycal/main.py", line 372, in run
    display.render(im_black, im_colour)
  File "/home/inky/Inkycal/inkycal/display/display.py", line 94, in render
    epaper.init()
  File "/home/inky/Inkycal/inkycal/display/drivers/epd_13_in_3_colour.py", line 110, in init
    self.send_command(0x12)  # SWRESET
  File "/home/inky/Inkycal/inkycal/display/drivers/epd_13_in_3_colour.py", line 69, in send_command
    epdconfig.spi_writebyte([command])
  File "/home/inky/Inkycal/inkycal/display/drivers/epdconfig.py", line 94, in spi_writebyte
    self.SPI.writebytes(data)
OSError: [Errno 9] Bad file descriptor
(venv) inky@inkycal:~/Inkycal $