[490] | 1 | ************************************************* |
---|
| 2 | * INDI Developers Manual |
---|
| 3 | * Chapter 8: Tutorial |
---|
| 4 | ************************************************** |
---|
| 5 | |
---|
| 6 | Introduction |
---|
| 7 | -------------- |
---|
| 8 | |
---|
| 9 | The tutorials included in the INDI Library can be used with any INDI compatible client. The following instructions are provided to test the drivers with KStars. If you are running a different client, refer to your client documentation. |
---|
| 10 | |
---|
| 11 | Tutorials |
---|
| 12 | ---------- |
---|
| 13 | |
---|
| 14 | Four tutorials are presented to introduce developers to the INDI architecture. |
---|
| 15 | |
---|
| 16 | tutorial_one: We construct a most basic (and useless) device driver to illustate basic INDI structures. |
---|
| 17 | tutorial_two: We create a simple simulator. We will use a few handy utility functions provided by INDI like timers, string <---> number conversion, and more. |
---|
[504] | 18 | tutorial_three: We create a simple CCD simulator, and establish a data channel with the client to transmit a FITS file. |
---|
[490] | 19 | |
---|
| 20 | tutorial_dome and tutorial_rain are part of the inter-driver communication tutorial. |
---|
| 21 | |
---|
[504] | 22 | tutorial_client: We create a simple client to set the temperature of a CCD simulator (tutorial_three). |
---|
| 23 | |
---|
[490] | 24 | Usage |
---|
| 25 | -------- |
---|
| 26 | |
---|
| 27 | 1. Running cmake in the libindi directory should build the examples binary as well. |
---|
| 28 | |
---|
| 29 | ------------------------------------------------------------------------------------------ |
---|
| 30 | |
---|
| 31 | 2. Run KStars (v1.1 or above is required) |
---|
| 32 | |
---|
| 33 | Under KStars, click on the "device" menu, then click on the "device manager". Click on the "client" tab and then click on the "add" button. |
---|
| 34 | |
---|
| 35 | A dialog box will be displayed with three fields: name, host, and port. |
---|
| 36 | |
---|
| 37 | You can enter anything in the name field, for example "my device" or "tutorial". |
---|
| 38 | |
---|
| 39 | Enter "127.0.0.1" in the host name and "8000" in the port entry (without the quotes). This device will be saved in your client menu. So you only to do #2 once. |
---|
| 40 | |
---|
| 41 | ------------------------------------------------------------------------------------------ |
---|
| 42 | |
---|
| 43 | 3. In the src/examples directory, run each tutorial |
---|
| 44 | |
---|
| 45 | $ indiserver -v -p 8000 ./tutorial_NUM |
---|
| 46 | |
---|
| 47 | where num is the tutorial number (tutorial_one, tutorial_two, or tutorial_three). |
---|
| 48 | |
---|
[504] | 49 | ------------------------------------------------------------------------------------------ |
---|
| 50 | |
---|
[490] | 51 | For the inter-driver communications tutorial, type instead: |
---|
| 52 | |
---|
| 53 | $ indiserver -v -p 8000 ./tutorial_dome ./tutorial_rain |
---|
| 54 | |
---|
| 55 | ------------------------------------------------------------------------------------------ |
---|
| 56 | |
---|
[504] | 57 | For tutorial_client. Run tutorial_three first: |
---|
| 58 | |
---|
| 59 | $ indiserver -v ./tutorial_three |
---|
| 60 | |
---|
| 61 | Then open another console tab, and run the client: |
---|
| 62 | |
---|
| 63 | $ ./tutorial_client |
---|
| 64 | |
---|
| 65 | You can connect to tutorial_three via a GUI client (e.g. KStars) before running tutorial_client. This will enable you to watch |
---|
| 66 | changes in the driver as they occur from tutorial_client. Make sure to set the port to 7624 in KStars. |
---|
| 67 | |
---|
| 68 | ------------------------------------------------------------------------------------------ |
---|
| 69 | |
---|
[490] | 70 | 4. In KStars, go the device menu --> device manager --> client and select the host you added in step #2 and hit connect. |
---|
| 71 | |
---|
| 72 | ------------------------------------------------------------------------------------------ |
---|
| 73 | |
---|
| 74 | 5. The connection icon should be changed to connected, otherwise, an error message will be displayed. |
---|
| 75 | |
---|
| 76 | ------------------------------------------------------------------------------------------ |
---|
| 77 | |
---|
| 78 | 6. Close the device manager, and open the INDI Control Panel in the device menu. You can control your device from there. |
---|
| 79 | |
---|