Using ESP-LINK (ESP8266 Wi-Fi to Serial Bridge) to program an Arduino UNO over Wi-Fi
Вставка
- Опубліковано 19 лис 2024
- In this video I'll show you how to setup and configure #ESPLINK on an ESP8266 ESP-01 to act as a transparent serial to Wi-Fi bridge. ESP-LINK is used to send and receive serial data/commands from an Arduino UNO (or potentially any serial device) over a WLAN. Additionally, ESP-LINK enables us to program our micro-controller platform over the air!
I give an overview of how to flash the firmware to your ESP8266 device as well as a brief tour on all the features ESP-LINK offers. How to setup and configure virtual COM ports on a PC using opensource and freeware software such as #com0com, #com2tcp and HW Virtual Serial Port.
And lastly how to integrate and test all these systems together so you are able to see data fly over the air!
Once you're up and running, you can take this further and develop the system suit your specific needs.
0:07 Introduction
0:56 Potential Applications
1:21 System Diagram
2:01 How to Program and Flash an ESP8266 ESP-01
2:30 Flashing ESP-LINK
4:46 Configuring ESP-LINK
8:48 ESP-LINK Feature Overview
10:53 Upgrading ESP-LINK Firmware OTA
11:18 Using the ESP-LINK Web Server
11:37 Circuit Diagram
13:30 Testing ESP-LINK using a Putty + USB-Serial Programmer
14:12 Arduino UNO Sketch for testing ESP-LINK
14:54 Virtual COM Port System Diagram
15:20 Virtual COM Port Application Options
15:37 Setting up and configuring com0com + com2tcp
18:16 Testing ESP-LINK using Putty + com0com + com2tcp
18:55 Setting up and configuring HW VSP3 - Virtual Serial Port
20:25 Testing ESP-LINK using Putty + HW VSP3 + Arduino IDE Serial Monitor
21:55 Uploading a Sketch to the Arduino UNO over Wi-Fi
23:16 Fin
com2tcp command: com2tcp --baud 115200 --ignore-dsr \\.\CNCB0 10.1.1.194 23
GitHub: github.com/SIN...
LBRY - open.lbry.com/...
LinkedIN - / sinconsulting
Fiverr - www.fiverr.com...
Contribute and ask questions here:
forums.ni.com/...
References:
ESP-LINK: github.com/jee...
Flashing an ESP-01: • LabVIEW Basics #7 - ES...
Boot Mode Selection: github.com/esp...
Flashing tool: www.espressif....
MQTT: 1sheeld.com/mq...
REST: / understanding-rest-rep...
Putty: www.putty.org/
com0com: sourceforge.ne...
HW VSP3: www.hw-group.c...
Thank you for this. It saved me literally hours of debugging.
Wow this video is a revelation! Very clearly explained and detailed. Thanks I just subscribed.
Welcome aboard!
esp-01 중계 모드로 사용하기위한 큰도움이 되었습니다
자동번역 약간의 오류가 있지만 공부에 큰영향이 없습니다
감사합니다 한국에서 ^^
Thanks so much!
It's so cool and detailed! Thank you much!
Excellent and simple guide.
where can i find all 4 .bin files in esp-link-v3.0.14 folder not any .bin file for flash esp.
unzip file first
@@ellpancha hi the files are still not there
Hello,
i have another question. I have to ESP-Link ESP8266 devices.
I connected both of them with a tool via their own socket port, e.g. 192.168.1.2:2323 and 192.168.1.3:2323.
The port can be opened. I send data over the socket port. I have set the LED of the ESP so that the LED flashes when receiving. Everything works out too.
But why do I not see the receipt of the data in the window of the console for serial communication.
Then I crossed the two ESPs with RX / TX to test that the data would also arrive on the other ESP. Unfortunately that does not work. I think this is related to the problem before.
Do you have any idea why the data is not displayed in the console?
greeting
Any thoughts what would be involved in writing an ESP32 application, that takes data from the uart, and passes it wirelessly either via bluetooth (SPP) or via Wifi?
I purchase a few USB-bluetooth dongles (Feasycom BP102, HC-05/HC-06/CP2102 master modules, etc).. but none can connect to an android phone! For example, when a Samsung S5 tries to connect to one of the bluetooth dongles, it will stop blinking, but after a couple seconds, Android says 'Can't communicate with the FSC_BP102' or HC-05, or HC06, etc. Aliexpress has a $15 RS232 Bluetooth dongle (BT578 V3), but not exactly sure if/how it will talk to my androids.
For Wifi, I imagine the ESP32 could act as a web server (TCP) and display the RS232 data, but maybe there's a UDP way it could send data to a PC on the same network? If the receiving application (mobile or PC) is written in the flutter framework, it could display the RS232 data with style!
Regarding the ESP32, I received a Risc-V ESP32 board (banggood 1914005), and an ESP-Prog clone (basically a FT2232HL/Q from Aliexpress).. and would like to step thru a blink-led example using JTAG! I used Zadiq to install the WinUsb drive but not sure how to configure OpenOCD. For example, if you unplug/plug, does the last debug program run, or was the debugger running out of RAM? How do you dump the contents out of NVM via OpenOCD?
Hi I want to make the following serial connection Arduino TX -> TTL serial -> esp8266 (AP) -> WIFI -> esp8266 (client) -> TTL serial -> Arduino RX. I can do it with Xbee but ESP's are so much cheaper. Have you ever seen a firmware that make this possible?
Hi great vid, but I have a problem, when I flash my ESP-01 and upload code to arduino, arduino does not echo back to me. It correctly sends the string in setup. The problem is, as it seems that arduino cannot recive any data. When I put command to light up on board LED on Serial.available>0, it never lights up even though I send data from Arduino serial monitor, putty or web interface. I tried flashing older firmware to no avail. I was not able to find any help on internet, so any help would be appreciated.
Difficult to say without seeing your code or circuit etc. But my gut feeling would be how you're handling the cases; when you read data from the serial monitor in the arduino I'm pretty sure it's character by character and not as a complete string. So your logic may not be triggering? Try to find an example on the arduino forums about turning on an LED from the serial monitor and see how you go.
awesome.. looking for this to control a remote UNO with GRBL. let's see anyway how it goes. (from other side of Melbourne.)
Just to add, IT WORKED.... CNCJS virtual connection. Cool to see the steppers turning.
Awesome! That's great to hear, let me know how it goes over the long term. Would be good to know how reliable the setup turns out :)
13:20 Doesn't this circuit need voltage level shifting? esp01 is 3V logic and arduino is 5V logic. In your circuit TX and RX pins are directly connected without a logic converter circuit.
One of the best videos available about esplink, if not the best. Really good work, very well organized.
However, It did not solved my quest ^^
I manage to get everything right until the very end - the upload.
I can get the messages back and forward, between the putty and the esplink, all via the virtual COM I created, just like in your video. I can also reset my atmega2560 trough the esplink console (debug menu option). But when I try to upload a code from arduino IDE (with virtual COM selected of course), I get the following error:
"
avrdude: stk500v2_setparm(): failed to set parameter 0x9e
avrdude: stk500v2_command(): unknown status 0xc8
avrdude: initialization failed, rc=-1
Double check connections and try again, or use -F to override
this check.
avrdude: stk500v2_command(): unknown status 0x01
avrdude: stk500v2_disable(): failed to leave programming mode
An error occurred while uploading the sketch
"
Any idea what it might be? I mean the communication is going weel, i can chat with myself trough esplink and virtual com, and can reset the microcontroller...so the connections appear fine - it feels like something on the avrdude call is missing.
Anyway, great video nevertheless. Congratulations!
Cheers, Luís Pereira.
Found a way!
For those who might encounter the same problem I did:
The solution for me was not in the virtual COM, but in a COM port recognised in arduino IDE as network port, instead of the usual serial ports. So in orther for this network por show up for selection, I had to change the hostname (Home/System overview) and the Service Name (Services/mDNS) to "arduino". After that the network port with the IP address of the esp will show up in the port selection in arduino IDE. But at that point I still could not upload, I had an error that said "failed to reset the board", and the solution was in adding the following 5 lines to the Boards.txt file in the arduino installation directory (for me is: :\Program Files (x86)\Arduino\hardware\arduino\avr\Boards.txt). Those 5 lines are:
mega.upload.network.endpoint_upload=/pgmmega/upload
mega.upload.network.endpoint_sync=/pgmmega/sync
mega.upload.network.sync_return=204:SYNC
mega.upload.network.endpoint_reset=/log/reset
mega.upload.network.port=80
...if you are using a pro mini, those lines would be:
pro.upload.network.endpoint_upload=/pgm/upload
pro.upload.network.endpoint_sync=/pgm/sync
pro.upload.network.sync_return=204:SYNC
pro.upload.network.endpoint_reset=/log/reset
pro.upload.network.port=80
You basically have to add the same 5 lines for each board you want to upload to, with the prefix of your board (mega for Mega2560, uno for Uno...etc).
I also found the reference that the atmega2560 also needs baudrate to be specifically 115200...not sure if its true, but in any case, it worked.
Thanks for the video and sorry for the long posts about my problems...but you never know who might be looking for the same problem.
More discussion about this problem in here: github.com/jeelabs/esp-link/issues/394
Thank you.
Cheers, Luís Pereira.
Hi Luís, thank you for the feedback and sharing your problem and debugging method here ! Hopefully someone in the future finds it useful :) keep up the great work.
This changed slightly, probably in some arduino IDE update, the lines you need to edit are now:
mega.upload.network.endpoint_upload=/pgm/upload
mega.upload.network.endpoint_sync=/pgm/sync
mega.upload.network.sync_return=204:SYNC
mega.upload.network.endpoint_reset=/log/reset
mega.upload.network.port=80
The small change is in the "pgmmega" in the 1st and 2nd lines, that now needs to be "pgm" instead of "pgmmega". For safeguard, in future occasions, just look at these 5 lines for the unowifi at the bottom of the board.txt file, those should work and you just have to change the prefix at the beginning of each line to match your microcontroller.
Friend I'm trying to do using esplink on esp01s to update the firmware nodemcu but when in the water the firmware mode nodemcu stops working esp link! How is it possible to be a ligament? 🤔 🙃 Rx-tx TX-rx
I'm not entirely certain what you're asking friend, but it sounds like your asking for the pin configuration for UART? Please review github.com/jeelabs/esp-link/blob/master/FLASHING.md
@@SINConsulting No friend, I made the connection
Rx esp 01s connection to TX nodemcu, and TX esp 01s connection to rx nodemcu. The question when using esp 01s does not turn on esplink until the nodemcu reboot is so? 🤔 Why nodemcu download mode does not allow you to download esp 01s is not clear. And I'm trying to make nodemcu on a virtual com port created with the program tibo and it is not possible to make friends whether it is fashionable to make friends at all? 🤔 Or it's just for Arduino 😁
Hi, thanks for this great tutorial.
After following all the step I'm unable to upload code on UNO. I'm trying to upload blink sketch and successful created virtual port and also check that connection via serial monitor. The reset uC button on esplink web page is working properly but when I program the AVR, ESP sometimes does not reset UNO I get error on arduino IDE.
I have ESP8266 12F module
Thanks in advance I hope you will help
The most common cause for this I found was an improper ground between your ESP, Arduino and PSU.
This resulted in AVR sync issues because the reset signal from the ESP wasn't resetting the arduino properly. It works from the web GUI, but you will notice when you upload code via the Arduino IDE the arduino isn't actually resetting. This is why I put that debug output in my code to let me know on the serial monitor everytime the Arduino reset.
So first thing to check is if you ESP & Arduino share a common ground.
To eliminate the PSU ground, my system was floating and was powered by a battery.
where do u get the 4 bin files
hmm can I do uart to esp and the over tcp bridge esp to uart? essentially uart over tcp from a device apposed to a virtual port of a pc? I want to send these commands over the internet or local Ip
Installed ESP-Link on NodeMCU v3. Along with this, I updated the bootloader. Initially, I did not know how much memory the module has. When trying to upload files (tried according to the instructions, at different addresses depending on the size of the memory), the firmware was successfully installed only when it was uploaded to the addresses, taking into account that the module has a memory of 512 KB. Question - is it possible that my NodeMCU has an ESP8266 installed with a memory size of 512 kb? After all, all the descriptions say that there should be 4 MB. After a reboot, the monitor now displays: SPI Flash Size & Map: 4Mbit(256KB+256KB). In the "Detected Info" window of the ESP8266 Download tool, it writes QUAD; 32 Mbit.
I could not resist and opened the screen cover of the module, the memory there is XM25QH32BHIG, i.e. for 4 megabytes. The question is the same that I already asked - why, when flashing this module through the Esp8266 download tools program, is it successfully flashed only when you register start addresses for recording that correspond to the module's memory size of 512 kilobytes? If I specify addresses for a module with a memory of 4 MB, then after the firmware the module goes into a looped reboot
hey, thanks for the tutorial, i did the steps all correctly, i can communicate from the esp link console with both serial monitor and putty but when I upload a sketch over the air I get "not in sync" error, can you help please
Do you have the esp and arduino connected via a common ground ? If you don't, the esp reset signal won't trigger the arduino reset properly during sync.
@@SINConsulting yes it's connected to the same ground, I have nodemcu esp8266 (esp12) for reference
and the error message is:
" avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x30
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x20
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x30
avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x20
avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x30
avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0x20
avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0x30
avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0x20
avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x30
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x20
An error occurred while uploading the sketch"
So your RST signal from the ESP is not triggering the Arduino reset pin when the AVR Dude program initiates the sync.
You have to debug the reset signal to see why it is not triggering.
In my case it was becuase of the ground issue. To avoid any ground problems with the PSU I used a battery to power everything so the system was 'floating'.
Put a debug line in your code that outputs to the console everytime you reset the Arduino. So you know if the ESP is actually resetting it properly.
@@SINConsulting I have the same problem but the common ground is OK. I can trigger the reset from the µC Reset button on the µC console. But is does not happen when I use the arduino IDE to program over the Vintualport.
Have you found a solution in the mean time?
Hello, I've follow and done step-by-step, the UART is good, the reset button work well but when I tried to flash there's an error sync (stk500_stk: not in sync). Can you help me out ? (I'm using Arduino standalone and UNO, both got same error)
I have the same you found a solution yet?
@@VerreyckenGerd and i
Hello,
Thanks for the great instructions. I always have the problem that with every download, even if I just want to flash the boot file, the message "8-download fail" always comes up. Can someone tell me what that means.
Thanks and regards
Are the memory addresses set correctly in the flashing program for your ESP model?
Sorry, I forgot to say that the ESP is an ESP-07 with a voltage converter. It needs 5V and not 3.3V. I switched on the 5V and the ESP can be flashed. Still, although I set the addresses correctly, I can flash the ESP but the program does not start. I found out that I can omit the INIT file and with that I get the ESP8266 flown with the ESP-Lik software and run. But I didn't quite understand the addresses and the individual binary files. Can you explain the individual files again and explain how to set the addresses. Thank you and great work ...
Hey Thomas, I'm not to familiar with the ESP07. But maybe have a look here github.com/jeelabs/esp-link/blob/master/FLASHING.md
To see if you can try and get it working.
@@SINConsulting Hi,
i know, but it is the same ESP8266 with another RAM size etc.
Look that is the startup from ESP which comes over the serial interface.
Its looks great, but the firmware flash is strange or i have set the address from the fils incorrect.
You know how i can set the original device firmware?
13:21:44.218 -> 119> ** esp-link v3.2.47-g9c6530d
13:21:44.218 -> 119> Flash config restore ok
13:21:44.218 -> 119> CONN led=-1
13:21:44.218 -> 119> SER led=2
13:21:44.459 -> 255> Wifi init, mode=STA
13:21:44.459 -> 255> Wifi uses DHCP, hostname=ESP8266002
13:21:44.459 -> 255> "ip": "0.0.0.0"
13:21:44.459 -> 255> "netmask": "0.0.0.0"
13:21:44.459 -> 257> "gateway": "0.0.0.0"
13:21:44.459 -> 260> "hostname": "ESP8266002"
13:21:44.459 -> 263> sleep enable,type: 2
13:21:44.459 -> 266> Httpd init, conn=0x3fff4128
13:21:44.459 -> 269> No user file system found!
13:21:44.459 -> 272> Serbridge pins: reset=0 isp=-1 tx_enable=-1 swap=0
13:21:44.459 -> 286> Reset cause: 6=external
13:21:44.459 -> 286> exccause=0 epc1=0x0 epc2=0x0 epc3=0x0 excvaddr=0x0 depc=0x0
13:21:44.459 -> 286> Flash map 1MB:512/512, manuf 0x5E chip 0x6014
13:21:44.459 -> 291> ** esp-link v3.2.47-g9c6530d: ready, heap=18960
13:21:44.459 -> 296> SNTP timesource set to us.pool.ntp.org with offset 0
13:21:44.459 -> 301> initializing MQTT
13:21:44.459 -> 303> MQTT_Init, host=192.168.182.17
13:21:44.459 -> 307> initializing user application
13:21:44.459 -> 310> Waiting for work to do...
13:21:44.459 -> 313> mode : sta(40:f5:20:29:3a:f3) + softAP(42:f5:20:29:3a:f3)
13:21:44.459 -> 319> add if0
13:21:44.459 -> 321> add if1
13:21:44.459 -> 322> dhcp server start:(ip:192.168.4.1,mask:255.255.255.0,gw:192.168.4.1)
13:21:44.459 -> 330> bcn 100
13:21:44.459 -> 345> Wifi auth mode: 0 -> 3
13:21:44.567 -> 452> scandone
13:21:44.567 -> 453> state: 0 -> 2 (b0)
13:21:44.567 -> 457> state: 2 -> 3 (0)
13:21:44.567 -> 462> state: 3 -> 5 (10)
13:21:44.567 -> 463> add 0
13:21:44.567 -> 463> aid 4
13:21:44.567 -> 463> cnt
13:21:44.602 -> 494>
13:21:44.602 -> 494> connected with NoWayz7590EG, channel 6
13:21:44.741 -> 626> dhcp client start...
13:21:44.741 -> 628> Wifi connected to ssid NoWayz7590EG, ch 6
13:21:48.105 -> 3889> ip:192.168.182.125,mask:255.255.255.0,gw:192.168.182.252
13:21:48.105 -> 3889> Wifi got ip:192.168.182.125,mask:255.255.255.0,gw:192.168.182.252
13:21:48.105 -> 3892> MQTT: Connect to 192.168.182.17:1024 0x3fff8a90 (client=0x3fff6c5c)
13:21:48.105 -> 3989> MQTT: TCP connected to 192.168.182.17:1024
13:21:48.105 -> 3990> MQTT: Send type=TYPE_CONNECT id=0000 len=48
13:21:48.169 -> 4043> MQTT: Recv type=CONNACK id=0000 len=4; Pend type=NULL id=00
13:21:48.169 -> 4044> MQTT Client: Connected
13:21:48.510 -> 4387> Accept port 2323, conn=0x3fff8e20, pool slot 0
13:21:50.067 -> 5968> Accept port 2323, conn=0x3fff8ce0, pool slot 0
13:21:53.057 -> 8937> Accept port 2323, conn=0x3fff8d00, pool slot 0
13:21:58.024 -> 13930> Accept port 2323, conn=0x3fff8a40, pool slot 0
13:21:59.405 -> 15266> Wifi check: mode=AP+STA status=5
13:21:59.405 -> 15266> Wifi got IP. Going into STA mode..
13:21:59.405 -> 15266> bcn 0
13:21:59.405 -> 15267> del if1
13:21:59.405 -> 15267> pm open,type:2 0
13:21:59.405 -> 15269> mode : sta(40:f5:20:29:3a:f3)
13:21:59.439 -> 15354> Turning OFF uart log
To flash the original firmware, you can find the firmware here: www.espressif.com/en/support/download/at
If it's the same ESP8266 chip with 1024kb flash like in the video - the memory addresses should be the same. If you still can't get it working properly, have a look here on page 16 for the flash table www.espressif.com/sites/default/files/documentation/2a-esp8266-sdk_getting_started_guide_en.pdf
Then set the addresses to match and debug from there :)
Hallo, nach dem Flash blinkt die blaue led ganz schnell aber ich bekomme kein wifi mit Namen esp … können sie mir helfen?
great video, thanks !
Great vid
Connect the 5 volt RX and TX directly to the 3.3 volt TX and RX of the ESP ???
Then connect at least 470 R in series !
3.3 Volt to the Arduino work fine. It needs 0V to reset and the UNO inputs are 3.3 V compatible.
With a tiny85 I'm even able safely to measure 5 to 3.3 volts on the reset pin and at the same time trigger a reset at 0 volts.
Cool tool, serial monitor works. I also can reset the connected arduino from web interface, but flasing from Arduino IDE is not possible. It always stucks with ".. not in sync...".
I have the same, you found a solution yet?
Arduino can be OTA with nrf24L01 module.
hello, can you explain where can i find the files boot_v1.5, user1.bin, espdata_default.bin ,blank.bin
These are the firmware files for the ESP, you can download them from espressif for the factory firmware or the ESP-LINK GitHub, for the esp-link firmware.
@@SINConsulting i have dowloaded the esp-link firmware from the github from the link you mentioned in the video but after i unpacked the archive i do nott find those files nedeed for flashing
Thanks sir
Thanks for the feedback!
Is it possible to link two ESP8266 devices together with ESP-Link and have them talk to each other? For example, set one to AP mode and the 2nd, set that one to connect to the AP.
Short answer: yes.
Long answer: yes, but it depends on the application. You can achieve this without esp-link if you're just using two ESP8266s, if you're using them with other systems then yeah it will be a little more complicated.
@@SINConsulting I am basically capturing serial data with plain text strings from a GPIO modem device, which is then sent across a network connection where the other device will decode everything. The receiving device is a Nextion display. That too runs as a serial device. As of now I can capture that data from the one Esp-link device remotely using port 23. I just wanted to know if both Esp-link devices can talk to each other, since the 2nd device needs know what to do with the data. I am awaiting for another Esp8266 (d1 mini) to arrive in the mail before I try, I already screwed up one with Tasmota (that didn't work with my setup) Anyway, thanks for information!
Gotcha, Have a look into setting up an MQTT Client and Broker using ESP-LINK. This would be able to achieve what you're looking for i believe.
@@SINConsulting I am running a Mosqitto server, I have been trying to figure out topics and such, still learning. Basically all I need to do is send TX and RX String data from GPIO1 and GPIO3. As I said, I am still trying to figure this MQTT stuff out, I can't get the Esp-Link devices to send out anything else besides {"rssi":-52, "heap_free":10504} (lol) which is then sent to the local Mosqitto server, which I then monitor with MQTT Explorer. As far getting two ESP-Link devices to talk to each other directly, it doesn't seem to be working. I bought 3 more of these, so I am going to try some other firmware. One that looks promising is called Esp-Easy, it has a lot of options.
thank you sir