×

INDI Library v2.0.7 is Released (01 Apr 2024)

Bi-monthly release with minor bug fixes and improvements

Raspberrypi Camera Driver Raspistill - Searching for teammate

  • Posts: 8
  • Thank you received: 1

Rendering Error in layout Message/Item: array_keys(): Argument #1 ($array) must be of type array, null given. Please enable debug mode for more information.

Please Log in or Create an account to join the conversation.

  • Posts: 161
  • Thank you received: 39
I'm considering writing this as well, because the v4l modes don't seem to expose the same ones that raspistill does.

In experimenting, I've come across this which github.com/Gordon999/Pi-AutoGuider seems to work better by a fair bit compared to using the v4l settings, after days of trying to mess with it, and uses most of the process you describe.

Have you started a github project or anything to work on it?
6 years 2 months ago #23955

Please Log in or Create an account to join the conversation.

  • Posts: 161
  • Thank you received: 39
github.com/james-lan/indi/tree/raspiccd

I have started some work on doing this and have gotten images. (Really crappy ones so far) using a V2 and using this library: www.uco.es/investiga/grupos/ava/node/40

After getting those images, I think I'm going to have to either make my own replacement for the library I'm using (tearing into raspistill) or use the raspistill method above.

The more I look at the Raspi cameras the more it looks as ad-hoc as the above code, but I have an understanding of it, which should let me make a decent replacement.

Updates will take a bit.... on the last reboot, the root fs on the SD apparently corrupted.
6 years 1 month ago #25223

Please Log in or Create an account to join the conversation.

  • Posts: 8
  • Thank you received: 1
hi,

I an cleaning my projects right now and before erasing, I share with you a bunch of code lines:

i tweeaked the example 3 in the libindi folder

/**************************************************************************************
** Client is asking us to start an exposure
***************************************************************************************/
bool SimpleCCD::StartExposure(float duration)
{
ExposureRequest = duration;
system("raspiyuv -t 1 -w 2592 -h 1944 -rgb -o /tmp/test.rgb");
// Since we have only have one CCD with one chip, we set the exposure duration of the primary CCD
PrimaryCCD.setExposureDuration(duration);

gettimeofday(&ExpStart, nullptr);

InExposure = true;

// We're done
return true;
}


void SimpleCCD::grabImage()
{
// Let's get a pointer to the frame buffer
uint8_t *image = PrimaryCCD.getFrameBuffer();

streampos size;
char * memblock;

ifstream file ("/tmp/test.rgb2", ios::in | ios::binary);

if (file.is_open())
{
file.seekg (0, ios::end);
size = file.tellg();
memblock = new char [size];
file.seekg (0, ios::beg);
file.read (memblock, size);
file.close();

int expectedNbPixel = PrimaryCCD.getXRes() * PrimaryCCD.getYRes();

uint8_t * red = image;
uint8_t * green = image +expectedNbPixel;
uint8_t * blue = image+2*expectedNbPixel;

for(int i=0;i<expectedNbPixel;i++)
{
*(red++) = (uint8_t)(*(memblock + 3*i ));
*(green++) = (uint8_t)(*(memblock + 3*i + 1));
*(blue++) = (uint8_t)(*(memblock + 3*i + 2));
}

} //end if image exists
IDMessage(getDeviceName(), "Download complete.");

// Let INDI::CCD know we're done filling the image buffer
ExposureComplete(&PrimaryCCD);
}

wish it helps :)

regards
5 years 10 months ago #27017

Please Log in or Create an account to join the conversation.

  • Posts: 44
  • Thank you received: 10
Is there still an interest in pursuing this?
5 years 5 months ago #32027

Please Log in or Create an account to join the conversation.

  • Posts: 161
  • Thank you received: 39
Yeah, now that I know a bit more about INDI (from OnStep) I might pursue this, as a planetary imager. The drawback is forgetting the Pi Camera stuff.
5 years 4 months ago #34064

Please Log in or Create an account to join the conversation.

  • Posts: 44
  • Thank you received: 10
I followed up on the posts here and wrote a simple driver that I have been using for autoguiding. It is capable of long exposures using a stacking technique. The longest that I have tried is a 5 min exposure when the scope was parked, pointed to the north celestial pole (since it is the autoguiding camera).

I could use some help with some of the features that require programming skills that I am weak in. One of those being the video code.

I am working on documenting the install steps now, and can probably post a link in a few days and would be interested in feedback.
5 years 4 months ago #34101

Please Log in or Create an account to join the conversation.

  • Posts: 44
  • Thank you received: 10
As promised, here is the link to my proof-of-concept driver for the Raspberry Pi Camera:

github.com/jdhill-repo/indi-picamera

It is based on a modified INDI Generic CCD driver. I have built it on Raspbian, but not on Mate because I had trouble with the necessary userland build files for Raspiraw. If anyone has success with Mate, I would be interested in your results. Currently, it is only coded for the v2 camera. I went through a lot of trail and error with UV4L, Raspistill, etc before having some success with Raspiraw. It uses Linux system calls and reads the image from a non-blocking pipe.

This is just a basic approach, but hopefully at least a good start for a driver for the Raspberry Pi Camera.
The following user(s) said Thank You: Jasem Mutlaq
5 years 3 months ago #34231

Please Log in or Create an account to join the conversation.

Time to create page: 0.627 seconds