{"id":848,"date":"2022-02-06T18:39:27","date_gmt":"2022-02-06T09:39:27","guid":{"rendered":"https:\/\/rfsec.ddns.net\/db\/?p=848"},"modified":"2025-10-26T19:47:29","modified_gmt":"2025-10-26T10:47:29","slug":"asi-zwo%e3%82%ab%e3%83%a1%e3%83%a9%e3%82%92python%e3%81%a7%e5%88%a9%e7%94%a8%e3%81%99%e3%82%8b","status":"publish","type":"post","link":"https:\/\/rfsec.ddns.net\/db\/?p=848","title":{"rendered":"ASI ZWO\u30ab\u30e1\u30e9\u3092python\u3067\u5229\u7528\u3059\u308b"},"content":{"rendered":"\n<p>\u6700\u521d\u306bASI_linux_mac_SDK_V1.21\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/p>\n\n\n\n<p><strong>\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u306e\u30ea\u30f3\u30af\u3000<\/strong><\/p>\n\n\n\n<p><blockquote class=\"wp-embedded-content\" data-secret=\"XaYYSJa0GZ\"><a href=\"https:\/\/astronomy-imaging-camera.com\/software-drivers\/\">Software and Drivers<\/a><\/blockquote><iframe loading=\"lazy\" class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; clip: rect(1px, 1px, 1px, 1px);\" title=\"&#8220;Software and Drivers&#8221; &#8212; ZWO ASI\" src=\"https:\/\/astronomy-imaging-camera.com\/software-drivers\/embed\/#?secret=EPyeXDB391#?secret=XaYYSJa0GZ\" data-secret=\"XaYYSJa0GZ\" width=\"600\" height=\"338\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe><\/p>\n\n\n\n<p>\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u3066\u5c55\u958b\u3059\u308b\u3068\uff1b<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>$ls ASI_linux_mac_SDK_V1.21\ndemo  doc  include  lib  license.txt\n$ls ASI_linux_mac_SDK_V1.21\/demo\nMakefile  bin  main_SDK2_snap.cpp  main_SDK2_video.cpp  main_SDK2_video_mac  main_SDK2_video_mac.cpp  readme.txt\n\n$cat readme.txt\nPlease install opencv2 at first, for example under Linux x86 OS, run:\nmake platform=x86\nBelow options is supported:\nx86(Linux 32-bit)\nx64(Linux 64-bit)\narmv5\narmv6\narmv7\narmv8\nmac32\nmac64\nmac(32-bit and 64-bit)\n\nIf libASICamera2.so or (.dylib) can&#39;t be found at run time, resolve by delow two ways:\n1.Add a .conf file that contains the path of the library to \/etc\/ld.so.conf.d\/, run ldconfig.\n2.Add compile option -Wl,-rpath=&lt;library path&gt;<\/code><\/pre><\/div>\n\n\n\n<p>raspberry pi4 64bit OS\u306e\u5834\u5408 <strong>armv8<\/strong> <\/p>\n\n\n\n<p>make\u306b\u5148\u7acb\u3063\u3066\u3001demo\/bin\u306e\u4e0b\u3078armv8\u30d5\u30a9\u30eb\u30c0\u30fc\u3092\u4f5c\u308b\u3002<\/p>\n\n\n\n<p>\/usr\/include\u306e\u4e0b\u306b\u3001opencv2\u306e\u30d5\u30a1\u30a4\u30eb\u4e00\u5f0f\u304c\u5fc5\u8981\u3002<\/p>\n\n\n\n<p>root\u6a29\u9650\u306a\u3057\u3067\u30ab\u30e1\u30e9\u3092\u30a2\u30af\u30bb\u30b9\u3067\u304d\u308b\u3088\u3046\u306b\u3059\u308b\u305f\u3081\u306e\u30eb\u30fc\u30eb\u3092\u8ffd\u52a0<\/p>\n\n\n\n<p>\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u3000ASI_linux_mac_SDK_V1.21lib\/asi.rules\u3092lib\/udev\/rules.d \u307e\u305f\u306f\/etc\/udev\/rules.d\u3078Copy\u3057\u3066\u3001\u30ab\u30e1\u30e9\u3092\u629c\u304d\u5dee\u3057\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>$cd demo\n$mkdir demo\/bin\/armv8\n$make platform=armv8\n\n$ ls demo\/bin\/armv8\/\nlibASICamera2.so  main_SDK2_video_mac  test_gui2_snap  test_gui2_video<\/code><\/pre><\/div>\n\n\n\n<p><strong>libASICamera2.so<\/strong>\u3000\u3092\u53c2\u7167\u3067\u304d\u308b\u3088\u3046\u3001\u9069\u5207\u306a\u30d5\u30a9\u30eb\u30c0\u30fc\u3078\u914d\u7f6e\u3057ldconfig<\/p>\n\n\n\n<p>(\u3042\u307e\u308a\u826f\u3044\u65b9\u6cd5\u3067\u306f\u306a\u3044\u304c\u3001\/lib\u3000\u306e\u4e0b\u3078libASICamera2.so\u3092Copy)<\/p>\n\n\n\n<p>Python\u304b\u3089\u5229\u7528\u3067\u304d\u308b\u3088\u3046\u306b\u30e9\u30a4\u30d6\u30e9\u30fc\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/p>\n\n\n\n<p><a href=\"https:\/\/github.com\/python-zwoasi\/python-zwoasi\">https:\/\/github.com\/python-zwoasi\/python-zwoasi<\/a><\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-python\" data-lang=\"Python\"><code>#!\/usr\/bin\/env python\n\nimport argparse\nimport os\nimport sys\nimport time\nimport zwoasi as asi\n\nenv_filename = os.getenv(&#39;ZWO_ASI_LIB&#39;)<\/code><\/pre><\/div>\n\n\n\n<p>ZWO_ASI_LIB\u306b\u306f\u3001\u6b21\u306e\u30d1\u30b9\u3092\u8a2d\u5b9a<\/p>\n\n\n\n<p>$ echo $ZWO_ASI_LIB<br>\/home\/pi\/python-zwoasi\/build\/lib\/zwoasi<\/p>\n\n\n\n<p>$ ls \/home\/pi\/python-zwoasi\/build\/lib\/zwoasi<\/p>\n\n\n\n<p>__init__.py\u3000\u306e\u5185\u5bb9<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>&quot;&quot;&quot;Interface to ZWO ASI range of USB cameras.\n\nCalls to the `zwoasi` module may raise :class:`TypeError` or :class:`ValueError` exceptions if an input argument\nis incorrect. Failure conditions from within the module may raise exceptions of type :class:`ZWO_Error`. Errors from\nconditions specifically from the SDK C library are indicated by errors of type :class:`ZWO_IOError`; certain\n:func:`Camera.capture()` errors are signalled by :class:`ZWO_CaptureError`.&quot;&quot;&quot;\n\nimport ctypes as c\nfrom ctypes.util import find_library\nimport logging\nimport numpy as np\nimport os\nimport six\nimport sys\nimport time\nimport traceback\n\n\n__author__ = &#39;Steve Marple&#39;\n__version__ = &#39;0.1.0.1&#39;\n__license__ = &#39;MIT&#39;\n\n\ndef get_num_cameras():\n    &quot;&quot;&quot;Retrieves the number of ZWO ASI cameras that are connected. Type :class:`int`.&quot;&quot;&quot;\n    return zwolib.ASIGetNumOfConnectedCameras()<\/code><\/pre><\/div>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6700\u521d\u306bASI_linux_mac_SDK_V1.21\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb \u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u306e\u30ea\u30f3\u30af\u3000 Software and Drivers \u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u3066\u5c55\u958b\u3059\u308b\u3068\uff1b raspberry pi4 64bit OS\u306e\u5834\u5408 ar [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[2],"tags":[],"class_list":["post-848","post","type-post","status-publish","format-standard","hentry","category-camera"],"featured_image_src":null,"author_info":{"display_name":"mars","author_link":"https:\/\/rfsec.ddns.net\/db\/?author=1"},"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/rfsec.ddns.net\/db\/index.php?rest_route=\/wp\/v2\/posts\/848","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/rfsec.ddns.net\/db\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/rfsec.ddns.net\/db\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/rfsec.ddns.net\/db\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/rfsec.ddns.net\/db\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=848"}],"version-history":[{"count":1,"href":"https:\/\/rfsec.ddns.net\/db\/index.php?rest_route=\/wp\/v2\/posts\/848\/revisions"}],"predecessor-version":[{"id":849,"href":"https:\/\/rfsec.ddns.net\/db\/index.php?rest_route=\/wp\/v2\/posts\/848\/revisions\/849"}],"wp:attachment":[{"href":"https:\/\/rfsec.ddns.net\/db\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=848"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/rfsec.ddns.net\/db\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=848"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/rfsec.ddns.net\/db\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=848"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}