Skip to content
Snippets Groups Projects
Commit b6b939ce authored by Timothe Jost's avatar Timothe Jost
Browse files

update readme

parent a3d2993f
No related branches found
No related tags found
No related merge requests found
...@@ -6,12 +6,29 @@ This is a message dispatcher and protocol interpreter between Sensapex SMCPv1 an ...@@ -6,12 +6,29 @@ This is a message dispatcher and protocol interpreter between Sensapex SMCPv1 an
To build the project, navigate to the project directory and run the `cmake` command: To build the project, navigate to the project directory and run the `cmake` command:
First create the build configuration files :
```bash
cd sensapex_motion_control
sudo cmake -S ./sources -B ./build
```
Then build the executeable from sources and following the config
```bash ```bash
cd smcp1_proxy cd sensapex_motion_control
cmake --build ./cmake-build-debug --target smcp1_proxy sudo cmake --build ./build --target smcp1_proxy
``` ```
This will compile the source files and link them to create an executable. This will compile the source files and link them to create an executable.
The executeable, here smcp1_proxy is created in the build folder (because it is the one that contains the configuration files for the build).
To move the executable to a separate executeable directory for clarity sake, run the following command:
```bash
sudo mv ./build/smcp1_proxy .
```
This will move the executable to the root directory.
## Running ## Running
...@@ -23,6 +40,26 @@ After building the project, you can run the application with the following comma ...@@ -23,6 +40,26 @@ After building the project, you can run the application with the following comma
This will execute the `main` function defined in `main.c`. This will execute the `main` function defined in `main.c`.
## Make it run at start :
```bash
sudo crontab -e
```
Choose the nano editor if prompted, then enter :
```
@reboot /path_to/cronjob.sh
```
To make it log infos into a file :
```
@reboot /path_to/cronjob.sh >> /var/logs/sensapex.log 2>&1
```
2>&1 redirects stderr into stdout, so that everything is logged into the log file.
## License ## License
[MIT](https://choosealicense.com/licenses/mit/) [MIT](https://choosealicense.com/licenses/mit/)
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment