Bi-monthly release with minor bug fixes and improvements
Please Log in or Create an account to join the conversation.
%include <indibasetypes.h>
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
# install swig-indi-python
apt-get install swig2.0
cd /home/pi/INDI/
svn co -r 36 svn://svn.code.sf.net/p/pyindi-client/code/trunk/swig-indi/swig-indi-python/
mkdir libindipython
cd libindipython
cmake ../swig-indi-python
make
sudo make install
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
$ indiserver -v indi_simulator_ccd
2016-06-09T14:13:29: startup: indiserver -v indi_simulator_ccd
2016-06-09T14:13:29: Driver indi_simulator_ccd: pid=11789 rfd=3 wfd=6 efd=7
2016-06-09T14:13:29: listening to port 7624 on fd 4
2016-06-09T14:13:29: Driver indi_simulator_ccd: snooping on Telescope Simulator.EQUATORIAL_EOD_COORD
2016-06-09T14:13:29: Driver indi_simulator_ccd: snooping on Telescope Simulator.TELESCOPE_INFO
2016-06-09T14:13:29: Driver indi_simulator_ccd: snooping on CCD Simulator.FILTER_SLOT
2016-06-09T14:13:29: Driver indi_simulator_ccd: snooping on CCD Simulator.FILTER_NAME
2016-06-09T14:13:29: Driver indi_simulator_ccd: snooping on Telescope Simulator.EQUATORIAL_PE
2016-06-09T14:13:29: Driver indi_simulator_ccd: snooping on Focuser Simulator.FWHM
$ python test.py
1280.0
0.0
0.0
1.0
1280.0
1280.0
20.0
500.0
0.0
0.0
500.0
500.0
30.0
29.0020008087
28.0020008087
27.0009994507
26.0
24.9990005493
23.9979991913
22.9969997406
21.9950008392
20.9939994812
19.9930000305
18.9920005798
17.9909992218
16.9899997711
15.9890003204
14.9879999161
13.9870004654
12.986000061
11.9849996567
10.984000206
9.98299980164
8.98200035095
7.98099994659
6.98000001907
5.97900009155
4.97800016403
3.97699999809
2.97600007057
1.97500002384
0.973999977112
0.0
0.0
30.0
...
Please Log in or Create an account to join the conversation.
import sys, time, logging
import PyIndi
class IndiClient(PyIndi.BaseClient):
device = None
def __init__(self):
super(IndiClient, self).__init__()
self.logger = logging.getLogger('PyQtIndi.IndiClient')
self.logger.info('creating an instance of PyQtIndi.IndiClient')
def newDevice(self, d):
self.logger.info("new device " + d.getDeviceName())
if d.getDeviceName() == "CCD Simulator":
self.logger.info("Set new device CCD Simulator!")
# save reference to the device in member variable
self.device = d
def newProperty(self, p):
self.logger.info("new property "+ p.getName() + " for device "+ p.getDeviceName())
if self.device is not None and p.getName() == "CONNECTION" and p.getDeviceName() == self.device.getDeviceName():
self.logger.info("Got property CONNECTION for CCD Simulator!")
# connect to device
self.connectDevice(self.device.getDeviceName())
# set BLOB mode to BLOB_ALSO
self.setBLOBMode(1, self.device.getDeviceName(), None)
if p.getName() == "CCD_EXPOSURE":
# take first exposure
self.takeExposure()
def removeProperty(self, p):
self.logger.info("remove property "+ p.getName() + " for device "+ p.getDeviceName())
def newBLOB(self, bp):
self.logger.info("new BLOB "+ bp.name.decode())
# get image data
img = bp.getblobdata()
import cStringIO
# write image data to StringIO buffer
blobfile = cStringIO.StringIO(img)
# open a file and save buffer to disk
with open("frame.fit", "wb") as f:
f.write(blobfile.getvalue())
# start new exposure for timelapse images!
self.takeExposure()
def newSwitch(self, svp):
self.logger.info ("new Switch "+ svp.name.decode() + " for device "+ svp.device.decode())
def newNumber(self, nvp):
self.logger.info("new Number "+ nvp.name.decode() + " for device "+ nvp.device.decode())
def newText(self, tvp):
self.logger.info("new Text "+ tvp.name.decode() + " for device "+ tvp.device.decode())
def newLight(self, lvp):
self.logger.info("new Light "+ lvp.name.decode() + " for device "+ lvp.device.decode())
def newMessage(self, d, m):
self.logger.info("new Message "+ d.messageQueue(m).decode())
def serverConnected(self):
print("Server connected ("+self.getHost()+":"+str(self.getPort())+")")
def serverDisconnected(self, code):
self.logger.info("Server disconnected (exit code = "+str(code)+","+str(self.getHost())+":"+str(self.getPort())+")")
def takeExposure(self):
self.logger.info("<<<<<<<< Exposure >>>>>>>>>")
# get current exposure time
exp = self.device.getNumber("CCD_EXPOSURE")
# set exposure time to 5 seconds
exp[0].value = 5
# send new exposure time to server/device
self.sendNewNumber(exp)
logging.basicConfig(format='%(asctime)s %(message)s', level=logging.INFO)
# instantiate the client
indiclient=IndiClient()
# set indi server localhost and port 7624
indiclient.setServer("localhost",7624)
# connect to indi server
print("Connecting and waiting 2secs")
if (not(indiclient.connectServer())):
print("No indiserver running on "+indiclient.getHost()+":"+str(indiclient.getPort())+" - Try to run")
print(" indiserver indi_simulator_telescope indi_simulator_ccd")
sys.exit(1)
time.sleep(1)
# start endless loop, client works asynchron in background
while True:
time.sleep(1)
Please Log in or Create an account to join the conversation.
if d.getDeviceName() == "CCD Simulator":
if d.getDeviceName() == "V4L2 CCD":
# connect to device
self.connectDevice(self.device.getDeviceName())
# set BLOB mode to BLOB_ALSO
self.setBLOBMode(1, self.device.getDeviceName(), None)
if p.getName() == "CCD_EXPOSURE":
# take first exposure
self.takeExposure()
def takeExposure(self):
self.logger.info("<<<<<<<< Exposure >>>>>>>>>")
# get current exposure time
exp = self.device.getNumber("CCD_EXPOSURE")
# set exposure time to 5 seconds
exp[0].value = 5
# send new exposure time to server/device
self.sendNewNumber(exp)
Please Log in or Create an account to join the conversation.
if d.getDeviceName() == "V4L2 CCD":
Please Log in or Create an account to join the conversation.
indiserver indi_sbig_stv
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.