Ferrante Enriques replied to the topic 'Python driver package' in the forum. 2 months ago

hi Bernard,
you were right about the connection standard property.
I added this switch to the Thermostat:

# create a switchvector so client can turn on/off connection
    connectionswitchmember = SwitchMember(name="CONNECT", label="Connection",
                                   membervalue=thermalcontrol.connectionswitch)
    connectionswitchvector = SwitchVector( name="CONNECTION",
                                    label="Connection Control",
                                    group="Control",
                                    perm="rw",
                                    rule = "AtMostOne",
                                    state="Ok",
                                    switchmembers=[connectionswitchmember] )

And the error message is gone. But I know that managing connection properly is more than that: some property like connection itself and connection parameters should be available before connecting, while the others are visible only upon successful connection; more or less what updateparams() function does in the INDI protocl convention.

@Jasem, if I got this right, by expanding this code to fully manage interaction with a client (connection, standard properties etc as Bernard wrote) and feeding the xml directly into indiserver via stdin/stdout (to avoid chaining) would allow the community of python developers to write drivers that interoperates with standard INDI drivers and client like Ekos to connect both drivers.

Read More...

Ferrante Enriques replied to the topic 'Python driver package' in the forum. 2 months ago

Hi Bernard,
As you said, I'd like to mix standard drivers on Ekos client with custom drivers in python.
I followed a different approach by chaining the python to the ekos server so that I don't have to write an executable driver just for communication.
Here are the easy steps if someone wants to give it a try:

1) Started Example 1 with pyServer on port 7625. Name of the device is Thermostat as in the example.

driver.listen("localhost", 7625)

2) chained this python server with the Ekos one, like in the picture below:


3) Start Ekos.


Still I get an error in the log: Failed to connect to Thermostat. Please ensure device is connected and powered on.
But the temperature updates just fine.

Ferrante

Read More...

Ferrante Enriques replied to the topic 'Python driver package' in the forum. 3 months ago

hi Bernard,
if I get it right, a client can interact with the device through an indipydriver driver exchanging INDI xml messages. And if you need to serve more than one device to a client then you use the Ipyserver.

I think I'm missing something, but is it possible to have an indipydriver running in an indiserver so that a client like Ekos can connect to both standard INDI drivers and indipydrivers?

Ferrante

Read More...

Ferrante Enriques replied to the topic 'indi web page client' in the forum. 4 months ago

and as quick example that shows the dynamic behavior of websockets, attached an html page that slightly modifies index.html but still uses Elwood's framework in htdocs.tgz .
- Unzip and add index_read.html to /var/www/html/
- Start kstars/ekos (not Elwood's INDI) with Telescope Simulator or edit index_read.html according to your mount driver
- Start lighttpd and enter http://127.0.0.1/index_read.html

You will read the telescope RA/DEC coordinates in real time.

File Attachment:

File Name: index_read.html.zip
File Size: 1 KB


Read More...

Ferrante Enriques replied to the topic 'indi web page client' in the forum. 4 months ago

just to confirm that it works fine!



Step by step instruction for anyone else who wants to test it (on ubuntu linux):
- sudo apt install lighttpd
- lighttpd default document root is /var/www/html place your files there else change the doc root.
- lighttpd configuration file is in /etc/lighttpd/lighttpd.conf
- Edit lighttpd.conf as Elwood wrote in indi.js
- Remember to restart the server: sudo systemctl restart lighttpd
- Unzip Elwood's INDI tgz in, say, 'ws_test' and compile:
- cd ws_test/libastro then make
- cd ws_test/liblilxml then make
- cd ws_test/INDI then make
- Open Chrome and enter http://127.0.0.1

ferrante

Read More...

Ferrante Enriques replied to the topic 'indi web page client' in the forum. 4 months ago

ok, it was in your INDI, I was searching in the online repository...

Read More...

Ferrante Enriques replied to the topic 'indi web page client' in the forum. 4 months ago

ok. but I cannot find the driver in the indi directory or in the filesystem and not even a source code for simbad on the indi repository, is it hosted somewhere else?
And also googling for it doesn't give much insight
Thanks
Ferrante

Read More...

Ferrante Enriques replied to the topic 'indi web page client' in the forum. 4 months ago

hi Elwood,
first of all thanks for starting the INDI development so long ago and still contributing with new ideas.
I'm trying to run the websocket script but I'm not succeeding:
- Installed lighttpd
- Configured /etc/lighttpd/lighttpd.conf according to the instruction in indi.js (see attachment).
- Left the default document root /var/www/html and put all the scripts there.
- Started indiserver
- Connected to 127.0.0.1/index.html

I can see the 'Name' form field but no update on RA/DEC (see attached image)What I'm doing wrong?
Indiserver doesn't show any incoming connection, so I guess the url redirection from /indi-websockt to indi server is not working properly.

File Attachment:

File Name: lighttpd.txt
File Size: 13 KB



Read More...