splitti / oled_phoniebox

oled_phoniebox
24 stars 16 forks source link

Shutdown #2

Closed nubbler closed 5 years ago

nubbler commented 5 years ago

I'm very new in this Topic, but have successful installed the phoniebox with the oled Display.

I'm working with two Rotary knobs for volume control (press for pause) and next/Previous (press for shutdown).

  1. Is there any possiblility to keep the shutdown function with the oled Display? OR is GPIO3 the only one who the shutdown can work? So if I2C needed, no shutdown function?

  2. Is there any other possibilitie to change to get the wlan information on the display or change the mode? Because I have the rotary knobs, it's impossible to press next/Previous on the same time....

Thank you for the great work! Installation was successful on the first try without any problems!

splitti commented 5 years ago

Hi,

  1. You can change the GPIO to any other on the gpio-buttons.py
  2. There are many ways, but you have to develop them. I tried to find a solution for the greatest mass of oled Users. Please tell is more about your setting, maybe i can help you...
nubbler commented 5 years ago

Hi,

  1. ok, set it to GPIO4 and it works. I had in mind that it will only work with GPIO3, but it was the power-up from firmware halt that only work with GPIO3 (Wiki "Using GPIO hardware buttons"). Do you know the reason why (want just to understand the background)? But it's not so important for me, only the shutdown is needed...for the power-up I have the USB-switch cable between powerbank and Pi.

  2. Setup are the two rotary knobs (one with vol+/vol- and push halt; one with next/prev and push shutdown). I use an raspberry Zero W. Next plan (when housing painting is finished) is to add the contrast buttons. Maybe a function to change the buttons from "Next/Prev 2sec" to "contrast+/contrast- 2sec" will work for me. Can I change the defined GPIOs by myself in the code? So far i didn't find them.

  3. I'm not sure, but I think I have found a small bug: I have added some test content, some audio folders and one radio stream (Kinderradio from laut.fm). Config was the "Full" mode When the system was freshly booted, and I start with the RFID Card for the radio stream, the play screen will be viewed and stay permanently. The display doesn't switch to the play view. When I start with a RFID Card for an audio folder the change to the play view work. Then I change then to the stream again, the play view will also come for the radio stream. So the behavior will only occur then I start with the radio stream after boot.

Again, thank you for your work! I like the Display a lot.

splitti commented 5 years ago
  1. Sorry, don't know
  2. Yes, it is really easy to change the Code. It is the GPIO-buttons.py in the scripts/gpio-buttons Folder.
  3. I will check this as soon as possible, but i think it takes a few days, sorry.

I am happy with every User liking my script. Thank you for your Feedback!!!

nubbler commented 5 years ago

Hi all,

ok, here is my setup with two buttons for the contrast & wlan info/ mode change:

def def_contrastup(): if cminus.is_pressed == True : check_call("/usr/bin/touch /tmp/o4p_overview.temp", shell=True) else: check_call("/usr/bin/python3 /home/pi/oled_phoniebox/scripts/contrast/contrast_up.py", shell=True)

def def_contrastdown(): if cplus.is_pressed == True : check_call("/usr/bin/touch /tmp/o4p_overview.temp", shell=True) else: check_call("/usr/bin/python3 /home/pi/oled_phoniebox/scripts/contrast/contrast_down.py", shell=True)

cplus = Button(21,pull_up=True,hold_time=2.0,hold_repeat=False) cminus = Button(13,pull_up=True,hold_time=2.0,hold_repeat=False)

cplus.when_held = def_contrastup cminus.when_held = def_contrastdown

splitti commented 5 years ago

So, i fixed point 3, the bug with Radio. Please update the repo, restart services and give me feedback, if everything works fine!

Remember: save your own gpio-buttons-File! On common releases, there could be also changes!

nubbler commented 5 years ago

yeah, everything works fine :-). THank you again for the great work. My daughter loves her "singsing"