peteoheat / pibooth-neopixel_spi

Implementation of pibooth-neopixel that uses SPI instead of PWM
7 stars 1 forks source link

LEDs only work with testfiles, not with pibooth #4

Closed bennnil closed 1 month ago

bennnil commented 2 months ago

I can not get the plugin to work. The provided testfiles work great, I have added the part to the printer config and it does not give me any errors. However the Leds stay dark no matter what I do.

Do you have a hint for me how to check if the plugin is correctly loaded ?

Thanks in advance!

lxne commented 1 month ago

How does your config part look like?

bennnil commented 1 month ago

Hey @lxne, my config looks the following:

[GENERAL]

User interface language: 'fr', 'de' or 'en'

language = de

Path to save pictures

directory = /home/pi/Bilder/pibooth

Cleanup the 'directory' before start

clear_on_startup = False

Start pibooth at Raspberry Pi startup

autostart = False

debug = True

Show fail message and go back to wait state in case of exception

failsafe = True

plugins = ["/home/pi/Downloads/pibooth/pibooth_neopixel.py"]

[WINDOW]

The (width, height) of the display window or 'fullscreen'

size = (800, 480)

Blinking background when a capture is taken

flash = True

Animate the last taken picture by displaying captures one by one

animate = True

How long is displayed the capture in seconds before switching to the next one

animate_delay = 0.2

Show arrows to indicate physical buttons: 'bottom', 'top' or 'hidden'

arrows = bottom

Apply horizontal offset to arrows position

arrows_x_offset = 0

How long is the preview in seconds

preview_delay = 2

Show a countdown timer during the preview

preview_countdown = True

Stop the preview before taking the capture

preview_stop_on_capture = False

[PICTURE]

Orientation of the final picture: 'auto', 'portrait' or 'landscape'

orientation = landscape

Possible choice(s) of captures numbers (numbers between 1 to 4)

captures = 1

Effect applied to the captures (list of quoted names accepted)

captures_effects = none

Crop each capture border in order to fit the paper size

captures_cropping = True

Main text displayed

footer_text1 =

Secondary text displayed

footer_text2 =

RGB colors used for footer texts (list of tuple accepted)

text_colors = (0, 0, 0)

Fonts name or file path used for footer texts (list of quoted names accepted)

text_fonts = ('Amatic-Bold', 'AmaticSC-Regular')

Alignments used for footer texts: 'left', 'center' or 'right' (list of quoted names accepted)

text_alignments = center

Overlay path (PNG file) with same aspect ratio than final picture (list of path accepted)

overlays = /home/pi/Desktop/overlay.png

Background RGB color or image path (list of tuple or path accepted)

backgrounds = (255, 255, 255)

[CAMERA]

Adjust for lighting issues, normal is 100 or 200 and dark is 800 max

iso = 700

Flip horizontally the capture

flip = False

Rotation of the camera: 0, 90, 180 or 270

rotation = 270

Resolution for camera captures (preview will have same aspect ratio)

resolution = (2592,1944)

[PRINTER]

Name of the printer defined in CUPS (or use the 'default' one)

printer_name = default

How long is the print view in seconds (0 to skip it)

printer_delay = 5

Maximum number of printed pages before warning on paper/ink levels (0 = infinite)

max_pages = 0

Maximum number of duplicate pages sent to the printer (avoid paper waste)

max_duplicates = 1

Print 1, 2, 3 or 4 picture copies per page

pictures_per_page = 1

[CONTROLS]

How long to debounce the hardware buttons in seconds

debounce_delay = 0.5

Physical GPIO IN pin to take a picture

picture_btn_pin = 11

Physical GPIO OUT pin to light a LED when picture button is pressed

picture_led_pin = 7

Physical GPIO IN pin to print a picture

print_btn_pin = 13

Physical GPIO OUT pin to light a LED when print button is pressed

print_led_pin = 15

Physical GPIO OUT pin to light a LED at pibooth startup

startup_led_pin = 29

Physical GPIO OUT pin to light a LED during preview

preview_led_pin = 31

lxne commented 1 month ago

Which version of pibooth are you using?

Do you see the plugin on startup? Something like neopixel…

Bildschirmfoto 2024-08-17 um 17 43 55

You renamed the file to 'pibooth_neopixel.py', right?

I added it like this and it is working…

Bildschirmfoto 2024-08-17 um 17 50 40

Did you edit the file content? Two things to check

If the lights are running you might have to play around with the multiplier here: time_between_pixels = raw_time_between_pixels * 1.7 With 32 LEDs and a 5 seconds preview, I had to set it to 1.7 for it to have good timing.

bennnil commented 1 month ago

Thanks for looking into this. It seems it was a problem with a PATH variable that has been declared such that the changes I made were not used. I did a whole new setup with pibooth to figure this out. Now it works like charm!