Hello everybody,
I have got the following code working with the online Blynk-server:
#define BLYNK_PRINT Serial
#include <blynk.h>
char auth[] = "xxxxxxxxxxxxxxxxx";
int pinValue;
BLYNK_WRITE(V1)
{
pinValue = param.asInt();
}
void setup()
{
Serial.begin(9600);
delay(5000);
Blynk.begin(auth);
pinMode(D7, OUTPUT);
}
void loop()
{
Blynk.run();
if (pinValue==1)
{digitalWrite(D7, HIGH);
}
else
{digitalWrite(D7, LOW);
}
}
When I use the same code for the Blynk local server it doesn’t work:
#define BLYNK_PRINT Serial
#include <blynk.h>
char auth[] = "xxxxxxxxxxxxxxxxxxxx";
int pinValue;
BLYNK_WRITE(V1)
{
pinValue = param.asInt();
}
void setup()
{
Serial.begin(9600);
delay(5000);
Blynk.begin(auth, IPAddress(192,168,0,101), 8080);
pinMode(D7, OUTPUT);
}
void loop()
{
Blynk.run();
if (pinValue==1)
{digitalWrite(D7, HIGH);
}
else
{digitalWrite(D7, LOW);
}
}
I can access my Blynk local server so there is no problem with IP-address. My Blynk local server is also running the latest version and authorisation-code is correct.
Anybody an idea what could be wrong? Thanks in advance,
Bart