After creating valid HPGL output the next step will be to actually wire up the plotter an get it to work!
Wire up to Linux
After plugin in the adapter it is possible to figure out the tty port via dmesg.
Assuming that the port is ttyXXX , ls -l /dev/ttyUSB0 will print out the assigned usergroup.
If being member of this usergroup does not help with getting read / write permission, sudo chmod 666 /dev/ttyUSB0 will do the job.
Writing output to plotter
Using python's pySerial module writing commands from a file is done like this:
import serial
# Read command file. Commands should be in separate lines.
commands = open('command_file').readlines()
# Initialize with path, baudrate, bytesize, and parity
ser = serial.Serial('/dev/ttyXXX', 9600, 8, 'O') # open serial port
for command in commands:
ser.write(command.encode()) # write to plotter
After creating valid HPGL output the next step will be to actually wire up the plotter an get it to work!
Wire up to Linux After plugin in the adapter it is possible to figure out the tty port via
dmesg
. Assuming that the port isttyXXX
,ls -l /dev/ttyUSB0
will print out the assigned usergroup. If being member of this usergroup does not help with getting read / write permission,sudo chmod 666 /dev/ttyUSB0
will do the job.Writing output to plotter Using python's pySerial module writing commands from a file is done like this:
Plotter's coordinate system