Geektoolkit / Dynaframe3

Dynamic Photo and Video Slideshow system for SBC (such as Raspberry pi)
199 stars 37 forks source link

Docker Server #101

Open Protektor-Desura opened 3 years ago

Protektor-Desura commented 3 years ago

Instead of having a bunch of different web interfaces to connect to each picture frame in your home. Why not have a main program that they all connect to on a master server with a single web interface to upload everything to a single place, set settings for each one in one web interface to make it easier to manage all your frames in your home? Doing it under docker would also mean that it would be way simpler for most people to setup and they wouldn't have to know what libraries and such to install and it would just work. You would also be in control of all the versions of everything with a docker as well.

I mean you already added some home automation stuff so you already have a main server to control all the home automation. Plus I would think it would make it simpler for managing with home automation as well.

Geektoolkit commented 3 years ago

Yeah, @RichN001 has mentioned the idea of having a webserver as well, and a few people have mentioned the hassel of managing multiple frames.

I'll look into it. A central place to manage the frames would be powerful, and would allow for much better and easier web development than we're doing right now (plus we'd gain stability). The toughest thing is the avalonia framework that is giving me the smooth (on a pi4) animations isn't super thrifty with memory, and we're already close to the pi3's limits for memory pressure causing segfaults if you load too large of an image even. I have some memory improvements I'm working on to help there, and maybe I have a requirement of a pi4 4gb as a 'server' if you're going to manage several or a dedicated pi to run apache. I'll have to see how thrifty apache is and if I can run it behind Dynaframe reliably....on one hand Dynaframe could drop webserver requirements which would be handy regardless.

It's a great suggestion, I'll look into it and do some experimenting.

dibyadip-das commented 3 years ago

I am looking for the same solution. You can take advantage of Github Action to build your code and push your docker image.

Protektor-Desura commented 3 years ago

I would remove the web server setup running on the frames and put a central website on another machine to handle the web interface. The frames can then just talk to the main server to get pictures, configuration and such. I would think it would make for a much smaller setup needed on a Pi running the frames. You don't have images, you don't have a web server running there. It's just basically a client connecting to the server and throwing up the pictures from the server. It would also mean in theory you don't have to duplicate images on each frame/Pi as well since it would just pull them from the server. It is across a LAN so speed shouldn't be an issue for pulling files.

I would think it would also allow for more complex sorting and displaying of the images/files since you could make a custom playlist on the main server and then just feed a list of files to the frame to pull from the server and display along with code saying how fast to switch and what kind of fade/switch/etc that you want it to do between each file. Basically some kind of XLM file with all the details about what to show and when and how.

qwksilver commented 3 years ago

It would be nice to see a pitcher-catcher type setup, that way both sides can be built into the single frame if that frame is going to be completely stand alone, otherwise you install both on a pi4 and can use lesser units like the pi3 to just catch and display the photo stream.

drinehimer commented 2 years ago

@Geektoolkit @qwksilver Is there still any interest in doing this? I would like to control multiple Dynaframes with Home Assistant and adding some proper REST endpoints (or even better some MTTQ capability. Would be nice to support both eventually). Splitting things between a front end (frame) and back end (that can be combined on a single device) would be a great first step.

If there is still interest I would be happy to contribute.

Geektoolkit commented 2 years ago

@drinehimer I welcome you to contribute a branch and do a PR, and we can review it. I have a toddler and have had a ton of time taken up.

For this project going forward, I'm going to let the community contribute and drive it forward. I'll be working working on a version that is more of a product (it's a ground up rewrite, will be released as a full pi image, and will be designed to be much more user friendly). That product will be Dynaframe Pro and where I'll spend my time. I eventually will add MQTT to it, and probably a proper rest endpoint at some point as well (though right now I'm working on an ajax frontend with some fancy features there)

drinehimer commented 2 years ago

@Geektoolkit thanks and I completely understand the time commitment to the kids (mine are finally sleeping through the night about half the time).

This is a pretty big change no matter what so I wanted to get my thoughts in front of you before I get too far along. I already started working on a branch locally to start moving things and do a little tinkering with new stuff for my personal benefit. I was able to convert the UI to blazor (web assembly) pretty easily and have Avalonia start up the ASP.NET Core engine to serve it and Web API endpoints up in place of the SimpleHttpServer (Thought being to convert things to easier/more standard web technologies to work with and then split them into two).

TLDR; Do you have any concerns with bringing in Blazor WebAssembly for the webpage? If not I will keep moving forward in that direction.

Geektoolkit commented 2 years ago

No concern whatsoever.

The "pro" branch I'm working on basically moved all of the http commands to a more rest like API and then the web front end used Ajax calls. It cleans up everything and makes that disaster of a simplehttpserver.cs mostly go away. I think you're heading in a similar direction with this code base and the community will love you for it :)

drinehimer commented 2 years ago

@Geektoolkit I have the blazor migration portion done. In the interest of not making the PR too big I would like to go ahead and do one just for the blazor portion and a seperate for docker. In order to not have to create a 3.0 followed shortly by a 4.0 I think it would be best to create a 3.0 branch that I can merge to until the second PR is complete.

Geektoolkit commented 2 years ago

Dan, that sounds great. I just added you to the collaborators group so you have access to handle checkins and such. Since you go that involved with the code you should be able to help manage it :) Feel free to add me to the PRs. The way I've handled the builds here has been a bit fast and loose because the 'official' releases are all tested by the community and then promoted. So don't feel like you have to get everything rock solid to create a beta release and get feedback. Please note that the top of tree though has a database change and may have inroduced other playlist bugs.
My dynaframe pro fork that I'm planning on releasing as an image release (no source, but better supported) is so far removed from this at this point that I'm not of much help, but that's ok and was always my plan. I want the community to drive this forward and have it as a very hackable setup that they can make solve issues they have. I appreciate the passion and work and I'm excited to see the results!

drinehimer commented 2 years ago

Sounds good. I went ahead and created the 3.0 branch and a PR to that. It doesn't effectively change much to the end user with this PR although it does break/improve the endpoints to follow normal REST standards. If you or the community feel like it is worth going ahead and shipping before I get the docker change - might take a couple months depending on how much time the family gives me :) - then I would be happy to do that and get the documentation updated.

In terms of CI/CD I can probably help with that a little down the road as well. I have a lot of experience setting up CI/CD. Primarily Azure DevOps, but the project I have been working on for my company most of this year was done on Github with Github Actions.

Geektoolkit commented 2 years ago

Cool I should have time to review it tomorrow evening. I appreciate the assistance. I totally get the family aspect!

drinehimer commented 2 years ago

I was finally able to get this completed. Looks like the first PR is still open. I went ahead and opened a second to a 3.0 branch.

Geektoolkit commented 2 years ago

Got it, both should be completed. looks like a ton of great work!

drinehimer commented 2 years ago

I have merged both PRs. It is ready for any additional testing you or others want. I already had it running in combined mode for a week on my living room monitor and then switched to running the server on a k3s cluster. The docker file is set up to build the container, but a registry will be needed to push to.