Skip to content

Instantly share code, notes, and snippets.

@ednisley
Created March 18, 2018 12:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ednisley/522a201ca5c032d5528f4911405e746f to your computer and use it in GitHub Desktop.
Save ednisley/522a201ca5c032d5528f4911405e746f to your computer and use it in GitHub Desktop.
Kermit script to capture HP 8591 spectrum analyzer screen image
#!/usr/bin/kermit +
# Fetches screen shot from HP8591E spectrum analyzer
# Presumes it's set up for plotter output...
# Converts HPGL to PNG image
# use raw-socket to disable telnet termination chars
set host 192.168.1.40 7002 /raw-socket
set modem none
# Make sure we have a param
if not defined \%1 ask \%1 {File name? }
set input echo off
set input buffer-length 200000
# Tell it what size to plot
echo Triggering plot output...
output plot 0,0,60000,40000;
log session "\%1.hgl"
# Wait for end of data stream
input 400 SP;
echo ... HPGL data captured
close session
close
echo Converting HPGL in
echo --\%1.hgl
echo to PNG in
echo --\%1.png
run hp2xx -q -m png -c 1436 "\%1.hgl"
echo Cropping and resizing
#run mogrify -crop "515x395+0+0!" "\%1.png"
run mogrify -density 300 -resize 200% "\%1.png"
echo Finished!
exit 0
@ednisley
Copy link
Author

More details on my blog at https://wp.me/poZKh-7qI

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment