Wednesday, September 23, 2020

ESP3D on SKR 1.4/1.4 Turbo with ESP01S

So you have the board. It's new, shiny and it has this strange looking 8 pin port labeled WiFi? Seriously?! WiFi on that board?

Yes! And it is quite easy to set it up! Curious? Let's begin!

Installation of required tools

For obvious reasons I'll tell you how to do it on Linux. It may work on MacOS too and I doubt it'll work on Windows. Linux is my go-to system and I don't use anything else.

Installing PlatformIO

First you need Platformio commandline tools installed. You can find the instruction on PlatformIO website here.

I've had to symlink the pio command to ~/bin/pio to have it available without specifying the full path. Your milage might vary.

Clone the repository

This is quite easy if you already have Git installed. If you don't have it check out this site for further information. Once Git is on your system clone the repository by issuing the following command:

$ git clone https://github.com/luc-github/ESP3D

Building

This is the coolest part :) There are a few commands that will get you to 100% in no time thanks to PlatformIO:

Erasing EEPROM:
$ pio run -e esp01s_160mhz -t erase

Uploading the firmware:
$ pio run -e esp01s_160mhz -t upload

Uploading files to the SPIFSS
$ pio run -e esp01s_160mhz -t uploadfs

Configuration of ESP3D

Configuring the module is pretty straightforward and described really well on this page so I won't duplicate the content. Clicking a link is easy enough :D

Configuration of Marlin firmware

Now this used to be a royal pain in the neck requiring you to modify framework code which was plain and simple ugly. Luckily enough this is now made super simple!

Find a place in Configuration.h that has the following line:

/**
 * Select a secondary serial port on the board to use for...
 * :[-1, 0, 1, 2, 3, 4, 5, 6, 7]
 */
//#define SERIAL_PORT_2 -1

and change it to look like this:

/**
 * Select a secondary serial port on the board to use for...
 * :[-1, 0, 1, 2, 3, 4, 5, 6, 7]
 */
#define SERIAL_PORT_2 3
#define LPC_PINCFG_UART3_P4_28

The #define LPC_PINCFG_UART3_P4_28 is the newest addition to the LPC1769 core and allows to use the correct pins for the second serial port so that the module can properly communicate with the board.

Compiling Marlin

Now that we have PlatformIO installed we can build Marlin from command line which I think is super cool and so easy! Switch to the root of the Marlin repository and issue the following command:

$ pio run -e LPC1769

And a few moments later... that's it! You have the latest firmware in .pio/build/LPC1769/firmware.bin

Have fun!

No comments: