×

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

Bi-monthly release with minor bug fixes and improvements

indi web page client

  • Posts: 6
  • Thank you received: 3
Hello all,

It's the 20th anniversary since I wrote the first draft of the INDI protocol (here) so it was a good time to stop by and say hello. This is a wonderful site and I want to thank everyone for using INDI.

I want to share a means I developed to write INDI clients as web pages using pure javascript. This is very convenient and avoids all the hassles of deploying compiled applications for different platform. The core idea is to connect a web server to an indiserver via a websocket then send setINDI commands and receive getINDI responses using javascript. I have attached a very simple example in htdocs.tgz. At the top of indi.js is the configuration file change needed for the lighttpd web server, but I think all web servers support websockets similarly.

I have also made extensive performance improvements to indiserver, please find attached the new version in INDI.tgz. It also includes the indisimbad driver used by the web example above and a few other handy drivers.

Both of these codes have seen exhaustive field use so they should be very reliable.

Well that's all for now, maybe I will check in again in another 20 years :-)

All the best,

Elwood
The following user(s) said Thank You: Jim, Ferrante Enriques
10 months 1 week ago #93484
Attachments:

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

  • Posts: 6
  • Thank you received: 3
I posted the wrong version of the indiserver. Please disregard the previous and use attached.
10 months 1 week ago #93485
Attachments:

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

  • Posts: 249
  • Thank you received: 62
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:2 KB
Last edit: 10 months 1 week ago by Ferrante Enriques. Reason: Wrong attachment
10 months 1 week ago #93494
Attachments:

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

  • Posts: 6
  • Thank you received: 3

Replied by Elwood Downey on topic indi web page client

The web page uses the Simbad driver so I'm thinking you are not running the indisimbad driver. In the INDi directory run it like this:

./indiserver ./indisimbad

Then on the web page type the common name of an astro object, for example M31, and the page should report the RA and Dec.
10 months 1 week ago #93495

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

  • Posts: 249
  • Thank you received: 62
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
10 months 1 week ago #93497

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

  • Posts: 6
  • Thank you received: 3

Replied by Elwood Downey on topic indi web page client

untar the INDI.tgz file, cd INDI then make.
The following user(s) said Thank You: Ferrante Enriques
10 months 1 week ago #93498

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

  • Posts: 249
  • Thank you received: 62
ok, it was in your INDI, I was searching in the online repository...
10 months 1 week ago #93502

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

  • Posts: 6
  • Thank you received: 3

Replied by Elwood Downey on topic indi web page client

Ok, good, thanks for giving it a try.

Once this ability was working I have never built an INDI client app again, I now always write web page clients. The example I gave you is just to show how setindi() and setPropertyCallback() work. But now it opens the door to all the rich html/css formatting to make really beautiful clients that are super portable, even to cell phones. And using a websocket makes them very efficient as well, even for showing blob images.

Anyway, many thanks for your work and take care,

Elwood
10 months 1 week ago #93508

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

  • Posts: 249
  • Thank you received: 62
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 unzip htdocs.tgz 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
- In ws_test/INDI launch indiserver: ./indiserver ./indisimbad
- Open Chrome and enter http://127.0.0.1

ferrante
The following user(s) said Thank You: Brian
Last edit: 10 months 1 week ago by Ferrante Enriques.
10 months 1 week ago #93525
Attachments:

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

  • Posts: 249
  • Thank you received: 62
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
10 months 1 week ago #93526
Attachments:

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

  • Posts: 216
  • Thank you received: 120

Replied by Rick Bassham on topic indi web page client

Hey Elwood, first, thanks for such a wonderful contribution to the community. INDI really is a great system.

Ferrante reminded me that I started down this path a while ago, but I ended up not finishing out any docs or really pushing it through. I've got a collection of repos that were mainly proof of concept things to see if I could get INDI and KStars on the web so to speak.

The first is: github.com/rickbassham/node-indi-client. This node.js client is a simple translation between the XML of INDI and JSON via a websocket. It is a separate stand-alone thing that will connect to an existing INDI server and communicate using the existing INDI protocol, not using a websocket, but it will expose a websocket and do the translation from XML to JSON.

Next is: github.com/rickbassham/indi-web. This is a Vue.js based web app using the client above. It is basically an INDI control panel running in the web, and also serves as an example for writing a client.

Then there is github.com/rickbassham/indi-mqtt-bridge. This is an example of using that client to create a bridge between INDI and MQTT. For a while I was using this in conjunction with influxdb and grafana to log and visualize things like telescope position over time, focuser position, etc.

Getting into KStars and Ekos specific things:

github.com/rickbassham/ekos-mqtt-bridge is a bridge between Ekos and MQTT. In this case, it relies on the Ekos Live functionality, but instead of a hosted solution it runs locally.

Finally there is github.com/rickbassham/ekos-web. This is similar to the above, but exposes a web interface for Ekos instead of just using MQTT.

I'll see if I can get some documentation together on these if there is interest in continuing development on them.

Rick
10 months 1 week ago #93547

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

Time to create page: 0.793 seconds