AsiSnap v1.4 Command Line Capture from Raspberry Pi

any question related to our SDK and driver

Moderators: yang, Support@ZWO

Post Reply
User avatar
hamak
Posts: 30
Joined: Mon Feb 16, 2015 6:37 pm
Location: Norway
Contact:

AsiSnap v1.4 Command Line Capture from Raspberry Pi

Post by hamak » Wed Oct 11, 2017 8:59 am

Updated 11.Oct.2017
AsiSnap v1.4 released
  • - Dark Frame Subtraction is working. -drk 0 = Diabled, 1= Enabled
    - Added Set Region Of Interest (ROI). To center 1920x1080 on azi178mc. -rox 588 -roy 500
    - Updated with the new SDK v0.6.0921. works with raspberry pi 2/3
asiSnap14.png
Full source code included in zip file
asisnap14.zip
(480.46 KiB) Downloaded 356 times

Hello there

This is what my Raspberry Pi3 with asiSnap v1.4 does today: http://aurora.klo.no

NB. This project are without GUI, no X-Server and suited for light-weighted and embedded systems when finished!

It was created as a All-Sky Camera Command Line Tool for Raspberry Pi 2 and 3

I have used the latest SDK from ZWO that will work on Minibian and Rasbian lite.
When everything is installed it uses 976MB on MicroSD, 34MB RAM on boot and 160MB RAM when running.

Full Working Setup from clean image with minibian https://minibianpi.wordpress.com/download/
IMPORTANT! Remember there is no sudo installed on minibian image so you are running as root
Default username root and password raspberry

apt-get install -y raspi-config nano # I NOW use raspi-config to expand microsd and reboot
apt-get update # Update RPi
apt-get install -y libopencv-dev fbi zip # Install OpenCV and fbi image viewer
unzip asisnap14.zip # Extract all files to YOUR directory
cp libASICamera2.so /usr/local/lib # Copy this file to avoid error when compiling
ldconfig -v # Load config
./asiSnap

fbi -T 2 image.jpg # If connected by SSH with HDMI screen connected to RPi
fbi image.jpg # Run this if directly connected to RPi with HDMI screen


Known Issues:
When disabling DarkFrame Subtraction with [-drk 0] you need to rename dark.bmp or else it still will use it.
If someone know how to fix this issue please tell me so I can change the code and put it out here.


PS. When you have modified the source code, capture.cpp, just run ./make.sh to compile your code again and run ./asiSnap program again with all the switches you like or need.

My short but true story!
I started learning C/C++ saturday 15.october.2016 when i found the article of Thomas Jacquin's Allsky camera on the web ;-)
http://www.instructables.com/id/Wireles ... /?ALLSTEPS

User avatar
Support2@ZWO
Posts: 668
Joined: Thu Feb 09, 2017 4:58 am

Re: AsiSnap v1.4 Command Line Capture from Raspberry Pi

Post by Support2@ZWO » Tue Oct 17, 2017 6:36 am

Hi hamak,
Well done, thanks for sharing!
Please contact us if you have any questions.
Thanks
chad
ZWO Driver Engineer
Location:lon=120.6 lat=31.3
SuZhou China

User avatar
hotblack43
Posts: 4
Joined: Sun May 20, 2018 8:48 am

Re: AsiSnap v1.4 Command Line Capture from Raspberry Pi

Post by hotblack43 » Sun May 20, 2018 9:03 am

Hi,
I am very glad to find asisnap 1.2 and 1.4. I have a ZWO ASI224MC camera and I am setting it up for night-sky observations. In trying out various softwares I realised the need for a command line programme, just like asisnap.

I have now used asisnap 1.2 for a while. I did have problems with the shared object libASICamera2 not being in my libraries but worked out what to do after a while - I found libASICamera2.a among the files that are installed when PHD2 is installed and copied it to my /usr/lib/. asisnap1.2 then proceeds to work.

I have now seen that asisnap1.4 is available and tried to install it - but make.sh does not compile it - it looks like problems with openCV? Anyway, I cannot solve those problems - but still want to try version 1.4 - however, unlike version 1.2 there is no compiled executable provided in the zip file, which was provided in 1.2 - so I cannot try out 1.4!

Any suggestions on how I can get the compiled executable for 1.4?

Any suggestions on why running make.sh generates so many errors? I did install openCV2 on my raspberry (it takes a whole day, but made no, apparent, difference).

All ideas and suggestions are very welcome!

Cheers,

Peter Thejll
Denmark
ZWO ASI224C camera on an RPi 3B+

User avatar
hotblack43
Posts: 4
Joined: Sun May 20, 2018 8:48 am

Re: AsiSnap v1.4 Command Line Capture from Raspberry Pi

Post by hotblack43 » Mon May 21, 2018 9:10 am

Hi, not sure I understand. Where does the asisnap14.zip file come from? There is not ftp in the minibian image ... and if I did manage to get the zip file, do I extract it as root or as a non-root user?

Peter Thejll
Denmark
ZWO ASI224C camera on an RPi 3B+

MartinGoedbloed
Posts: 4
Joined: Sun Jun 03, 2018 9:34 am

Re: AsiSnap v1.4 Command Line Capture from Raspberry Pi

Post by MartinGoedbloed » Sun Jun 03, 2018 12:58 pm

Hi,

Initially the asiSnap application couldn't be build from source.

Don't think "capture.cpp" contains a real error, but the version of raspbian/gcc wasnt able to create an executable from it.

Used version:
OS : 9.4
G++: gcc version 6.3.0 20170516 (Raspbian 6.3.0-18+rpi1+deb9u1)


On line 398, the string "dark.jpg" must be casted as char* for a succesfull compile.

- ASI_ERROR_CODE err = ASIEnableDarkSubtract(CamNum, "dark.bmp");
+ ASI_ERROR_CODE err = ASIEnableDarkSubtract(CamNum, (char*)"dark.bmp");

Haven't tested if the DarkSubstract functionality also works with this fix, but will test it soon.

Thanks,

Martin

User avatar
hotblack43
Posts: 4
Joined: Sun May 20, 2018 8:48 am

Re: AsiSnap v1.4 Command Line Capture from Raspberry Pi

Post by hotblack43 » Sun Jun 03, 2018 1:32 pm

Hi,
the fix by MartinGoedbloed (thanks for the post!) gets rid of the compile warning, and the code appears to work.

The posted 'known issues' was this:

Known Issues:
When disabling DarkFrame Subtraction with [-drk 0] you need to rename dark.bmp or else it still will use it.
If someone know how to fix this issue please tell me so I can change the code and put it out here.

I do not have a dark.bmp file, and the code ran without problems ... so does this mean that IF I had dark.bmp it would not be used if I have 'drk -0'?

Happy to do my own dark subtraction, though!

Cheers,

Peter Thejll
ZWO ASI224C camera on an RPi 3B+

MartinGoedbloed
Posts: 4
Joined: Sun Jun 03, 2018 9:34 am

Re: AsiSnap v1.4 Command Line Capture from Raspberry Pi

Post by MartinGoedbloed » Sun Jun 03, 2018 6:57 pm

Hi,

I've went through the sourcecode of capture.cpp and the library header file, but can't see any reason that the presence of the 'dark.bmp' file actually enables/disables this mode (the option -drk 0/1 seems to do all the work).

I've found that the setting is stored in the registry (those poor windows users....), and that (forcefully) disabling the option seems to be the workaround.
File : ASICamera2.h

Function : ASIEnableDarkSubtract(int iCameraID, char *pcBMPPath)
==> it will be remembered in registry. so "Dark subtract" is on next time if you close your app.

Function : ASIDisableDarkSubtract(int iCameraID)
==> Disable the dark subtract function.
==> you'd better call it at start if you don't want to use it.
==> because dark subtract function is remembered on windows platform
Gt's

Martin

User avatar
hotblack43
Posts: 4
Joined: Sun May 20, 2018 8:48 am

Re: AsiSnap v1.4 Command Line Capture from Raspberry Pi

Post by hotblack43 » Wed Jul 11, 2018 6:50 am

Hi,
having now been able to compile asisnap1.4 for RPi I wanted to also run asisnap on Ubuntu.

However, when I try to run the make.sh file I get errors

/usr/bin/ld: skipping incompatible //usr/local/lib/libASICamera2.so when searching for -lASICamera2
/usr/bin/ld: cannot find -lASICamera2


Not sure what is going on here - should I find a version of libASICamera.so that is 'intended for Ubuntu and not Raspian'? Not sure that sentence makes sense ...

I can add that trying the above on Macos (High Sierra) works just fine.

Peter Thejll
ZWO ASI224C camera on an RPi 3B+

laheller
Posts: 7
Joined: Thu Apr 18, 2019 9:55 am

Re: AsiSnap v1.4 Command Line Capture from Raspberry Pi

Post by laheller » Sun May 19, 2019 4:28 pm

Hello @hamak

Is it possible to:
1. redirect stream from camera to standard output instead of file?
2. make this work also on Ubuntu Desktop Linux?

BR,

Ladislav

Post Reply