diff --git a/README.md b/README.md index 57fa4ef95356a6312b339301b351e42cc563528d..fbbe93f60fa2cfc8e6a01f413a3974e0e7636a74 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,69 @@ This is a message dispatcher and protocol interpreter between Sensapex SMCPv1 and Trinamic/Analog Devices TCML protocols. +## Device + +Run this code on a raspberry PI B3 or higher. + +It should be connected via ethernet to one of the two ports of the sensapex controller. +The sensapex controller should be powered (via usb C). +An usb port should be connected from the trinamic controller (any controller that works and can be tested with TMCL IDE is compatible). + + +## Executing the software + +- Go into the executeable subfolder (see what is in this repository section). +- choose wether you want to run the latest locally built/compiled exec or a different version (by doing ``cd ./0.2.29.400`` for example, to goat that version's location) +- run with the command : + +``` +./smcp1_proxy -s /dev/ttyACM0 +``` + +``/dev/ttyACM0`` is usually the serial port used for the com with the trinamic controller. However, with unplugging / replugging, it can happen that this port is not ACM0 but ACM1, or it might even be something else. To test it out, you can use the comand : + +```bash +ls /dev +``` + +or look at the ports in current use with this command : + +```bash +dmesg | grep tty +``` + + +## Parameters : + +- ``-s`` : ``SERIAL_PORT`` Specify the serial port to use (from / to trinamic ctl) +- ``-u`` : ``UDP_ADDRESS`` Specify the UDP address to use (from / to sensapexctl ) +- ``-p`` : ``UDP_PORT`` Specify the UDP port to use (from / to sensapex ctl) +- ``-n`` : ``NOTIF_FREQ`` Specify the notification frequency to use, in ms +- ``-h`` Displays the help (this parameters list) + + +## What is in this repository : + + +The code sits on the `/sensapex` folder, on the root of the raspberry. + +To go there, do : +```bash +cd /sensapex +``` + +This folder is a git repository folder. If the raspberry has internet, you can pull the lates changes done to this repository with the command : `sudo git pull` (use yourcomputer as a wifi hotspot to provide internet, so that the ethernet port stays free for communication with the senapex controller) + +The folder contains : +- the src folder (the sources) +- a build folder that is created when you build the sources on the raspberry using the cmake command, through the shell scripts included here. +- the executeable folder (where the executable binaries are, that are generated by the build) + + +In the executeable folder, you have the latest built file (smcp1_proxy file) +as well as different versions in the form of folders, each containing an executeable built at that version. + + ## Building To build the project, navigate to the project directory and run the `cmake` command: @@ -30,16 +93,6 @@ sudo mv ./build/smcp1_proxy . This will move the executable to the root directory. -## Running - -After building the project, you can run the application with the following command: - -```bash -./cmake-build-debug/smcp1_proxy -``` - -This will execute the `main` function defined in `main.c`. - ## Make it run at start : @@ -62,12 +115,17 @@ To make it log infos into a file : # Motor : -QSH5718-76-28-189 -https://www.analog.com/media/en/technical-documentation/data-sheets/QSH5718_datasheet_rev2.60.pdf +Model **QSH5718-76-28-189** +Datasheet and wiring diagram on analog devices : https://www.analog.com/media/en/technical-documentation/data-sheets/QSH5718_datasheet_rev2.60.pdf ## Tuning RPI's Ip to be detected : -- 192.168.137.254 +The IP of the Raspberry pi must be : +- ``192.168.137.254`` + +or any adress in the range of ``192.168.137.1`` to ``192.168.137.254`` (but not 255 !!!) +to be detected by the controller (wich sits at address 255). + ## License