qhyccd-lzr / QHYCCD_Linux_New

This repository contains a new (2017+) QHYCCD's Ubuntu Linux 64 and ARM V8 (Raspberry PI3, Odroid XU4) deliveries.
8 stars 3 forks source link

Problems with live frame mode on pi3 #12

Open bodhan opened 5 years ago

bodhan commented 5 years ago

Hello,I couldn't get GetQHYCCDLiveFrame when using QHY174 for live frame mode on a pi3b+, but single frame mode was fine.Error number from GetQHYCCDLiveFrame:-1.Here is my code:

include

include

include

include "libqhy/qhyccd.h"

unsigned short ImgData = NULL; qhyccd_handle camhandle = NULL;

int connectCCD(); int capAndSend(); void closeCCD();

int main() { int ret = connectCCD(); if(ret != 0) { printf("Connect CCD failed!"); }

capAndSend(); closeCCD(); return 0; }

int connectCCD() { int num = 0; int ret = QHYCCD_ERROR; char id[32]; unsigned int w, h, bpp, channels; double chipw, chiph, pixelw, pixelh;

ret = InitQHYCCDResource(); num = ScanQHYCCD(); ret = GetQHYCCDId(0,id); camhandle = OpenQHYCCD(id); ret = SetQHYCCDStreamMode(camhandle,1); ret = InitQHYCCD(camhandle); if(ret == QHYCCD_SUCCESS) { printf("Init CCD success!\n"); } else { printf("Init CCD failed!\n"); return 1; } SetQHYCCDBitsMode(camhandle,16); GetQHYCCDChipInfo(camhandle,&chipw,&chiph,&w,&h,&pixelw,&pixelh,&bpp); printf("max res %dx%d,depth:%d\n",w,h,bpp); SetQHYCCDParam(camhandle,CONTROL_WBR,188); SetQHYCCDParam(camhandle,CONTROL_WBG,128); SetQHYCCDParam(camhandle,CONTROL_WBB,200); SetQHYCCDParam(camhandle,CONTROL_USBTRAFFIC,8); SetQHYCCDParam(camhandle,CONTROL_SPEED,2); SetQHYCCDParam(camhandle,CONTROL_EXPOSURE,128000);

ret = BeginQHYCCDLive(camhandle); if(ret == QHYCCD_SUCCESS) { printf("live start success!\n"); } else { printf("live start failed!\n"); return 1; } return 0; }

int capAndSend() { unsigned int w, h, bpp, channels; int ret = GetQHYCCDLiveFrame(camhandle,&w,&h,&bpp,&channels,(unsigned char*)ImgData); if(ret == QHYCCD_SUCCESS) { printf("Get live frame success!w:%d,h:%d,bpp:%d,channels:%d\n",w,h,bpp,channels); } else { printf("Get live frame failed!%d\n",ret); return 1; } return 0; }

void closeCCD() { delete(ImgData); if(camhandle) { StopQHYCCDLive(camhandle); CloseQHYCCD(camhandle); ReleaseQHYCCDResource(); } } Thanks, Han

qhyccd-lzr commented 5 years ago

Hi,

the drivers are now developed directly at QHYCCD company. So, please go to their web page and download the latest drivers

including their testing application. Many bugs were fixed inside new drivers.

Jan

---------- Původní e-mail ---------- Od: bodhan notifications@github.com Komu: qhyccd-lzr/QHYCCD_Linux_New QHYCCD_Linux_New@noreply.github.com Datum: 29. 3. 2019 4:38:16 Předmět: [qhyccd-lzr/QHYCCD_Linux_New] Problems with live frame mode on pi3 (#12) " Hello,I couldn't get GetQHYCCDLiveFrame when using QHY174 for live frame mode on a pi3b+, but single frame mode was fine.Error number from GetQHYCCDLiveFrame:-1.Here is my code:

include

include

include

include "libqhy/qhyccd.h"

unsigned short ImgData = NULL; qhyccd_handle camhandle = NULL;

int connectCCD(); int capAndSend(); void closeCCD();

int main() { int ret = connectCCD(); if(ret != 0) { printf("Connect CCD failed!"); }

capAndSend(); closeCCD(); return 0; }

int connectCCD() { int num = 0; int ret = QHYCCD_ERROR; char id[32]; unsigned int w, h, bpp, channels; double chipw, chiph, pixelw, pixelh;

ret = InitQHYCCDResource(); num = ScanQHYCCD(); ret = GetQHYCCDId(0,id); camhandle = OpenQHYCCD(id); ret = SetQHYCCDStreamMode(camhandle,1); ret = InitQHYCCD(camhandle); if(ret == QHYCCD_SUCCESS) { printf("Init CCD success!\n"); } else { printf("Init CCD failed!\n"); return 1; } SetQHYCCDBitsMode(camhandle,16); GetQHYCCDChipInfo(camhandle,&chipw,&chiph,&w,&h,&pixelw,&pixelh,&bpp); printf("max res %dx%d,depth:%d\n",w,h,bpp); SetQHYCCDParam(camhandle,CONTROL_WBR,188); SetQHYCCDParam(camhandle,CONTROL_WBG,128); SetQHYCCDParam(camhandle,CONTROL_WBB,200); SetQHYCCDParam(camhandle,CONTROL_USBTRAFFIC,8); SetQHYCCDParam(camhandle,CONTROL_SPEED,2); SetQHYCCDParam(camhandle,CONTROL_EXPOSURE,128000);

ret = BeginQHYCCDLive(camhandle); if(ret == QHYCCD_SUCCESS) { printf("live start success!\n"); } else { printf("live start failed!\n"); return 1; } return 0; }

int capAndSend() { unsigned int w, h, bpp, channels; int ret = GetQHYCCDLiveFrame(camhandle,&w,&h,&bpp,&channels,(unsigned char*) ImgData); if(ret == QHYCCD_SUCCESS) { printf("Get live frame success!w:%d,h:%d,bpp:%d,channels:%d\n",w,h,bpp, channels); } else { printf("Get live frame failed!%d\n",ret); return 1; } return 0; }

void closeCCD() { delete(ImgData); if(camhandle) { StopQHYCCDLive(camhandle); CloseQHYCCD(camhandle); ReleaseQHYCCDResource(); } } Thanks, Han

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub (https://github.com/qhyccd-lzr/QHYCCD_Linux_New/issues/12), or mute the thread (https://github.com/notifications/unsubscribe-auth/AE-NVB8AlBjjl76kHVDo_cfE_FczfG5Bks5vbYqZgaJpZM4cRkDf) . "