techyian / MMALSharp

C# wrapper to Broadcom's MMAL with an API to the Raspberry Pi camera.
MIT License
195 stars 33 forks source link

Function not implemented. Unable to set camera config. #84

Closed wwombatt closed 5 years ago

wwombatt commented 5 years ago

I am having a problem using the library i use it on a raspberry pi 3 model b with .net core 2.1. When i run the all the examples i can see it captures always on picture and then crashes with the following exception:

Successfully processed 2.81mb.

Unhandled Exception: MMALSharp.MMALNotImplementedException: Function not implemented. Unable to set camera config. at MMALSharp.MMALCallerHelper.MMALCheck(MMAL_STATUS_T status, String message) at MMALSharp.Components.MMALCameraComponent.Initialise() at MMALSharp.MMALCamera.TakeRawPicture(ICaptureHandler handler)

I use this piece of code from the examples:

public async Task TakeTimelapsePicture() {
MMALCamera cam = MMALCamera.Instance;

// This example will take an image every 10 seconds for 4 hours
using (var imgCaptureHandler = new ImageStreamCaptureHandler("/home/pi/images/", "jpg"))
{
    var cts = new CancellationTokenSource(TimeSpan.FromHours(4));
    var tl = new Timelapse { Mode = TimelapseMode.Second, CancellationToken = cts.Token, Value = 10 };
    await cam.TakePictureTimelapse(imgCaptureHandler, MMALEncoding.JPEG, MMALEncoding.I420, tl);
}

// Only call when you no longer require the camera, i.e. on app shutdown.
cam.Cleanup();

}

techyian commented 5 years ago

Hi, what was the cause of the issue here?

wwombatt commented 5 years ago

Hi, what was the cause of the issue here?

It seemed it had something to do with configuring my raspberry pi because after a reboot it was working as expected. I could not reproduce the issue

techyian commented 5 years ago

Ok, thanks for letting me know.