Peppy WebRadio

  • Lassen Sie uns kurz den Player vergessen und versuchen Sie, ein einfaches Testprogramm auszuführen, das lediglich einen weißen Kreis auf blauem Hintergrund zeichnet. Bitte speichern Sie es in der Datei test.py und führen Sie Folgendes aus:

    python3 test.py

    Bitte lassen Sie mich das Ergebnis wissen.

    Freundliche Grüße

    -----------------------------------------------------------------------------------------------------------

    Let's forget about player for a moment and try to run simple testing program which just draws a white circle on a blue background. Please save it in file test.py and run:

    python3 test.py

    Please let me know the result.

    Best Regards

    Peppy Player Entwickler. Ehemaliger DESY (Hamburg) Entwickler :)

  • Hi,

    thanks for the test script. It works flowlessly - thats what i wanted to see (great). The touchscreen input is a little off, but i know that is a common problem and i haven't done the calibrating.

    I've done more testing. Setting "hdmi=True" fixed this issue. This display is attached to the Display Port (not GPIO).

    BUT the touchscreen doesn't work - no interaction possible (not responding - in the test program i could move the cursor). I will look at the LOGs and play around a while.

    Q: How can i quit the program? I haven't found a key to quit the programm (neither peppy nor the test program) to switch back to the text console.

    Thanks and Regards

  • Hi,

    i've used a pygame touchscreen test programm and the returned coordinates were off too. It seems that its is only a pygame problem. I've installed the Python FT5406 Multitouch Driver and tested it with the following code in console mode and it worked properly. Perhaps some small calibration is required, but i have to test it further.

    I think that the peppy.py code could be changed to use these package and driver. I look into it by myself in the evening.

    If you remove the GUI part (text) from the python-multitouch/examples/lines.py example, you have a FT5406 touch control within a console pygame window. Works!

    Einmal editiert, zuletzt von Koepisch (23. Januar 2019 um 13:07) aus folgendem Grund: lines.py

  • wenn Du es im Putty-Fenster gestartet hast (Windows), versuche: Strg + C

    Ich starte es direkt auf dem RPI. Mit 2 verschiedenen Tastaturen habe ich auch schon Strg+C /ESC und Sonstiges versucht, geht aber nicht. Die normalen Eingaben funktionieren über diese Tastatur, so dass das ein echt nerviges Problem ist, da ich immer den RPI neustarten muss.

  • Vielleicht die Antwort auf mein CLOSING Problem.

    KeyboardInterrupt won't be launched if keys are handled by pygame. Here's how you can detect the CTRL + C event.

    Code
    while True:
        for event in pygame.event.get():
            if (event.type == pygame.KEYUP and event.key == pygame.K_c and 
                event.mod & pygame.KMOD_CTRL):
                pygame.quit()
                sys.exit()

    PS:

    Das andere Testprogramm enthält auch einen Tastatur Exit (Esc). Dieser funktioniert bei mir einwandfrei. Ich denke dass ich die peppy.py für meine Anforderungen (7", Touch, Exit) entsprechend anpassen werde. Sollte alles funktionieren.

    Code
        for event in pygame.event.get():
            if event.type == KEYDOWN:
                if event.key == K_ESCAPE:
                    sys.exit()

    2 Mal editiert, zuletzt von Koepisch (23. Januar 2019 um 13:17)

  • Hallo Zusammen,

    ich hätte 2 Fragen bezüglich dem Radio.

    - Verbinden sich Bluetooth Speaker nachdem die Verbindung abgebrochen ist, entweder durch ein Reichweiten Problem oder weil der Akku leer ist, wieder von alleine, oder muss hier "Hand" angelegt werden?

    und

    - Ist es möglich, dass der letzte Stream beim Verbinden des Bluetooth Speakers automatisch wieder weiter läuft bzw. wenn es ein Radio Stream ist, dass dieser automatisch startet?

  • Hi Koepisch,

    This is great that you were able to resolve all issues. Are you using the official 7" display? It would be great to summarize all your findings in one post. I was thinking about making the disk image for the official display as well.

    Thank you!

    Yes, now i'm more confident that i get the things done. I use the official 7" display. Currently i study the peppy code to find the right places to integrate the new driver events. I don't know if i can skip the pygame "mouse events" completely. But i've also looked at the rotary encoder event raising - i could use this pattern too. I'm completely new to RPI, Linux and Python (but with professional developer background), so i have to learn a lot of things very fast. Stay tuned.

  • Hallo wusa,

    Meinen Du damit, dass der Player solche Probleme hat oder nur gefragt, ob der Player diese Funktion hat?

    Vielen Dank!

    ------------------------------------------------------------------------------------------------------------

    Hi wusa,

    Do you mean that the player has such issues or just asking if the player has this functionality?

    Thank you!

    Peppy Player Entwickler. Ehemaliger DESY (Hamburg) Entwickler :)

    Einmal editiert, zuletzt von peppy.player (23. Januar 2019 um 17:40)

  • Koepisch,

    I'm not sure that there is the need in that driver. Maybe it's just the question of calibration (?) That driver is just a Python program which is using events from the input device. The configuration of the screen including touchscreen happens in util/config.py in the function init_lcd. You can check if you really have the input devices mentioned in that function: /dev/fb0, /dev/input/touchscreen or /dev/input/event0.

    The main event handling loop is in the event/dispatcher.py

    Best Regards!

    Peppy Player Entwickler. Ehemaliger DESY (Hamburg) Entwickler :)

  • Koepisch,

    I'm not sure that there is the need in that driver. Maybe it's just the question of calibration (?) That driver is just a Python program which is using events from the input device. The configuration of the screen including touchscreen happens in util/config.py in the function init_lcd. You can check if you really have the input devices mentioned in that function: /dev/fb0, /dev/input/touchscreen or /dev/input/event0.

    The main event handling loop is in the event/dispatcher.py

    Best Regards!

    I've tried a lot but the touch doesn't work with the pygame event handler (touch points are off). The original touch data isn't routed properly via pygame. Currently i think i have to integrate the touch events from the new driver. But currently doesn't know how i should change the dispatcher.py.

  • Wollte nur fragen, ob der Player diese Funktionen hat.

    Der player macht nichts im zusammenhang mit der Bluetooth. In bezug auf diese funktionalität ist der bluealsa-treiber vollständig abhängig.

    Wenn jemand einen Bluetooth hat, der mit dem player verbunden ist, kann er das überprüfen und kommentieren. Ich habe momentan kein solches setup.

    -------------------------------------------------------------------------

    The player doesn't do anything related to the Blutooth. It relies completely on the bluealsa driver regarding this functionality.

    If anybody has a Bluetooth connected to the player they can check and comment. I don't have such setup at the moment.

    Peppy Player Entwickler. Ehemaliger DESY (Hamburg) Entwickler :)

  • I've tried a lot but the touch doesn't work with the pygame event handler (touch points are off). The original touch data isn't routed properly via pygame. Currently i think i have to integrate the touch events from the new driver. But currently doesn't know how i should change the dispatcher.py.

    I'm just trying to understand how that driver makes things working. It's using the same input device as you can see in the function _touch_device in this file:

    https://github.com/pimoroni/pytho…brary/ft5406.py

    So more likely the touchscreen device is /dev/input/event0

    It's the same as used by the player/pygame in the function lcd_init.

    Let me check if anybody else reported about this issue... If that's the bug I can contact Pygame developers. I just need to have more details.

    Thank you!

    Peppy Player Entwickler. Ehemaliger DESY (Hamburg) Entwickler :)

  • How much coordinates are "off" in terms of pixels? Maybe the easiest way is to add a "software callibration" - just add a shift to the x,y coordinates of the mouse events. Also I hope that you followed the steps described in the section 'Pygame Configuration' on this wiki page:

    https://github.com/project-owner/Peppy.doc/wiki/Expert

    Peppy Player Entwickler. Ehemaliger DESY (Hamburg) Entwickler :)

    Einmal editiert, zuletzt von peppy.player (23. Januar 2019 um 19:48)

Jetzt mitmachen!

Du hast noch kein Benutzerkonto auf unserer Seite? Registriere dich kostenlos und nimm an unserer Community teil!