{"id":1988,"date":"2016-03-03T20:36:01","date_gmt":"2016-03-04T02:36:01","guid":{"rendered":"http:\/\/haveblue.org\/?p=1988"},"modified":"2023-08-26T19:31:53","modified_gmt":"2023-08-26T19:31:53","slug":"stratasys-eeprom-hack-revisted","status":"publish","type":"post","link":"https:\/\/haveblue.org\/?p=1988","title":{"rendered":"Stratasys EEPROM hack revisted"},"content":{"rendered":"<p>Five years ago, I published what is probably the single most popular post on this blog &#8211; namely, <a href=\"http:\/\/haveblue.org?p=938\">how to reset a Stratasys material cartridge EEPROM<\/a> so that it can be refilled with much cheaper third party filament.\u00a0 Dan at <a href=\"http:\/\/gnurds.com\/\">gnurds.com<\/a> took things a step further and came up with some great <a href=\"http:\/\/gnurds.com\/index.php\/2013\/01\/02\/simplified-3d-printer-hacking\/\">step-by-step tutorials<\/a> on how to accomplish this, and even had a post featured in <a href=\"http:\/\/hackaday.com\/2012\/09\/19\/this-hack-can-refill-your-stratasys-3d-printer\/\">hackaday<\/a>.\u00a0 I received a lot of questions and feedback on the hack (and even helped hack a few machines running in the field), but the fact that the process requires modifying contents on the printer&#8217;s hard drive put it out of reach for users who were barred from doing any sort of &#8216;invasive surgery&#8217; on the machine (generally students stymied by school officials).\u00a0 What was needed was a truly &#8216;touchless&#8217; hack that didn&#8217;t require any modification of the base machine itself &#8211; we needed a way to actually generate our own EEPROM data from scratch rather than simply re-using the EEPROM data as it had come on the cartridge from the factory.\u00a0 The problem is that the EEPROM data is encrypted.\u00a0 Worse, my understanding of how <a href=\"https:\/\/en.wikipedia.org\/wiki\/Data_Encryption_Standard\">DES crypto<\/a> is done on a practical level is pretty much zero &#8211; I&#8217;ve done embedded programming before, but this sort of stuff is far outside my area of expertise.<\/p>\n<p>Fortunately, in 2013 a wizard cracked the EEPROM crypto and posted the code to <a href=\"https:\/\/github.com\/bvanheu\/stratasys\">github<\/a>!\u00a0 Benjamin&#8217;s sorcery is just what&#8217;s needed to build your own EEPROM image, and he&#8217;s put a great deal of time and effort into it for zero financial gain.\u00a0 As a result, it really bugs me when I see people using his code to sell programmers for hundreds of dollars, with zero attribution for his work.\u00a0 This post, then, shows start-to-finish how you can refill your own P-class Stratasys cartridge using only a Raspberry Pi.\u00a0 It&#8217;s admittedly long and detailed, but I think it&#8217;s important to understand the whole process before trying to use any shortcuts.<\/p>\n<p>The reason that it&#8217;s taken me so long to document this hack is that I previously had no real access to a P-class machine.\u00a0 Fortunately, my friends at <a href=\"http:\/\/www.into3dllc.com\/\">Into3D LLC<\/a> have one in their shop and were more than willing to let me attempt refilling one of their empty cartridges.\u00a0 It&#8217;s a Dimension BST 768, which fortunately is <a href=\"http:\/\/www.stratasys.com\/customer-support\/customer-resource-center\/legacy-products\">still supported for 2 more years<\/a>.\u00a0 This is what the front panel looks like with a near empty (1% material remaining) model cartridge:<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/haveblue.org\/wp-content\/uploads\/2016\/02\/front-panel-empty-cartridge.jpg\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-1991 size-full\" title=\"front panel empty cartridge\" src=\"https:\/\/i0.wp.com\/haveblue.org\/wp-content\/uploads\/2016\/02\/front-panel-empty-cartridge.jpg?resize=614%2C819\" alt=\"\" width=\"614\" height=\"819\" \/><\/a><\/p>\n<p>Here&#8217;s that very cartridge &#8211; the label on top lists some applicable patents (<a href=\"https:\/\/patents.google.com\/patent\/US6776602B2\/en\">6776602<\/a>, <a href=\"https:\/\/patents.google.com\/patent\/US7063285B1\/en\">7063285<\/a>, <a href=\"https:\/\/patents.google.com\/patent\/US7341214B2\/en\">7341214<\/a>, <a href=\"https:\/\/patents.google.com\/patent\/USD436111S1\/en\">D436111<\/a>, and <a href=\"https:\/\/patents.google.com\/patent\/US7754807B2\/en\">7754807<\/a>):<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/haveblue.org\/wp-content\/uploads\/2016\/02\/cart1.jpg\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-1993 size-full\" title=\"cart1\" src=\"https:\/\/i0.wp.com\/haveblue.org\/wp-content\/uploads\/2016\/02\/cart1.jpg?resize=614%2C514\" alt=\"\" width=\"614\" height=\"514\" \/><\/a><\/p>\n<p>The side has a recycling information label and identifying information for the cartridge itself &#8211; we&#8217;ll see how that matches up with the information on the EEPROM itself.<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/haveblue.org\/wp-content\/uploads\/2016\/02\/cart2.jpg\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-1994 size-full\" title=\"cart2\" src=\"https:\/\/i0.wp.com\/haveblue.org\/wp-content\/uploads\/2016\/02\/cart2.jpg?resize=614%2C340\" alt=\"\" width=\"614\" height=\"340\" \/><\/a><\/p>\n<p>Use a 7\/32&#8243; hex wrench to remove the 4 screws on the underside of the cartridge (I used a fold-up set to break them free first, then a standard L-wrench to remove them).<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/haveblue.org\/wp-content\/uploads\/2016\/02\/cart31.jpg\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-1996 size-full\" title=\"cart3\" src=\"https:\/\/i0.wp.com\/haveblue.org\/wp-content\/uploads\/2016\/02\/cart31.jpg?resize=614%2C526\" alt=\"\" width=\"614\" height=\"526\" \/><\/a><\/p>\n<p>Then, flip the cartridge over and give the shell a few raps with your knuckles to shift the internal desiccant packs into the bottom half.\u00a0 Carefully lift off the top half of the cartridge, exposing the 1% of material remaining on the spool:<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/haveblue.org\/wp-content\/uploads\/2016\/03\/bottomhalfopenedcart.jpg\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-2096 size-full\" title=\"bottomhalfopenedcart\" src=\"https:\/\/i0.wp.com\/haveblue.org\/wp-content\/uploads\/2016\/03\/bottomhalfopenedcart.jpg?resize=614%2C558\" alt=\"\" width=\"614\" height=\"558\" \/><\/a><\/p>\n<p>Despite my dislike of using cartridges for 3D printers (it&#8217;s a lot of excess material to house the consumable), these are actually quite well designed &#8211; there&#8217;s a pair of very simple drive wheels at the corner exit, and the other 3 corners get desiccant packs.\u00a0 The orange-brown circumferential seal has a spot for the filament to exit through, and the screws actually thread into brass inserts, not into the raw plastic.\u00a0 A single cartridge can be reused many times, potentially lasting a fair portion of the life of the actual machine.\u00a0 Parked right next to the drive wheels in a slot is the object of our interest, the EEPROM board itself:<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/haveblue.org\/wp-content\/uploads\/2016\/02\/cart5.jpg\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1998\" title=\"cart5\" src=\"https:\/\/i0.wp.com\/haveblue.org\/wp-content\/uploads\/2016\/02\/cart5.jpg?resize=614%2C378\" alt=\"\" width=\"614\" height=\"378\" \/><\/a><\/p>\n<p>Here&#8217;s what the front and back of the EEPROM PCB looks like:<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/haveblue.org\/wp-content\/uploads\/2016\/02\/eeprom-front-back.jpg\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2002\" title=\"eeprom front back\" src=\"https:\/\/i0.wp.com\/haveblue.org\/wp-content\/uploads\/2016\/02\/eeprom-front-back.jpg?resize=614%2C233\" alt=\"\" width=\"614\" height=\"233\" \/><\/a><\/p>\n<p>In case anyone is wondering, the text on the chip itself is:<\/p>\n<pre>DS2433\n1226B1\n586AC<\/pre>\n<p>As noted in the original blog post, the chip is a <a href=\"https:\/\/www.maximintegrated.com\/en\/products\/digital\/one-wire\/DS2433.html\">DS2433<\/a> (originally a Dallas Semiconductor product, hence the &#8216;DS&#8217;, now owned by Maxim).\u00a0 Importantly, it is a <a href=\"https:\/\/en.wikipedia.org\/wiki\/1-Wire\">1-wire<\/a> device, hence requiring only 2 contacts to the chip.\u00a0 As an aside, this nomenclature has always annoyed me &#8211; power and signal may be carried over a single wire, but you still need a ground connection.<\/p>\n<p>Now, to extract those pesky bits from the EEPROM, all 4096 of them!\u00a0 Technically, there&#8217;s a few more bits that we&#8217;ll need as well &#8211; a 48-bit serial number, 8 bits for <a href=\"https:\/\/en.wikipedia.org\/wiki\/Cyclic_redundancy_check\">CRC<\/a>, and an 8-bit family code (0x23).\u00a0 I&#8217;ve used a <a href=\"http:\/\/dangerousprototypes.com\/docs\/Bus_Pirate\">Bus Pirate<\/a> before, and you can use an <a href=\"https:\/\/www.arduino.cc\/\">Arduino<\/a> as well, but for this post I&#8217;ll be showing how to use a Raspberry Pi, since we can do everything on a single, standardized platform.\u00a0 In this case, I&#8217;m using a <a href=\"https:\/\/www.adafruit.com\/products\/998\">Raspberry Pi model B<\/a> with an <a href=\"https:\/\/www.adafruit.com\/products\/801\">Adafruit breakout board<\/a>, and I started with a clean <a href=\"https:\/\/www.raspberrypi.org\/help\/noobs-setup\/\">NOOBS<\/a> image (<a href=\"http:\/\/downloads.raspberrypi.org\/NOOBS\/images\/NOOBS-2016-02-09\/\">v1.7.0<\/a> to be specific) on a freshly formatted SD card.<\/p>\n<p>I booted the RasPi and was greeted with the installer &#8211; since I had the RasPi connected to my network, it provided me with network installation options, but I selected only the first option to install the Raspbian OS:<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/haveblue.org\/wp-content\/uploads\/2016\/03\/noobsinstall11.jpg\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2118\" title=\"noobsinstall1\" src=\"https:\/\/i0.wp.com\/haveblue.org\/wp-content\/uploads\/2016\/03\/noobsinstall11.jpg?resize=614%2C603\" alt=\"\" width=\"614\" height=\"603\" \/><\/a><\/p>\n<p>While that was installing, I prepped the breakout board.<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/haveblue.org\/wp-content\/uploads\/2016\/02\/breakoutboard1.jpg\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2018\" title=\"breakoutboard1\" src=\"https:\/\/i0.wp.com\/haveblue.org\/wp-content\/uploads\/2016\/02\/breakoutboard1.jpg?resize=614%2C869\" alt=\"\" width=\"614\" height=\"869\" \/><\/a><\/p>\n<p>I connected the black alligator clip to a GND (0vdc) terminal and the red alligator clip to IO4 on the breakout board (which is pin 7 of the RasPi header).\u00a0 Note that pinouts on the RasPi can be very confusing &#8211; IO4 on the breakout board is <em>not<\/em> GPIO.4 on the RasPi as I had first thought, but pin 4 of the Broadcom BCM2835 processor at the heart of of the RasPi (also known as GPIO.7 on the RasPi).\u00a0 You can read more about this confusion at <a href=\"http:\/\/wiringpi.com\/pins\/\">wiringpi.com<\/a>.\u00a0 I connected a 2.2k resistor to a 5vdc terminal and the IO4 terminal &#8211; this acts as a pullup.<\/p>\n<p>By this time, Raspbian had finished installing and I was looking at a fresh new desktop.\u00a0 I find it easier to just SSH into the RasPi, so once I determined its IP address (just hover your mouse over the network icon in the upper right of the desktop), I could fire up PuTTY and connect right to a shell (you can certainly do everything via a terminal window on the desktop, though).<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/haveblue.org\/wp-content\/uploads\/2016\/02\/pycryptoinstall.png\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2043\" title=\"pycryptoinstall\" src=\"https:\/\/i0.wp.com\/haveblue.org\/wp-content\/uploads\/2016\/02\/pycryptoinstall.png?resize=661%2C514\" alt=\"\" width=\"661\" height=\"514\" \/><\/a><\/p>\n<p>On a default install of Raspbian, the login is <strong>pi<\/strong> and the password is <strong>raspberry<\/strong>.\u00a0 While Raspbian includes just about all the software we&#8217;ll need by default, the Python crypto library will be required later on, so run <strong>sudo apt-get install python-crypto<\/strong> right away to install that package (the RasPi will need to be network connected with internet access for this to work).\u00a0 I then attached the breakout board to the RasPi and proceeded to do some testing with gpio to make sure that my wiring was correct.<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/haveblue.org\/wp-content\/uploads\/2016\/02\/labeled-raspi-assembly.png\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2091\" title=\"labeled raspi assembly\" src=\"https:\/\/i0.wp.com\/haveblue.org\/wp-content\/uploads\/2016\/02\/labeled-raspi-assembly.png?resize=614%2C484\" alt=\"\" width=\"614\" height=\"484\" \/><\/a><\/p>\n<p>I hooked up an oscilloscope to the red and black leads (you can use a multimeter, but a scope will let us see when EEPROM reads are occurring, which is handy when debugging), and saw that I had nearly 5vdc, which is just what I was expecting due to the 2.2k pullup resistor.<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/haveblue.org\/wp-content\/uploads\/2016\/03\/scope5vdc1.jpg\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2120\" title=\"scope5vdc\" src=\"https:\/\/i0.wp.com\/haveblue.org\/wp-content\/uploads\/2016\/03\/scope5vdc1.jpg?resize=614%2C463\" alt=\"\" width=\"614\" height=\"463\" \/><\/a><\/p>\n<p>Now, let&#8217;s have a look at actually controlling the pin that the red alligator clip is connected to.\u00a0 The <strong>gpio readall<\/strong> command gives us a snapshot of what the status is of all the header pins (again, see <a href=\"http:\/\/wiringpi.com\/the-gpio-utility\/\">wiringpi.com<\/a> for details).\u00a0 By default, all the I\/O pins are set to be inputs (note pin 7 is set as &#8216;IN&#8217;):<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/haveblue.org\/wp-content\/uploads\/2016\/02\/gpioreadallclean1.png\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2023\" title=\"gpioreadallclean\" src=\"https:\/\/i0.wp.com\/haveblue.org\/wp-content\/uploads\/2016\/02\/gpioreadallclean1.png?resize=661%2C418\" alt=\"\" width=\"661\" height=\"418\" \/><\/a><\/p>\n<p>We can change the mode from input to output on that pin with <strong>gpio mode 7 out<\/strong><\/p>\n<p><a href=\"https:\/\/i0.wp.com\/haveblue.org\/wp-content\/uploads\/2016\/02\/gpiosetout.png\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2025\" title=\"gpiosetout\" src=\"https:\/\/i0.wp.com\/haveblue.org\/wp-content\/uploads\/2016\/02\/gpiosetout.png?resize=661%2C434\" alt=\"\" width=\"661\" height=\"434\" \/><\/a><\/p>\n<p>And as soon as that command is issued, the voltage drops to zero:<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/haveblue.org\/wp-content\/uploads\/2016\/03\/scope0vdc1.jpg\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2121\" title=\"scope0vdc\" src=\"https:\/\/i0.wp.com\/haveblue.org\/wp-content\/uploads\/2016\/03\/scope0vdc1.jpg?resize=614%2C451\" alt=\"\" width=\"614\" height=\"451\" \/><\/a><\/p>\n<p>Issuing <strong>gpio write 7 1<\/strong> will bring that pin high:<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/haveblue.org\/wp-content\/uploads\/2016\/02\/gpiosethigh.png\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2027\" title=\"gpiosethigh\" src=\"https:\/\/i0.wp.com\/haveblue.org\/wp-content\/uploads\/2016\/02\/gpiosethigh.png?resize=661%2C434\" alt=\"\" width=\"661\" height=\"434\" \/><\/a><\/p>\n<p>Resulting in 3.3v output (RasPi digital I\/O is 3.3v, not 5v):<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/haveblue.org\/wp-content\/uploads\/2016\/03\/scope33vdc2.jpg\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2122\" title=\"scope33vdc\" src=\"https:\/\/i0.wp.com\/haveblue.org\/wp-content\/uploads\/2016\/03\/scope33vdc2.jpg?resize=614%2C439\" alt=\"\" width=\"614\" height=\"439\" \/><\/a><\/p>\n<p>That&#8217;s all for verifying that the wiring is correct.\u00a0 There&#8217;s one final change to make before we can actually try reading in an EEPROM, and that&#8217;s disabling <a href=\"https:\/\/www.raspberrypi.org\/documentation\/configuration\/device-tree.md\">Device Tree<\/a> (I understand it&#8217;s possible to get things working with DT enabled by means of some other configuration changes, but disabling it altogether is the route I went with).\u00a0 Run <strong>sudo raspi-config<\/strong> to bring up the configuration menu, and select Advanced Options:<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/haveblue.org\/wp-content\/uploads\/2016\/02\/raspiconfig1.png\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2030\" title=\"raspiconfig1\" src=\"https:\/\/i0.wp.com\/haveblue.org\/wp-content\/uploads\/2016\/02\/raspiconfig1.png?resize=661%2C434\" alt=\"\" width=\"661\" height=\"434\" \/><\/a><\/p>\n<p>Then, select Device Tree:<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/haveblue.org\/wp-content\/uploads\/2016\/02\/dt1.png\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2031\" title=\"dt1\" src=\"https:\/\/i0.wp.com\/haveblue.org\/wp-content\/uploads\/2016\/02\/dt1.png?resize=661%2C434\" alt=\"\" width=\"661\" height=\"434\" \/><\/a><\/p>\n<p>Select &#8216;No&#8217;:<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/haveblue.org\/wp-content\/uploads\/2016\/02\/dt2.png\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2032\" title=\"dt2\" src=\"https:\/\/i0.wp.com\/haveblue.org\/wp-content\/uploads\/2016\/02\/dt2.png?resize=661%2C434\" alt=\"\" width=\"661\" height=\"434\" \/><\/a><\/p>\n<p>And DT will then be set as disabled:<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/haveblue.org\/wp-content\/uploads\/2016\/02\/dt3.png\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2033\" title=\"dt3\" src=\"https:\/\/i0.wp.com\/haveblue.org\/wp-content\/uploads\/2016\/02\/dt3.png?resize=661%2C434\" alt=\"\" width=\"661\" height=\"434\" \/><\/a><\/p>\n<p>Back at the main menu, select Finish and you&#8217;ll be prompted to reboot (select &#8216;Yes&#8217;):<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/haveblue.org\/wp-content\/uploads\/2016\/02\/dt4.png\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2034\" title=\"dt4\" src=\"https:\/\/i0.wp.com\/haveblue.org\/wp-content\/uploads\/2016\/02\/dt4.png?resize=661%2C434\" alt=\"\" width=\"661\" height=\"434\" \/><\/a><\/p>\n<p>With the RasPi rebooted, we&#8217;re finally ready to read in an EEPROM.\u00a0 Recite the magic incantations <strong>sudo modprobe w1-gpio gpiopin=4<\/strong> and <strong>sudo modprobe w1-ds2433<\/strong> (note that you&#8217;ll need to run those commands again if you reboot the RasPi, so it may be worthwhile to add them to a startup script):<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/haveblue.org\/wp-content\/uploads\/2016\/02\/1wireenable.png\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2035\" title=\"1wireenable\" src=\"https:\/\/i0.wp.com\/haveblue.org\/wp-content\/uploads\/2016\/02\/1wireenable.png?resize=661%2C418\" alt=\"\" width=\"661\" height=\"418\" \/><\/a><\/p>\n<p>Now, connect the clips to the EEPROM &#8211; black clip to the ground pad, red clip to the data pad (you can tell which is the ground pad because it has a trace on all 4 sides connecting it to the ground plane):<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/haveblue.org\/wp-content\/uploads\/2016\/02\/clippedeeprom.jpg\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2060\" title=\"clippedeeprom\" src=\"https:\/\/i0.wp.com\/haveblue.org\/wp-content\/uploads\/2016\/02\/clippedeeprom.jpg?resize=614%2C423\" alt=\"\" width=\"614\" height=\"423\" \/><\/a><\/p>\n<p>If you have a scope hooked up, you&#8217;ll see that the voltage drops to 3.3 volts and then there will be a data read every 10 seconds or so:<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/haveblue.org\/wp-content\/uploads\/2016\/03\/scoperead1.jpg\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2124\" title=\"scoperead\" src=\"https:\/\/i0.wp.com\/haveblue.org\/wp-content\/uploads\/2016\/03\/scoperead1.jpg?resize=614%2C461\" alt=\"\" width=\"614\" height=\"461\" \/><\/a><\/p>\n<p>We can <strong>cd \/sys\/bus\/w1\/devices\/w1_busmaster1<\/strong> to have a look at the connected 1-wire devices seen by the RasPi, and therein is a specific directory created for that EEPROM (23-0000014d4762 in this case &#8211; your EEPROM will be different!):<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/haveblue.org\/wp-content\/uploads\/2016\/02\/eepromreads1.png\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2039\" title=\"eepromreads1\" src=\"https:\/\/i0.wp.com\/haveblue.org\/wp-content\/uploads\/2016\/02\/eepromreads1.png?resize=661%2C562\" alt=\"\" width=\"661\" height=\"562\" \/><\/a><\/p>\n<p>You can also use the <strong>xxd<\/strong> command to hex dump the EEPROM&#8217;s full UID as shown (0x2362474d0100006b).\u00a0 This particular UID consists of the family code (0x23, which should be the same on all Stratasys P-class EEPROMs, except for those used on uPrint cartridges), the device serial number (0x62474d010000 &#8211; note the endianness) and finally the checksum (0x6b).\u00a0 The screenshot also shows a dump of the 512 bytes of EEPROM data itself.\u00a0 In order to actually do anything with this EEPROM data, though, we&#8217;ll need Benjamin&#8217;s code.<\/p>\n<p>We&#8217;ll <strong>cd<\/strong> back to our user directory and then grab a .zip archive of the code via <strong>wget https:\/\/github.com\/bvanheu\/stratasys\/archive\/master.zip<\/strong>, after which we can extract it into a directory via <strong>unzip master.zip<\/strong>.<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/haveblue.org\/wp-content\/uploads\/2016\/02\/wgetpackage.png\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2041\" title=\"wgetpackage\" src=\"https:\/\/i0.wp.com\/haveblue.org\/wp-content\/uploads\/2016\/02\/wgetpackage.png?resize=661%2C706\" alt=\"\" width=\"661\" height=\"706\" \/><\/a><\/p>\n<p>We&#8217;ll <strong>cd<\/strong> into that directory and try running the main program by executing <strong>.\/stratasys-cli.py -h<\/strong><\/p>\n<p><a href=\"https:\/\/i0.wp.com\/haveblue.org\/wp-content\/uploads\/2016\/02\/stratasysclihelp.png\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2045\" title=\"stratasysclihelp\" src=\"https:\/\/i0.wp.com\/haveblue.org\/wp-content\/uploads\/2016\/02\/stratasysclihelp.png?resize=661%2C290\" alt=\"\" width=\"661\" height=\"290\" \/><\/a><\/p>\n<p>This is just what we want to see!\u00a0 If instead you get a number of errors mentioning crypto, make sure that you have the python-crypto library installed.\u00a0 At this point, we don&#8217;t need to do any further configuration on the RasPi, and we can actually dive into the EEPROM data itself.\u00a0 If you&#8217;ve managed to get this far, you&#8217;re probably capable of basic command line Linux work, so I&#8217;m going to gloss over those details from this point onward and let screenshots do most of the talking.\u00a0 First, we&#8217;ll copy the EEPROM data out to a file that we can actually work with.<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/haveblue.org\/wp-content\/uploads\/2016\/02\/initialdump.png\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-2048 size-full\" title=\"initialdump\" src=\"https:\/\/i0.wp.com\/haveblue.org\/wp-content\/uploads\/2016\/02\/initialdump.png?resize=661%2C802\" alt=\"\" width=\"661\" height=\"802\" \/><\/a><\/p>\n<p>A directory listing confirmed that the resulting file is exactly 512 bytes in length, and all the formatting looks just like all the other Stratasys EEPROM dumps I&#8217;ve seen.\u00a0 Let&#8217;s take one more look at the EEPROM UID, as we&#8217;ll need to format it correctly to feed into the stratasys-cli program:<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/haveblue.org\/wp-content\/uploads\/2016\/02\/eepromuid.png\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-2049 size-full\" title=\"eepromuid\" src=\"https:\/\/i0.wp.com\/haveblue.org\/wp-content\/uploads\/2016\/02\/eepromuid.png?resize=661%2C69\" alt=\"\" width=\"661\" height=\"69\" \/><\/a><\/p>\n<p>We need to reverse the byte order of the shown UID, so instead of <strong>23 62 47 4d 01 00 00 6b<\/strong> we&#8217;ll use <strong>6b 00 00 01 4d 47 62 23<\/strong> (remember, the family code of 0x23 is at one end, and the checksum is at the other end).\u00a0 Here we finally feed the EEPROM UID and the EEPROM data through the program, using &#8216;prodigy&#8217; as the machine type (any Dimension series machine should be &#8216;prodigy&#8217;, but a different machine type (Titan, Maxum, etc.) will have a different family name):<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/haveblue.org\/wp-content\/uploads\/2016\/02\/unencryptedinfo.png\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-2050 size-full\" title=\"unencryptedinfo\" src=\"https:\/\/i0.wp.com\/haveblue.org\/wp-content\/uploads\/2016\/02\/unencryptedinfo.png?resize=661%2C291\" alt=\"\" width=\"661\" height=\"291\" \/><\/a><\/p>\n<p>If you don&#8217;t have the UID formatted properly, the program will fail with a checksum error:<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/haveblue.org\/wp-content\/uploads\/2016\/02\/baduid.png\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-2051 size-full\" title=\"baduid\" src=\"https:\/\/i0.wp.com\/haveblue.org\/wp-content\/uploads\/2016\/02\/baduid.png?resize=661%2C308\" alt=\"\" width=\"661\" height=\"308\" \/><\/a><\/p>\n<p>If we take a quick look at the data, everything agrees with the label that was on the cartridge &#8211; the color, serial number, manufacturing lot, and manufacturing date all match perfectly (I&#8217;m guessing that the timestamp on the EEPROM data is actually GMT).\u00a0 Note that while the last use date is a separate entry in the EEPROM data, I&#8217;ve never seen it differ from the manufacturing date (maybe Stratasys intended to write this data back to the cartridge, but couldn&#8217;t be certain that the printer itself would actually have the correct day\/time set).\u00a0 A service manual I saw indicated that this timestamp was intended to be the date\/time that the cartridge was actually first inserted into a machine, so perhaps Stratasys intended to have cartridges &#8216;expire&#8217; after a certain amount of time.<\/p>\n<p>The EEPROM stores material quantity in terms of cubic inches.\u00a0 A brand new cartridge contains 56.3 cubic inches worth of filament, and the current level as shown on the EEPROM is under 0.75 cubic inches, so the 1% filament remaining message on the printer&#8217;s front panel was right on (there was actually a little more than that remaining on the reel, but the overage allows for nozzle purges, waste due to swapping cartridges, etc.).\u00a0 The original hack worked by simply setting the current material quantity back to 56.3, but the printer would remember the serial number of the cartridge (and refuse to work with that cartridge serial again), so files needed to be deleted on the printer itself.\u00a0 Since we can now create our own EEPROM images from scratch, we can simply change the serial number in addition to the material quantity, and the printer will be none the wiser.<\/p>\n<p>In addition to decrypting the EEPROM data and displaying it in a human readable format, Benjamin&#8217;s program can provide all the parameters needed to generate that very EEPROM data, which is extremely handy.\u00a0 We&#8217;ll simply tack on the <strong>-r<\/strong> option to the command we just used:<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/haveblue.org\/wp-content\/uploads\/2016\/02\/commandlinegeneration.png\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2054\" title=\"commandlinegeneration\" src=\"https:\/\/i0.wp.com\/haveblue.org\/wp-content\/uploads\/2016\/02\/commandlinegeneration.png?resize=661%2C434\" alt=\"\" width=\"661\" height=\"434\" \/><\/a><\/p>\n<p>We only need to change the highlighted options to create our desired EEPROM image:<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/haveblue.org\/wp-content\/uploads\/2016\/02\/neweepromgenerated.png\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-2055 size-full\" title=\"neweepromgenerated\" src=\"https:\/\/i0.wp.com\/haveblue.org\/wp-content\/uploads\/2016\/02\/neweepromgenerated.png?resize=661%2C387\" alt=\"\" width=\"661\" height=\"387\" \/><\/a><\/p>\n<p>Reading the generated neweeprom.bin file back through the program shows that the serial number is now different (I incremented the value by 1000 rather than 1 just in case there were consecutively serialized cartridges the machine had already seen), and the material quantity is back to &#8216;full&#8217;.\u00a0 Now, we can finally write that file back to the EEPROM itself (remember to use sudo when writing to the EEPROM due to permissions):<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/haveblue.org\/wp-content\/uploads\/2016\/02\/writingeeprom.png\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-2056 size-full\" title=\"writingeeprom\" src=\"https:\/\/i0.wp.com\/haveblue.org\/wp-content\/uploads\/2016\/02\/writingeeprom.png?resize=661%2C611\" alt=\"\" width=\"661\" height=\"611\" \/><\/a><\/p>\n<p>A quick hexdump directly from the EEPROM verifies that we&#8217;ve modified the contents successfully.\u00a0 Note that the new image we generated is only 113 bytes, while the original EEPROM data is a full 512 bytes.\u00a0 This is because everything after the &#8216;STRATASYS&#8217; at 0x69 is random garbage (early on, Stratasys simply padded out 0x71 onwards with zeros), so that portion of the EEPROM can be left unchanged.\u00a0 That&#8217;s all that we need to do with the RasPi &#8211; the EEPROM can be disconnected and set aside.\u00a0 All that remains is to reload the cartridge with fresh material.<\/p>\n<p>My favorite current filament is the &#8216;High Performance ABS&#8217; from <a href=\"http:\/\/coex3d.com\/news\/coex3d-introduces-2-new-high-performance-abs-grades\/\">Coex3D<\/a> &#8211; I&#8217;m partial to them because they&#8217;re local, their product quality is excellent, and Chris gave an amazing presentation on polymer processing and filament extrusion to our 3D printing user group a few years ago.\u00a0 He listened to my <a href=\"http:\/\/haveblue.org?p=841\">pleas for MG94 filament<\/a> and thankfully started producing it.<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/haveblue.org\/wp-content\/uploads\/2016\/03\/spollwontfit.jpg\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2100\" title=\"spool wont fit\" src=\"https:\/\/i0.wp.com\/haveblue.org\/wp-content\/uploads\/2016\/03\/spollwontfit.jpg?resize=614%2C575\" alt=\"\" width=\"614\" height=\"575\" \/><\/a><\/p>\n<p>While Coex3D reels fit right into my FDM series machines, they don&#8217;t fit into P-class cartridges (the bore is just a little too small, and there is a rubber piece attached to the top shell of the cartridge that would interfere anyhow).\u00a0 So I needed to <a href=\"http:\/\/haveblue.org?p=635\">respool the new filament onto the old reel<\/a>.<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/haveblue.org\/wp-content\/uploads\/2016\/03\/spoolonmill.jpg\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2102\" title=\"spoolonmill\" src=\"https:\/\/i0.wp.com\/haveblue.org\/wp-content\/uploads\/2016\/03\/spoolonmill.jpg?resize=614%2C616\" alt=\"\" width=\"614\" height=\"616\" \/><\/a><\/p>\n<p>In fact, respooling the filament itself is probably the hardest part of the entire process!\u00a0 I admittedly got a bit hackish with the use of electrical tape as a makeshift drive dog, but it worked.<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/haveblue.org\/wp-content\/uploads\/2016\/03\/redfilamentincartridge.jpg\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2103\" title=\"redfilamentincartridge\" src=\"https:\/\/i0.wp.com\/haveblue.org\/wp-content\/uploads\/2016\/03\/redfilamentincartridge.jpg?resize=614%2C540\" alt=\"\" width=\"614\" height=\"540\" \/><\/a><\/p>\n<p>Make sure that you have the desiccant packets in place, the EEPROM PCB in its slot, and the drive wheels in position, then very carefully feed the end of the filament through the hole in the disc portion of the gasket.\u00a0 Hold the filament in its guide slot, and carefully place the top shell half back in place (this is pretty tricky without having the gasket jump out of place).\u00a0 Flip it over, assemble the cartridge with the 4 screws, and our work is complete.\u00a0 Now, for the moment of truth&#8230;<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/haveblue.org\/wp-content\/uploads\/2016\/03\/fullcartinmachine.jpg\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2130\" title=\"fullcartinmachine\" src=\"https:\/\/i0.wp.com\/haveblue.org\/wp-content\/uploads\/2016\/03\/fullcartinmachine.jpg?resize=614%2C251\" alt=\"\" width=\"614\" height=\"251\" \/><\/a><\/p>\n<p>After loading the refilled cartridge into the printer, it showed a 100% full model spool!<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/haveblue.org\/wp-content\/uploads\/2016\/03\/successpart.jpg\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2129\" title=\"successpart\" src=\"https:\/\/i0.wp.com\/haveblue.org\/wp-content\/uploads\/2016\/03\/successpart.jpg?resize=614%2C644\" alt=\"\" width=\"614\" height=\"644\" \/><\/a><\/p>\n<p>Of course, the proof is in the prints, and the machine is now happily churning out parts far more inexpensively than before (and with better material properties than the OEM P400 filament had).<\/p>\n<p>Notes:<\/p>\n<p>1) Benjamin&#8217;s code works for other Stratasys printer families as well, including the big T-class and Maxum\/Quantum machines.\u00a0 It will even decrypt and generate binary images for uPrint cartridge EEPROMs.\u00a0 However, uPrint cartridges use a different EEPROM model that unfortunately utilizes an HMAC authentication scheme for writes.\u00a0 <span style=\"text-decoration: line-through;\">So while you can read EEPROMs and generate new .bin files, actually writing them back to the EEPROM is impossible without knowledge of the secret key used for the HMAC authentication.\u00a0 If you only have access to a uPrint, you&#8217;re kind of stuck.<\/span> [12FEB2017 addendum]\u00a0 It turns out that an HMAC protected EEPROM can be re-written by using the DIAG port on the printer.\u00a0 &#8216;Odin&#8217; discovered this workaround and authored <a href=\"http:\/\/haveblue.org\/wp-content\/uploads\/2017\/02\/hp-designjet-3d-hack.pdf\">these concise instructions<\/a> for the hack.\u00a0 This isn&#8217;t quite &#8216;touchless&#8217;, but until someone breaks or sidesteps the HMAC protection, it&#8217;s the best option.<\/p>\n<p>2) 56.3 cubic inches isn&#8217;t actually the maximum material quantity you can set on the EEPROM.\u00a0 It&#8217;s a floating point number, so the sky is the limit!\u00a0 However, on a P-class machine, 60.0 cubic inches is the maximum that the printer will accept as valid, as anything larger will instead be considered zero. [22FEB2017 addendum] Reports indicate that larger volumes can be used, but the &#8216;initial material quantity&#8217; field needs to be similarly large.\u00a0 However, others (Odin, for one) find that this doesn&#8217;t work on their machine, so this could be a difference between firmware revisions.<\/p>\n<p>3) I mentioned using an Arduino to read\/write the EEPROM.\u00a0 There&#8217;s actually a fork of Benjamin&#8217;s code available on github called <a href=\"https:\/\/github.com\/slaytonrnd\/CartridgeWriter\">CartridgeWriter<\/a> that runs in Windows and interfaces with an Arduino for EEPROM reads\/writes.\u00a0 I haven&#8217;t tried it myself, but others have used it successfully.\u00a0 I prefer running Benjamin&#8217;s code directly on a RasPi due to the amount of control it provides.\u00a0 Specifically, it makes some automation possible, such as&#8230;<\/p>\n<p>4) &#8230;<a href=\"https:\/\/www.youtube.com\/watch?v=IPgUh5_PjIc\">this clever little EEPROM rewriter<\/a> made by Sneaks Hacks.\u00a0 He&#8217;s posted the <a href=\"http:\/\/bit.ly\/1RNfscv\">wiring schematic and STL files for the housing<\/a>, and is currently working on an <a href=\"https:\/\/www.youtube.com\/watch?v=KNZ7OisApVw\">updated version<\/a> as well as documentation for people wanting to build their own.<\/p>\n<p>5) The Stratasys EEPROM PCB has a surface mount 4.7k pull<em>down<\/em> resistor right next to the DS2433.\u00a0 While most wiring schematics for reading\/writing a Stratasys EEPROM show to use a 4.7k pullup between 5v and the data pad, I used a 2.2k to help ensure that voltage to the DS2433 remains in an acceptable range.\u00a0 You can certainly start with a 4.7k pullup and reduce the resistance if you&#8217;re having flaky results, but I don&#8217;t think I&#8217;d go below 2.2k.<\/p>\n<p>6) Benjamin notes that use of the <strong>&#8211;output-file<\/strong> option when generating EEPROM images isn&#8217;t actually correct in a traditional Unix sense, and that I\/O redirection is really the proper Unix way to get binary output from stratasys-cli.py (that is, using something like <strong>.\/stratasys-cli.py &#8211;foo &#8211;bar &gt; my_file.bin<\/strong>).\u00a0 I think using <strong>&#8211;output-file<\/strong> is a little easier to see and understand what&#8217;s going on, but if you&#8217;re building an automated system like Sneaks Hacks did, using stdout can help streamline the processing chain.\u00a0 For example, you could write directly to the EEPROM <em>and<\/em> save a backup of the image all in one go by using something like <strong>.\/stratasys-cli.py &#8211;foo &#8211;bar | tee backup_image.bin \/sys\/bus\/w1\/devices\/w1_bus_master1\/23-0000014d4762\/eeprom<\/strong>.<\/p>\n<p>7) Everything in this post is simply the compilation and distillation of other people&#8217;s hard work &#8211; I simply wanted to bring it to a wider audience.\u00a0 These are the folks who deserve all the credit:<\/p>\n<ul>\n<li>Huge thanks goes to Mjolinor, who I believe was the first to <a href=\"http:\/\/www.3dprintforums.com\/showthread.php?t=1088\">pioneer using a RasPi as an all-in-one solution<\/a> for rewriting Stratasys EEPROMs.<\/li>\n<li>Thanks to the anonymous and unnamed people (you know who you are) who have assisted in developing and testing these techniques over the past few years and helped review this post before publishing.<\/li>\n<li>Steve, Joe, and John at Into3D LLC for letting me use their Dimension BST 768 as the guinea pig for this project.<\/li>\n<li>First, last, again, and finally, <a href=\"https:\/\/github.com\/bvanheu\">Benjamin Vanheuverzwijn<\/a>.\u00a0 This man is an absolute electronic wizard and none of this would have been possible without him.\u00a0 Send him coffee.<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Five years ago, I published what is probably the single most popular post on this blog &#8211; namely, how to reset a Stratasys material cartridge EEPROM so that it can be refilled with much cheaper third party filament.\u00a0 Dan at gnurds.com took things a step further and came up with some great step-by-step tutorials on [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"nf_dc_page":"","_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[2],"tags":[],"class_list":["post-1988","post","type-post","status-publish","format-standard","hentry","category-3d-printing"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/haveblue.org\/index.php?rest_route=\/wp\/v2\/posts\/1988","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/haveblue.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/haveblue.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/haveblue.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/haveblue.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1988"}],"version-history":[{"count":2,"href":"https:\/\/haveblue.org\/index.php?rest_route=\/wp\/v2\/posts\/1988\/revisions"}],"predecessor-version":[{"id":2455,"href":"https:\/\/haveblue.org\/index.php?rest_route=\/wp\/v2\/posts\/1988\/revisions\/2455"}],"wp:attachment":[{"href":"https:\/\/haveblue.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1988"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/haveblue.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1988"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/haveblue.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1988"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}