3D Printing Over SD Card Wi-Fi Hack

24,922

75

19

Introduction: 3D Printing Over SD Card Wi-Fi Hack

About: Programmer, Inventor, Rapid Prototype, and a Student

Are you tired of having to print over USB or having to remove the SD Card constantly to load your files?, then this tutorial is the one for you. I will be showing a small hack to make your 3D Printer Wi-Fi ready.

What I mean with this is loading your files from your Computer to the SD Card over Wi-Fi and only interfacing with the on-board screen to start your print

This hack will work with any Marlin-Firmware based 3D Printer and I will assume that you have done any Arduino work before and/or any sort of programming.

My Reasons:

The need for this hack is based on the high traffic of users that comes to the Invention Studio, the largest student run makerspace in the US, (over 100+ users weekly). Our goal is to create a user-friendly 3D Printer area for users to come and start their prints within minutes. The current line of printers at the Invention Studio are a combinations of Ultimaker 2+, Afinia H480, and UP Mini 2. Despite the Afinias and Up Minis having the friendliest interface, we are looking to replace them and standardize our line with more Ultimaker 2+ because of their reliability, quality, and volume size.

The needs for our 3D Printer space is been able to "connect" 5-6 printers per computer (We tried USB printing and it is not reliable specially when you have multiple printers), interact less physically with the SD Card (mostly to prevent the lost or damage of the SD Card and its port slots), establish easy steps and processes to teach users and future volunteers how to be 3D Printing savvy.

Step 1: Ingredients

Now that we know this is what we want. This is the list of things you need to accomplish this tutorial.

  1. Toshiba FlashAir W-03 8GB/16GB/32GB -> This will be the Wi-Fi module/memory card that we will be going to use to interface between our computer and our printer.
  2. Marlin Firmware (specific to your 3D printer) -> we need to make slight adjustments I will explain why later on.
    • Since I am using the Ultimaker 2+ I found the firmware on the Ultimaker Github I used this version because it is the one that my printers accept. This will be a little different for each one of you (mostly because of the settings).
    • If you do not have a copy of your firmware, contact your 3D Printer company and see if they can send you a copy of the firmware.
  3. Text Editor (preferably Sublime Text since it color codes your code and it numbers each line) however any text editor will do, except notepad. Notepad is bad!
  4. Arduino IDE -> this will be used to upload the modified Marlin Firmware.

If you have any questions so far, do not hesitate to contact me via the comments. I will answer to the best of my ability any questions related to this instructable.

Step 2: Modifying Your Marlin Firmware

  • Grab your Marlin and make a copy of it (This way we have a backup that we can revert in case something goes wrong).
  • Now let's open the Marlin folder that we will modify. You shall see over 50+ files (in my case I have 79 files exactly)
  • With Sublime Text or your preferred text editor open the following files:
    • Configuration.h
    • Sd2Card.cpp

Configuration.h

  • Add the following line below BAUDRATE. Refer to the picture for reference.
//SomeCode above ignore that
#define BAUDRATE ######## //Some number will appear do not change those numbers
#define FLASH_AIR_WIFI // <-- You will add this line of code, picture above for reference
//SomeCode below ignore that too

Sd2Card.cpp

  • Add the following line under readData() function and under chipSelectHigh() method call. Refer to the picture for reference.
bool Sd2Card::readData(uint8_t* dst, uint16_t count) {
//SOME CODE HERE look at the picture to see what the code looks like more or less
chipSelectHigh();
//add following 3 lines
#ifdef FLASH_AIR_WIFI
    spiSend(0xFF);
#endif
return true;
fail:
  chipSelectHigh();
//add following 3 lines
#ifdef FLASH_AIR_WIFI
    spiSend(0xFF);
#endif
  return false;
}
  • Save both files and you are done manipulating the firmware.

What did we just do?

My understanding of the topic is that when you attempt to insert your Toshiba Flashair to a 3D Printer, the printer will recognize it as a memory card, however it will not turn on the Wi-Fi module built-in on the card. In order to activate back on the Wi-Fi module of the card, you need to write to the SD Card. The modification that we just made sends one byte to the SD Card which causes to activate the built-in Wi-Fi module.

Step 3: Uploading Marlin-Firmware to Your 3D Printer

If you already know how to upload your firmware, then please feel free to do that and skip this step.

.

.

.

You are still here? No problem, I got you cover!

  • Make sure everything is saved.
  • Open the file Marlin.ino (this will open the Arduino IDE software)
  • Verify and upload your code (make sure your printer is on and connected via USB)
    • If you are getting some sort of errors, then make sure you are using the Arduino Mega 2560 board and you are in the right COM port.
Tools->Boards->Arduino/Genuino Mega or Mega 2560
Tools->Port->COM

if you did everything correctly it should not give you any errors once uploaded verify that your printers turns back on.

**Similarly to revert our changes go to your backed up copy of Marlin, open the Marlin.ino and upload it.**

Step 4: Toshiba Flashair Configuration

Now that we have flashed the firmware we can now proceed to configure our Toshiba Flashair SD Card.

  • Plug your SD Card to your computer and make a copy of the three folders (some of these folders are hidden). This will be your backup in case something goes wrong.
  • Open SD_WLAN->CONFIG with Sublime Text or your favorite text editor and add the following modifications.

Original File

Note that you might have different numbers. Keep the values of YOUR file

[Vendor]
CIPATH=/DCIM/100__TSB/FA000001.JPG
APPMODE=0
APPNETWORKKEY=********
VERSION=FA9CAW3AW3.00.01
CID=02544d535731364740d2f6b179010b01
PRODUCT=FlashAir
VENDOR=TOSHIBA

Modified File

Change the values like the ones provided. Again keeping your values

[Vendor]
CIPATH=/DCIM/100__TSB/FA000001.JPG
APPMODE=4
APPNETWORKKEY=pickAPassword
VERSION=DO NOT CHANGE, YOU MIGHT HAVE DIFFERENT VALUE
CID=DO NOT CHANGE, YOU MIGHT HAVE DIFFERENT VALUE
PRODUCT=DO NOT CHANGE
VENDOR=DO NOT CHANGE
APPSSID=pickANameHere
LOCK=1
WEBDAV=2
TIMEZONE=-16
DNSMODE=1
APPAUTOTIME=0
UPLOAD=1

With this modification make sure to save it and make sure the files are inside the SD card. Overwrite the card if you must, but make sure the modified CONFIG file is in the SD_WLAN folder.

Step 5: Creating a Virtual Drive

Make sure your SD Card is on your printer and at this point you should be broadcasting a new connection name after whatever you have chosen. I chose to name mine Baymax.

  • Connect to the new network and find the IP address
    • In Windows, open either powershell or command prompt and type the command ipconfig to get the IP address. Write down your "default getaway" address.
  • Open This PC folder and click on "Add a network location"->"choose a custom network location" and type in http://YouDefaultGetway press next and your SD Card should appear as a "virtual" folder.
  • Create a shortcut on your Desktop or wherever and rename it after your printer's name

Step 6: Celebrate!

Now you can enjoy saving your gcode into this drive and you can view your gcode files in your printer's newly Wi-Fi SD Card.

Enjoy, Favorite, and Subscribe for more. If you have more questions let me know I will gladly answer your questions to the best of my abilities related to this project! Happy Printing Guys!

Internet of Things Contest 2017

Runner Up in the
Internet of Things Contest 2017

Makerspace Contest 2017

Participated in the
Makerspace Contest 2017

Be the First to Share

    Recommendations

    • Big and Small Contest

      Big and Small Contest
    • For the Home Contest

      For the Home Contest
    • Game Design: Student Design Challenge

      Game Design: Student Design Challenge

    19 Comments

    0
    kelpchex
    kelpchex

    3 years ago

    This site has some good info on editing the config file. https://mattshub.com/blog/2017/04/11/flashair-sd-card
    I did not make any changes to Sd2Card.cpp, chipselecthigh is not longer in the file. Below are the settings I added/changed to put my card in 'STA' mode, where it acts as a wireless device on your network that you can copy files to. I started out with the flashair card in a laptop so that the config file could be easily edited. I kept editing the config and pinging the ip (192.168.1.150) until I got a reply, then mapped a drive to 192.168.1.150 and changed more settings until write was enabled. I was never able to get the name to show up on my network, I can only connect by ip

    WEBDAV=2
    APPSSID=Your_wireless_SSID
    APPMODE=5 (5 means to connect to the value in APPSSID)
    APPNETWORKKEY=Your_wireless_SSID_password
    APPAUTOTIME=0 (0 is wireless always on, otherwise it turns off to save battery in battery powered devices)
    UPLOAD=1
    UPDIR=/
    ID=FLASHAIR
    APPNAME=flashaircard
    DHCP_Enabled=NO (I could not get dhcp working, so I assigned a static ip)
    IP_Address=192.168.1.150 (choose a free ip on your network)
    Subnet_Mask=255.255.255.0 (your subnet mask)
    Default_Gateway=192.168.1.1 (your gateway)
    Preferred_DNS_Server=192.168.1.1 (your dns server)

    0
    bruno.nujic
    bruno.nujic

    3 years ago

    Thx for this tutorial. It's working great with my W-04 and I didn't edit UM firmware at all.
    I also made my SD card to connect on home wifi.
    Only downside is when I insert SD card UM2+ shows every folder inside SD (DCIM, SD_WLAN and G-code folder which I made). Is there any way to show only G-code folder? Or show root folder without SD_WLAN folder?

    my config is:
    [Vendor]
    CIPATH=/DCIM/100__TSB/FA000001.JPG
    APPMODE=6
    APPNETWORKKEY=*********
    VERSION=F15DBW3BW4.00.03
    CID=02544d535733324755e43f697b012501
    PRODUCT=FlashAir
    VENDOR=TOSHIBA
    APPSSID=UltimakerNET
    LOCK=1
    WEBDAV=2
    TIMEZONE=-16
    DNSMODE=1
    APPAUTOTIME=60000
    UPLOAD=1
    BRGSSID=Internec (my home wifi SSID)
    BRGNETWORKKEY=******* (my home wifi pass)

    1
    crowfish
    crowfish

    Question 5 years ago

    Wanting to know if this can be used with any other card, considering that the firmware "named card" could be changed to seek other cards as like a "EZ_SHARE" that at the assigned #ifdef FLASH_AIR_WIFI be defined for any other card than the "toshiba",, what I want to know is this a defined status any were other than the #ifdef where it needs to be identified as what it's named as.

    As to change things as to declare what to name it as of.

    [Vendor]
    CIPATH=/DCIM/100__TSB/FA000001.JPG.............. what is this?

    APPMODE=0
    APPNETWORKKEY=*********......is any of it card related that is hard coded some place.. as identifier to the cards IP

    VERSION=FA9CAW3AW3.00.01

    CID=02544d535731364740d2f6b179010b01 ....looks almost like UUID number

    PRODUCT=FlashAir.... change to ez share

    VENDOR=TOSHIBA..... change to ez share

    How to id the card other than to use a more expensive toshiba cards and opt for a the cheaper EZ share..as to make it more of a REP-RAP situation than of buy "this band" name as not affordable to all.

    That even a wifi type dongle might be able to be used,, but that how to diffine it.

    0
    matbu
    matbu

    Answer 3 years ago

    I am also very interested in a solution for EZ SHARE cards!

    0
    ewoud_VM
    ewoud_VM

    5 years ago

    Hi there,

    First of all love you're guide, makes it really clear :)

    So i bought a card to test with, and actually got it working pritty fast, even without changing the firmware, (currently 2+ UM on 14.04.7-RC5 firmware).

    But currently i'm struggling to find a way to connect multiple printers at the sime time to 1 computer.

    Ideally i would like to have 1 computer with seperate folders for my printers, and if i place a gcode in one of the folders, that it automatically sends the gcode to the correct printer.

    Do you guys perhaps have an idea how to do this, without the need to keep connecting to the correct Wifi network?

    Ewoud

    0
    kakaday22
    kakaday22

    Reply 5 years ago

    Hi Ewoud!

    I'm glad to hear such positive feedback. If you want to connect multiple printers to the same computer. I have a whole setup in our makerspace that does exactly that. It requires a different code for the SD card and a router. I am more than happy to provide you with a detailed guides to achieve this

    0
    marcinose
    marcinose

    Reply 3 years ago

    Excellent work, thanks for sharing. What hackerspace are you at? Can you please share the code with me for using a single computer to run multiple RAMPS printers with the Toshiba FlashAir? We are at the Factor e Farm Hackerspace. We would like to try this in our Open Source Microfactory STEAM Camp coming up - https://www.opensourceecology.org/open-source-microfactory-stem-camp/

    0
    ewoud_VM
    ewoud_VM

    Reply 3 years ago

    Hi there!
    Thanks for the reply,

    Unfortunately i have a very long list of fun project I would still like to implement, and although I Lordy wanted to do this some time ago, I didn’t make it work yet.
    I even lost 1 of the 2 cards I bought to test it with...

    So we could try togheter, and keep in contact, but I don’t have a working code.
    I have a 3D printing company, MTB3D, and my mail is info@mtb3d.com

    0
    bipsendk
    bipsendk

    Question 4 years ago

    Any chance on an update for the Marlin 2.0 bugfix source? The Sd2Card.cpp has changed a bit, so identifying where to modify is a bit hard...

    0
    bipsendk
    bipsendk

    4 years ago

    I wonder - if I transfer files/directories to the SDcard via WiFi - will Marlin automatically re-read the filetable every time I enter the SDcard menu - or is the folder contents read every time you enter a folder? It would not be optimal, if one had to remove and re-insert the card after a file transfer :-)

    0
    gearsawe
    gearsawe

    4 years ago

    So if your printer is running Marlin and you don't feel like messing with editing firmware you may be able to get this to work by using marlins auto run feature. First edit the file on the SD card as instructed above then make a file in the root of the SD Card named auto0.g ,(that is a zero after auto) edit the file and put the following 3 lines.

    M28 EnableSD.g

    G0 X0

    M29 EnableSD.g

    this will write one command "G0 X0" to a file named EnableSD.g which would effectively cause the card to enable the wifi.

    The reason I am writing this is the Marlin MK4Duo i am using does not have the same cpp files and functions. But the above is a good work around and works with no fuss and no head aches. You will still have to edit the files on the SD card as instructed above.

    Happy Wifi File Transfer Printing!

    1
    ancienthart
    ancienthart

    5 years ago

    Would this work for this:
    http://www.ebay.com.au/itm/Micro-SDHC-Card-to-WIFI-SD-Card-Adapter-Wireless-Memory-Card-for-DV-Camera-Styli-/201322205696?hash=item2edfbd1200:g:~r0AAOSwj2dXkJnD

    0
    kakaday22
    kakaday22

    Reply 5 years ago

    I am not sure if it would work, but you are more than welcome to try. if you do please let me know your results. I am curious to see how it works. I used the Toshiba since there is more documentation for it and that is what I found available at the time.

    0
    delecto
    delecto

    Reply 5 years ago

    Yes for sure. Thanks again :)

    0
    kakaday22
    kakaday22

    Reply 5 years ago

    I am not to familiar with the Zaxe X1. However I been looking at it and it is very similar printer to the Monoprice Ultimate which is essentially a clone of the Ultimakers 2+. I played with the Zaxe Desktop Software to test and it is a great user-friendly software. I don't speak Turkish so took me a while to change the language to English haha. The settings seems straight forward couple of clicks and ready to print. I like their advance settings because it is straight to the point.

    Printer itself is running an MKS Board (which is the board I use for the printer I built at home) the Wi-Fi seems standard and the frame itself seems sturdy. Glass bed. Zaxe seems like a good printer.

    Here's a link of the Monoprice Ultimate for reference https://www.monoprice.com/product?p_id=15710

    0
    delecto
    delecto

    Reply 5 years ago

    Thank you sir. I appreaciate very much your comments. Seems Zaxe will be good choice so.

    0
    tomatoskins
    tomatoskins

    5 years ago

    This is a great way to not loose so many SD cards!