elixir-vision / picam

Elixir library used to capture MJPEG video on a Raspberry Pi using the camera module.
Other
122 stars 27 forks source link

Instead of crashing, show offline image #32

Closed jmerriweather closed 6 years ago

jmerriweather commented 6 years ago

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.

electricshaman commented 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.

jmerriweather commented 6 years ago

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.

electricshaman commented 6 years ago

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.

electricshaman commented 6 years ago

@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?