ASI120MM on Linux (my report on RPi3/INDI)

any question related to our SDK and driver

Moderators: yang, ray, chad

ASI120MM on Linux (my report on RPi3/INDI)

Postby sergiod » Fri Mar 03, 2017 11:26 am

Is anybody using successfully an ASI120MM on linux?

I have a Raspberry Pi 3 with Raspbian Jessie, kernel 4.9.13-v7+, INDI 1.4.1 (compiled from github, sha id 32d5623332dad10a64c6db206c4d7d787cd04da1), which includes the SDK v.0.6.0110 into the indi-asi driver.

Running indiserver on the RPi3 with indi-asi, and performing a simple test like hitting "Framing" in Focus tab (just a sequence of images), Exp=1s, Bin 1x1, the camera seems to work well for a few minutes, then got stuck (waiting forever at 'StartExposure->setexp : 1.000s' as seen in indi-asi driver debug log). In dmesg, I see these messages:

[27070.448662] usb 1-1.4: new high-speed USB device number 5 using dwc_otg
[27070.699494] usb 1-1.4: New USB device found, idVendor=03c3, idProduct=120a
[27070.699506] usb 1-1.4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[27070.699514] usb 1-1.4: Product: ASI120MM
[27070.699522] usb 1-1.4: Manufacturer: ZWOptical company
[27070.699529] usb 1-1.4: SerialNumber: 00000
[48180.056128] usb 1-1.4: reset high-speed USB device number 5 using dwc_otg
[48181.566120] usb 1-1.4: reset high-speed USB device number 5 using dwc_otg
[48183.306141] usb 1-1.4: reset high-speed USB device number 5 using dwc_otg
... ("reset" message repeats on each exposure)

To recover, I need to pull out the USB cable and reconnect again.


Interestingly, if I roll back the SDK embedded in indi-asi driver from v0.6.0110 to v0.4.0929 (replacing the libASICamera2 library embedded in indi-asi with the one extracted fromhttp://astronomy-imaging-camera.com ... 4.0929.tar), the "reset" dmesg messages are gone, and the camera operates for a longer period, but sadly (after say 1 hour, sometimes more), it also gets stuck. The SDK versions in between behaves like 0.6.0110 ("reset" messages on dmesg).

On a laptop with Kubuntu 16.04.4 (x64) running indiserver, I can connect to the indi_asi driver with Ekos, but exposures always fail no matter the version of the SDK, showing "ASIGetExpStatus failed (0). Restarting exposure... " and then "Exposure failed after 3 attempts".

The camera has been tested on SharpCap in Windows and seems to be ok, so I'm discarding hardware failures.

Anyone got this working? If so, can you report your exact versions (OS/platform, kernel, INDI, etc)?

As I can see in the forum, ZWO is recommending the USB3.0 (-S suffix versions). Any report of these working on a RPi3?

ZWO: I see you blame the hw performance of the USB2.0 cameras to explain why these won't work reliably on Linux (viewtopic.php?f=17&t=6668#p11640). Then why do they work on Windows? (same camera, same computer). It would be great if you fix the linux SDK.

Thanks in advance
Sergio
sergiod
 
Posts: 7
Joined: Fri Mar 03, 2017 10:25 am

Re: ASI120MM on Linux (my report on RPi3/INDI)

Postby chripell » Fri Mar 03, 2017 2:29 pm

Have you tried to adjust USB bandwidth to something fixed instead of auto? I found it critical for smoothly running the ASI1600 under Linux (even on a beefy laptop) together with the ASI120.
chripell
 
Posts: 77
Joined: Tue Sep 17, 2013 4:50 pm

Re: ASI120MM on Linux (my report on RPi3/INDI)

Postby sergiod » Fri Mar 03, 2017 11:53 pm

Thanks for your answer.

The bandwidth was set to 40, which is the lowest value allowed in the INDI driver. 'Auto' setting is disabled.

I forgot to mention that in first place I had to flash the camera with the "compatible" firmware, as the RPi3 complained about the USB packet size of the stock firmware.
sergiod
 
Posts: 7
Joined: Fri Mar 03, 2017 10:25 am

Re: ASI120MM on Linux (my report on RPi3/INDI)

Postby yang » Sat Mar 04, 2017 3:09 am

It is normal that print reset message, can it work with compatible firmware?
ZWO software engineer
Location:lon=120.6 lat=31.3
SuZhou China
yang
Site Admin
 
Posts: 220
Joined: Fri Jul 25, 2014 2:43 am

Re: ASI120MM on Linux (my report on RPi3/INDI)

Postby chripell » Sat Mar 04, 2017 10:02 am

Ah, I see. With the compatible firmware I've never ever got a good frame in 16 bit even on a i7 laptop :-( I use the old ASI Camera for guiding so 8 bit is OK and it works. I think the limitation about maxPacketSize is because of BadUSB attacks. Here is a patch to work around it (but then, I decided to go with compatible firmware mode to avoid the hassle of recompiling my kernels because I use it only for guiding):

diff --git a/drivers/usb/core/config.c b/drivers/usb/core/config.c
index a2d90ac..107635d 100644
--- a/drivers/usb/core/config.c
+++ b/drivers/usb/core/config.c
@@ -349,10 +349,12 @@ static int usb_parse_endpoint(struct device *ddev, int cfgno, int inum,
j = maxpacket_maxes[usb_endpoint_type(&endpoint->desc)];

if (maxp > j) {
- dev_warn(ddev, "config %d interface %d altsetting %d endpoint 0x%X has invalid maxpacket %d, setting to %d\n",
+ dev_warn(ddev, "config %d interface %d altsetting %d endpoint 0x%X has invalid maxpacket %d, setting to %d (IGNORED!)\n",
cfgno, inum, asnum, d->bEndpointAddress, maxp, j);
+#if 0
maxp = j;
endpoint->desc.wMaxPacketSize = cpu_to_le16(i | maxp);
+#endif
}

/*
chripell
 
Posts: 77
Joined: Tue Sep 17, 2013 4:50 pm

Re: ASI120MM on Linux (my report on RPi3/INDI)

Postby sergiod » Sat Mar 04, 2017 3:29 pm

Thanks Yang. I made all my tests with the compatible firmware; with the stock firmware the ASI120MM is not usable on a RPi3 (Rasbian Jessie at least). ZWO recommends the USB3.0 cameras for linux, do you have any success report on a RPi3?

Yang, when you say that reset messages are normal, do you mean your SDK is requesting a device reset to the USB subsystem (via libusb or something) at each exposure?

Thanks chripell... that's pretty advanced stuff for me. If I understood correctly, you're currently ok with the compatible firmware, bandwidth set to a low, fixed value, and 8 bits per pixel.
sergiod
 
Posts: 7
Joined: Fri Mar 03, 2017 10:25 am

Re: ASI120MM on Linux (my report on RPi3/INDI)

Postby yang » Mon Mar 06, 2017 2:58 am

> with the stock firmware the ASI120MM is not usable on a RPi3 (Rasbian Jessie at least).ZWO
> recommends the USB3.0 cameras for linux, do you have any success report on a RPi3?
I have tested 120MM on Pi3(2016-11-25-raspbian-jessie) with the "compatible" firmware and frame works normally , I connect camera through INDIGO server.
a customer use ASI071 on Pi3 successfully with TheSkyX.


>Yang, when you say that reset messages are normal, do you mean your SDK is requesting a device >reset to the USB subsystem (via libusb or something) at each exposure?
yes
ZWO software engineer
Location:lon=120.6 lat=31.3
SuZhou China
yang
Site Admin
 
Posts: 220
Joined: Fri Jul 25, 2014 2:43 am

Re: ASI120MM on Linux (my report on RPi3/INDI)

Postby sergiod » Mon Mar 06, 2017 11:49 am

Hi Yang,

the 120MM does connect and send exposures to the RPi3/INDI, the problem is that is not stable (at least on Jessie). Have it running for a while, see what happens. Sometimes breaks after 5 minutes, sometimes after 90 minutes.

Thanks!
sergiod
 
Posts: 7
Joined: Fri Mar 03, 2017 10:25 am

Re: ASI120MM on Linux (my report on RPi3/INDI)

Postby chripell » Mon Mar 06, 2017 9:04 pm

sergiod wrote:Thanks chripell... that's pretty advanced stuff for me. If I understood correctly, you're currently ok with the compatible firmware, bandwidth set to a low, fixed value, and 8 bits per pixel.


Exactly as you said, but on an i7 laptop. I use the ASI120MM together with an ASI1600MC. The ASI1200MM is set at 1s exposure for OpenPHD. Consider the USB host controller of embedded SOCs can be pretty shitty.

Also, by no means I would consider an USB reset a normal thing :-) It means that the host driver has detected an error condition ad is trying to recover. Maybe the recovery succeeds but well, but it is a last resort, not a normal situation, see http://superuser.com/questions/668911/w ... ice-resets for example.
chripell
 
Posts: 77
Joined: Tue Sep 17, 2013 4:50 pm

Re: ASI120MM on Linux (my report on RPi3/INDI)

Postby kcobby » Tue Apr 11, 2017 7:30 pm

I use chained RPI 3's running headless Ubuntu Mate. Allowed me to install Ekos on each via the ppa. You could check to see if the USB max output current is set to 1.2A, some may be set to 0.6A which is too low for the ASI120MM. If you have other USB powered devices shwring the current on the same RPI you may need to add a powered hub to provide the ASI120MM with enough current.
190mm f5.3 Maksutov Newtonian, NEQ6 Pro, ZWO ASI1600MM-COOLED, EFW7, ASI120MM, WO f4 50mm Guider, KDE Neon, KStars, Ekos, Chained Raspberry Pi 3's, Pixinsight.
kcobby
 
Posts: 8
Joined: Tue Apr 11, 2017 5:54 pm
Location: Dubai, United Arab Emirates

Next

Return to SDK & Driver

Who is online

Users browsing this forum: No registered users and 1 guest