Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "armv8")
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64")
# confusing ! but that works on Raspberry Pi4 Model B Rev 1.5 (call: cat/proc/cpuinfo)
set(LIBASICAMERA_PATH ${CMAKE_CURRENT_SOURCE_DIR}/asi_libs/armv6/libASICamera2.a)
elseif(APPLE)
set(LIBASICAMERA_PATH ${CMAKE_CURRENT_SOURCE_DIR}/asi_libs/mac/libASICamera2.a)
else()
set(LIBASICAMERA_PATH ${CMAKE_CURRENT_SOURCE_DIR}/asi_libs/x64/libASICamera2.a)
endif()
Expand Down
18 changes: 16 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ python wrapper over ZWO astronomical cameras
## What is it

camera-zwo-asi is a python wrapper of the C++ SDK as provided by [ZWO](https://astronomy-imaging-camera.com/). It provides a python object oriented interface for interacting with ZWO astronomical cameras.
The version of SDK currently binded is 1.24.
The version of SDK currently binded is 1.31.
You may find the original C++ SDK binaries and documentation [here](https://astronomy-imaging-camera.com/software-drivers).

## Requirements
Expand All @@ -15,6 +15,7 @@ camera-zwo-asi has been tested only with :

- python 3.10 on Ubuntu 20.04
- python 3.9 on raspberry pi 3 (PI OS Lite 32-bit)
- python 3.11 on MacOS 14.1 (x64 only)

but is likely to work with other recent version of python3 / ubuntu / raspberry. Compilation on other linux based platforms is less likely to be successful.

Expand All @@ -23,7 +24,7 @@ but is likely to work with other recent version of python3 / ubuntu / raspberry.
The following APT dependencies are required:

```bash
apt install -y libusb-1.0-0-dev libgl1-mesa-glx libglib2.0-dev libopencv-dev python3-dev cmake ninja-build libusb-dev
apt install -y libusb-1.0-0-dev libgl1-mesa-glx libglib2.0-dev libopencv-dev python3-dev cmake ninja-build
```

For raspberry, also install:
Expand All @@ -32,6 +33,19 @@ For raspberry, also install:
apt install -y libatlas-base-dev
```

#### MacOS

Currently, the ASI library is not available for aarch64 on MacOS, so Apple Silicon users will have to run the x86 version through Rosetta 2.
The easiest way to do this is using the conda-forge channel on the Conda package management system:

```bash
conda create -n asi
conda activate asi
conda config --env --add channels conda-forge
conda config --env --set subdir osx-64 # Ensures all future operations use the correct package directory. Can skip this line on Intel systems.
conda install python=3.11 libusb pkg-config # pkg-config needed to find libusb correctly
```

## Installation

### from PyPI
Expand Down
Binary file added asi_libs/mac/libASICamera2.a
Binary file not shown.
5 changes: 5 additions & 0 deletions camera_zwo_asi/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"""

import os
import sys
import argparse
from pathlib import Path
from .camera import Camera
Expand All @@ -15,6 +16,10 @@ def udev():
"""
creates a files called 99-asi.rules and provides instruction on how to install it
"""
if sys.platform == 'darwin':
print('\nNo action is needed to enable the USB connection on MacOS.')
return

create_udev_file()
print("\nThe file 99-asi.rules has been created in the current directory.")
print("You may install it: 'sudo install 99-asi.rules /lib/udev/rules.d'")
Expand Down
12 changes: 0 additions & 12 deletions cmake/FindUSB.cmake
Original file line number Diff line number Diff line change
@@ -1,15 +1,3 @@
find_path(USB_INCLUDE_DIR NAMES usb.h
PATHS /usr/include
/usr/local/include
)

if(NOT USB_INCLUDE_DIR)
message(STATUS "libusb has not been found.")
message(STATUS "You can install it by 'sudo apt-get install libusb-dev' ")
message(FATAL_ERROR "libusb is required for building camera-zwo-asi")
endif(NOT USB_INCLUDE_DIR)


INCLUDE(FindPkgConfig)

if(NOT LIBUSB_FOUND)
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
CIBW_CMAKE_OPTIONS = [] # type: ignore
if "CIBUILDWHEEL" in os.environ and os.environ["CIBUILDWHEEL"] == "1":

if sys.platform == "linux":
if sys.platform in ("linux", "darwin"):
CIBW_CMAKE_OPTIONS += ["-DCMAKE_INSTALL_LIBDIR=lib"]

version_path = convert_path('camera_zwo_asi/version.py')
Expand Down