project-owner / PeppyMeter

PeppyMeter Repository
GNU General Public License v3.0
62 stars 13 forks source link

Exit on touch and i2c #6

Closed adolfotregosa closed 2 years ago

adolfotregosa commented 2 years ago

Hi. Is there a way to make exit on touch only apply to display and not i2c?

I2c update time is affecting the display vu meters. Makes it difficult to fine tune both, any way around this?

Thank you

project-owner commented 2 years ago

You can always enable/disable a particular output using the properties in the configuration file config.txt: https://github.com/project-owner/PeppyMeter/blob/914ebcabe037df5854ad2ac0939084b816857c5b/config.txt#L8 So you can disable I2C output and work with display. Then disable display and work with I2C. Please let me know if it helps.

adolfotregosa commented 2 years ago

Sorry, does not help. I was asking both at the same time but make exit on touch only affect display, keep i2c working. I2C update.period parameter is affecting display animation. Why ?

project-owner commented 2 years ago

You can try to replace this line: https://github.com/project-owner/PeppyMeter/blob/914ebcabe037df5854ad2ac0939084b816857c5b/peppymeter.py#L224 by these two lines (make sure that you use 8 spaces in front of each line as Python is sensitive for that):

        self.meter.stop()
        pygame.quit()

The I2C period affects the display animation because both use the same data source (named pipe). If for example I2C fetched value from the pipe that value is not available for the display anymore.

adolfotregosa commented 2 years ago

It works, thank you. It is difficult to integrate it on a player. It would be useful if peppy had some kind of way to start/stop/pause/on/off command line switches.

https://youtu.be/2rITU_s8SUg

POC working

project-owner commented 2 years ago

You POC looks good. Do you mean to control PeppyMeter from command line? I think it's doable using web server which would listen for commands from command line. That needs some time to implement. At minimum I can add flag to the config.txt which will enable those suggested two lines.

adolfotregosa commented 2 years ago

You POC looks good. Do you mean to control PeppyMeter from command line? I think it's doable using web server which would listen for commands from command line. That needs some time to implement. At minimum I can add flag to the config.txt which will enable those suggested two lines.

Yeah, the way the community is controlling peppymeter seams like a hack when it would be a lot easier to integrate to any player if peppy had a official way to control it. Have look at the following script. We are killing peppymeter to stop it and I am using i2cset to turn off leds. If peppy "knew" about pause or stop conditions it would be able to gracefully reset and control the start and stop of the vu meters , cool stuff. Killing software to stop it seams wrong lol

https://drive.google.com/drive/folders/1GWah30HWA-9XfSwMqmCdPrUm5jNerAK5?usp=sharing

PS: My poc is using pcf8575 so I had to do some changes to i2cinterface.py

project-owner commented 2 years ago

So you need a programmatic way to stop/start meter. That's a little bit different from command line. OK, I'll keep this issue open as enhancement. Whenever I have time I'll try to implement it.

adolfotregosa commented 2 years ago

Thank you for your time !

project-owner commented 2 years ago

In the latest release I added new configuration property: https://github.com/project-owner/PeppyMeter/blob/e87489345aa1488e5d97c756e90271fdd6ba8943/config.txt#L8 Which enables this code: https://github.com/project-owner/PeppyMeter/blob/e87489345aa1488e5d97c756e90271fdd6ba8943/peppymeter.py#L222

For a better integration with PeppyMeter you need to use it as a module/library. Something similar to this: https://github.com/project-owner/PeppyMeter/blob/e87489345aa1488e5d97c756e90271fdd6ba8943/peppymeter.py#L278

As an example of such integration you can use Volumio PeppyMeter plugin: https://community.volumio.org/t/project-with-peppymeter-screensaver-plugin-for-volumio-v2-9xx-and-3-0xx-buster

adolfotregosa commented 1 year ago

Hi. Just to share with you my project with PeppyMeter screen + i2c . Thank you for your work.

https://youtu.be/NoK5b-F8b44

project-owner commented 1 year ago

Hi, thank you for sharing your project! It's very well done. There are not so many projects having hardware VU Meters (I2C etc)