Using ESP-LINK (ESP8266 Wi-Fi to Serial Bridge) to program an Arduino UNO over Wi-Fi

everyone senior today we’re gonna do some engineering and stuff in this video we’re going to discuss how to use the ESP platform in particular an ESP – 2:01 is a transparent y-factor serial bridge the objective here is to be able to program and receive data from a basic arduino uno over my local wireless network this is going to be achieved through a firmware called ESP link which will allow your microcontroller or any other platform that sends and receives serial data to be connected to the Internet or wireless network however there are no real in-depth guides on how to set up ESP link and getting things running so I’m here to guide you through that process if you’re watching this video I’m assuming you already know why you’d want to set up ESP link and have an application in mind however if you don’t I’ll briefly go over mine I want to use the Arduino Uno as a cheap embedded system that I can communicate with through LabVIEW remotely and as the owner inherently doesn’t have any Wi-Fi capability I’m leveraging another cheap platform the ESP – 0 1 to add this functionality don’t worry though this is a future video and I won’t go to any detail on LabVIEW today on-screen now is how I’ve architectured the project to achieve this starting from bottom left the Arduino is connected to the ESP – 0 1 through its Rx and TX pins and data is communicated by directionally over us the ASP – 0 1 is flush with ESP link and connected to the wireless LAN and data is communicated by directionally over tcp/ip a virtual comport with tcp/ip redirection will be set up on your PC which enables bi-directional communication with the ESP link and pushes down the data to your target market controller and platform of course you can adjust its architecture to whatever floats your boat now that that’s out of the way let’s get started first step is going to be to flash your ESP device with ESP link I have gone into great detail in a previous video linked below and on screen on how to flash firmware to an ESP – zero one including the circuit diagrams and how we are required to go watch that video if this is your first time there are also abundant resources online on how to do this if you’re using a different ESP model so now let’s navigate to the ESP link github for once here if we scroll down we can see a blurb from G labs about all the features of this firmware we are in particular going to cover the first two you can read the rest in your own time if we scroll down a bit further there are a number of useful documents under Quick Links let’s open hardware configuration and serial flashing in a new tab and save it for later scroll a bit further down and we can now come across the releases and download section select see all releases then select the thermo release of your choice I’m going with the latest alpha released however if you encounter bugs or issues just flash an earlier stable release instead navigate to the download link and well download it once this is downloaded configure your ESP – is 0-1 into Flash boot mode and open up your esp8266 flashing tool I’m using the flashing tool made available by expressive systems which is a link down below once we have open up the flash tool for the ESP – zero one you’ll be presented with various settings the settings on-screen are for an ESP double zero one eight megabyte version so you can simply copy them if you’re using the same ESP – zero one model if you have a different model of an ASP or one you can simply never get back to the serial flashing page on the ESP link github this will tell you what files are to be flashed to what memory address alternatively if you just hover over the memory address field in the tool a tooltip will shop specifying the same thing now once you’ve set all that up and have the correct file set to the correct address select the comm port the ASP – – 0 1 is connected to and the correct baud rate then you just hit start and the flashing should be in don’t worry if you mess it up because either the flashing tool fail the upload or the ESP will just do nothing and you will figure out pretty quickly that you need to brief flash or ESP – 0 1 once it’s done reset your ESP – is 0 1 and you’re ready to set up ESP link after sudo flashing the ESP – 0 1 is peeling corporator Wi-Fi access point which we will need to join to reconfigure it into ap plus star mode as

for everything to function properly ESP link will need to join your existing Wi-Fi network so you’re able to send and receive data from your serial device I’ll be using my mobile device to configure this quickly for the process is the same if you’re using a laptop or tablet navigate to your Wi-Fi settings and locate the SSID with the ESP prefix click to join the access point once you’re connected open your browser of choice and navigate to the address eight 14.1 the ESP link webpage could load and this is a way you can configure all your ESP link settings navigate to the icon on the top left corner then select the Wi-Fi station menu option with looking at the switch to star plus AP mode hyperlink and click it the page will updater indicate you are now in AP + star mode scroll further down to the Wi-Fi associations area and locate your local Wi-Fi click the radio button and then fill out the network password and hit connect once connected scroll a bit further up and you should be able to see the IP address now allocated on your local network to your ESP link this is the address we will now be navigating to to make the remaining configuration changes which will be done on my PC okay now that we’re back on the PC if you notice in the browser address it is the IP address that was allocated by the router in the previous section you can also see it here under the system overview so let’s briefly go over what the configuration settings are available on the ESP link and what these menus are for my particular application I’ll be focusing on the ESP – 0 1 and the microcontroller console as the other features won’t be used on the homepage we have a system overview which details the network configuration settings and which services are available additionally note it lists the selected baud rate the ESP link is set to this is a study grade and it will not order adjust an actual device next we have the info area which is just a blurb about ESP link and some programming commands but it is advised to use the documents on the es peeling it up for clearer instructions on the right we have the system details which just summarizes the firmware information on your device and finally and most importantly we have the pin assignment area this is where you will specify what the peanuts of your ESP device will be if we open the presets drop down menu we can see a list of supported devices for this project I’m using the ASP – is 0-1 so I will select ASP – 0 1 notice now how all the drop-down fields below are or a populated you are able to adjust these to fit your application with all the available peanuts on your device if you hover over each option a tooltip will give you a brief description of what they are for reset is for resetting and programming the target microcontroller rxb or flash is an additional programming signal connection LED is just an output to tie to an external LED to indicate Wi-Fi connectivity similarly the LED will just indicate the serial activity to an external LED and new art pins are the TX and rx pins of your ESP device I’m going to disable everything except the reset and you are pins which I will leave in a default configuration once those changes are made keep the change button and you should get a pop-up message at the top indicating it was successful after this is done you’re pretty much ready to go and why everything up for testing but before that let’s have a brief tour of the other ESP link features if you don’t care you can just skip ahead we already know what the WHA FAQ station menu is for at least for configuring the Wi-Fi modes and associations of the ESP device additionally it lets you specify if you want to use a DHCP or static IP lease next Wi-Fi soft ap lets you configure the access point settings of ESP link if for example you want to use ESP link as a standalone server outside your local network the microcontroller console will be the most used page for our application this is a web page based serial console that will relay the serial information from your serial device you can reset the microcontroller using the reset microcontroller button you can clear the console using the Clio lock button you can set the baud rate ESP link is using to match of serial device along with the serial port parameter settings here by default it is 8 + 1 which is a default format for the Arduino so no need to change it below

the console you have the console entry where you type your commands along with the checkboxes to specify if you want to send a carriage return or a new line the history buffer will just keep track of all the commands sent from the console so you don’t have to type it out again moving on to services we have options for configuring the system log SMTP servers and multicast DNS next the rest slash MQTT page will allow you to configure rest and MQTT protocols which I know very little about but maybe that can be a future project moving on to the debug log it is just the debug log for the ESP link firmware which is useful for debugging it also allows you to reset the ESP device using the reset ESP link button and configure you our settings for the debug log second to last we have the upgrade firmware page which allows you to flash HP link firmware over Wi-Fi without the need for serial flashing it’s very simple as I’ll demonstrate simply select the choose file button and navigate to your firmware folder choose the user – bin file and hit update the firmware once you get a confirmation message that’s it you’re done lastly we have the webserver page which allows you to upload your own web page if you’re planning to use ESP link as a web server this is useful if you want to control or monitor your serial device through a web page and that’s about it if you want to learn more visit the es feeling github now that we have configured at ESP link for the ESP – 0 1 let’s go over the hardware configuration just know the recommended payouts can also be found on the ESP link github under hardware configuration which may be useful if we’re not using an ESP – 0 1 to connect the ESP – 0 1 to the arduino uno I have created the following circuit diagram pause here or take a screenshot to wire up your system on the top left side of the diagram I have a pin art map which if you follow left to right will tell you what connection from the ESP – 0 1 goes to the Arduino Uno and similarly from the PSU to the uno txd from the ESP goes to the RX t of the you know our XD from the ESP goes to the t XD of the you know GPIO 0 from the ESP goes to the reset pin of the you know ground from the ESP goes to the ground of the you know chip pulldown reset and VCC of the ESP are all tied to the 3.3 volt in of the uno the 5 volt rail of your power supply is tied to the V in pin of the you know and lastly the ground of the power supply is tied to the ground of the Arduino ensure you have a common ground across your circuit otherwise the ESP won’t be able to reset your uno or serial device properly in my system the power supply is connected to a USB power bank so the system is floating to avoid any potential ground issues additionally the bottom-left has a blob of the ESP – e01 pinout for your reference see my previous videos with details and explanation on these and that’s it once you’re all wired up test Pawel the system to make sure no magic smoke is released now we are ready to see some data of wire over serial to Wi-Fi first let’s conduct a quick sanity check and ensure the ESP link is able to send and receive data transparently I have my ESP – zero one connected to my USB programmer and as you can see in the base manager it is uncommon eight I’m going to use putty to open a serial console on comm a with the baud rate settings to match ESP link we should now be able to send and receive data bi-directionally so if I send data over Wi-Fi through the ear spilling console it should appear on the putty console and conversely if I send serial data from the putty console it should show up on the ESPN console all right cool now that little proof of concept works let’s move on to setting up the virtual serial ports here is a sketch I have deployed to mod we know in order to test ESP link it will open a serial session on the Arduino wait for the serial port to be ready and then print already status then any data that is sent or received on the Arabs and TX pins of either the Arduino or ESP – 0 1 will be echoed back to the serial console this way we should be able to send and receive data from both the ESP link console and the putty console tied to the Arduino serial port you may be thinking what serial port the Arduino isn’t connected to the PC via USB according to the circuit schematic that is correct and in order to send and receive data from LA do we know over-the-air we will need to set up a virtual comport

on our PC the premise of this is detailed in our expanded system diagram but essentially we are pointing our applications to our virtual comport that will for the serial data via a tcp/ip redirector to the ESP link which would transparently pass through the serial data to the Arduino now there are two ways to do this from our research which are free use an open source program called comma in conjunction with comp to TCP who is a close loss program called hardware virtual serial port which is very easy to use I will be using the ladder but I will demonstrate on how to set them both up combo pomp is an open source kernel level of virtual serial driver for Windows it will allow you to generate an unlimited number of virtual comport pairs in conjunction with com2 TCP which is a comport to TCP redirector you can communicate via serial interface with tcp/ip based applications or service to set up comma calm and come to TCP first navigate the null modem emulate a source for page he download to get the latest version of comecon then navigate to the files tab select come to tcp version 1.3 and finally select come to tcp 1.3 – 386 dot zip to download the built version of comp – tcp if you select the other file use the source code and you will have to build it yourself now once they are downloaded run the ComicCon installer once installation is finished close the Installer and run the setup program this program will allow you to create your virtual comport pair the first comport which are all named comm 10 will be the comport you point your application to the second comport which I will leave as CN CB 0 is the port you’ll point your TCP / IP redirected to ie come to TCP hit the add pair button and if you check your device manager now you will have two new virtual comm ports next copy the come to TCP exe file into the directory you install comecon in the address bar clear it and type CMD which will launch the command prompt if you type come to TCP in the command prompt you will list all the command options available for come to TCP if we examine the command structure under usage you need to type com2 tcp followed by the serial port options followed by the comm port and lastly followed by the host addressed and host port for our application the comm port will be the second virtual comport in repair so cnc be 0 and the host address and host port will be the IP address of your ESP link and for 23 or 23 23 I have prepared the following command line which will be in a description if you want to copy and paste it of course adjust to suit your system once you execute it you will see you have made a successful connection now what your serial port settings are if we open a serial session to content in putty you will see in the command from console a com2 TCP has opened a connection now that we have a vertical composite up let’s test it if we type something in either putty or the east peeling console it should appear in both consoles this confirms we are correctly sending and receiving serial data over-the-air a kind of cheap way to confirm this is if we hit the micro controller reset button and the ready message should appear once the Arduino reboots this is also a good way to confirm if the ESP link is able to reset the Arduino properly and that’s it for comma comm ok now moving on to hardware virtual serial port it is a closed source freeware program with a variety of features and it is straightforward to use if you scroll down there web page it has a comprehensive amount of information available on how to install and configure the program but it is pretty simple just hit the download button for the hardware virtual serial port 3 single file and once it’s downloaded run the Installer quanti uninstalled it run hardware virtual serial port and once it’s opened you’ll see a variety of tabs will be focused primarily on the virtual serial port tab as the default settings are fine for the scope of this project if you want to learn more about the other tabs and the possible configurations I strongly advise you read through the webpage as I mentioned earlier to set up the virtual comport as we did with comic on another virtual serial port tab we need to specify the comport name the IP address and the port number of the ESP

link as we did before once we have done that hit Craig calm and what is successful you should be able to see the virtual comport appear in your device manager one cool feature I really like about this program is it shows you the number of bytes sent and received across the serial port and over your network which is a great tool for debugging so that’s literally it in the configuration side pretty easy now let’s test the ESP link as we did before open a serial terminal through putty and directed to your virtual comport content in my case once the session is open you should see the status and serial port settings change on the hardware virtual serial port program to what we have specified in putty great we are now connected and ready to send data over the air as before we should be able to send and receive data on birthday ESP link and serial console simultaneously one thing you will notice on the hardware virtual serial port application is as you sent characters over the serial consoles the byte counts will increment in the direction you’re sending it notice if I send something from the ESP Ling console in increments in three bytes that is one by four the character one by four the carriage return and one by four the newline but if I send something over the party console their only increments by one as it doesn’t automatically include any of the formatting this is a great tool for debugging as a doozy and indication of the data being sent and if it’s being sent successfully in the case that data ends up in the cue column it is an indication that one side of the communication isn’t functioning properly alternatively if you don’t want to use putty you user arduino IDs serial monitor just select the virtual comport in the arduino ide and open the serial monitor they will work in the same way with the addition of handling the formatting for you now that we have everything up and running let’s upload some code to the Arduino Uno over Wi-Fi close the serial monitor of the arduino ide and select a sketch of your choice i’ll be using the basic serial read/write sketch are uploaded earlier in the video make sure you have the correct comport selected and then hit upload the programmer should then begin to upload code to your arduino you will know that everything is gone well from the verbose output of the Arduino IDE if you are getting timeout or sync issues recheck your circuit and ESP link settings and try again additionally you can observe in the ESP link serial console random characters being displayed and in the virtual serial port a patient you can see that that data is being transmitted during the upload what is finished uploading let’s test the code by resetting the Arduino through ESP link and once we do we should receive a confirmation message from the Arduino once it reboots and we do and that’s it for this project now you know how to set up ESP link virtual serial ports and are able to send and receive data from your Arduino over Wi-Fi on your PC I hope you enjoyed this guide and if you did please like comment and subscribe and I’ll see you in the next part