Compile error while trying to use Blynk ESP8266 Standalone example

Where do you live?
Do you have quick and easy access to FTDI’s, ESP’s, resistors and capacitors?

@psoro’s Robot project has a nice schematic and shows the parts you need to connect an ESP to an Arduino.

Don’t forget the voltage divider between ESP and Mega when you connect up the rx and tx lines as ESP can only take 3.3V on the rx line. tx is ok to end 3.3V to the rx of the Mega.

How many digital and how many Analogue ports are you using on the Mega for your project?

I think I once saw that you can flash an ESP with an Arduino and I have certainly flashed one Arduino from another so I don’t see why it can’t be done but I haven’t actually done it. You would need to ask Google if you didn’t want to wait for parts to arrive.

@Costas I’m in the US and could easily use amazon/sparkfun/adafruit for parts. My project uses 22 digital pins for outputs / inputs. No analog (using a few ds18b20’s so I only need 1 digital pin for all of them).

I have Mega’s, Leonardo, Nano’s and lots of different ESP’s here.

Based on your requirement of no analogue ports, which ESP’s don’t do too well without bolt on boards then I would go with ESP’s. With Blynk you can bridge ESP’s so 2 or 3 would give you the 22 digital pins. If you didn’t want to bridge the ESP’s there are probably bolt on boards with extra digital pins.

With the 128 virtual pins on an ESP do you need 22 digital pins?

Your Mega has 256KB of memory whereas the ESP’s (excluding the old ESP01’s) have 1MB and up to 15MB of further data storage capacity.

@Costas Honestly, I’d rather not have to restart this project with new controllers and new code. I was hoping to be able to just integrate Blynk into the system. Would a Bluetooth module be a better solution?

EDIT: Actually, I’d rather not use Bluetooth because of limited range capabilities. Wifi would be ideal so that I could monitor the system from anywhere in the house.

If you want to go the Mega route then fine. I have a Mega with a $3 ethernet board and even though it doesn’t give you the freedom of WiFi I prefer it for Blynking.

Pick up an FTDI then and see how you go with the ESP WiFi shield for the Mega. It can be done but I don’t like it, but then again I don’t need 22 digital pins.

So do I need to buy a full on shield for the mega to get wifi capabilities? Or can I in fact use the esp8266-01 that I have now? Sorry if my questions are coming off as stupid, but I really am new to this side of microcontrollers. And thank you for the info so far @Costas. You’ve been more than helpful.

Yes you can use the ESP8266-01.

@Costas And in order to do so, I need to grab an FTDI to program the esp, and then go from there, right? What steps do I take after that?

Yes an FTDI and then connect the ESP to the Mega (as per @psoro’s schematic). Then you use the ESP8266_Shield sketch and you are up and running. At least the Mega has plenty of serial ports so you can flash the ESP and still have Serial Monitor available for debugging etc.

Awesome @Costas. Thanks so much for your help. I’ll order the stuff and implement when it all arrives. I’ll let you know how it goes.

1 Like

@jeebsinc,
you can find below schematics for the FTDI to program the ESP:

The CH340G converter is really cheap and friendly, in fact, you will find same chip at many different boards with the ESP8266.

GPIO 0 must be connected to GND while programing (SW1 at the image )

Thanks @psoro !

Hey @psoro in your schematic of how to hook the esp up to the usb ttl connector, is that top pin supposed to be 5V?

Mine looks like this (flipped over so back is facing up and the usb is pointing to my right):

5V
VCC
3V3
TXD
RXD
GND

Hi @jeebsinc,
Yes, the TOP pin is 5V:

The same pins as yours.

BR

if you move the jumper, you get 3.3 at the third pin right?

Yes, you get 3.3V, BUT be careful, you CAN’T use this pin to feed the esp!

Ok. Until here I did step by step. So when I try to complile appear this messagem;

warning: espcomm_sync failed
error: espcomm_open failed
error: espcomm_upload_mem failed
error: espcomm_upload_mem failed

I think its clear thar a I´m having hardware problem, so I[m using a ESP8266 -ESP01 cause a don´t have many space in my project. It is plugged in my arduiino… So what can I do now?

show picture of your hardware.

swap TX & RX

Try reducing the baud rate and if that doesn’t help it might be the way you have set up your hardware i.e. you can’t flash a new sketch if the rx / tx pins are currently tied to something else.

A post was split to a new topic: Compiler error message