-
-
Notifications
You must be signed in to change notification settings - Fork 38
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
Comments
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. |
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. :) |
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. |
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. :) |
Curious, how is it broken? |
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:
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. |
@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. :) |
@dadr Great! I'll get on it tomorrow! :) |
Can you grab logs from the system? Would love to find out what's wrong so the image works. |
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. |
@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: Let me know what else you want to know? :) |
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: |
Hi again... Sunny here too, afternoon though... :) Here is the page that show up: When running the ddcutil (in SSH not on the actual console) there is not output in the file.
Let me know... :) |
Thanks for all the good info. Just confirming, you are only connected to your LAN with WiFi? Try 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 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. |
@dadr Nah, I'm connecting to SSH via the ethernet cable (just to get at stable connection). But the wifi is also "connected".
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... I can do a reinstall of the whole frame again if you think something has gone wrong? :) |
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
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:
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. If that looks normal, then you could try:
If that does not help, then try to re-install on a new SD card? :-( |
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"...
And debug after the "cleaning" (still get failsafe-page)...
Next step, reinstall on a new SD-card and in another RPi-Zero... I'll make a new post. :) |
Ok, same SD-Card, same install. Another RPi-Zero connected to another screen.
Next up. reinstall on a new SD-Card... |
Install procedure on new SD-Card:
Debug info...
Just realized I cloned the "original" repo. So, I'm cleaning up and cloning the correct one.
But still get failsafe page... :(
Next up, try this install in another Rpi (not a Zero) if I can find one. :) |
Ok, same result on a Rpi 2 Model B v1.1 with ethernet LAN connected.
Next up a Rpi B+... |
Ok, same result on a Rpi Model B+ v1.2 with ethernet LAN connected.
Hmm... I'm out of ideas now... I don't have a unused Rpi 3 or 4 unfortunately... I'm sorry I could not help more... |
OK! New info... Did a reinstall again, same image (2021-05-07-raspios-buster-armhf-lite.zip).
Stared the frame again and it did not work... I commented out the first two (group and mode) but left the rotation, restarted and got "fail safe". Sorry for taking all your time... At least we now know why... |
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 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! |
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 . |
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... In the debug log: |
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:
each of these commands will return (in json) a standby : T/F keyword/state pair. |
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? |
Great! It works! :) 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/ :) |
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. :) |
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. |
Yes, It's not really a problem. I'm happy with this! :) 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). :) |
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:
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 |
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? |
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. |
Yes I'm interrested by this. I do exactly the same with domoticz. I do it this way |
@JuliAn50M, If you're impatient to try, the best branch to clone is now: 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. |
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?
The text was updated successfully, but these errors were encountered: