INDI Library v2.0.6 is Released (02 Feb 2024)

Bi-monthly release with minor bug fixes and improvements

Driver for Raspberry Pi "High Quality Camera?"

  • Posts: 49
  • Thank you received: 12

Ok, ill try more with that input, sorry but Im a bit of work spare time now adays so its moving a bit slow.
The following user(s) said Thank You: Keith Venables
3 years 3 weeks ago #67128
The topic has been locked.
  • Posts: 12
  • Thank you received: 1
Many thanks,
If there is anything I can do to help - tests, characterisation etc? Just ask.
Being retired I have no time excuses!
3 years 2 weeks ago #67135
The topic has been locked.
  • Posts: 63
  • Thank you received: 7
Could I inquire as to the latest on this, please?

I have the Pi HQ Camera and want to try it in an All Sky Camera. Previously I have been using ZWO cameras for this with RPi 3B, in particular the ASI178MC but this is a relatively old camera and needs quite a lot of cooling (using 60s exposures) to reduce thermal noise and hot pixels. This system has worked well with KStars/Ekos/INDI but cooling has produced a complicated setup - cooling the case of a non-cooled astro camera is inefficient. I have friends who would like to make an ASC too but ZWO astro cameras are expensive and would be interested if I can get it working with a cheaper camera.

My thinking is that the Pi HQ Camera is a much later addition to the Sony sensor range and could well be a lot more advanced and more sensitive in spite of smaller pixels.

To summarise, I'm looking to use the Pi HQ Camera with INDI and RPi, maybe the RPi Zero, using exposures of around 30s to 60s.

Thanks in advance.
3 years 1 week ago #67552
The topic has been locked.
  • Posts: 12
  • Thank you received: 1
Hi Gina,
Its quite useable with the current indi driver if ones takes care to set the parameters in the right order. I'm able to get exposures up to 200 sec, both through indi, and direct RPi command line.

However, I've been running it alongside a ZWOASI 120MM-S in a plate-solving project to compare performances. The small pixels do seem to be an issue. To get anywhere near the same sensitivity as the ZWO camera I have to bin it 4x4.
The following user(s) said Thank You: Gina Davis
3 years 1 week ago #67554
The topic has been locked.
  • Posts: 1
  • Thank you received: 0
From what I can gather, it appears the RaspiHQ camera is perfectly usable within Ekos, as long as the correct setup order is done (Gain before exposure if I've read the thread correctly?).  I've yet to test this in anger, but I appear to be getting some output during the day which is promising.

What I can't get to work though, is live video or video recording. The live video button below the sequence order window has a cross-through it?! Is this supported yet, or have I missed something on setup?

(Video seems to work fine via comman line and raspivid
2 years 8 months ago #72626
The topic has been locked.
  • Posts: 49
  • Thank you received: 12
Sorry, but live video is not yet supported at all in the driver.
2 years 8 months ago #72630
The topic has been locked.
  • Posts: 121
  • Thank you received: 12

Has there been any progress on this driver? 
Unfortunately now something is wrong with forum and I can read only First page, and last using Reply trick so I cannot see any posts regarding driver. 

I have installed and tried indi_rpicam that does not support video, I would guess that that is this one we are talking about here? but it seems a bit slow and I do not think it can be used for autoguiding, but it can be used for capturing.
I have tried V4L2 CCD driver(sudo apt-get install indi-webcam) and that one does stream video, but it can stream or capture as far as I saw(played for less then 15 minutes), it is also detected in PHD2 and I think it can be used for autoguiding, it might be best at this moment but additional testing and reading needed.
I have tried Indi Webcem driver(sudo apt-get install libindi1), that one is not good for this purpose. 

There should also be support for "libcamera" for raspberry pi. That one should be the best option, but clean new driver will have to be written, but I am not sure about progress as information is scarce, but there is Google coding camp this summer for libcamera, so that is a good news. Libcamera should enable Raspberry Pi to plugin any sensor you want that has appropriate interface(MIPI CSI)
2 years 6 months ago #74473
The topic has been locked.
  • Posts: 19
  • Thank you received: 1
Hi Lars, can I ask, do you disable DPC (Defective Pixel Correction), otherwise known as the Sony Star Eater algorithm. As this is now possible to disable, eg by running this before starting the camera "sudo vcdbg set imx477_dpc 0". Please see here: www.raspberrypi.org/forums/viewtopic.php?t=277768

Last edit: 2 years 5 months ago by James.
2 years 5 months ago #75146
The topic has been locked.
  • Posts: 121
  • Thank you received: 12
I do not agree with that.
You can easily disable that by running a script you mentioned(I created startup.sh script that runs few commands that I run before ekos), and sometimes you do not want that disabled, as I am using this camera for plate solving, I want noise to be reduced so I enable DPC.
Also as this is root command it would require entering password every time you start indi, it does not make sense.

I think most important feature needed is implementation of binning, further speeding up of download(binning would help there as well) 

Also i have a weird bug, I first have to take 10 s exposure that takes 5 seconds, and then i have to take 15s to enable long exposures. If I do not do that, every exposure is locked at 5s for some reason. 

I think Lars is too busy now to make any changes on code of rpi camera. 
2 years 5 months ago #75456
The topic has been locked.
  • Posts: 121
  • Thank you received: 12
I was going through the code and noticed this part with comment :

selectSensorConfig(0 /* What ever 0 means */);

That is actually binning mode, as per documentation:
File Attachment:

Just to note this is for high quality camera, different modes are for different cameras. 

Also interesting thing is that zero is "Automatic" but explenation of that part is missing from documentation except this note for all cameras:
Anything output res below 1296 x 976 will use the 2 x 2 binned mode. 

If automatic works then setting resolution to half should activate binning automatically, but I am not sure how to test that. Maybe by picturing fixed long distance target(lamp) with different resolutions but same exposure?

EDIT: i just tried reducing resolution, unfortunately it is only crop in current implementation of driver, but with resolution of 2028x1520, download time is 0.5 seconds. 

Also I am unable to build and test this mode by changing modes "selectSensorConfig" could someone try to change that and try? 
Last edit: 2 years 5 months ago by Outta.
2 years 5 months ago #75722
The topic has been locked.
  • Posts: 121
  • Thank you received: 12
I managed to get binning working with this driver. Beside better sensitivity binning achieves lower download speed that is now around 1s.
Binning is set by changing sensor mode. There are 4 modes, but actually only mode 2 is useful here as it is full res 2x2 binning. Also there is no separate vertical or horizontal binning. I had to make few more little changes here as well to make this working.

Here is difference in non properly focused countertop of my kitchen:
File Attachment:

I did not make pull request as I have no idea how to make this binning to take value from UI so you have to rebuild every time if you want to change binning. In short change is: setSensorConfig(2) in mmalcamera.cpp, in mmaldriver.cpp and raw12tobayer16pipeline.cpp remove resolution checks. In INDI you have to set resolution manually to 1/2 - 2028x1520.
Here is git diff if someone wants to try:
<code>diff --git a/indi-rpicam/mmalcamera.cpp b/indi-rpicam/mmalcamera.cpp
index bbc36f1..2175bc2 100644
--- a/indi-rpicam/mmalcamera.cpp
+++ b/indi-rpicam/mmalcamera.cpp
@@ -38,7 +38,7 @@ MMALCamera::MMALCamera(int n) : MMALComponent(MMAL_COMPONENT_DEFAULT_CAMERA), ca
-    selectSensorConfig(0 /* What ever 0 means */);
+    selectSensorConfig(2 /* What ever 0 means */);
diff --git a/indi-rpicam/mmaldriver.cpp b/indi-rpicam/mmaldriver.cpp
index fbb1804..2adf7c2 100644
--- a/indi-rpicam/mmaldriver.cpp
+++ b/indi-rpicam/mmaldriver.cpp
@@ -67,13 +67,13 @@ void MMALDriver::assert_framebuffer(INDI::CCDChip *ccd)
     LOGF_DEBUG("%s()", __FUNCTION__);
     int nbuf = (ccd->getXRes() * ccd->getYRes() * (ccd->getBPP() / 8));
-    int expected = 4056 * 3040 * 2;
+   /* int expected = 4056 * 3040 * 2;
     if (nbuf != expected)
         LOGF_DEBUG("%s: frame buffer size set to %d", __FUNCTION__, nbuf);
         LOGF_ERROR("%s: Wrong size of framebuffer: %d, expected %d", __FUNCTION__, nbuf, expected);
-    }
+    }*/
     LOGF_DEBUG("%s: frame buffer size set to %d", __FUNCTION__, nbuf);
diff --git a/indi-rpicam/raw12tobayer16pipeline.cpp b/indi-rpicam/raw12tobayer16pipeline.cpp
index f78f697..6438494 100644
--- a/indi-rpicam/raw12tobayer16pipeline.cpp
+++ b/indi-rpicam/raw12tobayer16pipeline.cpp
@@ -59,9 +59,9 @@ void Raw12ToBayer16Pipeline::data_received(uint8_t *data,  uint32_t length)
     uint8_t byte;
-    assert(bcm_pipe->header.omx_data.raw_width == 6112); 
-    assert(ccd->getXRes() == 4056);
-    assert(ccd->getYRes() == 3040);
+//    assert(bcm_pipe->header.omx_data.raw_width == 6112); 
+//    assert(ccd->getXRes() == 4056);
+//    assert(ccd->getYRes() == 3040);
     int maxX = ccd->getSubW();
     int maxY = ccd->getSubH();
The following user(s) said Thank You: Craig Dobbs
Last edit: 1 year 11 months ago by Outta.
2 years 5 months ago #75954
The topic has been locked.
Thank you! If this is well tested and produce the expected results, then it should be incorporated in the driver when the binning is changed.
2 years 5 months ago #75965
The topic has been locked.
Time to create page: 1.120 seconds