Python binding for ZWO ASI SDK now available

any question related to our SDK and driver

Moderators: yang, ray, chad

Post Reply
stevemarple
Posts: 3
Joined: Fri Dec 09, 2016 3:55 pm

Python binding for ZWO ASI SDK now available

Post by stevemarple » Wed Dec 28, 2016 10:54 pm

I wanted a Python binding for the ZWO ASI SDK but as I couldn't find anything (official or otherwise) I've written one and made it available on Github and Pypi. For more information please see my blog post:
http://blog.stevemarple.co.uk/2016/12/a ... ate-1.html

Still and video mode capture has been tested (briefly) using an ASI 174MC connected to a Raspberry Pi and using Python 2.7. Please report problems via the issue tracker on the Github project page: https://github.com/stevemarple/python-zwoasi

I'll add the Python Software Foundation license text soon.

Steve

User avatar
Florin Andrei
Posts: 7
Joined: Sat Apr 30, 2016 3:27 am
Location: California
Contact:

Re: Python binding for ZWO ASI SDK now available

Post by Florin Andrei » Tue Jan 10, 2017 4:47 am

This is awesome!

stevemarple
Posts: 3
Joined: Fri Dec 09, 2016 3:55 pm

Re: Python binding for ZWO ASI SDK now available

Post by stevemarple » Sun Jan 29, 2017 10:23 pm

Still and video capture have now been used successfully with the ASI174MC, ASI178MC and the ASI1600MM.

riklaunim
Posts: 510
Joined: Tue Dec 31, 2013 6:15 pm

Re: Python binding for ZWO ASI SDK now available

Post by riklaunim » Mon Jan 30, 2017 12:46 am

Interesting, will have to check it out,.

easybob95
Posts: 147
Joined: Wed May 25, 2016 3:51 pm

Re: Python binding for ZWO ASI SDK now available

Post by easybob95 » Sun Sep 02, 2018 1:28 pm

Hello,

i would like to control my asi178mc with a raspberry pi 3 b+.

I have already wrote a program to test the raspberry with the picamera v2 and it works great, except the fact IMX219 is not a suitable sensor for astro. I used python language and common libraries like poencv, numpy, PIL, tkinter.

I have tried to install your python biding for asi sdk. The command pip install zwoasi seems to work fine.

When i try to run your zwoasi_demo.py program, it says "Import Error : no module named 'zwoasi'.

I can't find any solution.

I have also downloaded zwo SDK but i must say i don't know what to do with it.

I suppose you have understand i am complete newbie with linux and raspberry.

Could you explain me step by step :
- what i must do with zwo sdk
- how i can import zwoasi

What i would expect is to be able to import asi commands in python program as i import for example numpy in a python program and start to develop a software for the asi178mc.

Many thanks in advance for your lights !

Alain

easybob95
Posts: 147
Joined: Wed May 25, 2016 3:51 pm

Re: Python binding for ZWO ASI SDK now available

Post by easybob95 » Mon Sep 03, 2018 10:29 am

Hello,

maybe i have found some answers.

Concerning python binding :

i guess i must place zwoasi module in my working directory. In that case, when i run my program, python will look for __init__.py which is in zwoasi directory.

Is that correct ?

Concerning the SDK library, i should place the Armv7 files in a directory which is listed in Python path (for example /usr/lib/Python3).

Is that correct ?

In the python binding example (zwoasi_demo.py), there is a part concerning zwo library initialisation :

env_filename = os.getenv('ZWO_ASI_LIB')

parser = argparse.ArgumentParser(description='Process and save images from a camera')
parser.add_argument('filename',
nargs='?',
help='SDK library filename')
args = parser.parse_args()

# Initialize zwoasi with the name of the SDK library
if args.filename:
asi.init(args.filename)
elif env_filename:
asi.init(env_filename)
else:
print('The filename of the SDK library is required (or set ZWO_ASI_LIB environment variable with the filename)')
sys.exit(1)


Concerning this line : env_filename = os.getenv('ZWO_ASI_LIB')

I suppose it is used to point to the sdk library. I don't understand how a link can be created beteen ZWO_ASI_LIB and the library.

How can i make the link with the library file ?

Alain

easybob95
Posts: 147
Joined: Wed May 25, 2016 3:51 pm

Re: Python binding for ZWO ASI SDK now available

Post by easybob95 » Mon Sep 03, 2018 6:45 pm

I have solved all my problems.

ASI178MC works fine with raspberry pi 3 b+

Alain

User avatar
walkfaraway
Posts: 76
Joined: Tue May 09, 2017 5:52 am
Location: lon=120.6 lat=31.3

Re: Python binding for ZWO ASI SDK now available

Post by walkfaraway » Thu Oct 11, 2018 8:03 am

easybob95 wrote:I have solved all my problems.

ASI178MC works fine with raspberry pi 3 b+

Alain
That sounds very exciting :D
Mouling Song
ZWO Software Engineer
Location:lon=120.6 lat=31.3
SuZhou China

easybob95
Posts: 147
Joined: Wed May 25, 2016 3:51 pm

Re: Python binding for ZWO ASI SDK now available

Post by easybob95 » Thu Oct 11, 2018 9:23 am

walkfaraway wrote:
easybob95 wrote:I have solved all my problems.

ASI178MC works fine with raspberry pi 3 b+

Alain
That sounds very exciting :D
Yes. the camera SDK and the filter wheel SDK works great with Python. Now, i can make what i want with those equipments. The limitation is the processor speed and USB2 but as i don't need high framerate, it's not a problem.

To solve frame rate problem (for Moon imaging for example), i use my software with my laptop under windows 10 and i can reach quite good frame rate with ASI178MM (about 10 fps at full resolution). It's not so bad for Python which is much less fast than C++.

Alain

Post Reply