<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="3.7.4">Jekyll</generator><link href="https://puccilabs.com/feed.xml" rel="self" type="application/atom+xml" /><link href="https://puccilabs.com/" rel="alternate" type="text/html" /><updated>2023-05-03T17:08:34+00:00</updated><id>https://puccilabs.com/feed.xml</id><title type="html">Puccinelli Laboratories</title><subtitle>Enabling global infectious disease surveillance.</subtitle><author><name>Robert R. Puccinelli</name></author><entry><title type="html">Guide: Flashing the P1 Programmer</title><link href="https://puccilabs.com/guides/ProgramP1/" rel="alternate" type="text/html" title="Guide: Flashing the P1 Programmer" /><published>2020-11-06T00:00:00+00:00</published><updated>2020-11-06T00:00:00+00:00</updated><id>https://puccilabs.com/guides/ProgramP1</id><content type="html" xml:base="https://puccilabs.com/guides/ProgramP1/">&lt;p style=&quot;color:dark-gray; font-size: 80%; text-align: center;&quot;&gt;&lt;img src=&quot;/assets/images/Boards/P1_Front_Photo.jpg&quot; alt=&quot;image-center&quot; class=&quot;align-center&quot; /&gt;
&lt;strong&gt;&lt;em&gt;P1 Programmer&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;h2 id=&quot;overview&quot;&gt;Overview&lt;/h2&gt;
&lt;p&gt;The objective of this guide is to demonstrate how to program the P1 Programmer using pyftdi with a Linux based machine. Once it has been programmed, it can then be used to interface with other Vespucci modules for testing and flashing.&lt;/p&gt;

&lt;h2 id=&quot;materials-used&quot;&gt;Materials Used&lt;/h2&gt;

&lt;ul&gt;
  &lt;li&gt;P1 Programmer&lt;/li&gt;
  &lt;li&gt;Micro USB Cable&lt;/li&gt;
  &lt;li&gt;Raspberry Pi&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;guide&quot;&gt;Guide&lt;/h2&gt;

&lt;h3 id=&quot;ft231x-description&quot;&gt;FT231X Description&lt;/h3&gt;
&lt;p&gt;The P1 programmer utilizes the FT231X to interface with UART devices with full handshake via USB while also providing four GPIO pins (CBUS) that are independent of the UART interface. FTDI chips typically utilize the virtual com port driver (VCP) to bridge USB to UART, but programmable control of the CBUS requires the use of FTDI D2XX driver. The figures below are from FTDI Application Note 184, which describes the various I/O states, and from the FT231X datasheet to describe the potential CBUS functions of interest. In particular, our design will utilize the TX LED, RX LED and GPIO functions.&lt;/p&gt;

&lt;p style=&quot;color:dark-gray; font-size: 80%; text-align: center;&quot;&gt;&lt;img src=&quot;/assets/images/Posts/ProgP1/P1_FT231XStates.png&quot; alt=&quot;image-center&quot; class=&quot;align-center&quot; /&gt;&lt;/p&gt;

&lt;p style=&quot;color:dark-gray; font-size: 80%; text-align: center;&quot;&gt;&lt;img src=&quot;/assets/images/Posts/ProgP1/P1_FT231XCBUSFunc.png&quot; alt=&quot;image-center&quot; class=&quot;align-center&quot; /&gt;&lt;/p&gt;

&lt;h3 id=&quot;p1-pinout-description&quot;&gt;P1 Pinout Description&lt;/h3&gt;
&lt;p&gt;Vespucci modules are designed to utilize most of the full UART signals, so all lines except for the DSR will be used by the FT231X. The following figure describes the pinout for the FTDI IC. Of note, the only pins that require programmatic control are CBUS0 and CBUS3. CBUS0 serves as a power on signal to wake attached modules. CBUS3 serves as a signal to power the 3V3 bus for attached modules. The bus power signal can either be sent by the FTDI chip or from an attached Black Magic Probe. A more complete schematic can be found in the &lt;a href=&quot;https://gitlab.com/puccilabs/vespucci-pcbs/-/blob/master/Programmer/P1_FT231X/P1_FT231X.pdf&quot;&gt;PCB GitLab repo&lt;/a&gt;.&lt;/p&gt;

&lt;p style=&quot;color:dark-gray; font-size: 80%; text-align: center;&quot;&gt;&lt;img src=&quot;/assets/images/Posts/ProgP1/P1_FTPinout.png&quot; alt=&quot;image-center&quot; class=&quot;align-center&quot; /&gt;
&lt;strong&gt;&lt;em&gt;FT231X Pinout on the P1 Programmer.&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;h3 id=&quot;pyftdi-installation&quot;&gt;pyftdi Installation&lt;/h3&gt;
&lt;p&gt;The programmer will be programmed and controlled with pyftdi on Linux, which provides a Python wrapper for an open source variant of the FTDI D2XX driver. I’m using pyftdi because that is the first library that worked for me and it seems to be actively updated at the time of writing. With respect to other systems, I ran into permission issues when using OSX where serial access was restricted and I couldn’t solve the problem. Windows was providing segfault issues and Ubuntu on a hypervisor or WSL had trouble finding the programmer or ran into segfault issues as well. I did find that using a pure Linux OS worked without an issue - in this case, a Raspberry Pi 3B with a Debian image. The following instructions are more or less copied from the pyftdi installation guide. Another benefit of pyftdi is that the EEPROM can be flashed without needing to use FTDI’s FT_Prog utility. This will allow us to use a custom VID PID code when we’re able to get one without needing to recompile a Windows driver.&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Install Python3, required modules and the libusb driver. Create a udev rule to escalete FTDI device permissions.&lt;/li&gt;
&lt;/ol&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-shell&quot; data-lang=&quot;shell&quot;&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;apt-get install python3, python3-pip, python3-venv, libusb-1.0
&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;nano /etc/udev/rules.d/11-ftdi.rules&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;In the 11-ftdi.rules, enter the following and save the file:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-shell&quot; data-lang=&quot;shell&quot;&gt;&lt;span class=&quot;nv&quot;&gt;SUBSYSTEM&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;==&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;usb&quot;&lt;/span&gt;, ATTR&lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;idVendor&lt;span class=&quot;o&quot;&gt;}==&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;0403&quot;&lt;/span&gt;, ATTR&lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;idProduct&lt;span class=&quot;o&quot;&gt;}==&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;6015&quot;&lt;/span&gt;, &lt;span class=&quot;nv&quot;&gt;GROUP&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;plugdev&quot;&lt;/span&gt;, &lt;span class=&quot;nv&quot;&gt;MODE&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;0664&quot;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;ol start=&quot;2&quot;&gt;
  &lt;li&gt;Reload udev rules and add current user to the group.&lt;/li&gt;
&lt;/ol&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-shell&quot; data-lang=&quot;shell&quot;&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;udevadm control &lt;span class=&quot;nt&quot;&gt;--reload-rules&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;udevadm trigger
&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;adduser &lt;span class=&quot;nv&quot;&gt;$USER&lt;/span&gt; plugdev
newgrp plugdev&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;Create a Python3 virtual environment and install packages.&lt;/li&gt;
&lt;/ol&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-shell&quot; data-lang=&quot;shell&quot;&gt;mkdir programmer &amp;amp; &lt;span class=&quot;nb&quot;&gt;cd &lt;/span&gt;programmer
python3 &lt;span class=&quot;nt&quot;&gt;-m&lt;/span&gt; venv venv_programmer
&lt;span class=&quot;nb&quot;&gt;source &lt;/span&gt;venv_programmer/bin/activate
pip install pyftdi&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;h3 id=&quot;ft231x-programming&quot;&gt;FT231X Programming&lt;/h3&gt;

&lt;p&gt;Some of the settings on the FTDI chip should be changed on the P1 such as the CBUS pins as outlined above and the maximum current, which is set to 300mA for driving downstream modules. A config that is ready to go can be downloaded from &lt;a href=&quot;/assets/data/p1_config.ini&quot;&gt;this link&lt;/a&gt; and can be programmed with the following command.&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-shell&quot; data-lang=&quot;shell&quot;&gt;python ftconf.py ftdi:///1 &lt;span class=&quot;nt&quot;&gt;-l&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-i&lt;/span&gt; p1_config.ini &lt;span class=&quot;nt&quot;&gt;-u&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;The &lt;code class=&quot;highlighter-rouge&quot;&gt;ftconf.py&lt;/code&gt; script can be found in &lt;code class=&quot;highlighter-rouge&quot;&gt;venv_programmer/bin/ftconf.py&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The device hexdump isn’t particularly necessary, but I’ll post it here in the event that it’s useful for someone later on. The last string, PL5J9KNY, is the device serial number and should be varied between devices.&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-shell&quot; data-lang=&quot;shell&quot;&gt;python ftconf.py ftdi:///1 &lt;span class=&quot;nt&quot;&gt;-x&lt;/span&gt;

000000   00 00 03 04 15 60 00 10 80 96 0c 00 00 00 a0 14   .....&lt;span class=&quot;sb&quot;&gt;`&lt;/span&gt;..........
000010   b4 1c d0 12 00 00 00 00 00 00 08 01 02 08 00 00   ................
000020   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00   ................
000030   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00   ................
000040   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00   ................
000050   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00   ................
000060   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00   ................
000070   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00   ................
000080   4a 36 b5 c9 01 00 b9 41 6a 31 40 00 00 00 00 00   J6.....Aj1@.....
000090   00 00 00 00 44 33 53 44 4f 43 5a 44 00 00 00 00   ....D3SDOCZD....
0000a0   14 03 50 00 75 00 63 00 63 00 69 00 4c 00 61 00   ..P.u.c.c.i.L.a.
0000b0   62 00 73 00 1c 03 50 00 31 00 20 00 50 00 72 00   b.s...P.1. .P.r.
0000c0   6f 00 67 00 72 00 61 00 6d 00 6d 00 65 00 72 00   o.g.r.a.m.m.e.r.
0000d0   12 03 50 00 4c 00 35 00 4a 00 39 00 4b 00 4e 00   ..P.L.5.J.9.K.N.
0000e0   59 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00   Y...............
0000f0   00 00 00 00 00 00 00 00 00 00 00 00 00 00 a6 0a   ................&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;To set your own parameters, you can modify the following command. Append -v to the end to see what the configuration result is or append a -u to the end to upload the configuration to the FTDI chip.&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-shell&quot; data-lang=&quot;shell&quot;&gt;python ftconf.py ftdi:///1 &lt;span class=&quot;nt&quot;&gt;-m&lt;/span&gt; PucciLabs &lt;span class=&quot;nt&quot;&gt;-p&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'P1 Programmer'&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-c&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;cbus_func_0&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;GPIO &lt;span class=&quot;nt&quot;&gt;-c&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;cbus_func_1&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;RXLED &lt;span class=&quot;nt&quot;&gt;-c&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;cbus_func_2&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;TXLED &lt;span class=&quot;nt&quot;&gt;-c&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;cbus_func_3&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;GPIO &lt;span class=&quot;nt&quot;&gt;-c&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;power_max&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;300&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;There you go! You have now programmed the P1 Programmer so that it is ready to use with other Vespucci modules.&lt;/p&gt;</content><author><name>Robert R. Puccinelli</name></author><category term="vespucci" /><category term="setup" /><category term="programmer" /></entry><entry><title type="html">Guide: SMT PCB Fabrication</title><link href="https://puccilabs.com/guides/PCBReflow/" rel="alternate" type="text/html" title="Guide: SMT PCB Fabrication" /><published>2020-11-04T00:00:00+00:00</published><updated>2020-11-04T00:00:00+00:00</updated><id>https://puccilabs.com/guides/PCBReflow</id><content type="html" xml:base="https://puccilabs.com/guides/PCBReflow/">&lt;figure class=&quot;half&quot;&gt;
    &lt;a href=&quot;/assets/images/Posts/Reflow/ReflowPCBBare.jpg&quot;&gt;&lt;img src=&quot;/assets/images/Posts/Reflow/ReflowPCBBare.jpg&quot; /&gt;&lt;/a&gt;
    &lt;a href=&quot;/assets/images/Boards/R1_Front_Photo.jpg&quot;&gt;&lt;img src=&quot;/assets/images/Boards/R1_Front_Photo.jpg&quot; /&gt;&lt;/a&gt;

&lt;/figure&gt;

&lt;h2 id=&quot;overview&quot;&gt;Overview&lt;/h2&gt;
&lt;p&gt;The objective of this guide is to demonstrate how to fabricate SMT PCBs. While through hole components can be soldered onto a PCB with relative ease with a soldering iron and good technique, surface mount components typically require the use of masks and a reflow oven. This is largely due to their small size, which makes them difficult to handle and solder. However, surface mount components can be advantageous for designs by making them more compact, improving circuit performance and lowering cost.&lt;/p&gt;

&lt;p&gt;Solder paste masks can either be purchased from various vendors online, fabricated with a laser cutter, or cut one with a stencil cutter as described in the &lt;a href=&quot;/guides/SilhouetteServer&quot;&gt;Silhouette guide&lt;/a&gt;. Similarly, commercial reflow ovens can be purchased or you can build one. I purchased a Controleo3 oven build kit from &lt;a href=&quot;https://www.whizoo.com/buy&quot;&gt;Whizoo&lt;/a&gt; and followed their instructions.&lt;/p&gt;

&lt;h2 id=&quot;materials-used&quot;&gt;Materials Used&lt;/h2&gt;

&lt;ul&gt;
  &lt;li&gt;Solder Paste Mask&lt;/li&gt;
  &lt;li&gt;Solder Paste&lt;/li&gt;
  &lt;li&gt;Flux Paste (Optional)&lt;/li&gt;
  &lt;li&gt;Isopropanol (Optional)&lt;/li&gt;
  &lt;li&gt;Putty Knife, Flexible&lt;/li&gt;
  &lt;li&gt;Tweezers, ESD Safe&lt;/li&gt;
  &lt;li&gt;Reflow Oven&lt;/li&gt;
  &lt;li&gt;PCB &amp;amp; Components&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;guide&quot;&gt;Guide&lt;/h2&gt;

&lt;p style=&quot;color:dark-gray; font-size: 80%; text-align: center;&quot;&gt;&lt;img src=&quot;/assets/images/Posts/Reflow/ReflowPCBMount.jpg&quot; alt=&quot;image-center&quot; class=&quot;align-center&quot; /&gt;
&lt;strong&gt;&lt;em&gt;PCB Secured to Workspace.&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Secure the target PCB to the work area. I recommend taping down other PCBs with the same height to prevent the target from moving. When you tape down the mask in the next step, you want it to be completely flat across the surface. This means that you might need to use spacers if you have components already soldered to the other side of the target PCB.&lt;/li&gt;
&lt;/ol&gt;

&lt;p style=&quot;color:dark-gray; font-size: 80%; text-align: center;&quot;&gt;&lt;img src=&quot;/assets/images/Posts/Reflow/ReflowPCBStencil.jpg&quot; alt=&quot;image-center&quot; class=&quot;align-center&quot; /&gt;
&lt;strong&gt;&lt;em&gt;Stencil Aligned and Secured to PCB.&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;ol start=&quot;2&quot;&gt;
  &lt;li&gt;Align the solder paste mask to the pads on the target PCB and tape it down. It is important that the mask is flat across the PCB so that solder paste does not go under the mask when spreading it.&lt;/li&gt;
  &lt;li&gt;Apply paste near one side of each group of pads. While a little bit of paste can be spread across a long distance. It is usually fine to use more than you think you’ll need so that all pads are covered with paste in one pass.&lt;/li&gt;
&lt;/ol&gt;

&lt;p style=&quot;color:dark-gray; font-size: 80%; text-align: center;&quot;&gt;&lt;img src=&quot;/assets/images/Posts/Reflow/ReflowPCBSwipe.jpg&quot; alt=&quot;image-center&quot; class=&quot;align-center&quot; /&gt;
&lt;strong&gt;&lt;em&gt;Solder Paste Spread Across Mask - Not the Cleanest, But Good Enough!&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;ol start=&quot;4&quot;&gt;
  &lt;li&gt;Spread the solder paste across the mask with a flexible putty knife.&lt;/li&gt;
&lt;/ol&gt;

&lt;p style=&quot;color:dark-gray; font-size: 80%; text-align: center;&quot;&gt;&lt;img src=&quot;/assets/images/Posts/Reflow/ReflowPCBPaste.jpg&quot; alt=&quot;image-center&quot; class=&quot;align-center&quot; /&gt;
&lt;strong&gt;&lt;em&gt;Solder Paste on Pads.&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Carefully remove the mask by lifting one side. If another attempt needs to be made, I recommend cleaning the board and mask with isopropanol and repeating the steps above. If there are a few pads or an IC which looks like it could be problematic, solder flux can be deposited over those pads. The flux will help the paste reflow better and minimize shorts.&lt;/li&gt;
&lt;/ol&gt;

&lt;p style=&quot;color:dark-gray; font-size: 80%; text-align: center;&quot;&gt;&lt;img src=&quot;/assets/images/Posts/Reflow/ReflowPCBPop.jpg&quot; alt=&quot;image-center&quot; class=&quot;align-center&quot; /&gt;
&lt;strong&gt;&lt;em&gt;PCB Populated with Components Prior to Reflow.&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;ol start=&quot;6&quot;&gt;
  &lt;li&gt;Using ESD safe tweezers, populate the board with your components. Do your best to center the parts over the pads, particularly ICs. It doesn’t need to be perfect though since the part will most likely recenter itself when the paste liquifies in the oven.&lt;/li&gt;
&lt;/ol&gt;

&lt;p style=&quot;color:dark-gray; font-size: 80%; text-align: center;&quot;&gt;&lt;img src=&quot;/assets/images/Posts/Reflow/ReflowOven.jpg&quot; alt=&quot;image-center&quot; class=&quot;align-center&quot; /&gt;
&lt;strong&gt;&lt;em&gt;Toaster Oven Turned Reflow Oven with Whizoo Build Kit.&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;ol start=&quot;7&quot;&gt;
  &lt;li&gt;Configure your reflow oven to match the reflow profile of your paste. Place the populated PCB in the oven and reflow! If I am reflowing the 2nd side of my PCB, I’ll lift it with some small heatsinks that I have so that it is flat and the components on the bottom are not in contact with anything else.&lt;/li&gt;
&lt;/ol&gt;

&lt;p style=&quot;color:dark-gray; font-size: 80%; text-align: center;&quot;&gt;&lt;img src=&quot;/assets/images/Boards/R1_Front_Photo.jpg&quot; alt=&quot;image-center&quot; class=&quot;align-center&quot; /&gt;
&lt;strong&gt;&lt;em&gt;Finished PCB.&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;ol start=&quot;8&quot;&gt;
  &lt;li&gt;Repeat prior steps for other side of PCB, if needed.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;There you go! You are now able to reliably fabricate PCBs that use surface mount components. This opens up an opportunity to create more advance circuits such as those using radio and microcontroller ICs.&lt;/p&gt;</content><author><name>Robert R. Puccinelli</name></author><category term="fabrication" /><category term="stencil" /><category term="PCB" /></entry><entry><title type="html">Guide: Automated Stencil Cutting</title><link href="https://puccilabs.com/guides/SilhouetteServer/" rel="alternate" type="text/html" title="Guide: Automated Stencil Cutting" /><published>2020-06-18T00:00:00+00:00</published><updated>2020-06-18T00:00:00+00:00</updated><id>https://puccilabs.com/guides/SilhouetteServer</id><content type="html" xml:base="https://puccilabs.com/guides/SilhouetteServer/">&lt;p style=&quot;color:dark-gray; font-size: 80%; text-align: center;&quot;&gt;&lt;img src=&quot;/assets/images/Posts/Silhouette/SilhouetteAndPi.jpg&quot; alt=&quot;image-center&quot; class=&quot;align-center&quot; /&gt;
&lt;strong&gt;&lt;em&gt;Silhouette Cameo with a Raspberry Pi 3B+ Stencil Server&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p style=&quot;color:dark-gray; font-size: 80%; text-align: center;&quot;&gt;&lt;img src=&quot;/assets/images/Posts/Silhouette/SilhouetteStencilCrop.jpg&quot; alt=&quot;image-center&quot; class=&quot;align-center&quot; /&gt;
&lt;strong&gt;&lt;em&gt;Example Stencil for the R1 Radio Module with 0402 Caps and Rs.&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;h2 id=&quot;overview&quot;&gt;Overview&lt;/h2&gt;
&lt;p&gt;The objective of this guide is to simplify the PCB stencil cutting process by setting up a dedicated server to manage the entire cutting workflow. This is advantageous because, despite the great stencil quality, cutting with a vinyl cutter can be dreadfully slow and requires a USB connection operate the machine at all times.&lt;/p&gt;

&lt;p&gt;To free my laptop from a USB tether, I set up a small Raspberry Pi 3B+ to interface with my Silhouette Cameo. Now, I can transfer a gerber to the Pi over the network, have the Pi process it, and have the Pi manage the cutter with a single terminal command.&lt;/p&gt;

&lt;p&gt;The Cameo preprocessing and cutting tools are available in &lt;a href=&quot;https://github.com/pmonta/gerber2graphtec&quot;&gt;Peter Monta’s Github repo&lt;/a&gt;. Once I dialed in settings for my specific machine, I set up the Raspberry Pi for network communication, installed the tools, wrote a script on the Pi that automates processing and cutter communication, and wrote a script on my Mac that copies a file to the Pi and executes the cutter script.&lt;/p&gt;

&lt;p style=&quot;color:dark-gray; font-size: 80%; text-align: center;&quot;&gt;&lt;img src=&quot;/assets/images/Posts/Silhouette/SilhouetteAndHiddenPi.jpg&quot; alt=&quot;image-center&quot; class=&quot;align-center&quot; /&gt;
&lt;strong&gt;&lt;em&gt;The Pi and cables can be tucked away without impeding cutter operation.&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;h2 id=&quot;materials-used&quot;&gt;Materials Used&lt;/h2&gt;

&lt;ul&gt;
  &lt;li&gt;Raspberry Pi 3B+ w/ Power Supply&lt;/li&gt;
  &lt;li&gt;MicroSD Card w/Adapter&lt;/li&gt;
  &lt;li&gt;Macbook Pro (OSX 10.14)&lt;/li&gt;
  &lt;li&gt;Silhouette Cameo&lt;/li&gt;
  &lt;li&gt;Cutting Blade, 45° or 60°&lt;/li&gt;
  &lt;li&gt;Mylar Sheet, 4 mil&lt;/li&gt;
  &lt;li&gt;Cutting Mat&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;guide&quot;&gt;Guide&lt;/h2&gt;
&lt;h3 id=&quot;raspberry-pi-setup&quot;&gt;Raspberry Pi Setup&lt;/h3&gt;
&lt;ol&gt;
  &lt;li&gt;Download Raspberry Pi OS Lite at &lt;a href=&quot;https://www.raspberrypi.org/downloads/raspberry-pi-os/&quot;&gt;https://www.raspberrypi.org/downloads/raspberry-pi-os/&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;Unzip the file and mount the resulting .img&lt;/li&gt;
  &lt;li&gt;In the terminal, add an empty ssh file and set up your wireless network credentials so that you can remotely ssh into the device.&lt;/li&gt;
&lt;/ol&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-shell&quot; data-lang=&quot;shell&quot;&gt;&lt;span class=&quot;nb&quot;&gt;cd&lt;/span&gt; /Volumes/boot
touch ssh
nano wpa_supplicant.conf&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;In wpa_supplicant.conf, include the following:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-shell&quot; data-lang=&quot;shell&quot;&gt;&lt;span class=&quot;nv&quot;&gt;ctrl_interface&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;DIR&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;/var/run/wpa_supplicant &lt;span class=&quot;nv&quot;&gt;GROUP&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;netdev 
&lt;span class=&quot;nv&quot;&gt;update_config&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;1
&lt;span class=&quot;nv&quot;&gt;network&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;={&lt;/span&gt;
   ssid&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;YourNetworkNameInQuotes&quot;&lt;/span&gt;
   scan_ssid&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;1
   psk&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;YourNetworkPasswordInQuotes&quot;&lt;/span&gt;
   key_mgmt&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;WPA-PSK
&lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;ol start=&quot;4&quot;&gt;
  &lt;li&gt;Download an etcher program to flash the .img onto an SD card. Raspberry Pi appears to offer one for those without a favorite etcher.&lt;/li&gt;
  &lt;li&gt;Select the .img file, select the SD card, and flash&lt;/li&gt;
  &lt;li&gt;Transfer the SD card to the Pi and power it up. The initial boot may take 30s as it expands the file system.&lt;/li&gt;
  &lt;li&gt;SSH into the system and change the default credentials.&lt;/li&gt;
&lt;/ol&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-shell&quot; data-lang=&quot;shell&quot;&gt;ssh pi@raspberrypi.local
&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;use raspberry as the password when prompted&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;raspi-config&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;ol start=&quot;8&quot;&gt;
  &lt;li&gt;The config menu will allow you to change the password and hostname in the Network option. Hostname is the name of the device on the network, so the next login will become YourHostname.local&lt;/li&gt;
  &lt;li&gt;Reboot the device and confirm that the new password and hostname work:&lt;/li&gt;
&lt;/ol&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-shell&quot; data-lang=&quot;shell&quot;&gt;ssh pi@YourHostname.local
&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;enter password when prompted&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;ol start=&quot;10&quot;&gt;
  &lt;li&gt;Install and update required software:&lt;/li&gt;
&lt;/ol&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-shell&quot; data-lang=&quot;shell&quot;&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;apt-get update
&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;apt upgrade &lt;span class=&quot;nt&quot;&gt;-y&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;apt install git gerbv pstoedit &lt;span class=&quot;nt&quot;&gt;-y&lt;/span&gt;
git clone https://github.com/pmonta/gerber2graphtec.git
&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;usermod &lt;span class=&quot;nt&quot;&gt;-a&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--group&lt;/span&gt; lp pi&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;ol start=&quot;11&quot;&gt;
  &lt;li&gt;Build and install an older version of Ghostscript. The pstoedit utility will fail to generate a .pic file for identifying cutter paths with the current version:&lt;/li&gt;
&lt;/ol&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-shell&quot; data-lang=&quot;shell&quot;&gt;wget https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs921/ghostscript-9.21.tar.gz
&lt;span class=&quot;nb&quot;&gt;tar &lt;/span&gt;xvf ghostscript-9.21.tar.gz
./ghostscript-9.21/configure
make
make install&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;h3 id=&quot;pi-cutter-script&quot;&gt;Pi Cutter Script&lt;/h3&gt;
&lt;ol start=&quot;12&quot;&gt;
  &lt;li&gt;Create a script that will be used to automate the stencil cutting process. &lt;strong&gt;NOTE:&lt;/strong&gt; Parameters that I am using in this script have been proven to work well with my specific machine, blades, and mylar film. When testing your own system, please refer to Peter Monta’s website and repository for background and calibration advice:&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;http://pmonta.com/blog/2012/12/25/smt-stencil-cutting/&quot;&gt;http://pmonta.com/blog/2012/12/25/smt-stencil-cutting/&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/pmonta/gerber2graphtec&quot;&gt;https://github.com/pmonta/gerber2graphtec&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-shell&quot; data-lang=&quot;shell&quot;&gt;nano ~/g2g.sh&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;In g2g.sh, include the following:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-shell&quot; data-lang=&quot;shell&quot;&gt;&lt;span class=&quot;c&quot;&gt;#!/usr/bin/bash&lt;/span&gt;
python ~/gerber2graphtec/gerber2graphtec &lt;span class=&quot;nt&quot;&gt;--speed&lt;/span&gt; 1--force   14 &lt;span class=&quot;nt&quot;&gt;--border&lt;/span&gt; 0.5,0.5 &lt;span class=&quot;nt&quot;&gt;--offset&lt;/span&gt; 3.75,0 stencil.gbr &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; /dev/usb/lp0 &lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;h3 id=&quot;optional-password-free-server&quot;&gt;Optional: Password-free Server&lt;/h3&gt;
&lt;ol start=&quot;13&quot;&gt;
  &lt;li&gt;Exit the SSH session and optionally create a key pair so that a password does not need to be entered every time a file is transferred to the Pi for cutting.&lt;/li&gt;
&lt;/ol&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-shell&quot; data-lang=&quot;shell&quot;&gt;&lt;span class=&quot;nb&quot;&gt;exit
&lt;/span&gt;ssh-keygen &lt;span class=&quot;nt&quot;&gt;-t&lt;/span&gt; rsa
&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;enter file location/name when prompted to save the key&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
ssh-copy-id pi@YourHostname.local&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;h3 id=&quot;file-transfer-and-execute-script&quot;&gt;File Transfer and Execute Script&lt;/h3&gt;
&lt;ol start=&quot;14&quot;&gt;
  &lt;li&gt;Create a script that sends a gerber to the Raspberry Pi and automatically starts the cutting process.&lt;/li&gt;
&lt;/ol&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-shell&quot; data-lang=&quot;shell&quot;&gt;nano ~/gerber2cameo.sh&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;In gerber2cameo.sh, include the following:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-shell&quot; data-lang=&quot;shell&quot;&gt;&lt;span class=&quot;c&quot;&gt;#!/bin/bash&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;HOSTNAME&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$1&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;FILE&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$2&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;
scp &lt;span class=&quot;nv&quot;&gt;$FILE&lt;/span&gt; pi@&lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;HOSTNAME&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt;.local:stencil.gbr
ssh pi@&lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;HOSTNAME&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt;.local ./g2g.sh&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;ol start=&quot;15&quot;&gt;
  &lt;li&gt;Create an alias so that the script is executable anywhere in the terminal. The example below is for fish, but an alias can easily be created for bash, which is the default shell. Refer to Google for advice on how to create aliases for your shell.&lt;/li&gt;
&lt;/ol&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-shell&quot; data-lang=&quot;shell&quot;&gt;&lt;span class=&quot;nb&quot;&gt;alias &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;g2c&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;source ~/gerber2cameo.sh&quot;&lt;/span&gt;
funcsave g2c&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;ol start=&quot;16&quot;&gt;
  &lt;li&gt;To use the script and start cutting through the Raspberry Pi, run the following:&lt;/li&gt;
&lt;/ol&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-shell&quot; data-lang=&quot;shell&quot;&gt;g2c YourHostname FileToCut.gbr&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;There you go! You are now able to start a stencil with a single command and move on with your life. No need to remain tethered to cutter.&lt;/p&gt;</content><author><name>Robert R. Puccinelli</name></author><category term="fabrication" /><category term="stencil" /></entry></feed>