diff --git a/README.md b/README.md index 1c16f07b88f11595d77b4872553aa06f8340b8c0..7f6e4811ab79f3615dc2736e596c4f3411aa58b2 100644 --- a/README.md +++ b/README.md @@ -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: +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 -cd smcp1_proxy -cmake --build ./cmake-build-debug --target smcp1_proxy +cd sensapex_motion_control +sudo cmake --build ./build --target smcp1_proxy ``` 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 @@ -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`. + +## 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 [MIT](https://choosealicense.com/licenses/mit/) \ No newline at end of file