2015/07/26

Software

My software options are somewhat limited, because of the way I wired my electronics. Most SLA printers I've seen use an Arduino microcontroller that plugs into a PC via USB. If a Raspberry Pi 2 is used, it is a replacement for the PC, not the Arduino.  This unique difference prevents me from using helpful community software, like Creation Workshop or Creation Workshop Host, directly. I had to write custom software.
 
I wrote a servo and projector module in python to test the Raspberry Pi 2's control over each. The servo uses the GPIO pins, so I used the RPi.GPIO module that comes with the Raspian. The projector needed pygame, which also comes with Raspian, to take over the display. You can download these modules here. With the modules done, I realized I didn't want to access these controls by command line forever, where I would forget the commands.

My options at this point are:
  1. Create a custom server and client for both the Raspberry Pi 2 and my PC using TCP/IP sockets
  2. Create a webserver on the Raspberry Pi 2 and connect with a browser on the PC
  3. Code a webserver on the Raspberry Pi 2 with Python and connect with a browser on the PC
I found that option 3 was easiest. Python creates a workable server in about 100 lines of code with built-in packages, which beats having to install a webserver and php on the Raspberry Pi 2. Eventually, I will implement this as my GUI. For the time being, however, I'm simply using the command terminal (SSH) to enter commands and Samba to transfer files from the PC to the Raspberry Pi 2.

I then wrote a Python script to control the printing process. My script you can download here.

No comments:

Post a Comment