Hi everyone, I started working with the RobotDyn UNO+WiFi, pretty much an UNO with the 8266 on board and some switches so you don’t need to fight with wires and anything between ATmega and the ESP.
Now, I made a simple sketch just to try and see that everything was working but I am not able to make the WidgetTerminal works.
The device is connected, LEDs (virtual and physical one) work, Button on app to switch those leds on/off works.
/* Comment this out to disable prints and save space */
#define BLYNK_PRINT Serial
#include <SPI.h>
#include <ESP8266_Lib.h>
#include <BlynkSimpleShieldEsp8266.h>
#include <SimpleTimer.h> // Timer per Blynk
// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "xxxxx";
// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "xxxxx";
char pass[] = "xxxx";
// Hardware Serial on Mega, Leonardo, Micro...
#define EspSerial Serial
// or Software Serial on Uno, Nano...
//#include <SoftwareSerial.h>
//SoftwareSerial EspSerial(2, 3); // RX, TX
// Your ESP8266 baud rate:
#define ESP8266_BAUD 115200
ESP8266 wifi(&EspSerial);
SimpleTimer timer;
WidgetTerminal terminal(V1);
byte led1=0;
byte led2=0;
void setup()
{
pinMode (13,OUTPUT);
// Set ESP8266 baud rate
EspSerial.begin(ESP8266_BAUD);
delay(10);
Blynk.begin(auth, wifi, ssid, pass);
// This will print Blynk Software version to the Terminal Widget when
// your hardware gets connected to Blynk Server
terminal.println(F("Blynk v" BLYNK_VERSION ": Device started"));
terminal.flush();
timer.setInterval(5000L, timedEvent);
Blynk.setProperty(V2, "color", "#04C0F8");
Blynk.setProperty(V3, "color", "#D3435C");
}
void timedEvent ()
{
if (digitalRead(13) == HIGH) led1=255;
else led1=0;
Blynk.virtualWrite (V2, led1);
Blynk.virtualWrite (V3, led2);
terminal.println ("Done");
terminal.flush();
/*
EspSerial.println ("AT");
delay (1000);
while(EspSerial.available())
{
terminal.write(EspSerial.read());
}
terminal.flush();
*/
}
void loop()
{
if (digitalRead(13) == HIGH) led2=255;
else led2=0;
Blynk.run();
timer.run();
}
Tried with both, still nothing… Terminal widget stays black…
I don’t know… I’ve been using Blynk with UNO, MKR1000, NodeMCU… this is the first time i have this kind of problems
void timedEvent ()
{
if (digitalRead(13) == HIGH) led1=255;
else led1=0;
That is fine then… I had black text once… took about 1/2 testing to figure it out
The hardware type shouldn’t really matter as far as sending data to the widgets is concerned… however make sure you have all the latest App and IDE Library versions installed before flashing your program to the board.
Have you tried the basic Terminal example from the Sketch Builder?
Ok… not even the example was working… now it is… and my sketch too…
the only thing i did was changing some colors from the terminal settings… but even before, as a test, i wrote down something on the input line and i was able to see it… so it was not a problem of black on black…
Maybe it likes black on blue terminal better, lol…
with this i was able to send the AT command to the 8266 and getting the answer “OK” (it’s just a test, ofc).
Is there a way to send AT cmds through the WidgetTerminal? So, like, i write down the command on the app and it sends it to the 8266 with the EspSerial.println
It sounds like it was somehow displaying Black on Black… even if it looked otherwise in the settings… As I said, I ran into similar issue a while back wherein the terminal “defaulted” to a black background after an App update. Once I reset the text (or background) colours, all was good again.
Basically… No. Once Blynk is communicating through the ESP shield via Serial.begin() you will not have access for any AT commands. It is a standard serial issue, not a Blynk issue; Only one thing can communicate over serial at a time… and even if you manage to interject something, it will just cause a disconnection with Blynk.