Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Turn off screen from remote system (ex. via URL) #189

Open
Snille opened this issue Apr 26, 2021 · 37 comments
Open

Turn off screen from remote system (ex. via URL) #189

Snille opened this issue Apr 26, 2021 · 37 comments

Comments

@Snille
Copy link

Snille commented Apr 26, 2021

Hi there! I'm on my way to save energy, so I'm using HA (Home Assistant) to manage my "screens" at home. I have multiple motion detectors placed in the house so, when non of them are "triggered", after a while (or by looking where our phones are) I turn off screens (and other stuff) that is not needed when nobody is home or asleep. I'm for the moment using a schedule to turn off the screens on my frames, but is there a way to remotely send a "turn off screen" command, I'm thinking via an API och just by visiting http://myframeip:7777/control/screenoff or http://myframeip:7777/control/screeon (or similar)?... If not possible already, maybe it's a good idea? :) There could be an option in the config to enable it?

@dadr
Copy link
Contributor

dadr commented May 19, 2021

I love your idea! I have SmartThings for home automation, and it would be useful with that as well. It would be great if the photo frames would turn off when I say "goodnight" to my home automation. I can also see this working among photo frames if one has the light sensor and others do not. They might sub/pub to such an interface. This seems reasonably do-able, and the photoframe already configures through the URL -- but it might get more complex if you need to reach the URL from a host outside your home network.

@Snille
Copy link
Author

Snille commented May 19, 2021

Sounds good! :) No need to be able to reach it from "outside" in my case, I'm using Home Assistant and it's all local lan. :)

@dadr
Copy link
Contributor

dadr commented Jun 9, 2021

Hi Snille, (and this may interest @JuliAn50M ) I've got a branch worked out with this feature, and I wanted to reach out and see if you would be up for testing. It's based on the python3 branch (future version of photoframe). If you are up to testing and doing a manual install, your help and feedback would be great. I can provide some basic instructions, and when we think it's ready, I'll do a PR to let Henric add it to the python3 branch here. What do you think? I'm asking first because this will require quite a bit of work on the command line, and it will help if you're generally familiar with linux on the Raspberry Pi.

@Snille
Copy link
Author

Snille commented Jun 9, 2021

Hi! I'm in! :) I just reinstalled one of my frames because (I think the SD-Card was messed up). But the new install has a broken GUI after updating the OS and the frame to the last version. I gladly try out the new version! :) And I'm not afraid of the console. :)
Thank you!

@mrworf
Copy link
Owner

mrworf commented Jun 9, 2021

Curious, how is it broken?

@dadr
Copy link
Contributor

dadr commented Jun 9, 2021

OK, with that in mind, I'm also going to ask that you take some notes and provide feedback on the instructions ;-).

Have a look at the readme here: https://github.com/dadr/photoframe/tree/feature/screen-off-url

Those instructions should get through a fresh install, but substitute this for the similar git command at line 145:

git clone --branch feature/screen-off-url --single-branch https://github.com/dadr/photoframe.git

I've added the notes about this feature (and the URLs) to the readme there.

Once you're all done and this is pulled into the python3 branch here, you can remove the /root/photoframe directory and use the documented git command to get back on the main (v2) branch. It will keep all your settings. ( no need for another install from scratch. )

And thanks again for helping out.

@Snille
Copy link
Author

Snille commented Jun 9, 2021

Curious, how is it broken?

@mrworf After reinstall (tried it 3 times on 2 different (new) SD-cards). When it first boots, it works. I can add the Google album. But the version on the "image" is an old version, missing some features. So I want to update to the latest. After that (and a restart) I only get to the "fail safe" page in the GUI. The "slideshow" still works, but I cant change any settings. :)

@Snille
Copy link
Author

Snille commented Jun 9, 2021

@dadr Great! I'll get on it tomorrow! :)

@mrworf
Copy link
Owner

mrworf commented Jun 9, 2021

Can you grab logs from the system? Would love to find out what's wrong so the image works.

@dadr
Copy link
Contributor

dadr commented Jun 9, 2021

I've also had an SD card fail. It did reformat rather than fail hard, so I don't think it was worn out. Nevertheless it convinced me to do some testing with making /tmp a RAM-based filesystem. Doing that does make the system marginally faster b/c all the image "trans-morgrification" is written to RAM instead of disk. That can help if you have a Pi3 with a lot of ram, but on average it was a wash on my Pi Zeros because it made them use swap instead. Either way, it seemed, you had to write to the SD card.

@Snille
Copy link
Author

Snille commented Jun 10, 2021

Can you grab logs from the system? Would love to find out what's wrong so the image works.

@mrworf Sure, here you go :) Logs
Let me know when you have downloaded so I can remove them... :)

@Snille
Copy link
Author

Snille commented Jun 10, 2021

OK, with that in mind, I'm also going to ask that you take some notes and provide feedback on the instructions ;-).

Have a look at the readme here: https://github.com/dadr/photoframe/tree/feature/screen-off-url

Those instructions should get through a fresh install, but substitute this for the similar git command at line 145:

git clone --branch feature/screen-off-url --single-branch https://github.com/dadr/photoframe.git

I've added the notes about this feature (and the URLs) to the readme there.

Once you're all done and this is pulled into the python3 branch here, you can remove the /root/photoframe directory and use the documented git command to get back on the main (v2) branch. It will keep all your settings. ( no need for another install from scratch. )

And thanks again for helping out.

@dadr Ok, installed, however I get the "Failsafe-page" when I want to configure... Same as with a new install (after update) of the v1.

Info:
Pi Zero Wifi (but I'm using ethernet for this).
No color-sensor
16gb Class 10 SD-Card
Using this screen (discontinued)
Here is the "failsafe" page.

Let me know what else you want to know? :)

@dadr
Copy link
Contributor

dadr commented Jun 10, 2021

Good Morning from sunny ATL - just saw your comment. And thanks for the log report. I'm confused a little, because there is another "failsafe page" that differs from the log report and is much more terse. Is this one you attached what you get, or is it the other?

In either case, I would try to reset my browser cache and make double sure that the URL is just the photoframe IP without anything behind it. (e.g. make sure it does not end in /debug) Sometimes the browsers these days try to be helpful and add the rest of the URL they "think" you are typing rather than the one you want.

You can also try http://raspberrypi.local (unless you have changed the hostname during the install) That sometimes works around a stubborn browser.

Does the screen say "Please configure photoframe" ?

And I spot another thing I should fix. It looks like ddcutil and /dev/i2c-2 are both working, but your monitor does not respond to brightness or contrast queries. It would help me if you could do:
sudo ddcutil capabilities > results.txt
and then share that file. I suspect it says that there are no capabilities for your monitor.

@Snille
Copy link
Author

Snille commented Jun 10, 2021

Hi again... Sunny here too, afternoon though... :)

Here is the page that show up:
image
The one I attached in the comment (to you @dadr) was from the "create bug report" from that page. :)

Yes, on screen I see:
image

When running the ddcutil (in SSH not on the actual console) there is not output in the file.

root@raspberrypi:~# sudo ddcutil capabilities > results.txt
Display not found
root@raspberrypi:~# ls
cache  history  photoframe  photoframe_config  results.txt
root@raspberrypi:~# cat results.txt
root@raspberrypi:~#

Let me know... :)

@dadr
Copy link
Contributor

dadr commented Jun 10, 2021

Thanks for all the good info.

Just confirming, you are only connected to your LAN with WiFi?

Try ip a from the ssh shell, and make sure that the IPv4 address matches the one on the screen.

Do you get the same result when you try the URL: http://raspberrypi.local/

Also, is there another device with a browser (like a smartphone) that you can try? Both IP and URL

From ssh you can also check permissions on the /root/photoframe* directories as well as the files inside the /root/photoframe_config. The directories should be drwxr-xr-x and regular files -rw-r--r-- all should be owned by root and group root.

Sorry that this is such a hassle. Needless to say I don't get that error. I have a Pi Zero W I can try it on this evening. I'm running this on a Pi3 right now.

Thanks for your help with this.

@Snille
Copy link
Author

Snille commented Jun 10, 2021

@dadr Nah, I'm connecting to SSH via the ethernet cable (just to get at stable connection). But the wifi is also "connected".
See output from "ip addr".

root@raspberrypi:~# ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether b8:27:eb:21:cb:39 brd ff:ff:ff:ff:ff:ff
    inet 10.0.0.134/24 brd 10.0.0.255 scope global dynamic noprefixroute wlan0
       valid_lft 72668sec preferred_lft 61868sec
    inet6 fe80::9bd9:1105:f413:f895/64 scope link
       valid_lft forever preferred_lft forever
3: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 00:0e:c6:8f:9f:ca brd ff:ff:ff:ff:ff:ff
    inet 10.0.0.163/24 brd 10.0.0.255 scope global dynamic noprefixroute eth0
       valid_lft 72667sec preferred_lft 61867sec
    inet6 fe80::8702:8f5f:6e3c:b6d9/64 scope link
       valid_lft forever preferred_lft forever
root@raspberrypi:~#

Yes, get the same page from the .local address and direct on the IP (both IPs). :) I get the same page in (inkognito) Firefox, (inkognito) Chrome, (inkognito) Edge and on my phone...
image
image
image
image

I can do a reinstall of the whole frame again if you think something has gone wrong? :)

@dadr
Copy link
Contributor

dadr commented Jun 10, 2021

Hi Erik,

As you already know, it's not your browser. 8-)

I just tried the software on my Pi Zero W. It works for me. I'm not sure what to suggest next...

It's also really troubling that you have seen this both for the original image and from a manual install. There is so much different between these two, that I have to wonder if it's some type of hardware problem.

Somewhat grasping:

Which OS image did you start from? I used 2021-03-04-raspios-buster-armhf-lite

The instructions set up WiFi for the US, and I assume you changed the country variable for Sweden. If not you can try setting up that localization in raspy-config - But since your WiFi is working I don't see how this can be a problem - except with the documentation in the readme.

Do you have another RPi that you could slip the SD card into and try that?

Can you try without the Ethernet attached - just using WiFi? (Although I have tried with the wired Ethernet and it seems to work fine on my Pi3.)

Do you have another SD card you can try a new install on? But before you do that perhaps you could watch the debug trace for exceptions or other oddball activity. To do that:

ssh into the Pi,  
sudo bash
cd /root/photoframe
systemctl stop frame
./frame.py --debug

At this point you should see a rolling log go by. Now go to your browser and request the management URL (http://raspberripi.local)

And I hope this will show something interesting in the rolling log above. If you can, copy that text and share it with us.

Once you're done, you can ^c to kill the frame process from the rolling log window. systemctl start frame puts back the system daemon version. (or reboot does too ;-)

If that looks normal, then you could try:

sudo bash
cd
systemctl stop frame
rm -rf photo*
rm -rf cache
rm -rf history
git clone --branch feature/screen-off-url --single-branch https://github.com/dadr/photoframe.git
systemctl start frame

If that does not help, then try to re-install on a new SD card? :-(

@Snille
Copy link
Author

Snille commented Jun 11, 2021

Hi again, sorry for giving all of you the headache. :) I'll do all the things in your post during the day and I'll try to document at the same time.

I'm using the latest buster image (downloaded it yesterday): 2021-05-07-raspios-buster-armhf-lite.zip

As a start, here is the debug log before the "cleaning"...

root@raspberrypi:~/photoframe# ./frame.py --debug
2021-06-11 06:37:39,237 - INFO - Loading service USB_Photos from svc_usb.py
2021-06-11 06:37:39,248 - INFO - Loading service PicasaWeb from svc_picasaweb.py
2021-06-11 06:37:39,260 - INFO - Loading service GooglePhotos from svc_googlephotos.py
2021-06-11 06:37:39,271 - INFO - Loading service SimpleUrl from svc_simpleurl.py
Display not found
2021-06-11 06:37:40,715 - ERROR - ddcutil is present but not getting temp increment from monitor.
Traceback (most recent call last):
  File "/root/photoframe/modules/colormatch.py", line 62, in __init__
    temp_str = debug.subprocess_check_output(['/usr/bin/ddcutil', 'getvcp', '0B'])
  File "/root/photoframe/modules/debug.py", line 42, in subprocess_check_output
    return subprocess.check_output(cmds, stderr=stderr).decode("utf-8")
  File "/usr/lib/python3.7/subprocess.py", line 395, in check_output
    **kwargs).stdout
  File "/usr/lib/python3.7/subprocess.py", line 487, in run
    output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['/usr/bin/ddcutil', 'getvcp', '0B']' returned non-zero exit status 1.
Display not found
2021-06-11 06:37:42,208 - ERROR - ddcutil is present but not getting min temp status from monitor.
Traceback (most recent call last):
  File "/root/photoframe/modules/colormatch.py", line 69, in __init__
    temp_str = debug.subprocess_check_output(['/usr/bin/ddcutil', 'getvcp', '0C'])
  File "/root/photoframe/modules/debug.py", line 42, in subprocess_check_output
    return subprocess.check_output(cmds, stderr=stderr).decode("utf-8")
  File "/usr/lib/python3.7/subprocess.py", line 395, in check_output
    **kwargs).stdout
  File "/usr/lib/python3.7/subprocess.py", line 487, in run
    output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['/usr/bin/ddcutil', 'getvcp', '0C']' returned non-zero exit status 1.
Display not found
2021-06-11 06:37:43,667 - ERROR - ddcutil is present but not getting brightness info from monitor
Traceback (most recent call last):
  File "/root/photoframe/modules/colormatch.py", line 76, in __init__
    temp_str = debug.subprocess_check_output(['/usr/bin/ddcutil', 'getvcp', '10'])
  File "/root/photoframe/modules/debug.py", line 42, in subprocess_check_output
    return subprocess.check_output(cmds, stderr=stderr).decode("utf-8")
  File "/usr/lib/python3.7/subprocess.py", line 395, in check_output
    **kwargs).stdout
  File "/usr/lib/python3.7/subprocess.py", line 487, in run
    output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['/usr/bin/ddcutil', 'getvcp', '10']' returned non-zero exit status 1.
2021-06-11 06:37:43,790 - INFO - ColorSensor not available
2021-06-11 06:37:43,795 - DEBUG - Adding listener <bound method display.enable of <modules.display.display object at 0xb555dc90>>
2021-06-11 06:37:43,806 - INFO - GPIO shutdown can be triggered by GPIO 3
2021-06-11 06:37:43,813 - INFO - Cache is set to True
2021-06-11 06:37:43,827 - DEBUG - hourOn = 4, hourOff = 22
2021-06-11 06:37:43,831 - DEBUG - Powermode changed to 'none'
2021-06-11 06:37:43,835 - DEBUG - Adding listener <bound method slideshow.shouldShow of <modules.slideshow.slideshow object at 0xb556f190>>
2021-06-11 06:37:43,856 - INFO - No http-auth.json found, disabling http authentication
2021-06-11 06:37:43,927 - INFO - Registering URL /<path:file> to RoutePages (simple)
2021-06-11 06:37:43,935 - INFO - Registering URL / to RoutePages (simple)
2021-06-11 06:37:43,950 - INFO - Registering URL /debug to RouteDebug (simple)
2021-06-11 06:37:43,989 - INFO - Registering URL /options/<cmd> to RouteOptions (simple)
2021-06-11 06:37:43,998 - INFO - Registering URL /options/<cmd>/<arg> to RouteOptions (simple)
2021-06-11 06:37:44,024 - INFO - Registering URL /setting to RouteSettings
2021-06-11 06:37:44,032 - INFO - Registering URL /setting/<key> to RouteSettings
2021-06-11 06:37:44,041 - INFO - Registering URL /setting/<key>/<value> to RouteSettings
2021-06-11 06:37:44,053 - INFO - Registering URL /keywords/<service>/help to RouteKeywords
2021-06-11 06:37:44,062 - INFO - Registering URL /keywords/<service> to RouteKeywords
2021-06-11 06:37:44,071 - INFO - Registering URL /keywords/<service>/add to RouteKeywords
2021-06-11 06:37:44,080 - INFO - Registering URL /keywords/<service>/delete to RouteKeywords
2021-06-11 06:37:44,089 - INFO - Registering URL /keywords/<service>/source/<int:index> to RouteKeywords
2021-06-11 06:37:44,100 - INFO - Registering URL /keywords/<service>/details/<int:index> to RouteKeywords
2021-06-11 06:37:44,113 - INFO - Registering URL /rotation to RouteOrientation
2021-06-11 06:37:44,119 - INFO - Registering URL /rotation/<int:orient> to RouteOrientation
2021-06-11 06:37:44,129 - INFO - Registering URL /overscan to RouteOverscan
2021-06-11 06:37:44,136 - INFO - Registering URL /overscan/<overscan> to RouteOverscan
2021-06-11 06:37:44,147 - INFO - Registering URL /maintenance/<cmd> to RouteMaintenance
2021-06-11 06:37:44,158 - INFO - Registering URL /details/<about> to RouteDetails
2021-06-11 06:37:44,168 - INFO - Registering URL /upload/<item> to RouteUpload
2021-06-11 06:37:44,178 - INFO - Registering URL /callback to RouteOAuthLink
2021-06-11 06:37:44,185 - INFO - Registering URL /service/<service>/link to RouteOAuthLink
2021-06-11 06:37:44,194 - INFO - Registering URL /service/<service>/oauth to RouteOAuthLink
2021-06-11 06:37:44,206 - INFO - Registering URL /service/<action> to RouteService
2021-06-11 06:37:44,216 - INFO - Registering URL /control/<cmd> to RouteControl
2021-06-11 06:37:44,226 - INFO - Registering URL /events to RouteEvents
2021-06-11 06:37:44,233 - INFO - Registering URL /events/<int:since> to RouteEvents
2021-06-11 06:37:44,241 - INFO - Registering URL /events/remove/<int:id> to RouteEvents
 * Serving Flask app "modules.server" (lazy loading)
 * Environment: production
   WARNING: Do not use the development server in a production environment.
   Use a production WSGI server instead.
 * Debug mode: on
2021-06-11 06:38:39,710 - INFO - Starting presentation
2021-06-11 06:38:39,714 - DEBUG - Commit this to history
2021-06-11 06:38:48,227 - DEBUG - Took 8.513114 seconds to process, next image is None
2021-06-11 06:38:49,233 - DEBUG - Commit this to history
2021-06-11 06:38:49,267 - DEBUG - Took 0.034914 seconds to process, next image is None
2021-06-11 06:38:51,273 - DEBUG - Commit this to history
2021-06-11 06:38:51,308 - DEBUG - Took 0.035128 seconds to process, next image is None
2021-06-11 06:38:55,314 - DEBUG - Commit this to history
2021-06-11 06:38:55,349 - DEBUG - Took 0.034626 seconds to process, next image is None
2021-06-11 06:39:03,355 - DEBUG - Commit this to history
2021-06-11 06:39:03,389 - DEBUG - Took 0.034657 seconds to process, next image is None

And debug after the "cleaning" (still get failsafe-page)...

root@raspberrypi:~/photoframe# ./frame.py --debug
2021-06-11 06:48:35,065 - INFO - No display settings, using: {'mode': 'DMT', 'code': 28, 'width': 1280, 'height': 800, 'rate': 60, 'aspect_ratio': '', 'scan': 'p', '3d_modes': [], 'depth': 32, 'reverse': True}
2021-06-11 06:48:35,938 - INFO - Loading service USB_Photos from svc_usb.py
2021-06-11 06:48:35,969 - INFO - Loading service PicasaWeb from svc_picasaweb.py
2021-06-11 06:48:36,049 - INFO - Loading service GooglePhotos from svc_googlephotos.py
2021-06-11 06:48:36,078 - INFO - Loading service SimpleUrl from svc_simpleurl.py
Display not found
2021-06-11 06:48:37,520 - ERROR - ddcutil is present but not getting temp increment from monitor.
Traceback (most recent call last):
  File "/root/photoframe/modules/colormatch.py", line 62, in __init__
    temp_str = debug.subprocess_check_output(['/usr/bin/ddcutil', 'getvcp', '0B'])
  File "/root/photoframe/modules/debug.py", line 42, in subprocess_check_output
    return subprocess.check_output(cmds, stderr=stderr).decode("utf-8")
  File "/usr/lib/python3.7/subprocess.py", line 395, in check_output
    **kwargs).stdout
  File "/usr/lib/python3.7/subprocess.py", line 487, in run
    output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['/usr/bin/ddcutil', 'getvcp', '0B']' returned non-zero exit status 1.
Display not found
2021-06-11 06:48:39,014 - ERROR - ddcutil is present but not getting min temp status from monitor.
Traceback (most recent call last):
  File "/root/photoframe/modules/colormatch.py", line 69, in __init__
    temp_str = debug.subprocess_check_output(['/usr/bin/ddcutil', 'getvcp', '0C'])
  File "/root/photoframe/modules/debug.py", line 42, in subprocess_check_output
    return subprocess.check_output(cmds, stderr=stderr).decode("utf-8")
  File "/usr/lib/python3.7/subprocess.py", line 395, in check_output
    **kwargs).stdout
  File "/usr/lib/python3.7/subprocess.py", line 487, in run
    output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['/usr/bin/ddcutil', 'getvcp', '0C']' returned non-zero exit status 1.
Display not found
2021-06-11 06:48:40,510 - ERROR - ddcutil is present but not getting brightness info from monitor
Traceback (most recent call last):
  File "/root/photoframe/modules/colormatch.py", line 76, in __init__
    temp_str = debug.subprocess_check_output(['/usr/bin/ddcutil', 'getvcp', '10'])
  File "/root/photoframe/modules/debug.py", line 42, in subprocess_check_output
    return subprocess.check_output(cmds, stderr=stderr).decode("utf-8")
  File "/usr/lib/python3.7/subprocess.py", line 395, in check_output
    **kwargs).stdout
  File "/usr/lib/python3.7/subprocess.py", line 487, in run
    output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['/usr/bin/ddcutil', 'getvcp', '10']' returned non-zero exit status 1.
2021-06-11 06:48:40,625 - INFO - ColorSensor not available
2021-06-11 06:48:40,629 - DEBUG - Adding listener <bound method display.enable of <modules.display.display object at 0xb557bc10>>
2021-06-11 06:48:40,640 - INFO - GPIO shutdown can be triggered by GPIO 3
2021-06-11 06:48:40,648 - INFO - Cache is set to True
2021-06-11 06:48:40,660 - DEBUG - hourOn = 4, hourOff = 22
2021-06-11 06:48:40,668 - DEBUG - Powermode changed to 'none'
2021-06-11 06:48:40,674 - DEBUG - Adding listener <bound method slideshow.shouldShow of <modules.slideshow.slideshow object at 0xb557bf50>>
2021-06-11 06:48:40,696 - INFO - No http-auth.json found, disabling http authentication
2021-06-11 06:48:40,842 - INFO - Registering URL /<path:file> to RoutePages (simple)
2021-06-11 06:48:40,851 - INFO - Registering URL / to RoutePages (simple)
2021-06-11 06:48:40,875 - INFO - Registering URL /debug to RouteDebug (simple)
2021-06-11 06:48:40,949 - INFO - Registering URL /options/<cmd> to RouteOptions (simple)
2021-06-11 06:48:40,957 - INFO - Registering URL /options/<cmd>/<arg> to RouteOptions (simple)
2021-06-11 06:48:40,997 - INFO - Registering URL /setting to RouteSettings
2021-06-11 06:48:41,004 - INFO - Registering URL /setting/<key> to RouteSettings
2021-06-11 06:48:41,013 - INFO - Registering URL /setting/<key>/<value> to RouteSettings
2021-06-11 06:48:41,025 - INFO - Registering URL /keywords/<service>/help to RouteKeywords
2021-06-11 06:48:41,034 - INFO - Registering URL /keywords/<service> to RouteKeywords
2021-06-11 06:48:41,042 - INFO - Registering URL /keywords/<service>/add to RouteKeywords
2021-06-11 06:48:41,052 - INFO - Registering URL /keywords/<service>/delete to RouteKeywords
2021-06-11 06:48:41,061 - INFO - Registering URL /keywords/<service>/source/<int:index> to RouteKeywords
2021-06-11 06:48:41,072 - INFO - Registering URL /keywords/<service>/details/<int:index> to RouteKeywords
2021-06-11 06:48:41,085 - INFO - Registering URL /rotation to RouteOrientation
2021-06-11 06:48:41,091 - INFO - Registering URL /rotation/<int:orient> to RouteOrientation
2021-06-11 06:48:41,119 - INFO - Registering URL /overscan to RouteOverscan
2021-06-11 06:48:41,128 - INFO - Registering URL /overscan/<overscan> to RouteOverscan
2021-06-11 06:48:41,138 - INFO - Registering URL /maintenance/<cmd> to RouteMaintenance
2021-06-11 06:48:41,149 - INFO - Registering URL /details/<about> to RouteDetails
2021-06-11 06:48:41,160 - INFO - Registering URL /upload/<item> to RouteUpload
2021-06-11 06:48:41,170 - INFO - Registering URL /callback to RouteOAuthLink
2021-06-11 06:48:41,176 - INFO - Registering URL /service/<service>/link to RouteOAuthLink
2021-06-11 06:48:41,185 - INFO - Registering URL /service/<service>/oauth to RouteOAuthLink
2021-06-11 06:48:41,196 - INFO - Registering URL /service/<action> to RouteService
2021-06-11 06:48:41,206 - INFO - Registering URL /control/<cmd> to RouteControl
2021-06-11 06:48:41,216 - INFO - Registering URL /events to RouteEvents
2021-06-11 06:48:41,223 - INFO - Registering URL /events/<int:since> to RouteEvents
2021-06-11 06:48:41,232 - INFO - Registering URL /events/remove/<int:id> to RouteEvents
 * Serving Flask app "modules.server" (lazy loading)
 * Environment: production
   WARNING: Do not use the development server in a production environment.
   Use a production WSGI server instead.
 * Debug mode: on
2021-06-11 06:49:36,818 - INFO - Starting presentation
2021-06-11 06:49:36,822 - DEBUG - Commit this to history
2021-06-11 06:49:45,048 - DEBUG - Took 8.226016 seconds to process, next image is None
2021-06-11 06:49:46,053 - DEBUG - Commit this to history
2021-06-11 06:49:46,090 - DEBUG - Took 0.036471 seconds to process, next image is None
2021-06-11 06:49:48,096 - DEBUG - Commit this to history
2021-06-11 06:49:48,130 - DEBUG - Took 0.035020 seconds to process, next image is None
2021-06-11 06:49:52,136 - DEBUG - Commit this to history
2021-06-11 06:49:52,171 - DEBUG - Took 0.034785 seconds to process, next image is None

Next step, reinstall on a new SD-card and in another RPi-Zero... I'll make a new post. :)

@Snille
Copy link
Author

Snille commented Jun 11, 2021

Ok, same SD-Card, same install. Another RPi-Zero connected to another screen.
Still fail safe page, "Photoframe isn't ready..." Message on screen...

root@raspberrypi:~/photoframe# ./frame.py --debug
2021-06-11 07:15:27,263 - INFO - Loading service USB_Photos from svc_usb.py
2021-06-11 07:15:27,274 - INFO - Loading service PicasaWeb from svc_picasaweb.py
2021-06-11 07:15:27,286 - INFO - Loading service GooglePhotos from svc_googlephotos.py
2021-06-11 07:15:27,296 - INFO - Loading service SimpleUrl from svc_simpleurl.py
Display not found
2021-06-11 07:15:27,685 - ERROR - ddcutil is present but not getting temp increment from monitor.
Traceback (most recent call last):
  File "/root/photoframe/modules/colormatch.py", line 62, in __init__
    temp_str = debug.subprocess_check_output(['/usr/bin/ddcutil', 'getvcp', '0B'])
  File "/root/photoframe/modules/debug.py", line 42, in subprocess_check_output
    return subprocess.check_output(cmds, stderr=stderr).decode("utf-8")
  File "/usr/lib/python3.7/subprocess.py", line 395, in check_output
    **kwargs).stdout
  File "/usr/lib/python3.7/subprocess.py", line 487, in run
    output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['/usr/bin/ddcutil', 'getvcp', '0B']' returned non-zero exit status 1.
Display not found
2021-06-11 07:15:28,100 - ERROR - ddcutil is present but not getting min temp status from monitor.
Traceback (most recent call last):
  File "/root/photoframe/modules/colormatch.py", line 69, in __init__
    temp_str = debug.subprocess_check_output(['/usr/bin/ddcutil', 'getvcp', '0C'])
  File "/root/photoframe/modules/debug.py", line 42, in subprocess_check_output
    return subprocess.check_output(cmds, stderr=stderr).decode("utf-8")
  File "/usr/lib/python3.7/subprocess.py", line 395, in check_output
    **kwargs).stdout
  File "/usr/lib/python3.7/subprocess.py", line 487, in run
    output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['/usr/bin/ddcutil', 'getvcp', '0C']' returned non-zero exit status 1.
Display not found
2021-06-11 07:15:28,596 - ERROR - ddcutil is present but not getting brightness info from monitor
Traceback (most recent call last):
  File "/root/photoframe/modules/colormatch.py", line 76, in __init__
    temp_str = debug.subprocess_check_output(['/usr/bin/ddcutil', 'getvcp', '10'])
  File "/root/photoframe/modules/debug.py", line 42, in subprocess_check_output
    return subprocess.check_output(cmds, stderr=stderr).decode("utf-8")
  File "/usr/lib/python3.7/subprocess.py", line 395, in check_output
    **kwargs).stdout
  File "/usr/lib/python3.7/subprocess.py", line 487, in run
    output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['/usr/bin/ddcutil', 'getvcp', '10']' returned non-zero exit status 1.
2021-06-11 07:15:28,724 - INFO - ColorSensor not available
2021-06-11 07:15:28,731 - DEBUG - Adding listener <bound method display.enable of <modules.display.display object at 0xb559bc10>>
2021-06-11 07:15:28,743 - INFO - GPIO shutdown can be triggered by GPIO 3
2021-06-11 07:15:28,748 - INFO - Cache is set to True
2021-06-11 07:15:28,757 - DEBUG - hourOn = 4, hourOff = 22
2021-06-11 07:15:28,767 - DEBUG - Powermode changed to 'none'
2021-06-11 07:15:28,771 - DEBUG - Adding listener <bound method slideshow.shouldShow of <modules.slideshow.slideshow object at 0xb55ad230>>
2021-06-11 07:15:28,791 - INFO - No http-auth.json found, disabling http authentication
2021-06-11 07:15:28,844 - INFO - Registering URL /<path:file> to RoutePages (simple)
2021-06-11 07:15:28,852 - INFO - Registering URL / to RoutePages (simple)
2021-06-11 07:15:28,866 - INFO - Registering URL /debug to RouteDebug (simple)
2021-06-11 07:15:28,901 - INFO - Registering URL /options/<cmd> to RouteOptions (simple)
2021-06-11 07:15:28,910 - INFO - Registering URL /options/<cmd>/<arg> to RouteOptions (simple)
2021-06-11 07:15:28,933 - INFO - Registering URL /setting to RouteSettings
2021-06-11 07:15:28,942 - INFO - Registering URL /setting/<key> to RouteSettings
2021-06-11 07:15:28,950 - INFO - Registering URL /setting/<key>/<value> to RouteSettings
2021-06-11 07:15:28,961 - INFO - Registering URL /keywords/<service>/help to RouteKeywords
2021-06-11 07:15:28,970 - INFO - Registering URL /keywords/<service> to RouteKeywords
2021-06-11 07:15:28,979 - INFO - Registering URL /keywords/<service>/add to RouteKeywords
2021-06-11 07:15:28,987 - INFO - Registering URL /keywords/<service>/delete to RouteKeywords
2021-06-11 07:15:28,996 - INFO - Registering URL /keywords/<service>/source/<int:index> to RouteKeywords
2021-06-11 07:15:29,007 - INFO - Registering URL /keywords/<service>/details/<int:index> to RouteKeywords
2021-06-11 07:15:29,018 - INFO - Registering URL /rotation to RouteOrientation
2021-06-11 07:15:29,025 - INFO - Registering URL /rotation/<int:orient> to RouteOrientation
2021-06-11 07:15:29,034 - INFO - Registering URL /overscan to RouteOverscan
2021-06-11 07:15:29,041 - INFO - Registering URL /overscan/<overscan> to RouteOverscan
2021-06-11 07:15:29,051 - INFO - Registering URL /maintenance/<cmd> to RouteMaintenance
2021-06-11 07:15:29,061 - INFO - Registering URL /details/<about> to RouteDetails
2021-06-11 07:15:29,071 - INFO - Registering URL /upload/<item> to RouteUpload
2021-06-11 07:15:29,081 - INFO - Registering URL /callback to RouteOAuthLink
2021-06-11 07:15:29,087 - INFO - Registering URL /service/<service>/link to RouteOAuthLink
2021-06-11 07:15:29,096 - INFO - Registering URL /service/<service>/oauth to RouteOAuthLink
2021-06-11 07:15:29,106 - INFO - Registering URL /service/<action> to RouteService
2021-06-11 07:15:29,116 - INFO - Registering URL /control/<cmd> to RouteControl
2021-06-11 07:15:29,125 - INFO - Registering URL /events to RouteEvents
2021-06-11 07:15:29,130 - INFO - Registering URL /events/<int:since> to RouteEvents
2021-06-11 07:15:29,139 - INFO - Registering URL /events/remove/<int:id> to RouteEvents
 * Serving Flask app "modules.server" (lazy loading)
 * Environment: production
   WARNING: Do not use the development server in a production environment.
   Use a production WSGI server instead.
 * Debug mode: on
2021-06-11 07:16:20,537 - INFO - Starting presentation
2021-06-11 07:16:20,541 - DEBUG - Commit this to history
2021-06-11 07:16:28,120 - DEBUG - Took 7.579218 seconds to process, next image is None
2021-06-11 07:16:29,125 - DEBUG - Commit this to history
2021-06-11 07:16:29,152 - DEBUG - Took 0.027369 seconds to process, next image is None
2021-06-11 07:16:31,158 - DEBUG - Commit this to history
2021-06-11 07:16:31,184 - DEBUG - Took 0.026662 seconds to process, next image is None
2021-06-11 07:16:35,190 - DEBUG - Commit this to history
2021-06-11 07:16:35,220 - DEBUG - Took 0.030040 seconds to process, next image is None

Next up. reinstall on a new SD-Card...

@Snille
Copy link
Author

Snille commented Jun 11, 2021

Install procedure on new SD-Card:

  1. Write 2021-05-07-raspios-buster-armhf-lite.zip image to SD-Card using Rufus.
  2. Mounting boot partition in Windows to copy over files: ssh and wpa_supplicant.conf.
    wpa_supplicant.conf content:
# Use this file instead of wifi-config.txt
# Should set country properly

country=se
update_config=1
ctrl_interface=/var/run/wpa_supplicant

network={
scan_ssid=1
ssid="snille.net"
psk="Will not tell... :)"
}
  1. Edit the confg.txt file (in notepad++) enabling and adding the following:
## For my screen 1280x800
hdmi_group=2
hdmi_mode=28
## Set rotation of the screen.
display_rotate=2 # 180 degrees
## Setting these according to your instructions... :)
dtparam=i2c2_iknowwhatimdoing
disable_splash=1
framebuffer_ignore_alpha=1
  1. I'm skipping the changes in the /boot/cmdline.txt because I want to see the boot process (for now).
  2. Booting the Pi...
  3. Logging in via SSH (LAN ip) and becomes root (sudo su).
  4. Update the system apt update && apt dist-upgrade
  5. Rebooting...
  6. Installing additional dependencies with apt... apt install git python3-pip python3-requests-oauthlib python3-flask imagemagick python3-smbus bc ddcutil libjpeg-turbo-progs
  7. Installing additional dependencies with pip... pip3 install requests requests-oauthlib flask flask-httpauth smbus netifaces
  8. Rebooting...
  9. Cloning the frame in /root... git clone --branch python3 --single-branch https://github.com/mrworf/photoframe.git
  10. Starting the frame with debug in the photoframe folder... ./frame.py --debug
  11. Waiting for startup and when "Photoframe isn't ready..." message appears, try to go to gui on LAN ip.
  12. Shows failsafe page... :(
  13. CTRL-C to stop frame.

Debug info...

root@raspberrypi:~/photoframe# ./frame.py --debug
2021-06-11 08:25:41,527 - INFO - No display settings, using: {'mode': 'DMT', 'code': 28, 'width': 1280, 'height': 800, 'rate': 60, 'aspect_ratio': '', 'scan': 'p', '3d_modes': [], 'depth': 32, 'reverse': True}
2021-06-11 08:25:41,724 - INFO - Loading service USB_Photos from svc_usb.py
2021-06-11 08:25:41,753 - INFO - Loading service PicasaWeb from svc_picasaweb.py
2021-06-11 08:25:41,816 - INFO - Loading service GooglePhotos from svc_googlephotos.py
2021-06-11 08:25:41,840 - INFO - Loading service SimpleUrl from svc_simpleurl.py
2021-06-11 08:25:41,846 - DEBUG - /usr/bin/ddcutil or /dev/i2c-2 not found - cannot adjust monitor
2021-06-11 08:25:41,852 - INFO - No SMB subsystem, color sensor unavailable
2021-06-11 08:25:41,860 - DEBUG - Adding listener <bound method display.enable of <modules.display.display object at 0xb54f6c10>>
2021-06-11 08:25:41,866 - INFO - GPIO shutdown can be triggered by GPIO 3
2021-06-11 08:25:41,872 - INFO - Cache is set to True
2021-06-11 08:25:41,891 - DEBUG - hourOn = 4, hourOff = 22
2021-06-11 08:25:41,897 - DEBUG - Powermode changed to 'none'
2021-06-11 08:25:41,900 - DEBUG - Adding listener <bound method slideshow.shouldShow of <modules.slideshow.slideshow object at 0xb54f6f10>>
2021-06-11 08:25:41,944 - INFO - No http-auth.json found, disabling http authentication
2021-06-11 08:25:42,166 - INFO - Registering URL /<path:file> to RoutePages (simple)
2021-06-11 08:25:42,178 - INFO - Registering URL / to RoutePages (simple)
2021-06-11 08:25:42,199 - INFO - Registering URL /debug to RouteDebug (simple)
2021-06-11 08:25:42,274 - INFO - Registering URL /options/<cmd> to RouteOptions (simple)
2021-06-11 08:25:42,283 - INFO - Registering URL /options/<cmd>/<arg> to RouteOptions (simple)
2021-06-11 08:25:42,322 - INFO - Registering URL /setting to RouteSettings
2021-06-11 08:25:42,328 - INFO - Registering URL /setting/<key> to RouteSettings
2021-06-11 08:25:42,336 - INFO - Registering URL /setting/<key>/<value> to RouteSettings
2021-06-11 08:25:42,349 - INFO - Registering URL /keywords/<service>/help to RouteKeywords
2021-06-11 08:25:42,358 - INFO - Registering URL /keywords/<service> to RouteKeywords
2021-06-11 08:25:42,366 - INFO - Registering URL /keywords/<service>/add to RouteKeywords
2021-06-11 08:25:42,375 - INFO - Registering URL /keywords/<service>/delete to RouteKeywords
2021-06-11 08:25:42,385 - INFO - Registering URL /keywords/<service>/source/<int:index> to RouteKeywords
2021-06-11 08:25:42,397 - INFO - Registering URL /keywords/<service>/details/<int:index> to RouteKeywords
2021-06-11 08:25:42,409 - INFO - Registering URL /rotation to RouteOrientation
2021-06-11 08:25:42,416 - INFO - Registering URL /rotation/<int:orient> to RouteOrientation
2021-06-11 08:25:42,426 - INFO - Registering URL /overscan to RouteOverscan
2021-06-11 08:25:42,433 - INFO - Registering URL /overscan/<overscan> to RouteOverscan
2021-06-11 08:25:42,443 - INFO - Registering URL /maintenance/<cmd> to RouteMaintenance
2021-06-11 08:25:42,454 - INFO - Registering URL /details/<about> to RouteDetails
2021-06-11 08:25:42,464 - INFO - Registering URL /upload/<item> to RouteUpload
2021-06-11 08:25:42,474 - INFO - Registering URL /callback to RouteOAuthLink
2021-06-11 08:25:42,480 - INFO - Registering URL /service/<service>/link to RouteOAuthLink
2021-06-11 08:25:42,489 - INFO - Registering URL /service/<service>/oauth to RouteOAuthLink
2021-06-11 08:25:42,499 - INFO - Registering URL /service/<action> to RouteService
2021-06-11 08:25:42,510 - INFO - Registering URL /control/<cmd> to RouteControl
2021-06-11 08:25:42,520 - INFO - Registering URL /events to RouteEvents
2021-06-11 08:25:42,526 - INFO - Registering URL /events/<int:since> to RouteEvents
2021-06-11 08:25:42,534 - INFO - Registering URL /events/remove/<int:id> to RouteEvents
 * Serving Flask app "modules.server" (lazy loading)
 * Environment: production
   WARNING: Do not use the development server in a production environment.
   Use a production WSGI server instead.
 * Debug mode: on
2021-06-11 08:26:38,658 - INFO - Starting presentation
2021-06-11 08:26:38,663 - DEBUG - Commit this to history
2021-06-11 08:26:46,943 - DEBUG - Took 8.279889 seconds to process, next image is None
2021-06-11 08:26:47,949 - DEBUG - Commit this to history
2021-06-11 08:26:47,984 - DEBUG - Took 0.035911 seconds to process, next image is None
2021-06-11 08:26:49,990 - DEBUG - Commit this to history
2021-06-11 08:26:50,025 - DEBUG - Took 0.035235 seconds to process, next image is None
2021-06-11 08:26:54,031 - DEBUG - Commit this to history
2021-06-11 08:26:54,065 - DEBUG - Took 0.034243 seconds to process, next image is None
2021-06-11 08:27:02,070 - DEBUG - Commit this to history
2021-06-11 08:27:02,105 - DEBUG - Took 0.034968 seconds to process, next image is None
2021-06-11 08:27:18,111 - DEBUG - Commit this to history
2021-06-11 08:27:18,146 - DEBUG - Took 0.034697 seconds to process, next image is None
2021-06-11 08:27:34,152 - DEBUG - Commit this to history
2021-06-11 08:27:34,186 - DEBUG - Took 0.034247 seconds to process, next image is None
2021-06-11 08:27:50,193 - DEBUG - Commit this to history
2021-06-11 08:27:50,227 - DEBUG - Took 0.034703 seconds to process, next image is None
2021-06-11 08:28:06,233 - DEBUG - Commit this to history
2021-06-11 08:28:06,267 - DEBUG - Took 0.034741 seconds to process, next image is None
2021-06-11 08:28:22,275 - DEBUG - Commit this to history
2021-06-11 08:28:22,310 - DEBUG - Took 0.036269 seconds to process, next image is None
2021-06-11 08:28:38,316 - DEBUG - Commit this to history
2021-06-11 08:28:38,350 - DEBUG - Took 0.034384 seconds to process, next image is None
2021-06-11 08:28:54,356 - DEBUG - Commit this to history
2021-06-11 08:28:54,390 - DEBUG - Took 0.034448 seconds to process, next image is None
^Croot@raspberrypi:~/photoframe#

Just realized I cloned the "original" repo. So, I'm cleaning up and cloning the correct one.

cd /root
rm -rf photo*
rm -rf cache
rm -rf history
git clone --branch feature/screen-off-url --single-branch https://github.com/dadr/photoframe.git

But still get failsafe page... :(
New debug info...

root@raspberrypi:~/photoframe# ./frame.py --debug
2021-06-11 08:39:19,552 - INFO - No display settings, using: {'mode': 'DMT', 'code': 28, 'width': 1280, 'height': 800, 'rate': 60, 'aspect_ratio': '', 'scan': 'p', '3d_modes': [], 'depth': 32, 'reverse': True}
2021-06-11 08:39:19,749 - INFO - Loading service USB_Photos from svc_usb.py
2021-06-11 08:39:19,780 - INFO - Loading service PicasaWeb from svc_picasaweb.py
2021-06-11 08:39:19,843 - INFO - Loading service GooglePhotos from svc_googlephotos.py
2021-06-11 08:39:19,868 - INFO - Loading service SimpleUrl from svc_simpleurl.py
2021-06-11 08:39:19,875 - DEBUG - /usr/bin/ddcutil or /dev/i2c-2 not found - cannot adjust monitor
2021-06-11 08:39:19,880 - INFO - No SMB subsystem, color sensor unavailable
2021-06-11 08:39:19,888 - DEBUG - Adding listener <bound method display.enable of <modules.display.display object at 0xb55adc30>>
2021-06-11 08:39:19,895 - INFO - GPIO shutdown can be triggered by GPIO 3
2021-06-11 08:39:19,900 - INFO - Cache is set to True
2021-06-11 08:39:19,911 - DEBUG - hourOn = 4, hourOff = 22
2021-06-11 08:39:19,915 - DEBUG - Powermode changed to 'none'
2021-06-11 08:39:19,919 - DEBUG - Adding listener <bound method slideshow.shouldShow of <modules.slideshow.slideshow object at 0xb55adf30>>
2021-06-11 08:39:19,935 - INFO - No http-auth.json found, disabling http authentication
2021-06-11 08:39:20,055 - INFO - Registering URL /<path:file> to RoutePages (simple)
2021-06-11 08:39:20,063 - INFO - Registering URL / to RoutePages (simple)
2021-06-11 08:39:20,084 - INFO - Registering URL /debug to RouteDebug (simple)
2021-06-11 08:39:20,161 - INFO - Registering URL /options/<cmd> to RouteOptions (simple)
2021-06-11 08:39:20,169 - INFO - Registering URL /options/<cmd>/<arg> to RouteOptions (simple)
2021-06-11 08:39:20,209 - INFO - Registering URL /setting to RouteSettings
2021-06-11 08:39:20,216 - INFO - Registering URL /setting/<key> to RouteSettings
2021-06-11 08:39:20,224 - INFO - Registering URL /setting/<key>/<value> to RouteSettings
2021-06-11 08:39:20,237 - INFO - Registering URL /keywords/<service>/help to RouteKeywords
2021-06-11 08:39:20,246 - INFO - Registering URL /keywords/<service> to RouteKeywords
2021-06-11 08:39:20,255 - INFO - Registering URL /keywords/<service>/add to RouteKeywords
2021-06-11 08:39:20,263 - INFO - Registering URL /keywords/<service>/delete to RouteKeywords
2021-06-11 08:39:20,273 - INFO - Registering URL /keywords/<service>/source/<int:index> to RouteKeywords
2021-06-11 08:39:20,284 - INFO - Registering URL /keywords/<service>/details/<int:index> to RouteKeywords
2021-06-11 08:39:20,296 - INFO - Registering URL /rotation to RouteOrientation
2021-06-11 08:39:20,303 - INFO - Registering URL /rotation/<int:orient> to RouteOrientation
2021-06-11 08:39:20,313 - INFO - Registering URL /overscan to RouteOverscan
2021-06-11 08:39:20,320 - INFO - Registering URL /overscan/<overscan> to RouteOverscan
2021-06-11 08:39:20,331 - INFO - Registering URL /maintenance/<cmd> to RouteMaintenance
2021-06-11 08:39:20,341 - INFO - Registering URL /details/<about> to RouteDetails
2021-06-11 08:39:20,352 - INFO - Registering URL /upload/<item> to RouteUpload
2021-06-11 08:39:20,362 - INFO - Registering URL /callback to RouteOAuthLink
2021-06-11 08:39:20,369 - INFO - Registering URL /service/<service>/link to RouteOAuthLink
2021-06-11 08:39:20,378 - INFO - Registering URL /service/<service>/oauth to RouteOAuthLink
2021-06-11 08:39:20,389 - INFO - Registering URL /service/<action> to RouteService
2021-06-11 08:39:20,399 - INFO - Registering URL /control/<cmd> to RouteControl
2021-06-11 08:39:20,409 - INFO - Registering URL /events to RouteEvents
2021-06-11 08:39:20,415 - INFO - Registering URL /events/<int:since> to RouteEvents
2021-06-11 08:39:20,424 - INFO - Registering URL /events/remove/<int:id> to RouteEvents
 * Serving Flask app "modules.server" (lazy loading)
 * Environment: production
   WARNING: Do not use the development server in a production environment.
   Use a production WSGI server instead.
 * Debug mode: on
2021-06-11 08:40:15,985 - INFO - Starting presentation
2021-06-11 08:40:15,990 - DEBUG - Commit this to history
2021-06-11 08:40:24,276 - DEBUG - Took 8.287084 seconds to process, next image is None
2021-06-11 08:40:25,282 - DEBUG - Commit this to history
2021-06-11 08:40:25,317 - DEBUG - Took 0.034981 seconds to process, next image is None
2021-06-11 08:40:27,324 - DEBUG - Commit this to history
2021-06-11 08:40:27,358 - DEBUG - Took 0.034794 seconds to process, next image is None
2021-06-11 08:40:31,364 - DEBUG - Commit this to history
2021-06-11 08:40:31,398 - DEBUG - Took 0.034365 seconds to process, next image is None
2021-06-11 08:40:39,404 - DEBUG - Commit this to history
2021-06-11 08:40:39,439 - DEBUG - Took 0.034819 seconds to process, next image is None
2021-06-11 08:40:55,446 - DEBUG - Commit this to history
2021-06-11 08:40:55,481 - DEBUG - Took 0.035712 seconds to process, next image is None
2021-06-11 08:41:11,488 - DEBUG - Commit this to history
2021-06-11 08:41:11,522 - DEBUG - Took 0.035252 seconds to process, next image is None
^Croot@raspberrypi:~/photoframe#

Next up, try this install in another Rpi (not a Zero) if I can find one. :)

@Snille
Copy link
Author

Snille commented Jun 11, 2021

Ok, same result on a Rpi 2 Model B v1.1 with ethernet LAN connected.
Debug:

 root@raspberrypi:~/photoframe# ./frame.py --debug
2021-06-11 09:19:02,828 - INFO - Loading service USB_Photos from svc_usb.py
2021-06-11 09:19:02,838 - INFO - Loading service PicasaWeb from svc_picasaweb.py
2021-06-11 09:19:02,848 - INFO - Loading service GooglePhotos from svc_googlephotos.py
2021-06-11 09:19:02,856 - INFO - Loading service SimpleUrl from svc_simpleurl.py
2021-06-11 09:19:02,860 - DEBUG - /usr/bin/ddcutil or /dev/i2c-2 not found - cannot adjust monitor
2021-06-11 09:19:02,862 - INFO - No SMB subsystem, color sensor unavailable
2021-06-11 09:19:02,866 - DEBUG - Adding listener <bound method display.enable of <modules.display.display object at 0x75564c10>>
2021-06-11 09:19:02,869 - INFO - GPIO shutdown can be triggered by GPIO 3
2021-06-11 09:19:02,881 - INFO - Cache is set to True
2021-06-11 09:19:02,882 - DEBUG - hourOn = 4, hourOff = 22
2021-06-11 09:19:02,883 - DEBUG - Powermode changed to 'none'
2021-06-11 09:19:02,884 - DEBUG - Adding listener <bound method slideshow.shouldShow of <modules.slideshow.slideshow object at 0x75576bb0>>
2021-06-11 09:19:02,894 - INFO - No http-auth.json found, disabling http authentication
2021-06-11 09:19:02,958 - INFO - Registering URL /<path:file> to RoutePages (simple)
2021-06-11 09:19:02,962 - INFO - Registering URL / to RoutePages (simple)
2021-06-11 09:19:02,975 - INFO - Registering URL /debug to RouteDebug (simple)
2021-06-11 09:19:03,015 - INFO - Registering URL /options/<cmd> to RouteOptions (simple)
2021-06-11 09:19:03,019 - INFO - Registering URL /options/<cmd>/<arg> to RouteOptions (simple)
2021-06-11 09:19:03,039 - INFO - Registering URL /setting to RouteSettings
2021-06-11 09:19:03,041 - INFO - Registering URL /setting/<key> to RouteSettings
2021-06-11 09:19:03,045 - INFO - Registering URL /setting/<key>/<value> to RouteSettings
2021-06-11 09:19:03,052 - INFO - Registering URL /keywords/<service>/help to RouteKeywords
2021-06-11 09:19:03,056 - INFO - Registering URL /keywords/<service> to RouteKeywords
2021-06-11 09:19:03,059 - INFO - Registering URL /keywords/<service>/add to RouteKeywords
2021-06-11 09:19:03,063 - INFO - Registering URL /keywords/<service>/delete to RouteKeywords
2021-06-11 09:19:03,067 - INFO - Registering URL /keywords/<service>/source/<int:index> to RouteKeywords
2021-06-11 09:19:03,072 - INFO - Registering URL /keywords/<service>/details/<int:index> to RouteKeywords
2021-06-11 09:19:03,078 - INFO - Registering URL /rotation to RouteOrientation
2021-06-11 09:19:03,080 - INFO - Registering URL /rotation/<int:orient> to RouteOrientation
2021-06-11 09:19:03,085 - INFO - Registering URL /overscan to RouteOverscan
2021-06-11 09:19:03,087 - INFO - Registering URL /overscan/<overscan> to RouteOverscan
2021-06-11 09:19:03,092 - INFO - Registering URL /maintenance/<cmd> to RouteMaintenance
2021-06-11 09:19:03,097 - INFO - Registering URL /details/<about> to RouteDetails
2021-06-11 09:19:03,102 - INFO - Registering URL /upload/<item> to RouteUpload
2021-06-11 09:19:03,106 - INFO - Registering URL /callback to RouteOAuthLink
2021-06-11 09:19:03,109 - INFO - Registering URL /service/<service>/link to RouteOAuthLink
2021-06-11 09:19:03,113 - INFO - Registering URL /service/<service>/oauth to RouteOAuthLink
2021-06-11 09:19:03,117 - INFO - Registering URL /service/<action> to RouteService
2021-06-11 09:19:03,122 - INFO - Registering URL /control/<cmd> to RouteControl
2021-06-11 09:19:03,126 - INFO - Registering URL /events to RouteEvents
2021-06-11 09:19:03,129 - INFO - Registering URL /events/<int:since> to RouteEvents
2021-06-11 09:19:03,132 - INFO - Registering URL /events/remove/<int:id> to RouteEvents
 * Serving Flask app "modules.server" (lazy loading)
 * Environment: production
   WARNING: Do not use the development server in a production environment.
   Use a production WSGI server instead.
 * Debug mode: on
2021-06-11 09:19:32,307 - INFO - Starting presentation
2021-06-11 09:19:32,309 - DEBUG - Commit this to history
2021-06-11 09:19:37,381 - DEBUG - Took 5.072139 seconds to process, next image is None
2021-06-11 09:19:38,383 - DEBUG - Commit this to history
2021-06-11 09:19:38,394 - DEBUG - Took 0.011068 seconds to process, next image is None
2021-06-11 09:19:40,396 - DEBUG - Commit this to history
2021-06-11 09:19:40,407 - DEBUG - Took 0.010916 seconds to process, next image is None
2021-06-11 09:19:44,411 - DEBUG - Commit this to history
2021-06-11 09:19:44,459 - DEBUG - Took 0.048485 seconds to process, next image is None
2021-06-11 09:19:52,461 - DEBUG - Commit this to history
2021-06-11 09:19:52,472 - DEBUG - Took 0.011114 seconds to process, next image is None
2021-06-11 09:20:08,474 - DEBUG - Commit this to history
2021-06-11 09:20:08,484 - DEBUG - Took 0.010846 seconds to process, next image is None
^Croot@raspberrypi:~/photoframe#

Next up a Rpi B+...

@Snille
Copy link
Author

Snille commented Jun 11, 2021

Ok, same result on a Rpi Model B+ v1.2 with ethernet LAN connected.
Debug:

root@raspberrypi:~/photoframe# ./frame.py --debug
2021-06-11 09:26:58,364 - INFO - Loading service USB_Photos from svc_usb.py
2021-06-11 09:26:58,385 - INFO - Loading service PicasaWeb from svc_picasaweb.py
2021-06-11 09:26:58,408 - INFO - Loading service GooglePhotos from svc_googlephotos.py
2021-06-11 09:26:58,428 - INFO - Loading service SimpleUrl from svc_simpleurl.py
2021-06-11 09:26:58,439 - DEBUG - /usr/bin/ddcutil or /dev/i2c-2 not found - cannot adjust monitor
2021-06-11 09:26:58,446 - INFO - No SMB subsystem, color sensor unavailable
2021-06-11 09:26:58,457 - DEBUG - Adding listener <bound method display.enable of <modules.display.display object at 0xb5518bf0>>
2021-06-11 09:26:58,465 - INFO - GPIO shutdown can be triggered by GPIO 3
2021-06-11 09:26:58,484 - INFO - Cache is set to True
2021-06-11 09:26:58,504 - DEBUG - hourOn = 4, hourOff = 22
2021-06-11 09:26:58,509 - DEBUG - Powermode changed to 'none'
2021-06-11 09:26:58,521 - DEBUG - Adding listener <bound method slideshow.shouldShow of <modules.slideshow.slideshow object at 0xb552a130>>
2021-06-11 09:26:58,563 - INFO - No http-auth.json found, disabling http authentication
2021-06-11 09:26:58,748 - INFO - Registering URL /<path:file> to RoutePages (simple)
2021-06-11 09:26:58,772 - INFO - Registering URL / to RoutePages (simple)
2021-06-11 09:26:58,812 - INFO - Registering URL /debug to RouteDebug (simple)
2021-06-11 09:26:58,916 - INFO - Registering URL /options/<cmd> to RouteOptions (simple)
2021-06-11 09:26:58,928 - INFO - Registering URL /options/<cmd>/<arg> to RouteOptions (simple)
2021-06-11 09:26:58,973 - INFO - Registering URL /setting to RouteSettings
2021-06-11 09:26:58,982 - INFO - Registering URL /setting/<key> to RouteSettings
2021-06-11 09:26:58,995 - INFO - Registering URL /setting/<key>/<value> to RouteSettings
2021-06-11 09:26:59,011 - INFO - Registering URL /keywords/<service>/help to RouteKeywords
2021-06-11 09:26:59,024 - INFO - Registering URL /keywords/<service> to RouteKeywords
2021-06-11 09:26:59,035 - INFO - Registering URL /keywords/<service>/add to RouteKeywords
2021-06-11 09:26:59,047 - INFO - Registering URL /keywords/<service>/delete to RouteKeywords
2021-06-11 09:26:59,060 - INFO - Registering URL /keywords/<service>/source/<int:index> to RouteKeywords
2021-06-11 09:26:59,076 - INFO - Registering URL /keywords/<service>/details/<int:index> to RouteKeywords
2021-06-11 09:26:59,093 - INFO - Registering URL /rotation to RouteOrientation
2021-06-11 09:26:59,101 - INFO - Registering URL /rotation/<int:orient> to RouteOrientation
2021-06-11 09:26:59,115 - INFO - Registering URL /overscan to RouteOverscan
2021-06-11 09:26:59,124 - INFO - Registering URL /overscan/<overscan> to RouteOverscan
2021-06-11 09:26:59,138 - INFO - Registering URL /maintenance/<cmd> to RouteMaintenance
2021-06-11 09:26:59,152 - INFO - Registering URL /details/<about> to RouteDetails
2021-06-11 09:26:59,165 - INFO - Registering URL /upload/<item> to RouteUpload
2021-06-11 09:26:59,178 - INFO - Registering URL /callback to RouteOAuthLink
2021-06-11 09:26:59,187 - INFO - Registering URL /service/<service>/link to RouteOAuthLink
2021-06-11 09:26:59,199 - INFO - Registering URL /service/<service>/oauth to RouteOAuthLink
2021-06-11 09:26:59,212 - INFO - Registering URL /service/<action> to RouteService
2021-06-11 09:26:59,227 - INFO - Registering URL /control/<cmd> to RouteControl
2021-06-11 09:26:59,240 - INFO - Registering URL /events to RouteEvents
2021-06-11 09:26:59,249 - INFO - Registering URL /events/<int:since> to RouteEvents
2021-06-11 09:26:59,259 - INFO - Registering URL /events/remove/<int:id> to RouteEvents
 * Serving Flask app "modules.server" (lazy loading)
 * Environment: production
   WARNING: Do not use the development server in a production environment.
   Use a production WSGI server instead.
 * Debug mode: on
2021-06-11 09:28:13,491 - INFO - Starting presentation
2021-06-11 09:28:13,498 - DEBUG - Commit this to history
2021-06-11 09:28:24,642 - DEBUG - Took 11.144537 seconds to process, next image is None
2021-06-11 09:28:25,649 - DEBUG - Commit this to history
2021-06-11 09:28:25,675 - DEBUG - Took 0.026341 seconds to process, next image is None
2021-06-11 09:28:27,681 - DEBUG - Commit this to history
2021-06-11 09:28:27,706 - DEBUG - Took 0.025956 seconds to process, next image is None
2021-06-11 09:28:31,712 - DEBUG - Commit this to history
2021-06-11 09:28:31,738 - DEBUG - Took 0.026153 seconds to process, next image is None
2021-06-11 09:28:39,744 - DEBUG - Commit this to history
2021-06-11 09:28:39,771 - DEBUG - Took 0.026794 seconds to process, next image is None
2021-06-11 09:28:55,776 - DEBUG - Commit this to history
2021-06-11 09:28:55,804 - DEBUG - Took 0.028292 seconds to process, next image is None
2021-06-11 09:29:11,810 - DEBUG - Commit this to history
2021-06-11 09:29:11,836 - DEBUG - Took 0.025877 seconds to process, next image is None
2021-06-11 09:29:27,842 - DEBUG - Commit this to history
2021-06-11 09:29:27,867 - DEBUG - Took 0.025914 seconds to process, next image is None
^Croot@raspberrypi:~/photoframe#

Hmm... I'm out of ideas now... I don't have a unused Rpi 3 or 4 unfortunately...
Is there something in the "updates" that break things maybe?

I'm sorry I could not help more...
Let me know if you want me to try anything else?

@Snille
Copy link
Author

Snille commented Jun 11, 2021

OK! New info... Did a reinstall again, same image (2021-05-07-raspios-buster-armhf-lite.zip).
Did not update with the apt update && apt dist-upgrade.
Did not changed the config.txt...
Installed dependencies and cloned the git (new).
I ran frame in debug mode and it worked (running on Rpi 2 B v1.1)!!
Now I did the apt update && apt upgrade and rebooted.
Stared the frame again and it worked again...
Edited the config.txt
Added my stuff....

## For my screen 1280x800
hdmi_group=2
hdmi_mode=28
## Set rotation of the screen.
display_rotate=2 # 180 degrees

Stared the frame again and it did not work...
So, it's something with these settings, Don't know why?

I commented out the first two (group and mode) but left the rotation, restarted and got "fail safe".
Then I commented out the rotate and put group and mode back and now it worked again.
So, it's the "display_rotate" in the config.txt that make the frame to failsafe...
Don't know why. :) However, since some versions back the "rotation" can be configured in the GUI. So, the option is unnecessary to use in the config.txt nowdays. So, this whole problem is not really a problem anymore.
Maybe, document that the option can not be used with the "frame" software somewhere in the Readme. :)

Sorry for taking all your time... At least we now know why...

@dadr
Copy link
Contributor

dadr commented Jun 11, 2021

Det var jättebra! I was able to re-create your error on my Pi Zero.

AND, I have a little good news. If I manually edit the /boot/config.txt to match your monitor rotate config I get the error, BUT, if I leave that alone and change the rotation from the management screen I don't. So I think that the management code does not handle the comment on that config line and that crashes the management screen.

That also makes a pretty easy workaround for you until we fix it. ;-) I was able to edit config.txt to remove the comment, and then saved the file. No need to reboot, the management screen will work from there.

Now I hope you can enjoy testing the feature and saving energy!

Some day I would like to hear your opinion about Home Assistant. I got started early with SmartThings (before Samsung bought them) and I wonder if it would be better to change-over. However, my wife is completely hooked on talking to the Amazon echo to turn on and off lighting, so I try not to experiment too much!

@dadr
Copy link
Contributor

dadr commented Jun 11, 2021

It would also be interesting to figure out an easy way to use these commands with a frame that is set to authenticate access. There are some hints in Issue #162 .

@Snille
Copy link
Author

Snille commented Jun 11, 2021

Skönt att det problemet är löst i alla fall! :)

Ok, I had almost forgot the reason for this thread, so, now i tried to just "visit" (with a webbrowser) the links...
http://ip/control/screenoff
http://ip/control/screenon
I get:
{"control":true}
But nothing happens with the screen. :)
Regardless what I put after control/ I get the same result back. :)

In the debug log:
2021-06-11 13:46:21,390 - WARNING - Unknown event 'screenoff' received, will not act upon it
2021-06-11 13:46:32,638 - WARNING - Unknown event 'screenon' received, will not act upon it

@dadr
Copy link
Contributor

dadr commented Jun 11, 2021

I chose to add the screen commands to another URL that was not associated with making permanent configuration changes. I should have mentioned that I put these instructions in the README.md file:

photoframe also supports 3 web/URL commands to allow controlling the screen through home automation:

http://photoframeip/maintenance/standby   will put the screen to sleep
http://photoframeip/maintenance/resume   will wake the screen up again
http://photoframeip/maintenance/get_standby   will return the current state of this feature

each of these commands will return (in json) a standby : T/F keyword/state pair.
NOTE: this state is not remembered across reboots or updates. This is intentional to allow recovery to a working system.

@dadr
Copy link
Contributor

dadr commented Jun 11, 2021

Right now, the URLs will override other power saving settings to turn the screen off, but not to turn the screen on. (Well, this is what I intended in the code :) So if the schedule or sensor says it should be off, then this will not turn it back on. Also, the get_standby command only reports the state of this input, and even if you get back {"standby":false} the screen might be in powersave by schedule or sensor. I thought that after you have the HA working, you would probably turn off the schedule and sensor anyway. Do you think there is a need to get the overall state of the screen across all inputs? Or to report a triple with the state of each input?

@Snille
Copy link
Author

Snille commented Jun 11, 2021

Great! It works! :)
I missed that in the ReadMe... Sorry...
I can now use all my motion-sensors in the house to turn on and off the frames! :)
The only "thing" maybe, is that it takes a while to process the picture when turning the screen on again (because the Zero is not a powerful machine). It's not really a problem, I just noticed it.
Well, now I just have to reinstall alla my frames... Hehe...

About Home Assistant, I moved over to Home Assistant maybe two years ago. Before that I ran everything in the Fibaro-universe (I'm on Z-wave mostly). But I never did like the usability of the HC2. LUA is fine and all, but HA is just OUTSTANDING when it comes to combability with everything... :) You can get all your "SmartThings" to work with HA as well: https://www.home-assistant.io/integrations/smartthings/ :)

@Snille
Copy link
Author

Snille commented Jun 11, 2021

Right now, the URLs will override other power saving settings to turn the screen off, but not to turn the screen on. (Well, this is what I intended in the code :) So if the schedule or sensor says it should be off, then this will not turn it back on. Also, the get_standby command only reports the state of this input, and even if you get back {"standby":false} the screen might be in powersave by schedule or sensor. I thought that after you have the HA working, you would probably turn off the schedule and sensor anyway. Do you think there is a need to get the overall state of the screen across all inputs? Or to report a triple with the state of each input?

In my case I will turn the schedule off completely and only use HA to control everything (the same way as I'm doing with my MagicMirror today). So, it does not matter for me. :)

@dadr
Copy link
Contributor

dadr commented Jun 11, 2021

I noticed the delay as well. It also happens when the screen turns on again from schedule or sensor. It even happens from one photo to the next if there are big differences in original resolution of the photos. That's the time it takes to render the first picture! I've measured up to 8 minutes on a Pi Zero for photos I've take at high resolution. It did occur to me that a better algorithm would be to prepare a picture and then wait for wakeup or the slideshow timer to say to show it. But that sounds like brain surgery on the photoframe, so I've avoided thinking about it too much!

I will have a look at HA and the link you shared.

@Snille
Copy link
Author

Snille commented Jun 11, 2021

Yes, It's not really a problem. I'm happy with this! :)
The question now is, should I reinstall all my (4) frames with your branch or wait and hope that it get's merged (soon)... :)
If you need more help/ideas/information about HA. Let med know. I'm deep in to that swamp...

Oh, another thing, when I added Google as a provider to the new frame (your branch) the callback URL is wrong. It's calling with the :7777 port... Should not be any port (80). :)

@dadr
Copy link
Contributor

dadr commented Jun 11, 2021

Good catch on the Google provider! If you are happy with the function, and it seems stable... (I'm also running it on 3 photoframes for 3 days now with the schedule and sensor enabled) Then I'll put in a PR so it gets added to the python3 branch. Once that happens, it's really easy to change over to mrworf python3 branch. Similar to the cleanup you have already done:

sudo bash
cd
systemctl stop frame
rm -rf photoframe
git clone --branch python3 --single-branch https://github.com/mrworf/photoframe.git
systemctl start frame

Doing this will have your photoframes keep up with updates there.

Finally - unless you have a monitor that can be adjusted, you need not add the dtparam=i2c2_iknowwhatimdoing to config.txt. The Pi developers clearly think that there is potential problem with people experimenting on that interface.

@Snille
Copy link
Author

Snille commented Jun 11, 2021

I've not done extensive testing just tried it, but it looks good and the function is there. It's working with my Google Album so it's all good. I'm not using authentication so I don't know about that. But I think, send the PR then I'll move over to mrworf's python3 branch. :)

Also I'm not using any sensor, is the i2c2 needed anyway for some other reason?

@dadr
Copy link
Contributor

dadr commented Jun 11, 2021

i2c2 is connected to the HDMI port. It's only needed by ddcutil to adjust monitor brightness and color temp when they support that feature. You need not enable i2c2 nor install ddcutil.

@JuliAn50M
Copy link

Hi Snille, (and this may interest @JuliAn50M ) I've got a branch worked out with this feature, and I wanted to reach out and see if you would be up for testing. It's based on the python3 branch (future version of photoframe). If you are up to testing and doing a manual install, your help and feedback would be great. I can provide some basic instructions, and when we think it's ready, I'll do a PR to let Henric add it to the python3 branch here. What do you think? I'm asking first because this will require quite a bit of work on the command line, and it will help if you're generally familiar with linux on the Raspberry Pi.

Yes I'm interrested by this. I do exactly the same with domoticz. I do it this way
http://192.168.0.40:7777/setting/powersave/none
http://192.168.0.40:7777/setting/powersave/schedule
but I'm ready to test the new version

@dadr
Copy link
Contributor

dadr commented Jul 5, 2021

@JuliAn50M,
I've got this in the current pull request to mrworf's python3 branch. He asked for some good improvements before accepting, so I'll get there as soon as I can. You can wait for that branch or try the one I have queued up in the pull request. Both will still have the bug in #193. I still haven't worked that one out.

If you're impatient to try, the best branch to clone is now:
git clone --branch python3 --single-branch https://github.com/dadr/photoframe.git
I'd appreciate your feedback on anything you find there!!

I think the new command will work differently than the one you have been using: Your command overrides the schedule to turn on the photoframe, but the new command will override the schedule (or sensor) to turn off the photoframe. Between them both, there are two types of automation possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants