Connecting an SKR Pro v1.2 via an ESP32 WiFi Adapter

Overview

The SKR Pro v1.2 is an STM32F407ZGT6 based board.

Downloading the board firmware

Choose the firmware (firmware-stm32f4-wifi.bin) from here. You can choose to download either the latest release (marked latest and classed by us as stable) or the latest pre-release if available (marked pre-release and classed by us as unstable).

Once downloaded, rename it firmware.bin

WiFi firmware preparation

Choose the correct corresponding firmware from here.

  • DuetWiFiServer-X.XX-XX.bin

Once downloaded, rename it DuetWifiServer.bin

DWC (DuetWebControl)

The correct version of DWC should be downloaded from here.
The version you download should be of the same version number as the board firmware you downloaded above.
For example, if version 3.4.0 of the board firmware has been downloaded, 3.4.0 of DWC should be downloaded.

Purchasing the WiFi Adapter

If you are just purchasing an adapter now, TeamGloomy Strongly recommends an ESP32 adapter as the WiFi performance has been greatly increased.

You will need to purchase an adapter that plugs into the EXP2 header. They can be purchased from Mellow.

  • Mellow (who works in close collaboration with TeamGloomy) on Aliexpress

Connect the ESP32 Adapter to the board as shown below. (Antenna also has to be connected)

SKR Pro v1.2 ESP32 Adapter Connection

If you don’t want to be able to update the WiFi adapter via the SKR Pro v1.2 it’s not needed to connect the 4-pin serial cable. Then add a small amount of solder in the area highlighted below to get power from EXP2.

Fly ESP32 Power
Fly ESP32 Power Solder

Homemade ESP32

Use an ESP32 with USB programming as it already 5v tolerant and it allows for updating via USB. They also need to be the 36 pin variety so they have GPIO0 broken out.

BOM

  • 1 x 36 pin ESP32
  • 1 x 330R resistor
  • jumpers or other ways of connecting to the SKR Pro v1.2

Preparing the ESP32

Follow the instructions here.
Alternatively you can connect the RX/TX pins on the ESP32 to a set of RX/TX pins on the SKR Pro v1.2.

Connecting the ESP32

The pinout for the SKR Pro v1.2 can be found here and the schematic for the Duet 2 WiFi for reference can be found here.

The table below shows the pins required on the ESP32 and what they are connected to on the SKR Pro v1.2. Please ensure that your cables are no longer than 30cm although they should ideally be as short as possible.

ESP32 Pin SKR Pro v1.2 Pin Resistor Value
RST PF_12 on EXP2 470R
CS/GPIO5 PB_12 on EXP2 2200R
MOSI/GPIO23 PB_15 on EXP2 47R
MISO/GPIO19 PB_14 on EXP2 47R
SCLK/GPIO18 PB_13 on EXP2 47R
ESP_DATA_Ready/GPIO0 PG_10 on EXP2 None
LPC_DATA_Ready/GPIO4 PF_11 on EXP2 None
VIN(5v) 5v on EXP2 None
GND GND on EXP2 None
ESP32 Pinout
ESP32 Pinout

Generate a config

We provide a handy online tool to assist you in generating a set of config files for your 3D printer. The configurator doesn’t cover all options that RRF can be used for (such as dual motor axis control, which can be manually added later), however it does give a good start.

We also have a collection of user created configs which can be a useful reference. They can be found here

Manual board.txt Changes

If you are using a set of config files provided by someone else or have no need to use the configurator, you will need to create your board.txt file manually.

Below are the contents that should be used.

//Config for SKR Pro v1.2
board = biquskrpro_1.1
//WiFi pins
8266wifi.espDataReadyPin = PG_10
8266wifi.TfrReadyPin = PF_11
8266wifi.espResetPin = PF_12


//ESP32 RX/TX Settings
8266wifi.serialRxTxPins = { PD_9, PD_8 }
serial.aux.rxTxPins = { PA_10, PA_9 }
heat.tempSensePins = { PF_6, PF_3, PF_4, PF_5 }




If the WiFi adapter is not working correctly e.g. error: “Failed to attach interrupt to pin G.10” after restarting the module (M552 S-1; M552 S0) check that the interrupt is not already used e.g. with “e1stop”. See also here.

The SKR Pro also uses a different pin for the CS for SPI so you need to modify stepper.TmcUartPins in board.txt accordingly.

Driver UART Pin SPI Pin
X PC_13 PA_15
Y PE_3 PB_8
Z PE_1 PB_9
E0 PD_4 PB_3
E1 PD_1 PG_15
E2 PD_6 PG_12
BTT-EXP-MOT 1 PF_11  
BTT-EXP-MOT 2 PG_10  

For example, if you had TMC5160s on X and Y, you would add the following line to your board.txt

stepper.TmcUartPins = { PA_15, PB_8, PE_1, PD_4, PD_1, PD_6, PF_11, PG_10, NoPin, NoPin, NoPin }

Note the added two SPI pins for the TMC5160s and then the remainder of the pins are the UART pins used by TMC22XX drivers.

Smart Drivers

If using TMC5160 or TMC22XX drivers (where 22XX is either the TMC2208, TMC2209, TMC2225 or TMC2226), the following line must also be added to the board.txt file

stepper.numSmartDrivers = X

Where X is the number of drivers fitted in total.

TMC5160 SPI Drivers

If using TMC5160 drivers, the following lines must also be added to the board.txt file.

stepper.num5160Drivers = X
stepper.spiChannel = 2

Where X is the number of TMC5160 drivers fitted.

The drivers must be grouped together with the installed TMC5160s first. They can have gaps between each driver and/or driver type. So, if you have say 3 TMC5160s and 1 TMC22XX and 1 other driver, the 5160s should installed first (e.g. in slots 0, 1 and 2 or slots 0, 3 and 4), the TMC22XX in a slot after the 5160 and the remaining driver last. You can use RRF to assign any of those slots to an axis/extruder.

Sensorless Homing

Follow the instructions as found here

Manual board.txt Changes

If you are using a set of config files provided by someone else or have no need to use the configurator, you will need to create your board.txt file manually.

Below are the contents that should be used.

//Config for SKR Pro v1.2
board = biquskrpro_1.1
//WiFi pins
8266wifi.espDataReadyPin = PG_10
8266wifi.TfrReadyPin = PF_11
8266wifi.espResetPin = PF_12


//ESP32 RX/TX Settings
8266wifi.serialRxTxPins = { PD_9, PD_8 }
serial.aux.rxTxPins = { PA_10, PA_9 }
heat.tempSensePins = { PF_6, PF_3, PF_4, PF_5 }




If the WiFi adapter is not working correctly e.g. error: “Failed to attach interrupt to pin G.10” after restarting the module (M552 S-1; M552 S0) check that the interrupt is not already used e.g. with “e1stop”. See also here.

The SKR Pro also uses a different pin for the CS for SPI so you need to modify stepper.TmcUartPins in board.txt accordingly.

Driver UART Pin SPI Pin
X PC_13 PA_15
Y PE_3 PB_8
Z PE_1 PB_9
E0 PD_4 PB_3
E1 PD_1 PG_15
E2 PD_6 PG_12
BTT-EXP-MOT 1 PF_11  
BTT-EXP-MOT 2 PG_10  

For example, if you had TMC5160s on X and Y, you would add the following line to your board.txt

stepper.TmcUartPins = { PA_15, PB_8, PE_1, PD_4, PD_1, PD_6, PF_11, PG_10, NoPin, NoPin, NoPin }

Note the added two SPI pins for the TMC5160s and then the remainder of the pins are the UART pins used by TMC22XX drivers.

Drivers

Although the original method of having the firmware detect the drivers is still supported, as we have now added TMC2240 support, there is now a new method.
The following line should be added (obviously with the array entries matching your drivers and their locations):

stepper.numSmartDrivers = X
stepper.DriverType = {Tmc2208, Tmc2240, tmc2209, tmc5160, stepdir}

For the number of smart drivers, if you have the following installed (tmc2209, none, tm5160, stepdir, tmc2209) then numSmartDrivers needs to be set to 5 not to 3. Basically it means how many entries there are in the driver types array. Entries after that number get set to stepdir.

The DriverType array allows for any driver to be used in any slot so there is no order requirement like the previous detection method. The array must also include an entry for each driver slot up to the last one thats populated.
The following list of entries are valid:

none
stepdir
tmc2208
tmc2209
tmc2660
tmc5160
tmc2240

If using TMC2240 or TMC5160 drivers, you also need to add the correct spi channel:

stepper.spiChannel = 2

TMC2240 Driver Temperature

TMC2240 drivers support reporting their own temperature, rather than just hot and very hot like the other TMC drivers. To utilise this, add the following line to your config.g

M308 S11 Y"drivers"

This will return the highest temperature reading from any of the drivers, 2240s will return the actual temperature, other drivers will return 0, 100 or 150 (as before).

If you want to know the temperature of a particular driver you need to add the following line (as well as the above):

M308 S12 Y"drivertemp" p"S11.X"

Where x is the driver number that matches the driver number used by M569

Sensorless Homing

Follow the instructions as found here

SD Card preparation

Now all the required files have been gathered, the SD card structure needs to be created.

SD Card Specification

When choosing an SD Card to use with RRF, we recommend one with the following features:

  • a branded card with a speed rating of Class 4 or higher
  • of up to 32GB capacity, formatted as below. RepRapFirmware does not support SD cards formatted in exFAT format.

Formatting

If you can’t use the recommended formatting tool, then the following points should be taken into account:

If you need to reformat the micro SDHC card:

  • If the capacity of the card is 4GB or lower, use FAT16 format
  • If the capacity is more than 4GB (up to 32GB) then you will have to use FAT32 format
  • All cards should be formatted with 512 byte sectors
  • For best upload speed choose the largest cluster size available, which is normally 64kb for FAT16 and 32kb for FAT32

SD Card Structure

The following structure should be replicated on your SD card.

sd card root/
├─ filaments/
├─ firmware/
│  ├─ DuetWifiServer.bin
├─ gcodes/
├─ macros/
├─ sys/
│  ├─ bed.g
│  ├─ board.txt
│  ├─ config.g
│  ├─ homeall.g
│  ├─ homex.g
│  ├─ homey.g
│  ├─ homez.g
│  ├─ pause.g
│  ├─ resume.g
│  ├─ sleep.g
│  ├─ stop.g
│  ├─ tfree0.g
│  ├─ tpost0.g
│  ├─ tpre0.g
├─ www/
│  ├─ contents of DuetWebControl-SD.zip
firmware.bin

In the above example, the contents of the sys folder have come from the online configurator.

The contents of DuetWebControl-SD.zip should be extracted into the www folder.

Final Setup

Once connected, power up the board using 12-24v and connect to the USB port on the board. Connect to the board using a program such as putty. Follow the instructions here to set it up for RRF. Change the Com port to match the SKR Pro v1.2 and connect. The baudrate doesn’t matter.

Flashing the WiFi Firmware

Type in the following to putty

M552 S0
M997 S1

Wait for the uploading of the WiFi firmware to finish.

Sending your WiFi Credentials

Send the following

M552 S0
M587 S"your SSID" P"your password"
M552 S1

The blue light on the WiFi chip shoould then flash blue and will go solid when a connection has been established. The ip address will be shown on the serial connection. It is also possible to type just M552 to get the current ip address reported back.

The final thing to do is add the line “M552 S1” to your config file. This can be done through the web interface. This just ensures that the WiFi connection is started at start up. There is no need to add the M587 command as this is written permanently to the flash of the ESP8266 chip.

Once up and running

You will need to PID tune your tools and your bed. Please be aware that bed tuning may take up to an hour and tool tuning normally takes around 15 minutes. If it takes longer, that is also fine as up to 30 cycles may be ran.

To tune the bed, run the following command, changing the temperature (the S value) if a different tuning temperature is required.

M303 H0 S60

To tune each tool, run the following command, changing the temperature (the S value) if a different tuning temperature is required. This proceedure will activate the part cooling fans during the final phase of the tuning process so their effect is taken into account. If your printer has more than one tool, make sure each one of them is tuned.

M303 T0 S220

Once the tuning is complete, either copy the M307 command into the heater definitions or send M500, ensuring you have M501 at the end of your config.g.
If the tuning fails at the end, carry on saving the values as in most cases the outputted values still work correctly.
If the values still result in a heater fault, please refer to this wiki page for information about how to adjust the values manually.

Tags: