QHYCCD

Firmware Not Loading Properly for QHY5III178

Alcan

Firmware Not Loading Properly for QHY5III178
« on: December 09, 2017, 11:41:34 PM »
I just got my QHY5III178, and I'm running into problems with the step of loading the firmware to the camera  on Debian.

It doesn't matter if I do it manually with fxload, or if I use the udev rules to do it automatically as soon as I plug in the USB cable---there's no error generated at this loading step, but the camera won't return an image (or rather, the returned image is blank with only zeros). Nothing in dmesg (or syslog) indicates anything went wrong:

Code: [Select]
[  926.314247] usb 1-4: new high-speed USB device number 5 using xhci_hcd
[  926.454797] usb 1-4: New USB device found, idVendor=1618, idProduct=0178
[  926.454799] usb 1-4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[  926.454801] usb 1-4: Product: WestBridge
[  926.454802] usb 1-4: Manufacturer: Cypress
[  926.454803] usb 1-4: SerialNumber: 0000000004BE
[  926.526696] usb 1-4: USB disconnect, device number 5
[  926.798254] usb 2-4: new SuperSpeed USB device number 3 using xhci_hcd
[  926.818815] usb 2-4: LPM exit latency is zeroed, disabling LPM.
[  926.819284] usb 2-4: New USB device found, idVendor=1618, idProduct=0179
[  926.819286] usb 2-4: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[  926.819288] usb 2-4: Product: Titan178U
[  926.819289] usb 2-4: Manufacturer: QHYCCD

However, if I try to run the LiveFrameSampletest, I get the following errors:

Code: [Select]
2017-12-09 21:47:41.874 LOG_ALARM -----------------  log4z thread started!   ----------------------------
2017-12-09 21:47:41.874 LOG_ALARM logger id=0 key=Main name=LiveFrameSampletest path=/tmp/ level=1 display=1
2017-12-09 21:47:42.066 LOG_FATAL libusb_control_transfer write ex (qhycam.cpp):551
2017-12-09 21:47:42.066 LOG_FATAL libusb_control_transfer write ex (qhycam.cpp):551
2017-12-09 21:47:42.066 LOG_FATAL libusb_control_transfer write ex (qhycam.cpp):551
2017-12-09 21:47:42.066 LOG_FATAL libusb_control_transfer write ex (qhycam.cpp):551

so something went wrong.

I narrowed the issue down to the firmware loading on Linux because if I reboot into Windows after doing this (without removing the camera from the USB port), EZCAP will similarly return a blank image. However, if I disconnect and reconnect the USB cable and connect to the camera again in EZCAP, it now works and returns a real image. If I reboot back into Debian after doing this, the camera still continues to work and return images (and the error in LiveFrameSampletest is gone).

Everything stops working again as soon as I disconnect and reconnect the USB cable while in Debian and load the firmware manually or automatically as described above.

Any ideas? Is the QHY5III178.img on Github the same as the firmware being loaded by EZCAP on Windows? I'd like to be able to use this camera in Debian without having to boot into Windows every time I connect it. Help is appreciated.

Alcan

Re: Firmware Not Loading Properly for QHY5III178
« Reply #1 on: December 10, 2017, 04:17:38 AM »
Just an update that the result is basically identical on a Ubuntu 16.04 VM (on the same computer as before) and on Raspbian 9 (on a Raspberry Pi 3)---i.e., blank/zero image returned after an apparent successful connection to the camera.

Re: Firmware Not Loading Properly for QHY5III178
« Reply #2 on: December 10, 2017, 07:18:47 PM »
Hi,
    You can input "lsusb" command,and check if the pid is 0178 or 0179.If no QHYCCD device pid,that means computer doesn't,if pid is 0178,that means computer found it but download firmware failed,if pid is 0179,that means computer found it and download firmware success.
    In addition,could tell me which machine do you use?Linux machine,virtual machine or raspberry?
QinXiaoXu

Alcan

Re: Firmware Not Loading Properly for QHY5III178
« Reply #3 on: December 10, 2017, 09:42:32 PM »
I've tested on all three (on Linux machine running Debian 9 + virtual machine running Ubuntu 16.04, and Raspberry Pi 3 running Raspbian 9), all with the same result.

The device number is initially 0178 until fxload is run (either by the udev rule, or manually, with no difference). It becomes 0179 after fxload is run (no errors in /var/log/syslog, or anywhere else I could find). However, the images being returned are blank (and the demo shows the "write ex" error).


As a (hopefully) temporary workaround so that I can use the camera without rebooting into Windows and back into Linux, I installed a Windows XP virtual machine with the Windows driver, and commented out the udev rule for the camera (so that fxload isn't run in Linux). Then, every time I connect the camera, I run the WinXP VM which does its equivalent of fxload, after which, I can shut down the VM, and the camera works as expected in Linux.
« Last Edit: December 10, 2017, 09:44:42 PM by Alcan »

Re: Firmware Not Loading Properly for QHY5III178
« Reply #4 on: December 10, 2017, 10:46:19 PM »
These are SDK I use now,you can use them replace your old SDK.And here is my test program.

Alcan

Re: Firmware Not Loading Properly for QHY5III178
« Reply #5 on: December 10, 2017, 11:33:00 PM »
That still doesn't seem to work. I think the QHYIII178.img is identical to the one I had before.

I've tried several different fxload variants as well, including fx3load from here: https://sourceforge.net/projects/fx3load/, the fxload in the SDK (which might be the same as fx3load), and fxload-libusb (another fxload fork with fx3 support) from here: https://github.com/indilib/indi/tree/master/3rdparty/fxload-libusb, all with the same result of blank images, regardless of if I use the prebuilt binaries or if I build the fxload from source.

Re: Firmware Not Loading Properly for QHY5III178
« Reply #6 on: December 10, 2017, 11:51:12 PM »
Did you test by LiveFrameSample.cpp?Is it output some other debug information?
You can also install KStars software to check if camera is good?
« Last Edit: December 11, 2017, 12:08:07 AM by QinXiaoXu »

Re: Firmware Not Loading Properly for QHY5III178
« Reply #7 on: December 11, 2017, 01:12:25 AM »
If image you got like this?

Alcan

Re: Firmware Not Loading Properly for QHY5III178
« Reply #8 on: December 11, 2017, 02:52:13 AM »
Mine came out all black (screenshot attached) but still completely blank. In KStars Ekos, the image is pure white (still all zeros). Here's the output from the LiveFrameSampletest:

Code: [Select]
2017-12-11 01:47:21.499 LOG_ALARM -----------------  log4z thread started!   ----------------------------
2017-12-11 01:47:21.499 LOG_ALARM logger id=0 key=Main name=LiveFrameSampletest path=/tmp/ level=1 display=1
Init SDK success!
camtype = 4008 index = 0
nid:0
Yes!Found QHYCCD,the num is 1
connected to the first camera from the list,id is QHY5III178M-d417cd4e8cd767946
Open QHYCCD success!
Set QHYCCD stream mode success!
Init QHYCCD success!
Get QHYCCD ChipInfo success!
CCD/CMOS chip information  :
CCD/CMOS chip width        :9.993000 mm
CCD/CMOS chip height       :8.431000 mm
CCD/CMOS chip pixel width  :2.400000 um
CCD/CMOS chip pixel height :2.400000 um
CCD/CMOS chip width        :3056
CCD/CMOS chip height       :2048
CCD/CMOS chip depth        :8
This is not a color camera!
This camera doesn't have DDR!
Can set this camera bits!
2017-12-11 01:47:21.691 LOG_FATAL libusb_control_transfer write ex (qhycam.cpp):551
2017-12-11 01:47:21.691 LOG_FATAL libusb_control_transfer write ex (qhycam.cpp):551
2017-12-11 01:47:21.691 LOG_FATAL libusb_control_transfer write ex (qhycam.cpp):551
2017-12-11 01:47:21.692 LOG_FATAL libusb_control_transfer write ex (qhycam.cpp):551
Set camera gain success!
Can set this camera USBTraffic!
Set camera USBTraffic success!
Now this camera exposure time is 20 ms.
Set camera exposure time success!
Now this camera exposure time is 15 ms.
Can't set this camera speed!
Can set this camera 1X1 bin mode.
Set camera 1X1 bin mode success!
Set camera resolution success!
Get camrea memory length success!
BeginQHYCCDLive success!
Time pass:  1 |
Time pass:  2 |
Time pass:  3 |
Time pass:  4 |
Time pass:  5 | Frame rate: 19.6
Time pass:  6 |
Time pass:  7 |
Time pass:  8 |
Time pass:  9 |
Time pass: 10 | Frame rate: 24.8
Time pass: 11 |
Time pass: 12 |
Time pass: 13 |
Time pass: 14 |
Time pass: 15 | Frame rate: 25.0
Time pass: 16 |
Time pass: 17 |
Time pass: 18 |
Time pass: 19 |
Time pass: 20 | Frame rate: 24.6
Time pass: 21 |
Time pass: 22 |
Time pass: 23 |
Time pass: 24 |
Time pass: 25 | Frame rate: 24.8
...

Re: Firmware Not Loading Properly for QHY5III178
« Reply #9 on: December 11, 2017, 03:14:22 AM »
well,do you open the lid and add camera lens when you test it?Or you can modify exposure time check if have any change.
« Last Edit: December 11, 2017, 03:21:55 AM by QinXiaoXu »

Alcan

Re: Firmware Not Loading Properly for QHY5III178
« Reply #10 on: December 11, 2017, 03:48:58 AM »
Even with no light on the sensor, its output isn't all zero. In any case, there's no response to light at all, unless I load the firmware in Windows first (in which case, the camera works as expected, and I can take pictures through a telescope, etc.).

I attached a typical dark frame taken in Linux AFTER I loaded the firmware in Windows. This is what I expect a dark frame to look like. I do not get this after I load the QHY5III178.img with fxload---all I get after loading the firmware in Linux is an image that is all zeros (i.e., all white, or all black depending on brightness scaling).
« Last Edit: December 11, 2017, 03:51:23 AM by Alcan »

Re: Firmware Not Loading Properly for QHY5III178
« Reply #11 on: December 11, 2017, 07:06:04 PM »
em~~~ If you don't mind,could I remote control your computer to know more details?And you can send email to me to reply you timely,my email is qxx@qhyccd.com.Or you can send message to my google hungouts,it is qhyccdqxx@gmail.com.
« Last Edit: December 11, 2017, 07:18:16 PM by QinXiaoXu »

astrosoft

  • *
  • 105
  • Astronomical software developer C,C++,Java,Android
    • View Profile
    • Email
Re: Firmware Not Loading Properly for QHY5III178
« Reply #12 on: December 11, 2017, 11:23:55 PM »
Alcan,
as QinXiaoXu mentioned, if you see 1618:0179, firmware was properly uploaded to you camera.
Here is my dmesg, which is same to your one:

The first stage detection:
--------------------------------
[ 2079.273757] usb 1-2: New USB device found, idVendor=1618, idProduct=0178
[ 2079.273763] usb 1-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 2079.273768] usb 1-2: Product: WestBridge
[ 2079.273771] usb 1-2: Manufacturer: Cypress
[ 2079.273775] usb 1-2: SerialNumber: 0000000004BE
[ 2079.341982] usb 1-2: USB disconnect, device number 7
[ 2079.673179] usb 2-2: new SuperSpeed USB device number 3 using xhci_hcd
[ 2079.694012] usb 2-2: LPM exit latency is zeroed, disabling LPM.

Camera reboots after firmware is uploaded, then seen as:
-------------------------------------------------------------------------
[ 2079.694684] usb 2-2: New USB device found, idVendor=1618, idProduct=0179
[ 2079.694690] usb 2-2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 2079.694694] usb 2-2: Product: Titan178U
[ 2079.694698] usb 2-2: Manufacturer: QHYCCD

So, the problem is somewhere is application, not inside the camera. Please note, that I can run this camera without any problems
with TheSkyX on Linux and MacOSX.

Important:
I am not sure this will run on RPI3. That camera was not tested (updated) when this driver was released. I got that camera much later.
I will release a new RPI3 stuff ASAP, but need to finish other stuff.

Below is listing from TSX (Ubuntu):

X2Camera::CCEstablishLink start...
X2Camera::CCEstablishLink: m_SelectedCamera: QHY5III178C-d7d1e5459abdfc975
X2Camera::CCEstablishLink: ScanQHYCCD() found 1 cameras.
X2Camera::CCEstablishLink: QHY5III178C-d7d1e5459abdfc975 camera opened!
X2Camera::CCEstablishLink end...
X2Camera::CCStartExposure start...
X2Camera::CCStartExposure: exposure was set to: 0,100 [sec]
X2Camera::CCStartExposure: USB speed was set to: 0
X2Camera::CCStartExposure exposure time: 100000,000 [us]
X2Camera::CCStartExposure end...
X2Camera::CCEndExposure start...
X2Camera::CCEndExposure end...
X2Camera::CCReadoutImage      : Image request: 3056 x 2048 x 16 x 1
X2Camera::CCReadoutImage      : Image result : 3056 x 2048 x 16 x 1
X2Camera::CCReadoutImage      : No subframe, no binning.

Regards,
Jan
Jan Soldan 
Astronomical software development
QHYCCD distributor and European Warranty, Repair,
Warehouse centre

V Lukach 451,
251 65 Ondrejov,
Czech Republic

Email : astrosoft@email.cz
Mobile : +420 728 403 811
http://www.linkedin.com/in/jansoldan

Alcan

Re: Firmware Not Loading Properly for QHY5III178
« Reply #13 on: December 11, 2017, 11:41:59 PM »
Alcan,
as QinXiaoXu mentioned, if you see 1618:0179, firmware was properly uploaded to you camera.
Here is my dmesg, which is same to your one:

The first stage detection:
--------------------------------
[ 2079.273757] usb 1-2: New USB device found, idVendor=1618, idProduct=0178
[ 2079.273763] usb 1-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 2079.273768] usb 1-2: Product: WestBridge
[ 2079.273771] usb 1-2: Manufacturer: Cypress
[ 2079.273775] usb 1-2: SerialNumber: 0000000004BE
[ 2079.341982] usb 1-2: USB disconnect, device number 7
[ 2079.673179] usb 2-2: new SuperSpeed USB device number 3 using xhci_hcd
[ 2079.694012] usb 2-2: LPM exit latency is zeroed, disabling LPM.

Camera reboots after firmware is uploaded, then seen as:
-------------------------------------------------------------------------
[ 2079.694684] usb 2-2: New USB device found, idVendor=1618, idProduct=0179
[ 2079.694690] usb 2-2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 2079.694694] usb 2-2: Product: Titan178U
[ 2079.694698] usb 2-2: Manufacturer: QHYCCD

Given that the camera works perfectly fine on Linux if the firmware is loaded on Windows, and doesn't work in Linux or Windows if the firmware is loaded on Linux, that implies the problem must necessarily lie in the firmware loading. In fact, as I have it set up now, my Windows XP VM doesn't even see the second stage at all---from its perspective, the first stage is shown, the firmware is loaded, and the camera just disappears from its view. Meanwhile, all the image capture applications on the Linux host now work perfectly fine. From this, the only logical conclusion is that the difference between what makes Windows work and Linux not work is happening before the 178->179 change, since it works on Linux even if Windows never sees the 179.

The driver could very well not work on the RPi. However, at the moment, everything is behaving identically on the RPi as on my x86-64 machine.

Alcan

Re: Firmware Not Loading Properly for QHY5III178
« Reply #14 on: December 11, 2017, 11:44:03 PM »
Also, could this problem be limited to the monochrome version of this camera? I noticed that both of you are using the QHY5III178C, while mine is a QHY5III178M.