Skip to content

Commit

Permalink
Merge pull request #93 from matheuswhite/70-update-readme
Browse files Browse the repository at this point in the history
Update README.md for v0.2.0 release
  • Loading branch information
matheuswhite authored Jun 3, 2024
2 parents b03eabd + 146fd8f commit 18de50a
Show file tree
Hide file tree
Showing 59 changed files with 560 additions and 2,453,726 deletions.
63 changes: 46 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<p align="center">
<br><img src="imgs/scope-logo.png" width="800" alt="Scope Banner">
<br><img src="https://github.com/matheuswhite/scope-rs/actions/workflows/rust.yml/badge.svg" alt="Build Status">
<a href="https://opensource.org/licenses/BSD-3-Clause"><img src="https://img.shields.io/badge/License-BSD_3--Clause-blue.svg"></a>
<br><img src="https://github.com/matheuswhite/scope-rs/actions/workflows/build.yml/badge.svg" alt="Build Status">
<a href="https://opensource.org/licenses/BSD-3-Clause"><img src="https://img.shields.io/badge/License-BSD_3--Clause-blue.svg" alt="License BSD-3"></a>
<a href="https://crates.io/crates/scope-monitor"><img src="https://img.shields.io/crates/v/scope-monitor.svg" alt="Version info"></a>
<br><b>Scope</b> is a multi-platform serial monitor with user-extensible features.
</p>
Expand All @@ -18,21 +18,21 @@

With `Scope`, you can type a message on the command bar (at bottom) and hit `Enter` to send it through the serial port.

![Send data gif](videos/send_data.gif)
![Send data gif](videos/001_send_data/video.gif)

### Send in Hexadecimal

You also can send bytes in hexadecimal. To do it, type `$` and write your bytes in a hexadecimal format. The message
can have spaces and commas as separators (`Scope` will send the bytes of message without spaces and commas).

![Send hex gif](videos/hexa.gif)
![Send hex gif](videos/002_hexa/video.gif)

### Send Commands

You can send commands using the command bar. To send a command, type `/` and a list of all available commands is
shown above the command bar. Continue typing the command and hit `Enter` to send the command.

![Send command gif](videos/cmds.gif)
![Send command gif](videos/003_cmds/video.gif)

The commands are loaded from a user YAML file, passed at start of program (using `-c` flag). An example of YAML file is
shown below:
Expand All @@ -51,28 +51,53 @@ json_again: '{"cmd":2, "args":"world"}'
It's possible to retrieve old data and commands sent. You can hit `Up Arrow` and `Down Arrow` to navigate through
the history of sent data and commands.

![Command history](videos/history.gif)
![Command history](videos/004_history/video.gif)

### Auto Reconnect

The `Scope` tool has an auto-reconnect feature. When the serial port isn't available, `Scope` will keep trying to
reconnect to the serial port until it's available again.

![Reconnect gif](videos/reconnect.gif)
![Reconnect gif](videos/005_reconnect/video.gif)

### Colorful

`Scope` colors the command bar to notify the status of the serial connection: red to disconnected and green to
connected. Beyond status, the content read and written are colored too. The messages read is colored using ANSI terminal
color standard.

![Read ANSI color gif](videos/ansi.gif)
![Read ANSI color gif](videos/006_ansi/video.gif)

The data sent to serial port always has a background to differentiate it from read data. Characters outside the
printable range of the ASCII table are shown in magenta and in the hexadecimal format. Some characters are printed as
its representation, such as: `\n`, `\r` and `\0`.

![Special character gif](videos/invisible.gif)
![Special character gif](videos/007_invisible/video.gif)

### Setup Serial Port

It's possible change serial port and its baudrate while the tool is open. To do that,
type `!serial connect COM4 9600` to set serial port to `COM4` and baudrate to `9600`. You can also omit port to change
only the baudrate (`!serial connect 9600`) or omit the baudrate to change only the port (`!serial connect COM4`). If you
want to release the serial port, you'll type `!serial disconnect`.

![Setup serial port](videos/008_setup_serial/video.gif)

### Save history

To save the all messages captured (and sent) since the start, you can hit `Ctrl+s`. The history box will blink and a
message will be displayed on history. The filename is shown at top of history box with `.txt` extension. There is, at
the history's top-right corner, the size of all message captured.

![Save history](videos/009_save/video.gif)

However, if you want to save only the message captured from now, you'll use the record feature. Hitting `Ctrl+r`, you'll
start a record session. While in a record session, the history block is yellow and the `Scope` will store all messages
captured from now. To stop the record session, you need to hit `Ctrl+r` again. The right-corner indicator will show the
size of the record session. A new filename is created each time a new record session is started. Both: start session and
stop session, prints a message on the history box to indicate when it occurs.

![Save record](videos/010_record/video.gif)

### Message Timestamp

Expand All @@ -85,6 +110,10 @@ You can use `Scope` on multiple platforms, like: Linux, Windows and macOS[^1].

[^1]: Not tested yet.

### History Navigation

You can navigate through the message history using the mouse wheel or hitting `PageUp` and `PageDown`.

### Plugins

You can extend the basic functions of `Scope` using plugins! Plugins are scripts written in `lua` language. To create a
Expand Down Expand Up @@ -124,7 +153,7 @@ the serial port, send data to serial port, print some message in `Scope` text vi
the development of plugins for `Scope` you can read
the [Plugins Developer Guide](https://github.com/matheuswhite/scope-rs/wiki/Plugin-Developer-Guide).

![Plugin usage](videos/plugin.gif)
![Plugin usage](videos/011_plugin/video.gif)

## Scope vs Others

Expand Down Expand Up @@ -160,28 +189,28 @@ cargo install scope-monitor

## How to Use

After the installation, type `scope` followed by the serial port and the desired baud rate. For example, to open
After the installation, type `scope serial` followed by the serial port and the desired baud rate. For example, to open
the port `COM3` at `115200 bps` type:

```shell
scope COM3 115200
scope serial COM3 115200
```

When the command bar at the bottom is green, it starts to capture messages from serial port and allows for sending
messages.

To load a list of commands, from a YAML file, use should use `-c <YOUR_COMMANDS>.yml`
or `--cmd-file <YOUR_COMMANDS>.yml`
between `scope` and its parameters. For example, to load `cmd.yml` file, use can type:
between `scope` and `serial`. For example, to load `cmd.yml` file, use can type:

```shell
scope -c cmd.yml COM3 115200
scope -c cmd.yml serial COM3 115200
```

or

```shell
scope --cmd-file cmd.yml COM3 115200
scope --cmd-file cmd.yml serial COM3 115200
```

## Project Goals
Expand Down Expand Up @@ -220,8 +249,8 @@ Take a look at the [CONTRIBUTING](CONTRIBUTING.md) guide

## Acknowledges

+ [Emilio Bottoni](https://github.com/MilhoNerfado) for being a heavy tester of this tool;
+ [José Gomes](https://github.com/JoseGomesJr) for some features and tests.
+ [Emilio Bottoni](https://github.com/MilhoNerfado) and [José Gomes](https://github.com/JoseGomesJr) for the ideas that
pushes forward this tool, for the tests that finds hidden bugs and for good features implementations.

## License

Expand Down
1 change: 0 additions & 1 deletion assets/cmds.yaml

This file was deleted.

7 changes: 0 additions & 7 deletions assets/lorem.txt

This file was deleted.

File renamed without changes.
3 changes: 1 addition & 2 deletions videos/ansi_color.py → videos/000_scripts/ansi_color.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,10 @@ def to_color(message: bytes, color: Color) -> bytes:

with Serial('COM1_out') as s:
while True:
sleep(1)
sleep(0.5)
message = b''
for _ in range(3):
color = random.choice(color_pool)
message += to_color(b'Hello, World!', color) + b' '
message += b'\r\n'
print(f'Sending message {message}')
s.write(message)
3 changes: 1 addition & 2 deletions videos/invisibles.py → videos/000_scripts/invisibles.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@
if __name__ == '__main__':
with Serial('COM1_out') as s:
while True:
sleep(1)
sleep(0.5)
message = b'Hello, '
message += bytes(map(lambda x: x + 0x7E, b'World'))
message += b' \0Again\r\n'
print(f'Sending message {message}')
s.write(message)
4 changes: 4 additions & 0 deletions videos/001_send_data/background.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash

socat -dd PTY,link=COM1,raw,echo=0 PTY,link=COM1_out &> /dev/null

Binary file added videos/001_send_data/video.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
47 changes: 47 additions & 0 deletions videos/001_send_data/video.tape
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
Output video.gif

Require echo

Set Padding 2
Set LineHeight 1.0
Set Shell "bash"
Set FontFamily "CaskaydiaMono Nerd Font"
Set WindowBar Colorful
Set BorderRadius 10
Set Theme "tokyonight"
Set FontSize 14
Set Width 902
Set Height 549
Set Framerate 24

Type@100ms "scope serial COM1 115200"
Sleep 500ms
Enter

Type@300ms "HELLO"
Sleep 500ms
Enter
Sleep 2000ms

Type@300ms "Hello"
Sleep 500ms
Enter
Sleep 2000ms

Type@300ms "World"
Sleep 500ms
Enter
Sleep 2000ms

Type@300ms "AT"
Sleep 500ms
Enter
Sleep 2000ms

Type@300ms "OK"
Sleep 500ms
Enter
Sleep 2000ms

Sleep 1s
Escape
4 changes: 4 additions & 0 deletions videos/002_hexa/background.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash

socat -dd PTY,link=COM1,raw,echo=0 PTY,link=COM1_out &> /dev/null

Binary file added videos/002_hexa/video.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
36 changes: 36 additions & 0 deletions videos/002_hexa/video.tape
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
Output video.gif

Require echo

Set Padding 2
Set LineHeight 1.0
Set Shell "bash"
Set FontFamily "CaskaydiaMono Nerd Font"
Set WindowBar Colorful
Set BorderRadius 10
Set Theme "tokyonight"
Set FontSize 14
Set Width 902
Set Height 549
Set Framerate 24

Type@100ms "scope serial COM1 115200"
Sleep 500ms
Enter

Type@200ms "$48 65 6c 6c 6f"
Sleep 500ms
Enter
Sleep 2000ms

Type@200ms "$48,65,6c,6c,6f"
Sleep 500ms
Enter
Sleep 2000ms

Type@200ms "$48,65 6c,6c6f0a"
Sleep 500ms
Enter
Sleep 2000ms

Escape
4 changes: 4 additions & 0 deletions videos/003_cmds/background.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash

socat -dd PTY,link=COM1,raw,echo=0 PTY,link=COM1_out &> /dev/null

1 change: 1 addition & 0 deletions videos/003_cmds/cmds.yaml
Binary file added videos/003_cmds/video.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
57 changes: 57 additions & 0 deletions videos/003_cmds/video.tape
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
Output video.gif

Require echo

Set Padding 2
Set LineHeight 1.0
Set Shell "bash"
Set FontFamily "CaskaydiaMono Nerd Font"
Set WindowBar Colorful
Set BorderRadius 10
Set Theme "tokyonight"
Set FontSize 14
Set Width 902
Set Height 549
Set Framerate 24
Set Framerate 24

Type@100ms "scope -c cmds.yaml serial COM1 115200"
Sleep 500ms
Enter

Type@300ms "/hello"
Sleep 500ms
Enter
Sleep 2000ms

Type@300ms "/spaces"
Sleep 500ms
Enter
Sleep 2000ms

Type@300ms "/scapes"
Sleep 500ms
Enter
Sleep 2000ms

Type@300ms "/double_quotes"
Sleep 500ms
Enter
Sleep 2000ms

Type@300ms "/single_quotes"
Sleep 500ms
Enter
Sleep 2000ms

Type@300ms "/json"
Sleep 500ms
Enter
Sleep 2000ms

Type@300ms "/json_again"
Sleep 500ms
Enter
Sleep 2000ms

Escape
4 changes: 4 additions & 0 deletions videos/004_history/background.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash

socat -dd PTY,link=COM1,raw,echo=0 PTY,link=COM1_out &> /dev/null

6 changes: 6 additions & 0 deletions videos/004_history/cmds.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
hello: 'world!'
spaces: 'a big frase with spaces'
double_quotes: '"double"'
single_quotes: "'single'"
json: '{"cmd":1, "args":[true, "hello", 2.1]}'
json_again: '{"cmd":2, "args":"world"}'
Binary file added videos/004_history/video.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 18de50a

Please sign in to comment.