[SOLVED] Blynk.begin woes

Problems began with adding another project…
I finally saw the multiple hardware note and example sketch. I could not get the examples to work… even when trying to connect the original board using very basic connection examples.

Sometimes … connection problems weed themselves out the next day… (your server reboot?) Was now able to reconnect the most basic blynk sketch. I updated to the latest blynk library. I am running both pubsubclient (for mqtt service) and blynk. They refuse to run concurrently… they did before. Is there a way to get the previous blynk library back? I can get them to run separately.

Another problem… the examples that are given for using two boards requiring different mac address… they don’t seem to work. I am not running in server mode… there is no example of syntax ( blynk begin) that works for me when I specify the mac address. This works… ( Blynk.begin(auth, ssid, password ). Have found NO way to make this work… Blynk.begin(auth, ssid, password, arduino_mac); Thanks.

Regarding MAC: Please consult Arduino_Ethernet_Manual example for all parameters.
We will change this part a bit - so mac will be auto-generated.

I found this example, but again, it does not apply to a client … only to a server. I assume this is a configuration for local server. Am I correct in thinking this? I have tried various combinations and have not found anything to work. Thanks.

IPAddress server_ip (10, 0, 0, 10);

// Mac address should be different for each device in your LAN
byte arduino_mac[] = { 0xDE, 0xED, 0xBA, 0xFE, 0xFE, 0xED };
IPAddress arduino_ip ( 10, 0, 0, 20);
IPAddress dns_ip ( 8, 8, 8, 8);
IPAddress gateway_ip ( 10, 0, 0, 1);
IPAddress subnet_mask(255, 255, 255, 0);

void setup()
{
Serial.begin(9600);
Blynk.begin(auth, server_ip, 8442, arduino_ip, dns_ip, gateway_ip, subnet_mask, arduino_mac);
// Or like this:
//Blynk.begin(auth, “blynk-cloud.com”, 8442, arduino_ip, dns_ip, gateway_ip, subnet_mask, arduino_mac);
}

You could also use it for Blynk cloud:
Byte arduino_mac [] = {0xDE, 0xED, 0xFE, 0xBA, 0xAE, 0xEF};

Blynk.begin (auth, "blynk-cloud.com ", 8442, arduino_mac);

@DSC could you please start from blynk cloud, so we can check that it works fine for you? After that you may try local server.

I don’t understand … Start from blynk cloud?? I am NOT using a local Server… I am trying to connect to the Blynk cloud using blynk.begin.

Just try the code I sent.

Trying to narrow it down a little. The problem seems to be combining both local network and blynk … Seperatly they work fine … together blynk.begin gets confused. Using Huzzah Esp8622.

Readout from Serial monitor

Wait for WiFi… …
WiFi connected
IP address:
192.168.1.30
Starting Blynk…
[73324] Connecting to NetgearDSC

Please ignore include statement <> … formatting messes up displaying them here.
-------------- code ------------
#define BLYNK_PRINT Serial
#include ESP8266WiFi.h>
#include BlynkSimpleEsp8266.h>
#define WLAN_SSID “xxx”
#define WLAN_PASS “xxx”

// Variables ------
const char* ssid = “xxx”;
const char* password = “xxx”;

// mac addr for mqtt 2 - 18:fe:34:db:51:d9
char arduino_mac[] = {0x18, 0xFE, 0x34, 0xDB, 0x51, 0xD9};
char auth[] = “xxxxf”;

void setup()
{
Serial.begin(9600);

delay(10);
// We start by connecting to a WiFi network
Serial.println();
Serial.print("Connecting to ");
Serial.println(ssid);

WiFi.begin(ssid, password);

while (WiFi.status() != WL_CONNECTED)
{
delay(500);
Serial.print(".");
}

Serial.println("");
Serial.println(“WiFi connected”);
Serial.print("IP address: ");
Serial.println(WiFi.localIP());
delay(1000);
Serial.println(“Starting Blynk…”);

Blynk.begin(auth,WLAN_SSID, WLAN_PASS);
while (Blynk.connect() == false) {
// Wait until connected
}

Serial.println(“Blynk Connected…”);

} // ----------- end of setup -------

void loop(){ // ------------------ Loop --------------------->>>
Blynk.run();

}

Thank you for fixing Blinyk !!! Everything is back online… Have not tried multiple projects yet… just thankful to get main project back online.

1 Like