GithubHelp home page GithubHelp logo

hacknus / serial-monitor-rust Goto Github PK

View Code? Open in Web Editor NEW
119.0 119.0 15.0 6.55 MB

A cross-plattform serial monitor/plotter written entirely in rust.

License: GNU General Public License v3.0

Rust 100.00%
egui rust serial serial-communication serial-monitor serial-plotter

serial-monitor-rust's People

Contributors

hacknus avatar l-trump avatar lonesometraveler avatar oeb25 avatar zimward avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

serial-monitor-rust's Issues

Wrong displaying time

When build with -r flag, the plot is displayed wrong.
image
This is how it looks like in debug build:
image

Plot labels are sometimes hidden when changing devices

When you connect device A which transmits 5 columns and then later one reconnect device A but now it transmits 6 columns, the sixth label is hidden. A "reset labels" is required, but then we need to re-enter all previous 5 labels.

Desired behavior: keep old labels and add a new one "Column 6".

once this issue is fixed, we can bump the project up to version 1.0.0

laggy with large datasets

When logging for a long time ( 3 hours with 8 columns, 1 new value per second) the application gets laggy until I clear the data.

Consider using `usize::MAX` as a default value for `plotting_range` variable

Based on my understanding, MyApp's plotting_range is used to limit the number of PlotPoint displayed on the screen. However, the default value of -1_isize is not very intuitive since it doesn't clearly indicate what it does. From the code, it appears that -1 means to display all the PlotPoints. Would not it be better to use usize::MAX as the default value?

`zmodem2` crate

Hi just want to race awareness that I've started work on a new ZMODEM crate recently: https://github.com/jarkkojs/zmodem2. It is progressing rapidly as can be witnessed from the Git log. I've also listed issues that I want to reach for my personal uses and purposes for this: https://github.com/jarkkojs/zmodem2/issues.

Would be interesting to see how this could eventually integrated to the serial monitor. Most likely at least https://github.com/jarkkojs/zmodem2/issues/5 and https://github.com/jarkkojs/zmodem2/issues/1 need to be completed before this is doable.

Question about `serial_write` and acknowledgment

fn serial_write(port: &mut BufReader<Box<dyn SerialPort>>, cmd: &[u8]) -> bool {
    let write_port = port.get_mut();
    match write_port.write(cmd) {
        Ok(_) => {
            let mut response = "".to_string();
            serial_read(port, &mut response);
            println!("sent a command!");
            if response.contains("OK") {
                true
            } else {
                println!("cmd not acknowledged!!!");
                false
            }
        }
        Err(_) => false,
    }
}

The code expects a connected device to send back a string that contains "OK" each time it receives a command. I am not sure if this is a reliable way to handle a response, as the device on the other end may not have processed the command yet or may take some time to send a response.

Also, even if a device can respond quickly enough, I am not sure if the app can always read a "OK". Doesn't the app read whatever data in the RX buffer? Let's say a device sends "0.1" 100 times a second. The device sends back "OK" when it receives a command. When the app calls serial_read, does it always read "OK"? Or sometimes it reads "0.1"?

Offer to contribute to improving code quality

Hello there,

I came across your project and noticed that the codebase could benefit from some improvements to its quality. Specifically, I think running Clippy would help identify and fix many of the issues in the code.

I am interested in contributing to this project, and I believe improving the code quality would be a good first step. I would like to ask if you would be open to me submitting pull requests or working with you to make the changes.

Menu Item on macOS is missing

On macOS 14.1 (Apple Silicon) the menu item is no longer displaying "Serial Monitor" but it shows the system default "NSMenuItem".

EOL caracter is not interpreted

When \r\n (or \n for that matter) is entered as the EOL char, the monitor litteraly sends a '\' followed by a 'n' instead of interpreting it as the correct control character.

[New Feature]: associate timeseries to different plots.

It would be nice to associate timeseries to graphs and have the opportunity to display multiple graphs at the same time.

For example, by assuming to receive data streams from three sensors, one should be able to plot sensorValues1 and sensorValues2 on the first graph and sensorValues3 on the second graph.

defmt and/or probe-run support

It would be nice to have support for things like defmt and/or probe-run/probe-rs or similar. I imagine defmt would make a lot of sense for fast and efficient logging of lots of datapoints to build graphs. Also things like probe-run to allow communication using debugger instead of serial.

Not sure how or even if this would fit into this project, but as a user, it would be nice :)

Perhaps the easiest and most flexible would be something like adding stdin under "Devices" so the user can pipe the output of any external tool to serial monitor?

me@box:~/my-embedded-project$ cargo run | serial-monitor-rust

Feature request - Associate data points with text line

It would be quite useful if there were a graphical way to see what text line corresponds to what point on the x axis.

For example mousover the text line could show a horizontal line in the graph. In the same way hovering in the graph could light up the closest text line in the console.

Error handling in `print_to_console` and `update_in_console` functions

The print_to_console and update_in_console functions in gui.rs do not currently handle errors that can occur when acquiring the write lock on the provided print_lock.

pub fn print_to_console(print_lock: &Arc<RwLock<Vec<Print>>>, message: Print) -> usize {
    let mut length: usize = 0;
    if let Ok(mut write_guard) = print_lock.write() {
        write_guard.push(message);
        length = write_guard.len() - 1;
    }
    length
}

pub fn update_in_console(print_lock: &Arc<RwLock<Vec<Print>>>, message: Print, index: usize) {
    if let Ok(mut write_guard) = print_lock.write() {
        write_guard[index] = message;
    }
}

Should we add error handling and improve the code's reliability and robustness? We can modify them to return a Result that indicates whether the lock was successfully acquired or not.

Maximum transmission rate is severely limited

When transferring large amounts of data continuously, the transfer rate of serial-monitor-rust is much slower than other serial port software (e.g. serialplot). Comparisons as following:
image
image
The serial-monitor-rust receives a line every 0.025s, indicating the transfer rate of 25 sps. But the serialplot achieves 359 sps.

Command send is always sensitive to the Enter keystroke.

the command line should only send the contents when it is focused. Now it is always sensitive to the enter keystroke - even when one is adjusting another parameter in the side panel and pressing enter to save it. This will always send whatever is in the command line too (also just empty string + EOL).

Support for multiple plots

When data columns are in very different ranges it is impossible to view.

It would be very useful if the user could create multiple plots and select which data columns goes where.
Multiple Y-axis' would also be a great addition.

Selection of raw traffic and scrolling

Not able to select and scroll the raw traffic. We should find a way to allow similar behavior as in a text editor.
Also CTRL+A should be implemented.

A workaround to retrieve the data is to use the "save raw traffic" option and save a file.

Better dataset identification/selection

Hi,
I have a device where the output data is as so
[RECV] t + 210.359s: #,00:00:00 00/00/0000, , , .0862, ,N.m, VCX000002, 1
A feature for a custom separator would be pretty awesome

Feature request - Scale per channel

When having different values with completely different scales, the smaller ones turns in to flat lines close to zero

It would be useful to have individual scaling per channel like on an oscilloscope. Not shure how that would work with y-ranges etc.

image

Make keepawake a optional feature

Some (linux) Systems don't run a screensaver service which makes the serial monitor thread crash on a connect attempt. Either test if a screensaver is present or provide a feature to be able to remove it at compile time.

crash when selecting device

The latest code crashes because we get an out of bounds error in ./src/gui.rs:690:66:

self.serial_devices.number_of_plots[self.device_idx]

we need to make sure that number_of_plots is extended/updated when a new device is connected.

Workaround:
use the latest release

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.