So I have an esp-01. I HAVE been able to get the standalone Blynk working well on it (after pulling the chip on an old Uno and using the board for comm), but I am at wits end trying to get it to work as a shield for my Mega. I will also admit that there is just an absurd amount of conflicting and old information out there on the topic. So ultimately, I just can’t get it to work:
Here what I see in serial:
[19] Blynk v0.3.1
[520] Connecting to NETGEAR21
[1530] Failed to disable Echo
My newb questions:
-
Which set of rx/tx ports on the mega do I connect to?/is this where EspSerial Serial1 <<<— comes into play… like Serial1 corresponds to the TX1/RX1 ports?
-
Baud rate. My esp boards seems to be working well with 9600, but is it okay that console baud rate and esp baud rate are the same? I don’t really get it.
-
GPIO-0 and RST… Do I ground these pins at some point in the process of loading this code onto my mega?
-
AT commands… This is sort of a dumb question, but I don’t actually know how to get back to a point where I can just do AT commands with my esp… Is there some kind of basic sketch I can upload? I mostly ask this because I know one of you is going to ask what firmware version is on it…
-
My last question… is there any way I can accidentally fry everything?
d
And, of course, here is the code I’m trying to upload:
#define BLYNK_PRINT Serial // Comment this out to disable prints and save space
#include <ESP8266_HardSer.h>
#include <BlynkSimpleShieldEsp8266_HardSer.h>
// Set ESP8266 Serial object
#define EspSerial Serial1
ESP8266 wifi(EspSerial);
// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "blurp";
void setup()
{
// Set console baud rate
Serial.begin(9600);
delay(10);
// Set ESP8266 baud rate
EspSerial.begin(9600);
delay(10);
Blynk.begin(auth, wifi, "NETGEAR21", "derp");
}
void loop()
{
Blynk.run();
}
And this is the working standalone code:
#define BLYNK_PRINT Serial // Comment this out to disable prints and save space
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "blah";
int derp;
void setup()
{
Serial.begin(9600);
Blynk.begin(auth, "NETGEAR21", "derpy");
pinMode(BUILTIN_LED, OUTPUT);
}
BLYNK_WRITE(1){
derp = param.asInt()+0;
}
void derpalicious() {
if (derp > 0) {
digitalWrite(BUILTIN_LED, LOW);
} else {
digitalWrite(BUILTIN_LED, HIGH);
}
}
void loop()
{
Blynk.run();
derpalicious();
}