Add Wifi to SKR Pro step by step

If you are looking to add the little ESP01 board to your SKR board to control your MPCNC or Lowrider or whatever CNC device you are trying to wifi enable then I hope this post helps you avoid the struggles I went through. I really had trouble finding all the pieces required. I am doing this for an MPCNC with SKR Pro V1.2 with TFT35 E3 V3.0 running dual endstop V1 firmware V515. Just works!!!

First you need an ESP-01S like this (note: ESP-01 has less memory than ESP-01S so make sure you have an ESP-01S. You should be able to look at the markings on the flash chip on the ESP-01 and confirm that it is an 8Mb (8 megabit or 1 megabyte, 1MB) flash chip.


The ESP-01S is the small board on top and the red board with the yellow header is the programmer. There are a LOT of articles and posts on programming the ESP-01S using an arduinoā€¦ and a lot using a board SIMILAR to this that you MODIFY to make them programmers but the feature with this one is the switchā€¦ That little side switch switches between normal run mode (UART) and programming mode (PROG). The switch has to be in PROG mode WHEN you plug the device into your PC. I am doing this on a Windows PCā€¦ I saw many posts saying people had issues getting these to work but with the correct options and understanding I find this programmer works well.

Then you need programming software. This is available from Expressif at https://www.espressif.com/en/support/download/other-tools
At the time of writing the tool is the flash_download_tool_3.9.3 for Windows. Too large for me to attach to this post.

Then you need all the software pieces that get programmed into and then loaded onto the ESP-01S module. Those pieces are the firmware that gets flashed into the ESP-01S that makes it a tiny wifi web server and then the web user interface (webui) that gets uploaded via the web server interface that has all the printer controls etc.

First step is the firmware itself. If I understand this properly, the firmware is ESP3D V3ā€¦ and my struggle was primarily that there is an ESP3D available that is an older version. Using that results in a JSON error at the point when you think you are successfulā€¦ boy the number of times I hit that was frustrating. I am attaching everything needed to this post here. This is nothing but the V1 Engineering posted files assembled into one place.
ESP01SWifiUI.zip (495.7 KB)
the ZIP file contains firmware.bin which is the proper ESP3D V3 firmware for the ESP-01S module added to the three files (favicon.ico, index.html.gz, preferences.json) required for the webuiā€¦ Note that the indel.html.gz is indeed a zip file form inside a zip fileā€¦ thats OK. The web server firmware understands the gz filesā€¦ leave it as isā€¦ (too much knowledge makes you want to unzip it firstā€¦ donā€™tā€¦)

Download the flash download tool and unzip it. Download the ESP01WifiUI zip attached above and unzip it. Plug your ESP-01S into your programmer Flip the switch on your programming adapter to PROG mode and plug it into your USB port. Here is your first hurdleā€¦ does it show up as a COM portā€¦ The board uses a CH340 chip to communicate over USB and you may need a driver. The way you tell if it is working is using Windows Device Manager. In Device Manager, expand the COM ports tab and plug in the programming adapter and see if a new COM port shows up. Note that the COM port number may change depending on what USB port you plug it into on your PC and what other COM devices you have plugged in at the time. If the programmer shows up as a COM it should look like this
Before:
image
After:
image
Mine showed up as COM4ā€¦ successā€¦ If yours shows up as an Unknown Device then find CH340 driversā€¦

Now launch the Flash Download Tool. You should start with a window like this


Make sure ESP8266 is selected and click OK. 8266 is the chip on the ESP-01S. That should open the programming interface:

This interface is used to program the firmware.bin file (ESP3D V3) into the board. You NEED to set some options and while you may not NEED to do it, I recommend erasing the ESP-01S first.

Select the COM port of your programmer, mine was COM4.
Baud rate 115200 is correct.
SPI speed 40MHz is correct
SPI Mode must be set to DOUT
Click ERASE

You should get a Finish messageā€¦ If you get a fail check you settings.

Now we are ready to flash firmware.bin fileā€¦ BUTā€¦ unplug and plug the programmer. You have to do this every time you flash the ESP-01Sā€¦ leave the switch in PROG mode on the programmer.

In the flash download tool click the 3 dots to select the file to program and select firmware.bin from the ESP01WifiUI file you downloaded and unzipped. in the field to the righ enter the offset 0x00000 and check the box to the left to tell the tool this is the file to download. Click START

You should see a progress bar as the programming happens

When done you will get a Finish

Thats it, done programming the flash tool, now we can flip the switch on the programmer and put the programming tool into UART mode and plug it into a USB port and it should start operating as a little Wifi device!

Open up your Wifi connections and look for a WIFI network SSID called ESP3D which should be a secured network. Connect to it. The password is 12345678 when you connect to it.

Once conected, open your favorite web browser and in the address bar type 192.168.0.1 (note, that address bar is at the top, you are not typing this into a Google search fieldā€¦) and you should end up at the basic web interface provided by firmware.bin ESP3D V3 where you are going to add the rest of the UI files by clicking upload

In the file select dialog, you want to select 3 files to upload from the ESP01WifiUI file.

Once the upload is complete you should still have the basic web userinterface showing the uploaded files

Now comes the magicā€¦ refresh your browser (best is holding Ctrl key while clicking refresh to force a reload). You SHOULD see the full user interface now

We arenā€™t done yetā€¦ lots of settings to changeā€¦
I shrunk my browser window so I could capture one image with all the settingsā€¦ you may have to scroll around to change the settingsā€¦

All the ones here in yellow on this image are the minimum you need to change.

You must set Client mode means it is going to connect to an existing wifiā€¦ and you need to set the SSID and password for your existing wifiā€¦ The baud rate has to be set to 250000 (unless you have changed the Marlin firmware for some reason). OK, Hostname isnā€™t a MUSTā€¦ but humour meā€¦

When you click Save at the bottom you will be prompted to restart
image

After restart, your EPS-01S wifi board SHOULD connect to your existing wifiā€¦ butā€¦ how do you access it on your wifiā€¦ well, thatā€™s a bit trickyā€¦ it will get an IP address on your network automatically and figuring out that address might be a challengeā€¦ My wifi uses an app to manage it and I get notifications when a new device connectsā€¦ I can look at the IP address it got via the app. Most home routers have a web interface that let you look at connected devicesā€¦ To make matters worse, when you do find it, at some point down the road that IP address may change because you are assigned that address for a specific period of time and after that time it MAY get a different address. Another option is available on that settings page where you first set up your wifiā€¦ you can switch from DHCP to static and set a specific IP addressā€¦ but that requires knowledge of your home network (subnet mask, gateway etcā€¦) and also knowledge of what IP addresses are in use by existing devicesā€¦ I canā€™t really advise you about this because there are many variables on your wifi networkā€¦ but I will say you donā€™t HAVE to connect to your existing wifiā€¦ you could have left the ESP01 operating a its own AP (access point) and just connect to that ESP3D wifi when you want to control your CNC using 192.168.0.1. On my network, I am comfortable at findind devices, I found mine and using my wifi management app made that a DHCP reservation which means it will always get the same IP address. This is a networking rabbit holeā€¦ which is where I am leaving this postā€¦

Long post, hope it helpsā€¦

P.S. As soon as I clicked SAVE when I was making this I realized that it was going to fail to connect to my WIFI because y wifi password is not really ā€œmywifipasswordā€ā€¦ What happens in the case where it cannot connect is it goes back to Access Point mode instead of Client Mode and you will once again see the wifi SSID ESP3D that you can connect to with 12345678 password and take another shot at entering your wifi information correctly. This approach allows you to reconfigure your ESP-01S wifi settings easily if you ever have a change of wifi networksā€¦

21 Likes

Wow, that is awesome! I just spent a littel while getting 20 more ready for the shop. I need to try the other burning program you show P IO is a lot slower.

Thanks for sharing!

2 Likes

Well then you are REALLY going to love this part @vicious1
On startup choose Factory
image

Then you can plug in a number of themā€¦ The programming adapters are dirt cheapā€¦ you will be limited by numbe rof USB ports pretty muchā€¦ (dont forget to set the other optionsā€¦ the ones set in Developer mode donā€™t carry over to Facotry mode it appearsā€¦)

3 Likes

Thanks for posting!

So @vicious1 I was thinking about your situation of ā€œproducingā€ ESP-01S unit for saleā€¦ yes the Expressif tool Factory mode should let you flash 8 at once with ESP3D.bin which is nice, but that only gets you the ESP3D flashed on there and you still need to connect to each one individually to add the WEBUI stuffā€¦ thats a slow processā€¦ PITAā€¦ (pain in theā€¦) so I was thinking why not build one up to the point where all the WEBUI has been installed but it has not been configured (OK maybe configure baud rate 250000, just not wifi stuff) and read the full flash then and you should be able to write just that firmware.bin file to a new ESP-01S and have a ready to go unitā€¦ and I have confirmed thisā€¦

esptool.py is a python tool for ESP8266 and I found under Windows I could install Python for Windows (Microsoft Store), then type python get-pip.py (in the folder where you download and extract this file
get-pip.zip (2.0 MB)
) to install PIP then use that to install esptool (cmd prompt type pip get esptool)

Build an ESP-01S up to the point where you have added the WEBUI files, connect and set baud to 250000 and any other customization you might want, then at a command prompt use (first use it will ask you to associate .py files with Python)
esptool.py read_flash 0 0x400000 firmware_backup.bin
That should find an ESP-01S in a USB port (in PROG mode) and read the full flash contents into a file.

Then pop a fresh ESP-01S into the adapter and use the flash too 3.93 to write that saved firmware.bin to the new unitā€¦

Its wicked slow to read the full flash and its a large file which will take longer using the flash toolā€¦ but its all unattended which is nice for youā€¦

I should add that I have tested this and it worked using a single write Develop modeā€¦ but I have not tested the flash tool with the multiwrite Factory mode mentioned above as I only have one of the ESP-01S program adaptersā€¦ (another on orderā€¦ just becauseā€¦ nevermindā€¦ donā€™t ask whatā€™s already in my basementā€¦) And the image I tested with was my full image so when I was done I had a plug in ESP-01S that connected to my wifi and workedā€¦ and in case anyone else was wondering, this approach does NOT clone the MAC address of the ESP-01S you read from, each retains their own unique MAC address so when I plugged the cloned unit into my MPCNC it got a new DHCP IP address from my router. I wasnā€™t sure if the MAC address was stored in flash or somewhere elseā€¦ somewhere else appears to be the answer to that ponderingā€¦ It was when I was testing this that I realized that the flash tool was displaying in that little message box
image
That appears to be the MAC address of the ESP-01S in AP Access Point mode and STA Station modeā€¦

This should make mass producing them a lot easier!

2 Likes

I did try that but it failed for some reason. I will use your info and give it another shot when I run out of the ones I have,

I do think we will be moving to the octopus and esp32ā€™s soon though so those are much easier to program, at least last I tried. It is tough, BTT has a holiday coming up Jan 7th to 30th or so. So right now I am just trying to get boards to make it through that period. Then I will test the octo I have and probably order some when they get back.

1 Like

I got it all set up per your instructions, I now have wifi control to my machine! any advice on how to interface it to lightburn now?

Ligtburn needs to be hardwired as far as I know that is many types of programs all in one.

If you want it wirelessly, use it to make your gcode and put that on your memory card and run it that way, but the wifi chip will not connect to lightburn directly to control it.

I was able to spoof my lightburn on my laptop for exactly 3 seconds by adding a new machine and putting it in as a ruida controller.

When I added the IP address, the laser interface panel activated for a couple seconds, the connection dropped and the interface Breyer out again.

As far as I can work out- after many hours of Internet searches- it has something to do with how the ESP3D handles ā€˜UDPā€™ protocols - whatever that is. I was planning to email lightburn support, but my free trial ran out and I forgot about it.

Iā€™ll try to get time this week to email
And enquire.

I tried using a virtual USB to Wi-Fi, I could connect to the WiFi but couldnā€™t connect to through lightburn or repetier. I will try to spoof it and see what it does for me

OK, not advocating doing this as I tend to agree with the explanation I got from the Lightburn authors about why you donā€™t want to be controlling something that burns things remotely over wifiā€¦ so if you set fire to your place its on youā€¦

I pondered the lightburn connection (I use LightBurn and it is one of the BEST pieces of software!!!) and came up with an off the shelf working solution after a few hours of tinkering. Maybe I do a full build on that sometimeā€¦ but here it is in a nutshell.

Two pieces required. ESPLink and HW Virtual Serial Portā€¦

ESPLink

Turns an ESP-01s into a wifi serial link.
Find the release version that includes all the needed binaries.
Short form is once you get it burned into an ESP-01s using the flash tool I listed above (BUT on the flash loader 3.9 uncheck the do not change bin option which apparently allows the programmer to properly change the bootloader portion for the size of flash chip)
image
My flash tool looked like this

I should add a bit here about getting the ESPLink to connect to your own wifiā€¦ I sort of stumbled through this and had issues but it workedā€¦ I think the right approach was to connect to the ESPLink wifi network (no password) since it shows up in AP or Access Point mode, when you connect to that wifi you will launch a web browser and go to 192.168.4.1 and they have a nice easy web interface to set things up. Go into the uC Console section (menu on the left) and set the baud to 250000 since thats what the Marlin in the SKR board is expecting. Go to the Wifi Station secton and set your wifi SSID and password and click connectā€¦ this is where things get fuzzyā€¦ I saw it connect (my wifi sends me alerts when a new device connects to my wifi) but then it was goneā€¦ Reading I THINK it does a temporary connect in STA (station) mode then falls back into AP mode to continue with you doing config stuff. I think at this point I needed to just reboot (i.e. plug into my SKR and power up) and it would have gone full STA mode and been accessibleā€¦ If I get time I will redo and confirm but donā€™t hold your breathā€¦ You will of course still have to figure out your IP address on your WIFI networkā€¦ the ESPLink console I believe will show you what IP it got when it did the connectā€¦ check in the WIFI Station pageā€¦ Iā€™m lucky, like I said my wifi (EERO) sends me alerts and makes it real easy to determine the IP addressā€¦ You can also do static IP instead of DHCP if you know what you are doing network wise and know what is a safe static address to useā€¦

Once you get your ESP-01 programmed with Esplink and connected to your wifi and baud rate set to 250000 you then plug the ESP-01S into your SKR board you can move onto part twoā€¦ HW Virtual Serial Port
https://www.hw-group.com/software/hw-vsp3-virtual-serial-port
I downloaded the free single version
https://www.hw-group.com/product-version/hw-vsp3-single
On install I installed only the standaloneā€¦ (seemed like all I wantedā€¦ didnā€™t even look into the differenceā€¦)
image

Then all you do is create a virtual serial port pointing at port 23. Example on my networkā€¦ your IP will differā€¦
image
Then in LightBurn create a Marlin device and connect it to your new virtual com port (COM8 in my case) and LightBurn opens and makes my MPCNC moveā€¦ over wifiā€¦

Well that turned out to be a step by step almostā€¦ LOLā€¦

LightBurn asideā€¦ this use of ESPlink and HW Virtual Serial Port should make a nice easy way to send my CNC GCode direct from ESTLCam or other programs directly instead of using SD card like I have been doingā€¦ so thanks for putting this bug in my earā€¦ whole new approach to the connection between PC and CNCā€¦

I also have to warn there is ZERO security hereā€¦ it is bare ass open on your wifi to any device on your network that connects to that IP address over the telnet port (23) so if your network is not secure then donā€™t do thisā€¦

4 Likes

The HW serial port is in your laptop/PC?

I mainly want the functionality for the lightburn camera, but I really should concentrate on getting an enclosure figured out first. Burning aluminum anodizing off is kinda smelly

Thanks for the info

Explain more what you mean by the lightburn camera?
I have used a camera in LightBurn but that was a USB cameraā€¦ I am missing your point.

And I am jealousā€¦ my little 5W wonā€™t touch aluminumā€¦ and I reiterate my comment about controlling something that burns stuff over wifiā€¦ esp something that burns metalā€¦ YMMVā€¦

The HW Virtual Serial Port is a program that makes a fake serial port and if you connect that virtual serial port to TCP port 23 then any charachter sent to that COM port goes over wifi to the ESPLink board which receives it and sends it to the SKR board its plugged intoā€¦

I have done no performance or lengthy testing of thisā€¦

The lightburn camera function that lets you line up jobs directly to an image of the actual wood you are about to cut or engrave, for material management and alignment.

I donā€™t want a pc or laptop right next to my Cnc, and Iā€™m not running a long usb cable across my workbench when I have 3 client jobs in progress in a 17x17 shop. Accident waiting to happen. I was hoping to wifi control it from a laptop in a ā€˜cleanā€™ bay which is out of direct dust/chip exposure about 12 feet away.

My diode is 10w. I use 50% power and 50mm/s to engrave black aluminum tins. The anodizing can be burned off with a 2.5w laser.

Donā€™t understand the concern about wifi control - we are all safety conscious and wouldnā€™t dream of leaving the machine running without being attentive and no more than a few feet away. Itā€™s no different to running it tethered. Of course, there are dumbasses out there who would leave it, but theyā€™d still do that tethered or wifi controlled. Iā€™m not one of them.

Thanks for the info- I believe i bought one of the first esp1 chips from Ryan for the skr pro. I donā€™t have the capability or capacity to reprogram it for this functionality, but Iā€™m finding my 10W diode to be underperforming and I see a big upgrade within a year. Iā€™ll probably make do with ā€˜manual wireless modeā€™ until then.

1 Like

Well this esp-01s approach will let you send and receive from your mpcnc or low rider or whatever you have attached to your SKR board but my experience with using a camera with LightBurn for alignment just like you want leads me to believe this wonā€™t help you. The camera in my setup did not plug into the SKR board, it plugged directly into the controlling PC. I guess if you are using a wireless camera of some form and just need this esp-01s setup to control the engraver this approach would work. I guess Iā€™m still not fully understanding your full setup.

No, youre understanding just fine

Iā€™m an idiot who didnā€™t appreciate that the camera also has a wire and it would be to hook up to the laptop

Itā€™s been that kinda month. Too many irons not enough sleep

OK, so maybe if you used a wireless webcam as your camera and this ESPLink to control the engraver from LightBurnā€¦ Something like a Bluetooth webcam might work with LightBurnā€¦ Not sure how far away from the camera you want to be as Bleutooth range is limitedā€¦

1 Like

Itā€™s like 12 feet, but the wires would be a total pain, running past some pretty heavily used equipment. I though about running conduit along the wall but looks janky. I might actually end up going that route though

I was unable to get ESTLCAM to send directly using serial over WIFI but I was able to get Repetier Host V2.3.1 (latest at this time) to control the MPCNC and send GCODE to the MPCNC using this approach so this looks like a working solution to sending files to the CNC over WIFIā€¦

I also updated the original details adding stuff about getting ESPLink on your wifi networkā€¦

If i bought an esp01Ā² from V1 do i need to do any of this or is it ready to go?