I just finish building a local server on Raspberry Pi 3 B+, from Blynk app, I can register new account, connect to the local server and send out the email for authorization code.
I do have a project that was working fine when using Blynk hosted server. The same project will not work when I switch to local server.
Here is what I did when switch from cloud to local:
add the below to current project (my local server IP)
char server[] = "192.168.1.20";
Add the “server” to the end like
Blynk.begin(auth, ssid, pass, server);
when running the compile, nothing output on the serial monitor
By remove the word “server” then serial monitor can display the output result as it is now using Blynk cloud server
Your Local server and the Cloud server will also use totally different AUTH codes, so switching a project between them requires more than just the different IP.
I don’t know what you are expecting on the serial monitor… and you might want to show us the full code as just a bunch of differering commands doesn’t tell us much…
And have you followed all the RPi directions for internal the 80-8080 port forwarding? However i have no idea if this is actually necessary for basic Local Server use
PS, generally I use this format for my Local Server sketches… using Blynk.config() instead of Blynk.begin()
char auth[] = "xxxxxxxxxx";
char ssid[] = "xxxxxxxxxx";
char pass[] = "xxxxxxxxxx";
char server[] = "xxx.xxx.xxx.xxx"; // IP for your Local Server
int port = 8080;
void setup() {
Serial.begin(9600); // BLYNK_PRINT data
WiFi.begin(ssid, pass);
Blynk.config(auth, server, port); // non-blocking, even if no server connection
Blynk.connect();
}
Or with Blynk.begin()
char auth[] = "xxxxxxxxxx";
char ssid[] = "xxxxxxxxxx";
char pass[] = "xxxxxxxxxx";
char server[] = "xxx.xxx.xxx.xxx"; // IP for your Local Server
int port = 8080;
void setup() {
Serial.begin(9600); // BLYNK_PRINT data
Blynk.begin(auth, ssid, pass, server, port); // Blocking until server connected
}