Blynk. begin , error on server

Arduino UNO
connected via ESP 8266 via software serial.
The project works correctly on cloud servers using the following code
Blynk.begin(auth, wifi, ssid, pass);

if I try to use the server in the house (raspberry 3) using the following code
Blynk.begin(auth, wifi, ssid, pass, IPAddress(192,168,1,44), 8080);

and indicating the IP and the server port returns this error

error: 'IPAddress' was not declared in this scope

I just do not understand…

I do not understand why this error because using the same code with a WEMOS D1 mini the error does not appear and everything works correctly.

Can you show your variable declarations, especially how the wifi variable is being used?

Pete.

did you try:

IPAddress server(192,168,1,44); 
const int port = 8080;
.
.
.
Blynk.begin(auth, wifi, ssid, pass, server, port);

and while you’re at it, check if all the necessary headers are included, sounds like you’re missing one.

Or simply
Blynk.begin(auth, ssid, pass,"xxx,xxx,xxx,xxx",8080);

or

char auth[] = "xxxxxxxxxx";
char ssid[] = "xxxxxxxxxx";
char pass[] = "xxxxxxxxxx";
char server[] = "xxx.xxx.xxx.xxx";
int port = 8080;

void setup() {
.
.
.
  WiFi.begin(ssid, pass); 
  Blynk.config(auth, server, port);
  Blynk.connect();
}
1 Like

unfortunately this solution does not work but this works:

char auth[] = "xxxxxxxxxx";
char ssid[] = "xxxxxxxxxx";
char pass[] = "xxxxxxxxxx";
char server[] = "xxx.xxx.xxx.xxx";
int port = 8080;

void setup() {
.
.
.
Blynk.begin(auth, wifi, ssid, pass, server, port );
}

and I think I found the problem: in the IP address I used the commas instead of the points …

:slight_smile:

thank you all

I’m still curious about what Data you’re passing into the ‘wifi’ variable, I’ve never seen Blynk.begin used with that extra parameter in there.

I don’t think the commas were the issue, you use points when it’s a string literal (enclosed between quotation marks), but commas when declaring a IPAddress type variable.

Pete.

Hi Pete
I am attaching an extract from the working sketch:

//#define BLYNK_PRINT Serial
#include <ESP8266_Lib.h>
#include <BlynkSimpleShieldEsp8266.h>
#include <RBD_Timer.h>
#include <SoftwareSerial.h>
char auth[] = "874******************";
char ssid[] = "URR*******************";
char pass[] = "pha******************";
char server[] = "192.168.1.44";
int port = 8080;

#define ESP8266_BAUD 9600// ESP8266 baud rate:
SoftwareSerial EspSerial(3,2); // RX, TX
ESP8266 wifi(&EspSerial);
.   .   .   .   .

.   .   .   .   .

void setup(){
  Serial.begin(9600);
  EspSerial.begin(ESP8266_BAUD);// baud rate ESP8266 
  Blynk.begin(auth, wifi, ssid, pass, server, port );
.   .   .   .   .

.   .   .   .   .
}

void loop(){
  Blynk.run();
.   .   .   .   .

.   .   .   .   .
}

I hope I have answered your curiosity.

is this for a shield - arduino setup? I’m just wondering what that’s doing there.

I do not know what you mean. It is used on arduino one with esp8266 that communicates via softwareserial.

that’s roughly what I meant. thnx!

char auth = “xxxxxxxxxx”;
char ssid = “xxxxxxxxxx”;
char pass = “xxxxxxxxxx”;
char server = “xxx.xxx.xxx.xxx”;
int port = 8080;
void setup() {
.
.
.
WiFi.begin(ssid, pass);
Blynk.config(auth, server, port);
Blynk.connect();
}

Thank you!
For me Only this variant works with combination Mega2560+WiFi Shield ESP8266 + Local Server