# ModuleCubesatSim

ModuleCubesatSim is a package to deal with data transmit by [CubesatSimulator from AMSAT](https://cubesatsim.org) .

The *SoundmodemToInfluxDB* application gather data from soundmodem and store decoded data on influxDB database

On this readme, a quick start guide is provided for test and demo purpose. 

## Context

![Cubesat_Simulator_Synoptic_](Doc/Image/SchemaGroundStation.png)


## prerequisite 

On Windows computer, you need to install folowing software :

 * [Soundmodem](http://uz7.ho.ua/packetradio.htm) 
 * [influxDB](https://www.influxdata.com/) time serie database
 * [grafana](https://grafana.com/) dashboard front end 
 * ModuleCubesatSim

## SoundModem configuration

After the SoundModem installation, you need to allow connection to TCP KISS modem :

    On Soundmodem software :  
		
		menu:  Setting->devices:  tick the box KISS Server port

## InfluxDB configuration 

Deploy the InfluxDB application on your computer. The default configuration is enought for test or demo purpose. 

    To have this database running  : 
		 
		 Launch the "influxd.exe" executable 

When you run the **ModuleCubesatSim** application, the database is automaticaly created in your InfluxDB instance. 

## Grafana configuration

Deploy  InfluxDB application on your computer. 

After installation you have to lanch "grafana-server.exe" 

You have access to the application with browser at  http://<IP Adresses>:3000 

On your local computer, you have access with a browser to http://localhost:3000/


Before perform grafana dashboard configuration you need to run "ModuleCubesatSim" application. The influxDB database is created automaticaly. 

 how to import [CubesatSim Grafana template](Doc/ImportGraphanaTemplate.md)


## Installation

Retreive jar file from [electrolab Github](https://code.electrolab.fr/xtof/josast/tree/master/ModuleCubesatSim/Delivery/0.2) 



## Usage

Before lunching the application, following applications should be setup and running :
* SoundModem
* InfluxDB

To launch the application 

```java 

java -jar ModuleCubesatSim-0.0.2-SNAPSHOT-jar-with-dependencies.jar

```

To launch the application with option :

```
java -jar ModuleCubesatSim-0.0.2-SNAPSHOT-jar-with-dependencies.jar -h

usage: -h [-C <configFile>] [-h] [-V]
 -C,--Config <configFile>   Return application version
 -h,--help                  display help message
 -V,--Version               Return application version

```

### 1st launch 

If you have not set-up the application configuration file, The 1st launch of the application end with an error. A default configuration file is created in the config folder. You **must to update this file** with correct parameter before launching again the application.

## configuration file 

The configuration file allow to set up following parameters :
    
    # Soundmodem IP Adress 
    IPadress=localhost
    # Soundmodem KISS port 
    port=8100   
    # Influx DB adresss  
    adresse=http\://127.0.0.1\:8086
    # influxDB user login
    login=test
    # influxDB user password 
    password=test



## Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

## License
[GNU Lesser General Public License v2.1](http://choosealicense.com/licenses/lgpl-2.1/)
