This is my first post want to thank you in advance for every help.
I am new to the arduino world, my recent project is a blinking rgb strip controlled by a switch button :
I've ordered an ESP-01 or ESP 8266 to start a project controlled over WiFi.
I am using a USB to TTL to power up my arduino pro mini, now I need to attach somehow the esp-01 to the arduino (not sure if i need the adapter which I bought in a bundle). As i know it has a regulator for 5v->3.3v.
I connected the ESP-01 directly to the TTL and flashed a firmware (even few of them after failing with my project).
I was using this tutorial for the wiring:
My code returns me that the WiFi shield is not present.
One of the problems that I saw is that I cannot (or don't know how) send the AT commands to my esp.
Please see attached image of the components that i am using (ignore the wiring).
I know it's great to support Arduino and buy a branded board but if you're on a budget, a better option may be a NodeMCU of a Wemos D1 Mini. They can be both powered via usb, eliminating the need for the FTDI module.
To program the ESP-01 you use the proper adapter.
This is the enhanced version of the module first described in the quite good tutorial you cited so you do not need to add the programming jumper - the switch is already on this adapter.
Other than for programming the $1 "plain" adapter is extremely useful as it plugs straight into the average USB "phone charger" and you simply solder your connections to the adapter to operate other parts or sensors.
The ESP-01 has four I/O available - you will need to cut the track to the RX pin on the module to use that fourth pin effectively.
If you need more I/O, then you should go for the WeMOS D1 Mini as exiledyorkie points out.
The point is, it makes little or no sense to use an ESP in addition to an Arduino. The ESP is substantially more capable, so if you want WiFi, you use the ESP and forget the Arduino.
"If you need more I/O, then you should go for the WeMOS D1 Mini as exiledyorkie points out."
I just got a WeMOS D1 board from a US supplier for ~$6 shipped and it connects to my router with no issues, and uses the DollarTree thin flexible USB micro cables. So far very simple to use like a UNO with added no hassle wifi.
ieee488:
How do you do a Reset on the ESP-01 when using the Sensemart adapter (red)?
Do you simply unplug and replug the ESP-01?
Pretty much.
Not a great difficulty that I have found as I am necessarily swapping the ESP-01 between the programming adapter and the target system.
In fact, I am not sure I actually have the (red) adapter with the switch - I'll have to look (and that will consume my time even on New Years Day).
I just have a number of the cheaper adapters, including those actually attached to the "Times square" boards as the fully functional project. One such adapter has a jumper fitted which I leave in place, so I alternate between putting the ESP-01 into the programming adapter and plugging it in to USB to program, and taking it out and swapping it into the target system to test the result.
zoomkat:
"If you need more I/O, then you should go for the WeMOS D1 Mini as exiledyorkie points out."
I just got a WeMOS D1 board from a US supplier for ~$6 shipped and it connects to my router with no issues, and uses the DollarTree thin flexible USB micro cables. So far very simple to use like a UNO with added no hassle wifi.
Not sure who they are, but the board is somewhat like an uno with wifi. Still figuring out the pin arrangement, but no setup for communication or wifi. Just load a web server program and it works. You modify the example code to connect to your internet router and you are on line. I have two of them now, I got one from china and one from US supplier, both about $6.75 including shipping (China speedpak from china).
zoomkat:
Not sure who they are, but the board is somewhat like an uno with wifi. Still figuring out the pin arrangement, but no setup for communication or wifi. Just load a web server program and it works. You modify the example code to connect to your internet router and you are on line. I have two of them now, I got one from china and one from US supplier, both about $6.75 including shipping (China speedpak from china).
Thanks.
Do you use the Arduino IDE to upload the web server sketch? Just want to confirm.
Sounds easy. I will have to get one.
These ESP-01 are a royal pain. LOL.
ieee488:
As I have already written, if you were successful with flashing the ESP-01, the AT firmware is GONE.
GONE.
How are you getting the "No wifi shield" status?
What sketch are you using?
You are not helping yourself with this.
You have told us nothing useful to help you.
Wow... that means I cannot flash an AT firmware anymore?
Well... my plan is to connect my arduinio pro mini to the internet and make an HTTP request to my webpage. I found some sketches and combined them to write my code.
#include <SPI.h>
#include <WiFiEsp.h>
#include <HttpClient.h>
#include "SoftwareSerial.h"
SoftwareSerial Serial1(2, 3); // RX, TX
char ssid[] = "#########";
char pass[] = "#########";
int status = WL_IDLE_STATUS;
const char* kHostname = "#########";
const char* kPath = "/#########";
void setup() {
Serial.begin(9600);
Serial1.begin(115200);
WiFi.init(&Serial1);
// check for the presence of the shield:
if (WiFi.status() == WL_NO_SHIELD) {
Serial.println("WiFi shield not present");
// don't continue:
while (true);
}
while(WiFi.status() != WL_CONNECTED) {
Serial.print("Attempting to connect to WEP network, SSID: ");
Serial.println(ssid);
status = WiFi.begin(ssid, pass);
delay(2000);
}
Serial.println("Connected to SSID");
}
void loop() {
if(WiFi.status() == WL_CONNECTED) {
Serial.println("Success.");
WiFiEspClient c;
HttpClient http(c);
int httpCode = http.get(kHostname, kPath);
if(httpCode > 0) {
Serial.println("HTTP request succeed");
char payload = http.read();
Serial.println(httpCode);
Serial.println(payload);
//do my stuff
} else {
Serial.println("Error on HTTP request");
}
http.stop();
}
delay(10000);
}
"Do you use the Arduino IDE to upload the web server sketch? Just want to confirm."
Yes, no different than loading code to an arduino using the arduino IDE. You get a board list that includes the WeMOS D1, download the wifi libraries, and select the examples you want to run/ modify. Same operations as using an arduino.