Go Down

Topic: Help adding an ESP 8266 to my Arduino project (Read 742 times) previous topic - next topic

ieee488

#15
Feb 11, 2018, 10:25 pm Last Edit: Feb 11, 2018, 10:26 pm by ieee488
I tested 4 ways of OTA upload of Atmega sketch hex using esp8266. Two of them use SPI connection so they are not for the ESP-01. SPI connection can be used with esp8266 breakout boards (like Wemos D1 mini) or with boards with both MCUs on board connected with SPI (like the new board called 'red'). For now there is no esp8266 SPI connected Arduino shield.

For the serial connection of esp8266 I know the esp-link firmware and the dfu library used in WiFiLink firmware. The esp-link firmware has good  docs but the corresponding Atmega library doesn't support general networking (Client and Server implementation).

I use and maintain a copy of WiFiLink. The firmware supports OTA upload of the Atmega 328p (with Optiboot) sketch hex and the library for Atmega sketch supports general networking like the Ethernet or WiFi library. The SPI connection is supported by WFi Link and the dfu library too but it is complicated.

The simplest Atmega sketch OTA upload with esp8266 is the ESP8266AVRISP. I requires SPI and reset connection of MCUs. It can be added to any esp8266 sketch with esp8266 Arduino core. And I added it to Jiri Bilek's WiFiSpiESP firmware which supports a general networking library for SPI connected MCUs.

-----------------

You can create esp8266 sketches with esp8266 Arduino core.
So what does all of that mean?

Which specific partd does one need to buy to upload a sketch to an Arduino Uno?

I need a Dummies 101 version.




wvmarle

Get a proper ESP module, not the severely crippled ESP-01. Almost any will do.

Easiest, though, is to get a development board such as the WeMOS mini or NodeMCU. Those have all pins broken out, built in voltage regulator, etc.

You will however need level shifters on the SPI lines between the ESP and the Arduino, as the ESP runs at 3.3V and most Arduinos on 5V. Communication from ESP to AVR (MOSI, RESET) should be fine on 3.3V; the return (MISO) not as it's driven to 5V and that is too much for the ESP.
Quality of answers is related to the quality of questions. Good questions will get good answers. Useless answers are a sign of a poor question.

Juraj

#17
Feb 12, 2018, 07:37 am Last Edit: Feb 12, 2018, 09:55 am by Juraj
So what does all of that mean?
Which specific partd does one need to buy to upload a sketch to an Arduino Uno?
I need a Dummies 101 version.
SPI or UART? is networking library needed? your esp sketch or firmware for networking library in AVR?

for serial connection, firmware without networking library (or only MQTT) the esp-link is the best. it has good docs.

for serial connection with general networking library the WiFiLink is good, but only for Atmega 328p with Optiboot. This is what I use. I wrote the documentation and I can help troubleshot it.

for serial connection with your esp sketch you could use the dfu library used in WiFi Link.

For SPI connection the ESP8266AVRISP esp library is the best option in your sketch or with WiFiSpiESP firmware. Making SPI connections with jumper cables and level shifter is good only for test setup because SPI requires 4 lines connected with level shifter. Then the reset line, ground, vcc. And optional reset of esp from atmega.

all links are in my previous comment



image of spi connected wemos and nano with mutual reset connection and an extra connection required for WiFi Link



and fritznig for Uno

ieee488

#18
Feb 12, 2018, 07:41 pm Last Edit: Feb 12, 2018, 08:03 pm by ieee488
I want to upload a *.ino file
I want to upload it to the Arduino Uno.

I am thinking that I would use a prototype shield with the Arduino Uno to mount a ESP-05 and the level shifters boards (I have 10 laying around).
Would the ESP-05 work?




Juraj

I want to upload a *.ino file
I want to upload it to the Arduino Uno in another town.
no problem :-)

Would the ESP-05 work?
not for SPI connection.

ieee488

not for SPI connection.
Then UART?



It seems wasteful buying the ESP-12 will all of its GPIO pins simply to just use it for its SPI pins.


wvmarle

The ESP05 and ESP01 and so have the same processor - just many pins are not broken out. That's the problem.
Quality of answers is related to the quality of questions. Good questions will get good answers. Useless answers are a sign of a poor question.

Juraj

#22
Feb 12, 2018, 09:26 pm Last Edit: Feb 12, 2018, 09:32 pm by Juraj
Then UART?
for Uno yes, with WiFi Link. USB can't be used then. For OTA debug prints I use telnet.

for Mega, I do not know.


xl97

How about ONLY a UART/serial solution?

NO MENTION OF SPI!!!!!

Is the following correct or not?

Arduino IDE
Arduino UNO
ESP8266-01
&
your link: esp-link firmware  (https://github.com/jeelabs/esp-link)

Thats it?

Or is there more?

Again... -NO- SPI solution asked for or desired.

What else is missing?  Anything?

When you ask this: "is networking library needed?"

I'm not clear what it means or you asking about? (can you clarify please)

thanks!




ieee488

How about ONLY a UART/serial solution?

NO MENTION OF SPI!!!!!

Is the following correct or not?

Arduino IDE
Arduino UNO
ESP8266-01
&
your link: esp-link firmware  (https://github.com/jeelabs/esp-link)

Thats it?

Or is there more?

Again... -NO- SPI solution asked for or desired.

What else is missing?  Anything?

When you ask this: "is networking library needed?"

I'm not clear what it means or you asking about? (can you clarify please)

thanks!




+1000
excellent!
bravo!


also, if AT commands are being used, what is the esp-link firmware for? the Arduino Uno?






Juraj

#25
Feb 13, 2018, 05:59 am Last Edit: Feb 13, 2018, 07:39 pm by Juraj
with AT firmware you can't have AVR sketch OTA upload. AT firmware is in esp8266 and that is all. (there was a guy who made it work somehow)

the esp-link with serial was, what I recommended in first comment.

If you want to use the esp8266 in the way like Arduino networking shields are used (Ethernet or WiFi shield), then esp-link can't help you. the firmware doesn't support a library with WiFiClient and WiFiServer. the EL-link library supports only simple REST calls and MQTT.

the WiFi Link firmware is for Serial connection and the corresponding library has WiFiServer and WiFiClient. but OTA is for now supported only for Atmega 328p with Optiboot (UNO bootloader). The used dfu library could be enhanced with more MCU definitions implementing some interfaces.

Code: [Select]
connect.  esp8266     firmware   AVR   OTA     | AVR         WiFi 
method    firmware    framework  OTA   lib     | library     Client
-------------------------------------------------------------------
UART      AT          SDK        no    -       | WiFiEsp     yes   
UART      esp-link    SDK        yes   -       | EL-link     no   
UART      WiFiLink    Arduino    Uno   dfu     | WiFiLink    yes   
UART      sketch      Arduino    Uno   dfu     | sketch      -     
SPI       WiFiSpiESP  Arduino    yes   AVRISP  | WiFiSpi     yes   
SPI       WiFiLink    Arduino    yes   AVRISP  | WiFiLink    yes   
SPI       sketch      Arduino    yes   AVRISP  | sketch      -     




randomgirl98

What makes you think you can?

I have not anything that said this was possible.
I am a programmer the few i know about electronics is what i learned with Arduino. I though Arduino could that easily it seem i might need another module for it. any suggetions?

ieee488

with AT firmware you can't have AVR sketch OTA upload. AT firmware is in esp8266 and that is all. (there was a guy who made it work somehow)

the esp-link with serial was what I recommended in first comment.

If you want to use the esp8266 in the way like Arduino networking shields are used (Ethernet or WiFi shield), then esp-link can't help you. the firmware doesn't support a library with WiFiClient and WiFiServer. the EL-link library supports only simple REST calls and MQTT.

the WiFi Link firmware is for Serial connection and the corresponding library has WiFiServer and WiFiClient. but OTA is for now supported only for Atmega 328p with Optiboot (UNO bootloader). The used dfu library could be enhanced withmore MCU definitions implementing some interfaces.

Code: [Select]
connect.  esp8266     firmware   AVR   OTA     | AVR         WiFi 
method    firmware    framework  OTA   lib     | library     Client
-------------------------------------------------------------------
UART      AT          SDK        no    -       | WiFiEsp     yes   
UART      esp-link    SDK        yes   -       | EL-link     no   
UART      WiFiLink    Arduino    Uno   dfu     | WiFiLink    yes   
UART      sketch      Arduino    Uno   dfu     | sketch      -     
SPI       WiFiSpiESP  Arduino    yes   AVRISP  | WiFiSpi     yes   
SPI       WiFiLink    Arduino    yes   AVRISP  | WiFiLink    yes   
SPI       sketch      Arduino    yes   AVRISP  | sketch      -     




You obviously know this forwards and backwards.

But honestly, I am as confused as ever.

Would you just answer xl97's post as it is and concentrate just on that? Please?



ieee488

I am a programmer the few i know about electronics is what i learned with Arduino. I though Arduino could that easily it seem i might need another module for it. any suggetions?
Keep reading this thread.

Apparently, it can be done, but I can't figure it out with the posts I am reading in this thread.



xl97

Yes, please.   This seems like a great feature one can implement on many projects.

But I just cant keep what your saying clear.  (you mention other libs, you post cross reference charts, you reference SPI and serial, other IDE's...etc..etc..etc)

I have tried to weed out other info and only focus on 1 approach form beginning to end.

Lets start here:


Arduino IDE
Arduino UNO
ESP8266-01  <--  you can use the 01's for serial....correct? (or did I mis-read?)
&
your link: esp-link firmware  (https://github.com/jeelabs/esp-link)

Thats it?

Or is there more?


If the above is correct, then please outline all steps.

Serial solution from beginning to end.  

Thank you.


Go Up