ESP8266 is a low-cost Wi-Fi chip that allow to bring the power of WiFi in any DIY project. There are a lot of modules starting from 2$ that bring this chip very easy-to-use, the most common is the module ESP-01.
Starting from v2.7.0 LaserGRBL support WiFi connection with ESP8266 allowing each hobbyist to get rid of the usb cables between the pc and his engraver.
How to use ESP8266 in your grbl engraver
- First of all you must buy any ESP8266 module. I suggest any cheap module from ebay like ESP-01
- As second step you need to load a special software on your ESP module. To do this you need a USB-serial converter (like those used to program arduino).
All the necessary sketch and library can be downloaded from github page. This software implement a WebSocket to Serial bridge.
- Third you must connect your arduino serial port to ESP serial port.
- Finally you can use LaserGRBL to connect via WiFi. Have Fun!!!
Flashing a program to the ESP8266 is a bit more annoying than flashing an Arduino. When flashing the arduino, all you have to do is press the reset button and release while you upload a program (or even not doing anything if you have FTDI such as in arduino UNO,MEGA) and the arduino will start uploading.
With the ESP8266 you have to reset the micro-controller and start it in flashing mode using the GPIO0-to-Ground. If you don’t have any ESP8266 development board and only the module itself I advice building the next circuit
Which will make your life easier. NOTE: The «78xxl» part is actually LM1117 part, or any 5v to 3.3v converter.
This image shows the formal way to connect ESP8266 to FTDI with a voltage regulator — However, two more buttons have been added. The right button, when pressed, connects the RESET pin to the ground and when it is released, connects the RESET pin to the VCC through a pull-up resistor. The left button, when pressed, connect GPIO0 to the ground. Using this two buttons you can do all the tasks you need with the ESP8266:
- Working on normal mode — Both buttons are released.
- Resetting the ESP8266 — Press the reset button and release.
- Start in flash mode — Press both buttons, release the reset button and then release the GPIO0 button.
Once you have built this circuit and downloaded all the required library and sketch you can flash websocketserver.ino to ESP8266. (press reset and GPIO button and then release reset and GPIO to put ESP in flash mode).
If you have flashed your ESP correctly you must now find a new visible WiFi in your PC with ESP8266 name.
Connect to ESP8266 network and open your browser at http://192.168.4.1
You will find a page where you can configure the ESP8266 module to connect to your existing WiFi using your WiFi password.
Once ESP is connected to your network the ESP8266 network will disappear. You now must find the new ESP8266 module IP address in your router WiFi connected client list.
Connecting ESP to arduino/grbl
This schema show the correct way to connect ESP8266 module to arduino. If you use Arduino UNO you must use RX and TX pin as same of Arduino Nano in figure. RX to TX, TX to RX.
Use LaserGRBL with ESP8266
WebSocket conenction must be enabled in settings.
Once enabled you can configure the websocket URL to connect to your grbl.
Telnet to Serial
It is also possible to use a Telnet protocol instead of WebSocket. The procedure is the same but you must use this sketch to program your ESP8266.