×

INDI Library v2.0.7 is Released (01 Apr 2024)

Bi-monthly release with minor bug fixes and improvements

sx_ccd_test version 1.8 fails with LIBUSB_ERROR

  • Posts: 10
  • Thank you received: 0
Peter, anything I can do to help with the sxGetBuildNumber problem? If I can help please let me know.... Ted
8 years 6 months ago #5264

Please Log in or Create an account to join the conversation.

  • Posts: 712
  • Thank you received: 174
Ted, thank you, but I'll simply put it out from API, there is no use for this call anyway... Peter
8 years 6 months ago #5271

Please Log in or Create an account to join the conversation.

  • Posts: 10
  • Thank you received: 0
Ok Peter!

One further question about the driver in general. I have not tried it yet, however if I change this line:

snprintf(this->name, 32, "SX CCD %s", name);
to
snprintf(this->name, 32, "SX_CD_ %s", name);
at line #201 in sxcdd.ccp

Will that remove those irritating embedded spaces in the file names? I'll test this later today, just wondering if there is a good reason to leave the spaces?

Cheers! Ted
Last edit: 8 years 6 months ago by Ted. Reason: addition
8 years 6 months ago #5274

Please Log in or Create an account to join the conversation.

  • Posts: 712
  • Thank you received: 174
Hi Ted, it will work, it is just convention to use "nice" names here as far as they are used as user readable descriptions. I hope that it is never used as file name. In case of SX driver it may fail for parallel-to-usb adapter which is called "MX Camera". List of all name suffixes is in sxccdusb.cpp at line 125. Peter
8 years 6 months ago #5275

Please Log in or Create an account to join the conversation.


This is the device name only, filenames use a different template depending on which program you use. For Ekos, it's customized by you in the CCD module.
8 years 6 months ago #5278

Please Log in or Create an account to join the conversation.

  • Posts: 193
  • Thank you received: 46
What are you using to fetch files, that's writing them out with annoying filenames ?

If you want a quick and dirty sample in c++, I can post the source for my quick hack that I use to generate the movies from an overnight run of fetching frames from oculus. It stores them in filenames generated by timestamps.
8 years 6 months ago #5279

Please Log in or Create an account to join the conversation.

  • Posts: 10
  • Thank you received: 0

I am using the indi_takeimage script I posted on page two to take the images. I'm sure I am missing many things, it was a quick and dirty solution I found here. It always produces an image named "SX CCD SuperStar.CCD1.CCD1.fits", which is renamed by the last line in the script.

I'd love to see your movie hack Gerry. I could use animate to move the fits files but that is not good for browser access.

knro, so far I am not using Ekos, I may get there, time will tell...

Thanks all! Ted
8 years 6 months ago #5280

Please Log in or Create an account to join the conversation.

  • Posts: 712
  • Thank you received: 174
Now I understand... Yes, in this case the device name is really used in the file name, but I prefer to keep it in "nice" version with spaces anyway. You probably can handle it in shell scripts easily, it will be much harder to restore it to readable form in GUI tools. Peter
8 years 6 months ago #5283

Please Log in or Create an account to join the conversation.

  • Posts: 193
  • Thank you received: 46
The way I make the movies, is a 3 step process.

Step 1 - program runs all night, just grabbing frames from oculus, and storing them as fits files. I have the original version with the wider lens, so I set the bounds to cut off the black pieces, only grabbing the middle 1040x1040 of the sensor. This just ends me up with a directory of fits files, which your script could easily do too.

I'll get the source for this into a public location somewhere thru the day today.

Step 2 - I run a script against the directory of fits files, which produces a directory of jpeg files.

Step 3 - Use mencoder to make the movie from the jpegs.

Here is the script that does the conversions, it is set up to spawn 8 jobs in parallel (I use an 8 core machine to do it). Input filenames are expected to be in a format like this, 20150821134112.fits, where the filename is generated from the timestamp at the time it's written out, it's fairly obvious I think, yyyymmddhhmmss.fits. If one wanted to get really fancy, could probably write something to pull that info out of the fits file, but, I didn't get that fancy. the script further shaves a bit off of each image, partly because it's all trees here anyways, and partly to get the final size to something youtube is happy with. All the jpegs get dumped into a directory called test, which I clean out before each run.
#!/bin/bash
NUM=1
DIRNAME=Sept12
for NN in $(ls -rt $DIRNAME/*.fits)
do
  tt=$(printf "%05.0f" $NUM)
  ty=$(echo $NN | sed 's/.fits//g')
  ty=$(echo $ty | sed "s/$DIRNAME//g")
  ty=$(echo $ty | tr -d '/')
 
  yr=${ty:0:4}
  mo=${ty:4:2}
  da=${ty:6:2}
  h=${ty:8:2}
  m=${ty:10:2}
  s=${ty:12:2}
 
  echo $NN $tt $h:$m:$s
  #for use without timestamps
  convert  -shave 160x160 -rotate -90 -flop -normalize -gamma 0.8 -quality 100 $NN test/$tt.jpg &
  ### use for timestamps added 
  ##convert  -shave 160x160 -rotate -90 -flop -normalize -gamma 0.8 -fill white -draw "text 50,680 '$tt - $yr/$mo/$da $h:$m:$s'" -quality 100 $NN test/$tt.jpg &
  NUM=$((NUM+1))
  while [ $(jobs | wc -l) -ge 8 ] ; do 
	#echo waiting
	sleep 0.10
  done
done

Once you have all the jpegs, then it's easy to make the movie
mencoder mf://test/*.jpg -of lavf -lavfopts format=mp4 -ovc x264 -x264encopts bitrate=80000:global_header:threads=auto:bframes=0:crf=18 -o output.mp4 -mf fps=30

After uploading to youtube, the final output looks like this:-


Keep in mind, youtube completely destroys the quality, watching it locally the quality is MUCH higher.

Another step I recently experimented with, and it worked out. I added a callout to an external script every time my program gets a new data file, and that script just creates a jpeg and puts it onto a webserver directory. When the allsky is running, we can get a 'live view' by loading a web page from an internal web server.
The following user(s) said Thank You: Jasem Mutlaq
8 years 6 months ago #5284

Please Log in or Create an account to join the conversation.

  • Posts: 193
  • Thank you received: 46
Another couple of comments on using oculus. I dont know how much of an issue dew is in your part of the world, but out here on the wet coast, it's one of biggest challenges. We use the internal dew heater, but that presents yet another challenge. If the dew heater is on full blast, then the camera gets very warm, and a LOT of hot pixels start to show. I have everything out there plugged into a web power switch, one of the inexpensive ones from digital loggers. I set up a few scripts for that too.

I have a cron script that turns on the dew heater in the late afternoon, and leaves it on till later in the evening, it's a one shot, with one cron event turning on the relay at 4pm, and another turning it off at 10pm. This way, if I get a late start or whatever, I dont sit down to an oculus that's already dewed up beyond recognition. When I start the process for grabbing frames, I dial down the dew heater in a very crude fashion. Yet another script that flips the relay on the power switch, and cycles it on a 50% duty cycle by doing 2 minutes on, then 2 minutes off. That keeps up to the dew on MOST evenings, but at this time of year, it's not quite enough later in the evening on a good clear night, needs 3 minutes on with 2 off. I do worry that over time, this is going to wear out the relay for that port.

One of the things I'm working on today, is getting a fresh new software build for my cubieboard, that includes all the indi stuff necessary for the oculus, and i'm adding a bunch of other stuff into it, for working with the cute little usb gadgets from Phidgets. I'm going to use one of the digital switches they have to switches to control the 12V supply for the dew heater, dont have to worry about a solid state switch wearing out like the relay. The other thing I'm looking to experiment with, is the little infrared thermometer they have, see if I can get it set up in such a way it will measure sky temp for me, but, still figure out how to keep water out when it rains. I haven't full solved that part of the problem yet, but, I'll come up with something. i am hedging right now to mounting it just under the overhang of the roof, pointed out at a 45 degree angle. That way it's shielded from rain, but still looking at the sky, albeit not strait up.

When all is said and done, my cubieboard will be mounted on the post with the oculus, controlling it's dew controller, reading the sky temp sensor, and reading everything from the weather station, which I have yet to purchase. The whole works will be out on a post in the back lot, about 75 feet from where we are putting the observatory. I've got conduits in for the data drop already, still waiting on electrician to finish pulling power and fibre thru the conduits before that location can go live.
8 years 6 months ago #5289

Please Log in or Create an account to join the conversation.

  • Posts: 193
  • Thank you received: 46

One thing I have noticed, and not dug into at all in recent builds. When starting all the devices thru a pipe, documentation has the option to give them names more to ones liking, but that doesn't seem to work, or I am doing it wrong.

Here's the script I use to kick off simulators on my workstation, and the names do not stick.
#!/bin/sh
 
mkfifo /tmp/indififo
indiserver -f /tmp/indififo &
echo start indi_simulator_ccd -n "testccd" > /tmp/indififo
echo start indi_simulator_telescope -n "mymount" > /tmp/indififo

If that functionality was working, then the whole issue of device names and/or filenames can be made to go away, by simply defining a new name when starting things up.
8 years 6 months ago #5291

Please Log in or Create an account to join the conversation.

  • Posts: 193
  • Thank you received: 46
ok, responding to my own post, I figured out what i was doing wrong to start with names, need backslashes
#!/bin/sh
mkfifo /tmp/indififo
indiserver -f /tmp/indififo &
echo start indi_simulator_ccd -n \"testccd\" > /tmp/indififo
echo start indi_simulator_telescope -n \"mymount\" > /tmp/indififo

But this doesn't seem to work with the sx driver on my all sky box (older code). Not easy to test it with latest greatest right now, involves pulling down cables again.
8 years 6 months ago #5293

Please Log in or Create an account to join the conversation.

Time to create page: 1.144 seconds