I have a Arduino nano which is using the below bluetooth module to connect to my android phone.
I have setup a Blynk project to connect to the Arduino with bluetooth. Everything seems to connect fine and the bluetooth module’s “connect” LED lights up.
When I look at the serial monitor however, I get a message that repeats “login timeout”.
Also I have tried including some basic code just to activate the digital pin 13 on the Arduino but that doesn’t even light up. See below my code used to connect to the phone and Blynk app, its basically the standard example supplied by Blynk with my own pin values etc.
I cant get a button on the Blynk app to activate pins on my arduino and more worrying is the fact that I can’t even get pin D13 to light up from the arduino code.
Note sure whats happening here so any advise would be appreciated.
/*************************************************************
Download latest Blynk library here:
https://github.com/blynkkk/blynk-library/releases/latest
Blynk is a platform with iOS and Android apps to control
Arduino, Raspberry Pi and the likes over the Internet.
You can easily build graphic interfaces for all your
projects by simply dragging and dropping widgets.
Downloads, docs, tutorials: http://www.blynk.cc
Sketch generator: http://examples.blynk.cc
Blynk community: http://community.blynk.cc
Follow us: http://www.fb.com/blynkapp
http://twitter.com/blynk_app
Blynk library is licensed under MIT license
This example code is in public domain.
*************************************************************
Warning: Bluetooth support is in beta!
You’ll need:
- Blynk App (download from AppStore or Google Play)
- Arduino Nano board
- Decide how to connect to Blynk
(USB, Ethernet, Wi-Fi, Bluetooth, ...)
There is a bunch of great example sketches included to show you how to get
started. Think of them as LEGO bricks and combine them as you wish.
For example, take the Ethernet Shield sketch and combine it with the
Servo example, or choose a USB sketch and add a code from SendData
example.
*************************************************************/
/* Comment this out to disable prints and save space */
#define BLYNK_PRINT Serial
#include <SoftwareSerial.h>
SoftwareSerial SwSerial(7, 8); // RX, TX
#include <BlynkSimpleSerialBLE.h>
#include <SoftwareSerial.h>
// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "8e9354f3c75148acb8eb2efb56e221c7";
SoftwareSerial SerialBLE(7, 8); // RX, TX
void setup()
{
// Debug console
Serial.begin(9600);
SerialBLE.begin(9600);
Blynk.begin(SerialBLE, auth);
Serial.println("Waiting for connections...");
pinMode(12, OUTPUT);
pinMode(13, OUTPUT);
}
void loop()
{
Blynk.run();
// You can inject your own code or combine it with other sketches.
// Check other examples on how to communicate with Blynk. Remember
// to avoid delay() function!
digitalWrite(12, HIGH);
digitalWrite(13, HIGH);
}