• Arduion UNO with USB
• Android
• Blynk server
• Blynk Library 0.5.1
First, I used my Arduino Yun to connect Blynk and all things was ok. Since a MFRC522 module was used and I found Arduino Yun cannot dirve this RFID module, which goes well with Arduino UNO. Then I chose UNO instead of Yun. However, I don’t have other shield and USB is the only choice.
I just use the example program for test as the example video shows, but the device is showed “offline” in the app.
Here is my code
#include <SoftwareSerial.h>
SoftwareSerial DebugSerial(2, 3); // RX, TX
#define BLYNK_PRINT DebugSerial
#include <BlynkSimpleStream.h>
// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "802b7f2d1cc84f25ba85c474c4fe61ff";
void setup()
{
// Debug console
DebugSerial.begin(9600);
Serial.begin(9600);
Blynk.begin(Serial, auth);
}
void loop()
{
Blynk.run();
}
Remember that script needs to stay running the whole time you want to be connected
And you can NOT use any Serial Print commands… including #define BLYNK_PRINT Serial So comment them out or remove them. EDIT - your code looks OK. Of course you will need a USB-TTL adapter to use the DebugSerial
DebugSerial is fine as it is using SoftwareSerial on pins 2 & 3… but yes, it is useless without a USB-TTL adapter anyhow so while it is no harm to keep, there is no need for any Softserial reference in the code.
Change your code to this (with new AUTH)… if the device connects to the server the onboard LED will flash rapidly (4 times a second), if disconnected, it will go OFF (in about 10+ seconds).
the LED connected pin13 doesn’t light. the on-board LED, TX and RX, flash rapidly discontinuously, sometimes for 1seconds and sometimes for about 3 seconds…I don’t know the reason…
That means it is trying to send the AUTH code to the server and awaiting a reply… this is where having the SoftSerial DEBUG w/ USB-TTL and a terminal program option is handy
So, now it is either your AV or firewall that is blocking communication or bad AUTH or bad internet?? I would suspect the AV/Firewall. Determine what you are using and GOGGLE it to see how to either temporarily disable it, and allow the script to have access.
BTW, if/when you get the firewall figured out… take this part OUT of the void loop… it is only there for this testing and can cause issues in future uses.