tenox7 / ttyplot

a realtime plotting utility for terminal/console with data input from stdin
Apache License 2.0
961 stars 43 forks source link

ttyplot does not read data #52

Open themightyoarfish opened 3 years ago

themightyoarfish commented 3 years ago

So while the examples work, the command output I want to plot doesn't. I have a line such as

find  minicrane-scans/mrs/2020/11/02/ -name "*.pcd" | sort | xargs ./bin/pcl_icp | grep Yaw --line-buffered | cut -d" " -f 2

which runs and continuously outputs to stdout

-0
-0.000116325
-0.000274716
-0.000444506
-0.000536768
-0.000640014
-0.000762741
-0.000762741
-0.000997292
-0.00122629
-0.00153955
-0.00172964
-0.00172996
-0.00172996
-0.00180447
-0.00180986
...

However, piping this to ttyplot only shows waiting for data from stdin .

themightyoarfish commented 3 years ago

Oh actually it just takes a long time to update, maybe it need to read a minimum number of values before acting on them? A plot appears after a while, then doesn't move, then moves rapidly and then freezes again. The plot also does not make sens (should be monotonically increasing, but is just random numbers.

Screenshot 2020-11-08 at 13 50 58
luckman212 commented 3 years ago

@themightyoarfish Funny timing, I was playing with graphing WiFi signal RSSI yesterday, and realized that ttyplot does not seem to work with negative values.

For now, as a workaround I just inverted the numbers so my data would plot:

while true; do
  /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport --getinfo |
  awk '/agrCtlRSSI/{print -$2; exit;}';
  sleep 1;
done |
ttyplot -t "RSSI"
tenox7 commented 3 years ago

yes ttyplot only works with positive values, I think support for negative values is a very good feature request

as for slow speeds read about stdio buffering in unix, bottom of the readme, you will likely need to add some flush

themightyoarfish commented 3 years ago

Yes I employed some flags and expect's unbuffer program, but that alone didn't help.

On 15 November 2020 06:55:45 CET, Antoni Sawicki notifications@github.com wrote:

yes ttyplot only works with positive values, I think support for negative values is a very good feature request

as for slow speeds read about stdio buffering in unix, bottom of the readme, you will likely need to add some flush

-- You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub: https://github.com/tenox7/ttyplot/issues/52#issuecomment-727520230

-- Sent from my Android device with K-9 Mail. Please excuse my brevity.

tenox7 commented 3 years ago

can you post an example where unbuffering didn't help?

hartwork commented 7 months ago

@themightyoarfish besides support for negative values (tracked by #53): is any of the rest still an issue with release ~1.5.2~ 1.6.0?