Skip to content

Commit

Permalink
chore: readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Paolo-Beci committed May 9, 2024
1 parent baa6d8a commit bc5f637
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ pip install -r requirements.txt
```

### CONFIG file
To configure the parameters of the program you have to create a 'CONFIG.txt' file with the following parameters:
To configure the parameters of the program you have to create a `CONFIG.txt` file with the following parameters:
```txt
VALUES=PARAM1 PARAM2 NULL PARAM3
NEWLINE=;
Expand All @@ -25,7 +25,7 @@ BAUDRATE=9600
UDP_PORT=5000
SERIAL_PORT=/dev/ttyUSB0
```
The 'VALUES' params separated by a space indicate the order of the values in the CSV string. The 'NULL' value indicates that the value is not going to be sent, but discarded when the CSV comes into the program. The 'NEWLINE' param indicates the character that separates the CSV strings, the usage of '\n' as a NEWLINE can be achieved via the 'LF' symbol and the '\r\n' via the 'CRLF' one (ex: NEWLINE=LF). The 'SEPARATOR' param indicates the character that separates the values in the CSV string. The 'BAUDRATE' param indicates the baudrate of the serial port. The 'UDP_PORT' param indicates the port of the UDP server. The 'SERIAL_PORT' param indicates the serial port to use.
The `VALUES` params separated by a space indicate the order of the values in the CSV string. The NULL value indicates that the value is not going to be sent, but discarded when the CSV comes into the program. The `NEWLINE` param indicates the character that separates the CSV strings, the usage of '\n' as a NEWLINE can be achieved via the 'LF' symbol and the '\r\n' via the 'CRLF' one (ex: NEWLINE=LF). The `SEPARATOR` param indicates the character that separates the values in the CSV string. The `BAUDRATE` param indicates the baudrate of the serial port. The `UDP_PORT` param indicates the port of the UDP server. The `SERIAL_PORT` param indicates the serial port to use.

With the configuration shown above you can send the following JSON (assuming CSV data is: 1,2,3,4\n):
```json
Expand All @@ -36,6 +36,14 @@ With the configuration shown above you can send the following JSON (assuming CSV
}
```

## How to pair with Plotjuggler graphing tool
1. Open Plotjuggler
2. Click on the `Streaming` section, select UDP Server:
![Plotjuggler](img/plotjuggler.png)
3. Set the port to the same number as UDP_PORT of the CONFIG and click on 'Ok'.
4. Click on the 'Start' button and select the parameters you want to plot from the menu on the left.
5. Drag the data values in the graph area to visualize them.

## Build executable
```bash
pyinstaller --name SerialToUdpTranslator main.py --onefile --windowed
Expand Down
Binary file added img/plotjuggler.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit bc5f637

Please sign in to comment.