-
ACP and SQM-LE
Hi there,
at the moment I'm running ACP with my weather sensor (AAGware) connected, and it works fine. Now I wonder if there is any way to also connect my SQM-LE meter to ACP or ACP Scheduler (to identify sky clarity). I'm not sure if this would make sense, but it would be great to have that reading available somewhere in ACP:
Thanks
Lukas
-
I looked at the Unihedron site and see that there are many models and it is unclear how one gets to the measurements from a PC. I see ethernet, USP. Is there a program? I will guess that the Ethernet connection has some sort of protocol? Is it HTTP (in which case it would be relatively easy)?
ACP Scheduler has a Sky Condition API which can connect to a COM server which has just two properties: Available (yes/no) and SkyCondition (0-3). To allow the SQM to inform ACP Scheduler's selection of Plans to run controlled by the Sky Condition constraint, you could write a simple COM server that talks to the SQM (however that is done), take its data (whatever that is, light level, etc.) and calculate the 0-3 sky condition level. Then let Scheduler poll it for that info. The COM server can be written in script with notepad. The Boltwood weather servers are written this way (Windows Script Component).
-
Hi,
The connection is a simple Tcp, so I guess I could code such a script :)
I'll keep you updated
-
Hi Bob,
one question: As I am already running a weather server (AAGWare Cloud Sensor), which is already connected to ACP, can I also connect a second server (for the SQM-LE)? Or should I make something different?
-
ALright, I found it (was in ACP Scheduler's directory). I just have to find a way to let the script open a connection to the remote port and write 'rx', and I'll get the answer from the server :) Anyone has an idea how to do that in that script?
Thanks
Lukas
-
Lukas --
Only one weather server can be used by ACP, just an architectural limitation. To combine the two, you would have to write a new weather server that connects to both Clarity and the SQM. You can start with the supplied server for the Boltwood (it's implemented in script) and add logic to take in data from the SQM. The problem is that I don't kow how to open simple sockets from script without adding a COM component to the system. I found one for you Dimac Sockets. Go to
http://www.dimac.net/default3.asp?M=...loadsstart.asp
and get the A1002 w3sockets component. Install it and read the docs. Then in the CloudSensorII.wsc, add it as an object like this:
Code:
</public>
<object id="Util" progid="ACP.Util" events="false" reference="true"/>
<object id="Sock" progid="socket.tcp" events="false" reference="true"/>
<script id="BoltwoodII" language="VBScript">
Now within the code, you can access all of the Dimac API via Sock.xxx.
-
Bob
By the looks of things ist looks like the easiet way right now is to use the free sqm reader program from knightware. http://www.knightware.biz/sqm/reader.htm
This would allow one to periodically get the data and write the contents to a file. ACP could then query and pull the data from the file content.
The other issue would be to have a program that could be used to call and supply data directly to the SQM-LE. I think there are a variety of perl scripts provided with the CD. I'm wondering of one of those perl script could be called in a similar manner like the communication with the digiloggers controller using e2p program. That could be incorporated into a function call. it would have to be done from an ASP so the function ran at the server level and not the client level.
I see the cd content is provided from the web site at http://unihedron.com/projects/sqm-le/cd/
in the readme file it identifies the following
sqmutil.zip Perl Windows utility for reading and configuring the unit
socket.pl Perl example to read the SQM-LE
sqm-le-java.zip SQM-LE Java connection utility
sqmsocket.py Python example to read the SQM-LE
Also in the manual it state that there is a small web page and some java files have been installed on the lantronix Xport devide so that the SQM-LE can be accessed as a web page.
Maybe all that is needed is the com port redirector software. The Lantantronix Xport is nothing more than a serial over ethernet device. The comport redirector documentation is at http://www.lantronix.com/pdf/Com-Port-Redirector_PB.pdf
and the redirector software is found on the page at http://www.lantronix.com/support/downloads/?p=CPR
I'm wondering if these are the components that would be needed to use in conjunction with setting up a sky condition server in scheduler?
Todd
-
Todd --
This is something that I could not get involved in. There is a sample skeleton ACP weather server (WSC) that can be used to insert script. The problem is going to be locking the file so that it is not being written by oe process while trying to be read from a different process. Files for process to process are, ehem, tricky. The Clarity Log file writer does some specific locking and unlocking as described in the Clarity manual, and implemented in ther ACP.BoltwoodFile weather server.
-
I was sort of thinking it was two different issue. I think the sky condition server is for sure the approach to develop and is there to address the scheduler sky condition variable. The other issue is just to read and display the resulting value, which I assumed Lucaz was looking for. I don't know much about perl but I think that Lucaz could use a call to the supplied perl script from inside ACP and it would go and retrieve the value he is looking for. Sort of like a function call. He would have to supply the required arguments the perl script is expecting. I just don't know if that could be done from the html of a tiddler or an ASP script.
Todd
-
Lukas
I have since gone ahead and purchased one of these units. I have successfully been able to use the socket.pl perl script to issue a call to the device and request a single reading. The socket.pl script is found in the util folder on the SQM cd-rom. I just had to install strawberry perl onto the computer and follow the recommended installation instructions from unihedron. I then found an error in the sockets.pl script at line 22 where ARGV[0] should have been ARGV[1]. After that I just executed the script manually from a perl command window and got the data dumped out. I'm guessing a simple perl script like that example could be installed in the sky condition WSC to pull the data and then you can equate a value to one of the 4 sky condition classifications for a scheduler operation.
Todd