Closed jmerriweather closed 6 years ago
Hi @jmerriweather. Thanks for the PR! This is great. I have a few small change requests that I'm going to relay shortly via the code review mechanism on Github.
The main issue I see now is that the state of the camera is reset when it reconnects. That might be for another PR, being able to keep track of the state of the camera and re-sending that state to the camera when its back up.
Nice, thanks! :heart:
As for the state resetting, I agree - separate PR. I'd like to discuss that a little more though. There was a suggestion to track the values purely in Elixir-land, but I think we'd be better off using Elixir together w/ the getters from MMAL.
@jmerriweather A stop-gap solution that I just thought of: could you monitor the Port process (we might need to expose it) and then use that to reinitialize the settings?
This PR will allow Picam.Camera to continue to run and show an offline image when the port exits. Picam.Camera will attempt to reconnect the port every 10 seconds.