You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This repository contains a library and a set of tools that are useful for working with Twinleaf quantum sensors and accessories.
3
+
This repository contains two Rust crates, a library (`twinleaf`) and a set of tools (`twinleaf-tools`) that are useful for working with Twinleaf quantum sensors and accessories.
4
4
5
-
## CLI Usage
6
-
All the tools mentioned can have the `--help` argument added to display more information. The general workflow is to connect using `tio-proxy` which allows all the CLI tools to work with the single device at the same time.
5
+
**Note**: In versions <2.0.0, this crate contained binaries named `tio-proxy`, `tio-monitor`, `tio-health`, and `tio-tool`. These commands have been packaged into subcommands under the single binary `tio`. The former three original commands can be simply used without the `-`, while `tio-tool {toolname}` calls have largely been replaced with `tio {toolname}`.
7
6
8
-
### tio-proxy
7
+
## Basic Usage
8
+
### See `twinleaf-tools/README.md` for more usage details
9
9
10
-
The proxy makes a device attached via serial port available via Ethernet. The following will automatically scan for a `twinleaf` serial device:
10
+
Connect a proxy to the device to communicate with the other tools:
11
11
12
-
tio-proxy --auto
12
+
tio proxy
13
13
14
-
When there are more than one serial port available, it is necessary to specify the port using:
14
+
Terminal interface (TUI) to monitor sample data and issue commands with tab completion:
15
15
16
-
[linux]> tio-proxy -r /dev/ttyACM0
17
-
[macOS]> tio-proxy -r /dev/cu.usbserialXXXXXX
18
-
[wsl1] > tio-proxy -r COM3
16
+
tio monitor
19
17
20
-
The proxy allows multiple tools to connect to the device over TCP simultaneously.
18
+
Dump data to terminal:
21
19
22
-
### tio-tool
20
+
tio dump --data --meta
23
21
24
-
Logging data:
25
-
26
-
tio-tool log
22
+
Issue commands from terminal:
27
23
28
-
Issuing commands:
29
-
30
-
tio-tool rpc dev.name
24
+
tio rpc {command name} [arg]
31
25
32
-
### tio-monitor
26
+
Log data to csv:
33
27
34
-
Displays a live stream of incoming data with an optional color-coded threshold option.
35
-
36
-
Running the tool:
37
-
38
-
tio-monitor [yaml_path]
39
-
40
-
Yaml format to specify desired ranges:
41
-
field_name: {min: 0.0, max: 10000.0}
42
-
43
-
### tio-health
44
-
45
-
Displays a live table of all incoming data with some statistics to verify the behavior of devices. It also outputs a history of events derived from the `Sample` protocol implemented in the `twinleaf` crate, derived within the `data/buffer.rs` file.
46
-
47
-
Running the tool:
48
-
49
-
tio-health
28
+
tio log -f {file.tio} # blocking
29
+
tio log csv {stream name} {file.tio}
50
30
51
31
## Installation
52
32
@@ -56,4 +36,10 @@ With rust language tools, install the tools using:
56
36
57
37
It can be installed with the ability to convert to HDF5 using
58
38
59
-
cargo install twinleaf-tools --features hdf5
39
+
cargo install twinleaf-tools --features hdf5
40
+
41
+
It is convenient to add the cargo binary directory to the default search paths. Cargo will report where the binaries and installed and which path to add to your environment, if necessary.
42
+
43
+
The `serialport` library depends on `libudev` that is not included on certain linux distributions. To install it use:
Copy file name to clipboardExpand all lines: twinleaf-tools/README.md
+44-34Lines changed: 44 additions & 34 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,73 +1,84 @@
1
1
# Twinleaf I/O Tools in Rust
2
2
3
-
This repository contains a set of tools that are useful for working with Twinleaf quantum sensors and accessories. The repository contains the twinleaf library and a set of command line tools: a proxy, a utility, and a data monitoring tool.
3
+
Command-line tools for working with Twinleaf quantum sensors and accessories. Contains a proxy, terminal UIs, and command line utilities.
4
4
5
+
**Note**: In versions <2.0.0, this crate contained binaries named `tio-proxy`, `tio-monitor`, `tio-health`, and `tio-tool`. These commands have been packaged into subcommands under the single binary `tio`. The former three original commands can be simply used without the `-`, while `tio-tool {toolname}` calls have largely been replaced with `tio {toolname}`.
5
6
6
-
## Proxy
7
+
## CLI Usage
8
+
All the tools mentioned can have the `--help` argument added to display more information. The general workflow is to connect using `tio proxy` which allows all the CLI tools to work with the single device at the same time.
7
9
8
-
The proxy makes the device's serial port available via Ethernet, and supports multiple simultaneous client connections to a single device:
10
+
### Connecting to the device
9
11
10
-
tio-proxy --auto
12
+
The proxy makes a device attached via serial port available via Ethernet. The following will automatically scan for a `twinleaf` serial device:
11
13
12
-
When there are more than one serial port available, it is necessary to specify the port
14
+
tio proxy --auto
13
15
14
-
[linux] > tio-proxy -r /dev/ttyACM0
15
-
[macOS] > tio-proxy -r /dev/cu.usbserialXXXXXX
16
-
[windows]> tio-proxy.exe -r COM3
16
+
When there are more than one serial port available, it is necessary to specify the port using:
17
17
18
-
When a sensor is attached to a hub at port `0`, it is possible to proxy the data directly to that port using the `-s` flag:
18
+
[linux] tio proxy -r /dev/ttyACM0
19
+
[macOS] tio proxy -r /dev/cu.usbserialXXXXXX
20
+
[wsl1] tio proxy -r COM3
21
+
22
+
The proxy allows multiple tools to connect to the device over TCP simultaneously.
19
23
20
-
tio-proxy --auto -s /0
24
+
When a sensor is attached to a hub at port `0`, it is possible to proxy the data directly to that port using the `-s` flag:
21
25
22
-
With the proxy running, a set of tools can be used on the data stream.
26
+
tio proxy --auto -s /0
23
27
24
-
Log data to a raw binary file:
28
+
### Interacting with the device in terminal
25
29
26
-
tio-tool log
30
+
Logging metadata:
27
31
28
-
Parse that log data for stream id 1 to a `.csv` file. Assumes root route if unspecified.
32
+
tio log meta # Write metadata to meta.tio
33
+
tio log dump meta.tio # Parse meta.tio and print to terminal
29
34
30
-
tio-tool log-csv 1 logfile.tio
35
+
Logging sample data:
31
36
32
-
Parse that log data to an HDF5 file (requires --features hdf5 on crate installation)
37
+
# Log samples and write to log.{date-time}.tio until quit (Ctrl+C)
# Write to HDF5 file (requires `--features hdf5` on install)
44
+
tio log hdf {file} -g "{route}/{stream}/{column}"
45
+
tio log hdf {file} -g "*/{stream or column}"
38
46
39
-
tio-tool rpc dev.name
47
+
Dump data to terminal:
40
48
41
-
List available commands:
49
+
tio dump --data # Continuously print parsed samples
50
+
tio dump --data --meta # Same as above, with metadata header
42
51
43
-
tio-tool rpc-list
52
+
Device commands:
44
53
45
-
Firmware upgrade:
54
+
tio rpc list # List of rpc commands with types
55
+
tio rpc {command} [arg] # Issue command with optional argument
46
56
47
-
tio-tool firmware-upgrade <firmware.bin>
57
+
## Terminal UIs
48
58
49
-
Monitoring the data stream:
59
+
### tio monitor
50
60
51
-
tio-tool data-dump
61
+
Displays a live stream of incoming data with in-terminal graphs and command suggestions. Graph a stream by selecting it with the arrow keys and pressing Enter, and enter command mode by typing `:` (colon). Use `tio monitor -s {port}` to specify which port to open or `tio monitor -a` to open all ports.
52
62
53
-
A TUI device data monitor:
63
+
Run with:
54
64
55
-
tio-monitor
65
+
tiomonitor
56
66
57
-
A TUI device health monitor:
67
+
### tio health
58
68
59
-
tio-health
69
+
Displays a live table of all incoming data with some statistics to verify the behavior of devices. It also outputs a history of events derived from the `Sample` protocol implemented in the `twinleaf` crate, derived within the `data/buffer.rs` file.
60
70
61
-
And a variety of additional functions for use with Twinleaf sensors. Each tool can be called with the `--help` argument for more information.
71
+
Run with:
62
72
73
+
tio health
63
74
64
75
## Installation
65
76
66
77
The tools can be installed using
67
78
68
79
cargo install twinleaf-tools
69
80
70
-
It can be installed with the ability to convert to HDF5 using
81
+
They can be installed with the ability to convert to HDF5 using
71
82
72
83
cargo install twinleaf-tools --features hdf5
73
84
@@ -77,7 +88,7 @@ The `serialport` library depends on `libudev` that is not included on certain li
77
88
78
89
sudo apt install libudev-dev # debian linux
79
90
80
-
## Cross compilation
91
+
## Cross compilation
81
92
82
93
The tools can be compiled for other platforms by first adding those platform targets:
83
94
@@ -87,4 +98,3 @@ The tools can be compiled for other platforms by first adding those platform tar
0 commit comments