MikeGawi / ePiframe

ePiframe is an e-Paper (or HDMI, Composite display) Raspberry Pi Photo Frame with Google Photos and more
GNU General Public License v3.0
63 stars 10 forks source link

TypeError: display() takes 2 positional arguments but 3 were given #75

Closed xdweaver closed 1 year ago

xdweaver commented 1 year ago

I'm stuck please help me. Everything works great but when I send an image I get this error.

MikeGawi commented 1 year ago

Thanks for rising this issue.

What Waveshare display are you using? And what Waveshare package and color schema you have configured in display and epaper_color values in config.cfg.

xdweaver commented 1 year ago

Thank you for helping me, here is the config.cfg

No need to restart service after changing any of those values ; as this file is loaded per every display refresh/run ; Run the main script with flag --check-config to verify configuration

[Sources]

Set 1 to get photos from Google Photos.

; The rest of the values in this section regarding GP should be filled as well when enabled.

ACTIVATION IS NEEDED! Check documentation.

Default: 1 (enabled)

use_google_photos=0

Google API credentials filename and path.

Default: credentials.json

cred_file=

Google API token pickle filename and path to save authentication token

for further use.

Default: token.pickle

pickle_file=token.pickle

Names of the photo slide source albums in Google Photos.

; Multiple allowed - comma separated (e.g. Greece 2020,Tom's 2nd birthday).

Empty means all. Default: empty

album_names=

Set 1 to get photos from local storage.

; The rest of the values in this section regarding local should be filled as well when enabled.

Default: 1 (enabled)

use_local=1

Path of photos in local storage.

Folder will be created if not exists.

Default: 1 (enabled)

local_path=/home/pi/Pictures

Set 1 to get photos from local storage recursively from subfolders.

Default: 1 (enabled)

local_subfolders=1

[General]

Temperature units.

One of the values: metric or imperial

Default: metric

units=metric

Path of the downloaded original photo slide and conversion location.

Default: .

photo_convert_path=.

Download name of the original photo slide.

Leave only name in photo_download_name as the extension will be added

automatically.

Default: origphoto

photo_download_name=origphoto

Converted name of the current photo slide showed on the display.

Default: photo.bmp

photo_convert_filename=photo.bmp

Converted photo slide thumbnail filename.

Default: photo_thumb.jpg

thumb_photo_convert_filename=photo_thumb.jpg

Original photo slide thumbnail filename.

Default: origphoto_thumb.jpg

thumb_photo_download_name=origphoto_thumb.jpg

Path and name of ePiframe service log files.

Path will be created if doesn't exists.

Use empty to disable logs.

Default: logs/ePiframe.log

log_files=logs/ePiframe.log

Path and name of the ImageMagick convert tool binary.

Default: /usr/bin/convert

convert_bin_path=/usr/bin/convert

Path and name of the RRDTool binary.

Default: /usr/bin/rrdtool

rrdtool_bin_path=/usr/bin/rrdtool

Path and name of the FBI imageviewer binary.

Default: /usr/bin/fbi

fbi_bin_path=/usr/bin/fbi

Path and name of the index file holding current photo markups.

Default: index

photo_index_file=index

Path and name of the list file holding whole photo collection.

Default: list

photo_list_file=list

Path and name of the PID file holding current running script PID.

Default: pid

pid_file=pid

Path and name of the interval multiplication file holding current photo

time.

Default: time

interval_mult_file=time

[Display]

Type of the display connected: SPI or HDMI/Composite.

It's affecting other options specific for the display type.

Possible values: SPI, HDMI.

Default: SPI

display_type=SPI

Type of the e-paper display.

Possible values: Waveshare, Pimoroni.

Default: Waveshare

epaper_type=Waveshare

Color palette of e-paper display.

This determines what kind of conversion will be used for the image.

Other means no conversion and it will rely on the driver to adjust the

photo.

Possible values: BW (black&white), BW+Yellow, BW+Red, 4 colors, 7 colors,

Other.

Default: BW

epaper_color=BW+Red

Used for e-Paper SPI displays!

Name of the display class from Waveshare or Pimoroni Inky python codes.

Default: epd7in5_V2

display=epd7in5_V2

Clear display before refresh.

Use in case of ghosting. The frame update will take longer when enabled.

Default: 0 (disabled)

clear_display=0

Number of terminal (virtual console) used for HDMI/Composite display.

This option wrongly set may hang or corrupt terminals.

The default set will work on X and non-X environments.

Default: 1

tty=1

Photo frame refresh slide interval in seconds.

; Waveshare producer says it's best to wait min 180s between ; refreshing the display, so keep this value >= 180 ; Average photo preparation time (download + processing) may take up ; to 3 minutes on RasPi Zero so keep in mind that it will take ; some time on reboot.

Default: 600 (10 minutes)

slide_interval=600

Allow slide_interval multiplication.

When in photo description there is interval_mult_hotword and value,

e.g.

i.e. Frame 3

this photo will be displayed slide_interval * multiplication longer.

; Users should manually add this DESCRIPTION per photo.

Default:1 (option is enabled)

interval_mult=1

Hot-word to find in photo descriptions for the interval multiplication.

; Option interval_mult will not work without this. ; Don't leave it empty as someone can put for example ; year the photo was taken in it's description and it will ; mess it.

Default:Frame

interval_mult_hotword=Frame

Maximum interval multiplication for interval_mult.

; Option interval_mult will not work without this.

Every value above will be set to interval_max_mult value.

E.g. 10 when interval_max_mult=5 will result in slide_interval

Starting time for every day of the week of photo frame to start changing

photos.

Starting with Monday and Sunday is last.

; That will save power and will not update ; photo frame when it's not seen, e.g. at night. ; The values should be between 0:00 and 23:59. ; To change the format see modules/timermanager.py

Put - when frame should not work that day at all.

Default: 5:30,5:30,5:30,5:30,5:30,5:30,5:30 (start updating every day at

5:30 in the morning) start_times=5:30,5:30,5:30,5:30,5:30,5:30,5:30

Ending time for every day of the week of photo frame to stop changing

photos.

Starting with Monday and Sunday is last.

; That will save power and will not update ; photo frame when it's not seen, e.g. at night. ; The values should be between 0:00 and 23:59. ; To change the format see modules/timermanager.py ; Put - when frame should not stop updating that day and will ; work until start_times - or stop_times next days. ; - here when - same day in start_times will not update frame.

Put - everywhere to let frame work all the time.

Default: 23:30,23:30,23:30,23:30,23:30,23:30,23:30(stop updating every

day at 23:30 in the evening stop_times=23:30,23:30,23:30,23:30,23:30,23:30,23:30

This will allow to control power of HDMI (only) display.

Enabling will power off the display during stop times and power on

display during start times.

Default:1 (Enable power control).

control_display_power=1

This will allow to trigger (from web, bots, etc.) photo change or update

during off hours. Disabling will respect sleep time and supress triggers.

Default:1 (Enable triggers).

allow_triggers=1

[Image]

Used for e-Paper SPI black&white displays!

There are 6 standard types of conversion to black&white image (add more in

convertmanager module). Every option gives slightly different

results and you can pick the one best for your display. Types are:

1 - Floyd-Steinberg dither

2 - Floyd-Steinberg dither + high remap

3 - GIMP like result

4 - Floyd-Steinberg ordered dither

5 - direct conversion to black&white

6 - simple conversion to black&white + basic dither

; To add more see modules/convertmanager.py

Default: 1

convert_option=1

Width of the display. Default: 800 for the Waveshare 7.5inch paper

display 800x480 V2 image_width=800

Height of the display. Default: 480 for the Waveshare 7.5inch paper

display 800x480 V2 image_height=480

Convert photo to grayscale, used for HDMI/Composite displays.

1 for grayscale photo. Default: 0 (colorful)

grayscale=0

Colors number limit used for HDMI/Composite displays with limited palette.

Empty for no change and > 0 for specifying colors number.

Can be combined with grayscale option.

Default: empty

colors_num=

Invert colors - white will be black and black will be white.

; It can look interesting in frames with dark passe-partout frame.

1 for negative photo. Default: 0 (normal)

invert_colors=0

When image is smaller than the display

underlay will be added. Options: white, black or photo.

; photo will put blurred original photo underneath - takes more time to process.

Default:white

background_color=white

Determines if photo EXIF orientation

should be respected: digital cameras use orientation sensors to store

a value for how the camera is held.

This option makes processing time a bit longer.

Default 0 (do not rotate according to EXIF orientation value)

auto_orientation=0

Frame position - horizontal or vertical.

Default:1 (horizontal)

horizontal=1

Indicates if photo should be turned upside-down for horizontal frame

position.

Default:0 (normal)

turned=0

Frame rotation in vertical position.

Values: 90 (right) or 270 (left) degrees.

Default: 90

rotation=90

One of the image enhancements.

Calculates the mean values of an image, then applies a calculated -gamma

adjustment.

Default:0 (disabled)

auto_gamma=0

One of the image enhancements.

It finds the exact minimum and maximum color values in the image

and then stretches the values to the full range of values.

Default:0 (disabled)

auto_level=0

One of the image enhancements.

Increases the contrast in an image by stretching the range of intensity

values.

Default:0 (disabled)

normalize=0

One of the image enhancements.

Adjusts the photo brightness.

Value from -100(less) to 100(more) in % units.

Default:0 (no change)

brightness=0

One of the image enhancements.

Adjusts the photo contrast.

Value from -100(less) to 100(more) in % units.

Default:10 (+10% more)

contrast=10

Pimoroni Impressions e-paper displays saturation factor.

Possible values 0.0 - 0.99 float

Default:0.8

pimoroni_saturation=0.8

[Filtering]

Show random photos.

; Photos will be showed randomly once per ; whole collection turn, list will be updated on every run. ; With this option on asc/desc sort has no power.

Default=0 (no randomization, show in creation time order)

randomize=0

; All filtering options can be used in the same time (not only separately) ; to narrow number of photos

Starting creation date and time for photos filtering (everything after)

In format YYYY-MM-DD hh:mm:ss (e.g. 2020-05-01 10:01:17).

; To change the format see modules/filteringmanager.py

Empty means no low limit. Default: empty

photos_from=

Ending creation date and time for photos filtering (everything before)

in format YYYY-MM-DD hh:mm:ss (e.g. 2020-05-01 10:01:17).

; To change the format see modules/filteringmanager.py

Empty means no high limit. Default: empty

photos_to=

Number of photos to show. Only n first photos from the albums (and

filtered if set) will be shown. Empty means no limit. ; This will work only with randomize option disabled

Default: empty

no_photos=

Sort photos by creation date and time.

; This will work only with randomize option disabled

Options: none (no sorting), asc (ascending), desc (descending)

Default: none (no sorting)

sorting=none

[Weather]

Set 1 to show weather (icon and temperature) on the displayed photo.

; The rest of the values in this section should be filled as well when enabled.

Default: 0 (do not show)

show_weather=0

API key for the weather data.

; Get it for free on https://openweathermap.org

Default: empty

apikey=

Latitude of weather location.

; Get it here: https://www.maps.ie/coordinates.html

Example: 53.2734

Default: empty

lat=44.919285

Longitude of weather location.

; Get it here: https://www.maps.ie/coordinates.html

Example: 7.7783

Default: empty

lon= -123.317047

Weather information position.

; One of the values: 0, 1, 2, 3 ; 0 is for left-top corner ; 1 is for right-top corner ; 2 is for left-bottom corner ; 3 is for right-bottom corner

Default: 0 (left-top corner)

position=0

Weather information font size.

Default: 20

font=20

Weather information font color.

One of the values: white, black.

; Font stroke will be always in opposite color

Default: white

font_color=white

[Telegram bot]

; Please restart service after changing any of values in this section ; as bot thread is persistent per token and to not interfere threads ; it's better to re-run it

Set 1 to use Telegram bot to control frame from Telegram IM.

; The rest of the values in this section should be filled as well when enabled.

Default: 0 (disabled)

use_telebot=0

Telegram bot API token.

; Taken from BotFather Telegram Bot after creating new bot

Example: 1234567890:ABCDEFGAHIJKLMNabcdefghijklmn012345.

Default: empty

token=

Chat ids to talk with.

; Set the chat ids (take them from Telegram API) to narrow the chats that can control Telegram bot ; Multiple allowed - comma separated

Example: 123456789,-987654321.

Default: empty (everyone can control bot)

chat_id=

[Web interface]

; Please restart service after changing any of values in this section ; as webUI thread is persistent per port and host and to not interfere threads ; it's better to re-run it

Set 1 to use WebUI to control frame from the website.

; The rest of the values in this section should be filled as well when enabled.

Default: 0 (disabled)

use_web=0

ePiframe WebUI host.

Example: 127.0.0.1 (local only).

0.0.0.0 for (all) public IP address.

Default: 0.0.0.0

web_host=0.0.0.0

ePiframe WebUI port.

SOMETIMES YOU NEED TO OPEN IT IN YOUR FIREWALL SETTINGS!

Ports below 5000 need root privileges.

Value in 1-65535 range.

Default: 80

web_port=80

Set 1 to show and gather statistics (load, temp, mem) in

WebUI. It should not be noticed in device performance,

but disable if worried.

Default: 1 (enabled)

show_stats=1

Set 1 to load UI dark theme.

Default: 0 (disabled = light theme)

dark_theme=0

I'm using a waveshare 7.5 3 color., Im using epd_7in5b_V2.py

On Wed, Jan 25, 2023 at 10:28 PM Mike Gawi @.***> wrote:

Thanks for rising this issue.

What Waveshare display are you using? And what Waveshare package you have configured in display value in config.cfg.

— Reply to this email directly, view it on GitHub https://github.com/MikeGawi/ePiframe/issues/75#issuecomment-1404607393, or unsubscribe https://github.com/notifications/unsubscribe-auth/AUPNU7ZCLTT53CEHQ4GWYU3WUIKP7ANCNFSM6AAAAAAUG4NYU4 . You are receiving this because you authored the thread.Message ID: @.***>

MikeGawi commented 1 year ago

Please set display=epd_7in5b_V2 in config.cfg as currently you have epd_7in5_V2 BW display specified and let me know about results.

xdweaver commented 1 year ago

@.***:~/ePiframe $ ./ePiframe.py --test-display ePiframe - e-Paper Raspberry Pi Photo Frame 2023-01-26 00:55:08 : Verifying configuration... 2023-01-26 00:55:08 : OK! 2023-01-26 00:55:08 : Sending to display... Traceback (most recent call last): File "/home/pi/ePiframe/./ePiframe.py", line 909, in main() File "/home/pi/ePiframe/./ePiframe.py", line 610, in main test_display(config, logging) File "/home/pi/ePiframe/./ePiframe.py", line 765, in test_display display_manager = DisplayManager(config) File "/home/pi/ePiframe/modules/displaymanager.py", line 42, in init self.display = WaveshareDisplay(config) File "/home/pi/ePiframe/misc/wavesharedisplay.py", line 30, in init__ module = importlib.import_module("waveshare_epd." + self._display) File "/usr/lib/python3.9/importlib/init.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 1030, in _gcd_import File "", line 1007, in _find_and_load File "", line 981, in _find_and_load_unlocked ModuleNotFoundError: No module named 'waveshare_epd.epd7in5b_V2.py'; 'waveshare_epd.epd7in5b_V2' is not a package

On Thu, Jan 26, 2023 at 12:37 AM Mike Gawi @.***> wrote:

Please set display=epd_7in5b_V2 in config.cfg as currently you have epd_7in5_V2 BW display specified and let me know about results.

— Reply to this email directly, view it on GitHub https://github.com/MikeGawi/ePiframe/issues/75#issuecomment-1404693278, or unsubscribe https://github.com/notifications/unsubscribe-auth/AUPNU725OWHP7ZKFW2QNA2LWUIZULANCNFSM6AAAAAAUG4NYU4 . You are receiving this because you authored the thread.Message ID: @.***>

xdweaver commented 1 year ago

I see what I did wrong. I fixed it and it worked!! thank you..

On Thu, Jan 26, 2023 at 12:55 AM Daniel Weaver @.***> wrote:

@.***:~/ePiframe $ ./ePiframe.py --test-display ePiframe - e-Paper Raspberry Pi Photo Frame 2023-01-26 00:55:08 : Verifying configuration... 2023-01-26 00:55:08 : OK! 2023-01-26 00:55:08 : Sending to display... Traceback (most recent call last): File "/home/pi/ePiframe/./ePiframe.py", line 909, in main() File "/home/pi/ePiframe/./ePiframe.py", line 610, in main test_display(config, logging) File "/home/pi/ePiframe/./ePiframe.py", line 765, in test_display display_manager = DisplayManager(config) File "/home/pi/ePiframe/modules/displaymanager.py", line 42, in init self.display = WaveshareDisplay(config) File "/home/pi/ePiframe/misc/wavesharedisplay.py", line 30, in init__ module = importlib.import_module("waveshare_epd." + self._display) File "/usr/lib/python3.9/importlib/init.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 1030, in _gcd_import File "", line 1007, in _find_and_load File "", line 981, in _find_and_load_unlocked ModuleNotFoundError: No module named 'waveshare_epd.epd7in5b_V2.py'; 'waveshare_epd.epd7in5b_V2' is not a package

On Thu, Jan 26, 2023 at 12:37 AM Mike Gawi @.***> wrote:

Please set display=epd_7in5b_V2 in config.cfg as currently you have epd_7in5_V2 BW display specified and let me know about results.

— Reply to this email directly, view it on GitHub https://github.com/MikeGawi/ePiframe/issues/75#issuecomment-1404693278, or unsubscribe https://github.com/notifications/unsubscribe-auth/AUPNU725OWHP7ZKFW2QNA2LWUIZULANCNFSM6AAAAAAUG4NYU4 . You are receiving this because you authored the thread.Message ID: @.***>

MikeGawi commented 1 year ago

Great! Happy it worked! I will close this issue but don't hesitate to report new ones in the future.