I'm quite new to the Arduino world and my question is rather on a meta level though I do have a concrete technical problem. However, I think my general understanding of the ESP8266 might not fully be correct, thats why I'm addressing this here.
Few words to my project: For now I'm trying to send a "HelloWorld" message to AWS IoT console using an Uno+ESP8266 WiFi module. Did the same thing with a Raspberry Pi (without ESP but built-in WiFi) and worked fine. However with Uno+ESP I got really confused and I'm not sure whether I got ESP programming right. I'll present my approach so far and the open questions that jumped to my mind. Any clarifications are much appreciated!
First thing I did was test the ESP Module with the following tutorial:
https://medium.com/@cgrant/using-the-esp8266-wifi-module-with-arduino-uno-publishing-to-thingspeak-99fc77122e82
Since this worked just fine, I tried this Code:
https://github.com/HarringayMakerSpace/awsiot/blob/master/Esp8266AWSIoTExample/Esp8266AWSIoTExample.ino in order to send Messages to AWS IoT. But there I got confused. So here are my questions:
First thing that confused me was the board selection in Arduion IDE. To my understanding, "ESP8266WiFi" is more of a "board" than a "library". So I went with the "Generic ESP8266 Module". This confused me somehow, since I'm not sure whether this is meant for ESP Boards (e.g. NodeMCU DEVKIT) or would also work for my Uno+ESP configuration. So first question, am I doing this correct?
Also I was wondering whether I am uploading the sketch to the Uno or to the ESP directly (thus just utilizing the Uno as a bypass to connect the ESP to the PC, as described in the first link). In this context I'm also not sure about the wiring. Since I'm assuming here that the code is uploaded to the Uno, I connected ESP RX/TX to Uno TX/RX. Or do I need SoftwareSerial here?
So in the setting described, the upload to the board failed and I get the classy error
warning: espcomm_sync failed
error: espcomm_open failed
error: espcomm_upload_mem failed
error: espcomm_upload_mem failed
I read a lot of stuff on how to fix this error, but before I dig too deep into troubleshooting, I wanted to make sure that my assumptions are correct and I'm not missing something fundamental in my understanding. So if anyone could help me to shed some light on the problem I am extremely grateful.