Skip to content

Instantly share code, notes, and snippets.

Created March 18, 2018 12:30
What would you like to do?
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 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
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
Copy link

More details on my blog at

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