Coder Social home page Coder Social logo

mikegawi / epiframe Goto Github PK

View Code? Open in Web Editor NEW
58.0 6.0 10.0 12.42 MB

ePiframe is an e-Paper (or HDMI, Composite display) Raspberry Pi Photo Frame with Google Photos and more

License: GNU General Public License v3.0

Python 81.90% Shell 2.63% HTML 6.07% JavaScript 9.39%
digital-frame photo-frame google-photos google-photos-api e-paper raspberry-pi epiframe

epiframe's People

Contributors

guaycuru avatar kalmard0 avatar mikegawi avatar motoxcrazy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

epiframe's Issues

No Service Debug option

Service deamon is surpressing all output and errors by default, even configuration/access errors, etc. There should be a disable option for troubleshooting.

Frame is not starting exactly on wake time after sleep

As I'm basing frame update on the photo update interval, frame is not refreshing exactly on configured wake time. It would be better to check time every minute during the sleep period and do not show this information every time in logs to not pollute its content, i.e. show the sleep information every 10 minutes.

Easier Google Photos activation

I've heard some rumours that ePiframe activation for Google Photos is hard, problematic and not up-to-date. The problem is that due to security requirements activation can be done only on localhost (or public domain) also that steps needed on Google Cloud Console are poorly described and why ePiframe can't be the activation platform?! (Not that I'm saying that there were some changes on API too)

Well, it can.
After hours of research I've found a very nice workaround to localhost and public domain security requirements. You can receive an access code that can be displayed anywhere and used to get the access token.
I'm thinking about a script that will have two functionalities:

  • web version - with fancy screenshots and annotations, steps and Flask+Bootsrap magic, that can work after the installation as a Web Interface or started from install script.
  • console version - for people in hurry. Just text, plain instructions, fast and easy, that can be started on any device with python and prerequisites.

Ascending photo sorting is not working

ePiframe can sort photos by creation date in an descending order but it doesn't do anything with the photo list when descending sort is disabled. It just rely on the sorting provided by Google Photos but what if it's wrong?

HDMI e-paper screens

Is it possible to configure ePiframe for use with an HDMI ePaper screen? I am specifically interested in the 13.3" waveshare screen. I have two pi zero w boards without headers and the hdmi interface would make a very thin and clean setup.

ePiframe doesn't work with Google Python API version > 2

User koeljong informed me on MakerBot Thingiverse that ePiframe is not working with Google Python API version > 2. Thanks for the hint, koeljong. For now the only solution is to downgrade to 1.12.5 (sometimes it's better to uninstall first with sudo -H pip3 uninstall google-api-python-client) by:
sudo -H pip3 install -I --upgrade google-api-python-client==1.12.5 google-auth-httplib2==0.0.4 google-auth-oauthlib==0.4.2

Instructions and scripts will be updated in the next release. You can check the current version of the PIP packages with: pip3 show google-api-python-client

In the future I will do a more proper solution and adapt the code to the newest API version.

Add Telegram bot service to control frame and upload photos

Add Telegram bot service to perform some basic activities:

  • Show help
  • Ping frame
  • Echo
  • Show frame status
  • Reboot frame
  • Show next update time
  • Trigger frame update
  • Show current photo
  • Show current original photo
  • Set current photo to display # times longer
  • Uploading photo will be converted and shown on frame

Best choice is to use pyTelegramBotAPI to achieve that.
Telegram bot should be optional and inside ePiframe Service, running as a separate thread independently from ePiframe main functionalities.

Improve photo convert time by working on target size

I think I'm getting better how the ImageMagick conversion works after all these months watching it refreshing my frames and I've noticed that this knowledge can help significantly speed up the photo conversion which is currently the most resources demanding process of whole ePiframe refresh mechanism. My findings:

  • smaller images convert faster
  • percentage value in scale is slower than exact image size
  • blur should depend on original photo size
  • 'process big then resize to target size' and 'resize big to target size then process' give almost same results

With these observations I can find some optimizations for the conversion code.

Add a WebUI test tool to check functionality

As ePiframe has WebUI functionality to control the frame from web interface, it would be great to have a small tool to troubleshoot port issues, IP, access firewall troubleshooting, etc.

API

Allow controlling ePiframe from a simple API attached to WebUI module in Flask. Authentication with API key (from users DB) possible or with authentication header (basic encoding). Old users will get API key automatically. Database needs to be reorganized and backward compatible.

Python module versions

I have just completed 3 separate installations of ePiframe. Each system is identical and includes a raspberry pi zero w rev 1.1 with the 7.5" waveshare epaper screen. The automatic installation script operated normally, however each one had an error at a different steps - all with installing python modules via pip3. In each case, the module was installed manually, then the automatic script rerun. All completed without errors on the rerun of the install script.

Once the installation was completed, an addition error occurred and is the same on all three systems. When attempting to run ./ePiframe.py with any argument returns "Illegal instruction"

I wrote a script with only the imports from ePiframe.py and commented each out one by one to determine the issue. The modules that create this error are: configmanager, albummanager, randommanager, photomanager and filteringmanager
I believe that this is likely an architecture mismatch with one of the modules that is being installed via pip. Can you provide a list of versions of each module from a working system?

A similar issue occurred during an initial installation - the current version of raspbian was installed, but the automatic installation script and the manual method failed because several of the required packages are not available for the latest version of raspbian. I installed the legacy version of raspbian and the installations completed successfully.

pyTelegramBotAPI is not upgrading

As pyTelegramBotAPI documentation says:

While the API is production-ready, it is still under development and it has regular updates, do not forget to update it regularly by calling pip install pytelegrambotapi --upgrade

ePiframe should upgrade pyTelegramBotAPI during the update.

Device statistics

I was always jealous about the graphs in RPi-Monitor by @XavierBerger - a brilliant tool for monitoring RasPi, very popular and nicely performing on one of my RPi Zero.

Imitation is, of course, the highest form of flattery so I've looked in the code (yay for the Open Source!) and noticed that RRDtool, javascriptRRD and Flot are used. Maybe it would be good to embed this in ePiframe to have it under one tool?

RRD (Round Robin Table) for time series is a genius creation of Tobias Oetiker: easy, embedded (DB in a file), fixed size, etc. Of course I could use InfluxDB but I was terryfied with the client-server architecture on RPi Zero, maintaing external services, etc. There are other good embedded time series databases but I want to give RRD a try.

The goal:
Add ePiframe device statistics to WebUI: gather information, display it as a graph, pick a time window, check values, zoom, etc. I'm thinking of loads, memory and temperature.

Local mode [feature request]

Hi, first I want to thank you for this great project :) I modified it a bit and now use it with a waveshare 5.65 inch 7 color eink display.

What I miss is the possibility to use local files. This would be a great addition, because with a local mode and rclone (https://rclone.org/), nearly every cloud storage could be used with ePiframe ๐Ÿ’ฏ

What do you think? Would it be possible for you to implement this?

Add web interface

Add web interface based on Flask for configuration, control and photos upload.

Show next update time, status, service status, machine state, upload/change photos, show current original and converted photo, check logs, control system and change configuration. Port specified, dynamically changing content, mobile friendly, etc.

Configuration file backward compatibility

Add configuration file backward compatibility so that old config.cfg file can be used in the newer ePiframe version and all non-existing values are set to defaults during configuration load.

No control of photo contrast option

In one of the conversion patterns there is a small contrast enhancement hardcoded. Why not have this set up as a setting that everyone can control? And other enhancements as well - brightness, level control, etc. to improve and control how photos are displayed on ePiframe.

Showing the wrong original photo

Sometimes the wrong original photo (not the thumbnail) is shown in WebUI or sent from Telegram Bot. The last one is taken by the file timestamp.

Raspberry Pi Zero W reboots after sleep hours of ePiframe

On three RPi Zeros (model W, version 1.1) I've tested, one was rebooting automatically after sleep hours of ePiframe. It happened only on Zero version and all were bought in the same shop, same model, used same SD card with the same OS, used same PSU, cable and display. I've spent month on this trying everything (check below) and almost went nuts as nothing helped.

Luckily ePiframe doesn't care about reboots as it is controlled by system-level service that will run frame whenever it is needed and will start just after boot - that device works great as ePiframe and user is not complaing, but yet that problem haunted me.
Unfortunately I had to give the device away and can't test the reason anymore but I thought it would be fair to mention this here.

Usually when Pi keeps rebooting this is A HARDWARE PROBLEM:

  • check/change PSU - 99.99999% fault. Display is powered from Raspberry Pi so from my tests I can say that solid 5V 3A power supply is the best also for the displayed photo quality (no shadowing, no shifts, etc.);
  • check/change cable that is used for powering Raspberry Pi - common problem so play with different cables;
  • use display wires instead of HAT - see here;
  • faulty Raspberry Pi - yes it happens. I've seen a lot of this in the Internet so try with different ones;
  • try with different SD card - RPi can crash and reboot with corrupted card;
  • check and adapt display scripts - I mentioned about this here (at the bottom). There are some issues when display wakes up from deep sleep. Also keep an eye on the Waveshare libraries releases as some other fixes may appear;
  • minimize number of running scripts and processes - Zero is slow so if You have something else running, disable it and test again;
  • play with over-voltage option - this is my best idea but I haven't tested it with the faulty device. Some say that due to CPU and memory inrush after being idle it may happen that Raspberry Pi will boot by itself. You can check the fault with vgencmd get_throttled;

The things I checked:

  • overclocking, RPi temperature monitoring, etc;
  • disable Wifi sleep mode, Wifi USB dongles;
  • ePiframe code fixing and logs - it rebooted in various phases of ePiframe, not during putting photo on display but even during configuration check;
  • system journals, logs, etc - haven't found any useful clues;
  • different Raspberry Pi OS versions, not only Lite but Desktop version, clean installed system too. Also I tried with other distributions - no luck

not mentioning hardware and system configuration changes (ZRAM, less RAM for GPU, unistalling everything what was not needed, different SD cards and power units and cables and more and MORE AND MORE), ... that issue was a true pain in the back for me.

I'm open for new hints to fix this permanently so if someone has issue like that (and none of my ideas work) please describe it here, give OS details and let me know how I can help. Or maybe someone had symptoms like that and know how to fix them?

Add a Telegram bot test tool to check functionality

As ePiframe has Telegram bot functionality to control the frame from Telegram, it would be great to have a small tool to troubleshoot bot token, check messages, get chat ids for the configuration, etc.

Problem converting GIF files

ePiframe should be able to convert GIF files (only the 1st frame) with --test-convert option but it returns an exception.
./ePiframe.py --test-convert file.gif

GetToken tool ignores input

The GetToken tool that is used for getting the token pickle file here and is helping with Google Account authentication ignores data input. Anything written in the input dialogs has no impact on the script run as values are always defaults.

WebUI multithreading problem

As I am currently in the middle of a huge code refactorization, I've noticed that WebUI manager shares some global variables (__form and __current) that are not thread safe. I've never noticed anything wrong with the Website concurrency but still that needs to be fixed. Problem is probably a leftover from the design phase or just my stupidity...

Specify PIP versions

ePiframe installer should install specific PIP versions as for older packages ePiframe can fail (e.g. wtforms have different modules structure starting version 3.0). Minimal and optimal values should be added.

Broken style in Web Login window

As Bootstrap package had some small modifications its integrity is broken thus the style is not properly loaded into Login window. Integrity should be removed and that should fix the style.

Settings import/export

Add possibility to export and import all ePiframe settings in WebUI with validation, error handling etc.

Connection timeout during PIP installation/upgrade

When running install/upgrade script it happens that during PIPs installation the connection timeout error shows up even though there's nothing wrong wite the connection. Probably due to too many calls at once.

Reconnect problem

When Wifi goes down sometimes Telegram Bot or Web UI is not reconnecting and ePiframe needs to be restarted. That is probably because of not handled or not properly handled exception.

Users and passwords for web interface

It would be great to have a possibility to secure WebUI with username + password. Multiple usernames possible, added to a DB (SQLite) from the command line with possibility to add, delete users, change password, etc. If no users are in DB (default) then no authentication to WebUI is needed. Log out function added to WebUI should be visible only if user has been authenticated and nice Log In window that blocks entering to any site. NO PASSWORDS STORED IN THE DATABASE!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.