Creating scripts to send jobs to the FabLab machines

Amy Sun [amys@cba.mit.edu] 7/11/05

In most labs, there are at least one or two machines that are unnetworked and can only accept jobs from a computer hooked directly up to it. You can use scp to send a properly formatted toolpath file directly to the appropriate port of the computer that is hooked up to the machine.


Select the correct script and save to the header name in bold. Place the file in /usr/local/bin. Don't forget to chmod a+x filename. Details are below the links.

to_epi

  • to_epi_parallel
  • to_epi_ethernet

    to_camm

  • to_camm_parallel
  • to_camm_serial
  • to_camm_parallel_local
  • to_camm_serial_local

    to_modela

  • to_modela_local


    The command looks like this:

    scp filename.ext fab@xxx.xxx.xxx.xxx:/dev/ttyS0 for serial port
    scp filename.ext fab@xxx.xxx.xxx.xxx:/dev/lp0 for parallel port

    Replace xxx.xxx.xxx.xxx with the IP address of the computer that is hooked up directly to the machine.

    Which machines are on what kind of port? Well, you should just lean over and look. But from my memory:

    Finally, you can put the long scp command in a script so that users only remember one command per machine no matter what computer they are using. Here is an example from the South African lab where the vinyl cutter is hooked up to the serial port:

    FILENAME: to_camm

    #!/bin/bash
    # send file to vinyl cutter on serial port
    scp $1 fab@10.50.72.203:/dev/ttyS0

    When you create your file, the line with the #!/bin/bash is the very first line and you replace the IP address with the one on your computer. And most everyone else will use lp0 to talk to their vinyl cutters. You can use kwrite to copy the above code and save as a good filename.

    Save the file in /usr/local/bin. If you have problems writing the file to that directory because you don't have permissions, then just write it to any directory and move it later:

    Finally, don't forget to make the script executable:

    On the computer hook up directly to the machine, I use instead the following:

    Save and chmod in the same way above.

    That's it!

    To use the scripts, a user would create a .camm file using cam as usual, then:



    edit