BLYNK
HOME       📲 GETTING STARTED       📗 DOCS       ❓HELP CENTER       👉 SKETCH BUILDER

Hardware failing to connect to local blynk server

I am wondering if anyone can help me with my local server. I am using an arduino mega with built in esp8266. I am running java 11 with the newest version of blynk server 0.41.14. I have the local server running and can log into the admin page and app but I cant get my hardware to connect to the server .

I have forwarded ports 9443, 8080, 80, 443 and 8443 on my router and have all firewalls closed but just cant connect to server. I’m getting warnings about certs but i thought they were embedded. Can anyone please tell me what I am doing wrong? I am so puzzled.

00:41:04.436 -> [19] 
00:41:04.436 ->     ___  __          __
00:41:04.469 ->    / _ )/ /_ _____  / /__
00:41:04.469 ->   / _  / / // / _ \/  '_/
00:41:04.503 ->  /____/_/\_, /_//_/_/\_\
00:41:04.539 ->         /___/ v0.6.1 on Arduino Mega
00:41:04.572 -> 
00:41:05.043 -> [610] Connecting to *************
00:41:08.077 -> [3655] AT version:1.1.0.0(May 11 2016 18:09:56)
00:41:08.110 -> SDK version:1.5.4(baaeaebb)
00:41:08.144 -> compile time:May 20 2016 15:06:44
00:41:08.177 -> OK
00:41:15.179 -> [10768] +CIFSR:STAIP,"***.***.*.***"
00:41:15.213 -> +CIFSR:STAMAC,"a4:cf:12:d6:e6:d8"
00:41:15.247 -> [10777] Connected to WiFi
/*************************************************************
  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.

 *************************************************************

  This example shows how to use ESP8266 Shield (with AT commands)
  to connect your project to Blynk.

  WARNING!
    It's very tricky to get it working. Please read this article:
    http://help.blynk.cc/hardware-and-libraries/arduino/esp8266-with-at-firmware

  Change WiFi ssid, pass, and Blynk auth token to run :)
  Feel free to apply it to any other example. It's simple!
 *************************************************************/

/* Comment this out to disable prints and save space */
#define BLYNK_PRINT Serial


#include <ESP8266_Lib.h>
#include <BlynkSimpleShieldEsp8266.h>

// You should get Auth Token in the Blynk App.


// Your WiFi credentials.
// Set password to "" for open networks.
char auth[] = "OMieM29q_Uom55U_vmWE-XfiL7Kd7WLy";

char ssid[] = "*****";
char pass[] = "******";
char server[] = "*******";  // server IP add
char port[] = "8080";
// Hardware Serial on Mega, Leonardo, Micro...
#define EspSerial Serial3

// or Software Serial on Uno, Nano...
//#include <SoftwareSerial.h>
//SoftwareSerial EspSerial(2, 3); // RX, TX

// Your ESP8266 baud rate:
#define ESP8266_BAUD 115200

ESP8266 wifi(&EspSerial);

void setup()
{
  // Debug console
  Serial.begin(9600);

  delay(10);

  // Set ESP8266 baud rate
  EspSerial.begin(ESP8266_BAUD);
  delay(10);

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

void loop()
{
  Blynk.run();
}
00:14:20.139 INFO - Using data dir '\Path'
00:14:20.623 INFO - Region : local. Host : 192.168.0.184.
00:14:21.103 INFO - Initializing gmail smtp mail transport. Username : example@gmail.com. SMTP host : smtp.gmail.com:587
00:14:21.161 INFO - Reports : 0
00:14:21.162 INFO - Didn't find custom user certificates.
00:14:21.164 INFO - Didn't find Let's Encrypt certificates.
00:14:21.164 WARN - You didn't specified 'server.host' or 'contact.email' properties in server.properties file. Automatic certificate generation is turned off. Please specify above properties for automatic certificates retrieval.
00:14:21.164 WARN - ATTENTION. Server certificate paths (cert : 'C:\Users\niall\Documents\server1', key : 'C:\Users\niall\Documents\server1') not valid. Using embedded server certs and one way ssl. This is not secure. Please replace it with your own certs.
00:14:21.870 INFO - HTTP API and WebSockets server listening at 8080 port.
00:14:21.870 INFO - HTTPS API, WebSockets and Admin page server listening at 9443 port.
00:14:21.870 INFO - Mqtt hardware server listening at 8440 port.
00:15:32.374 INFO - niallfo@gmail.com Blynk-app (android-22721) joined.
00:17:12.044 INFO - niallfo@gmail.com Blynk-app (android-22721) joined.
00:19:46.696 INFO - Using data dir '\Path'
00:19:47.154 INFO - Region : local. Host : 192.168.0.184.
00:19:47.611 INFO - Initializing gmail smtp mail transport. Username : niallfo@gmail.com. SMTP host : smtp.gmail.com:587
00:19:47.680 INFO - Reports : 0
00:19:47.682 INFO - Didn't find custom user certificates.
00:19:47.683 INFO - Didn't find Let's Encrypt certificates.
00:19:47.683 WARN - You didn't specified 'server.host' or 'contact.email' properties in server.properties file. Automatic certificate generation is turned off. Please specify above properties for automatic certificates retrieval.
00:19:47.684 WARN - ATTENTION. Server certificate paths (cert : 'C:\Users\niall\Documents\server1', key : 'C:\Users\niall\Documents\server1') not valid. Using embedded server certs and one way ssl. This is not secure. Please replace it with your own certs.
00:19:48.408 INFO - HTTP API and WebSockets server listening at 8080 port.
00:19:48.410 INFO - HTTPS API, WebSockets and Admin page server listening at 9443 port.
00:19:48.411 INFO - Mqtt hardware server listening at 8440 port.
00:23:48.676 INFO - Using data dir '\Path'
00:23:49.163 INFO - Region : local. Host : 192.168.0.184.
00:23:49.649 INFO - Initializing gmail smtp mail transport. Username : niallfo@gmail.com. SMTP host : smtp.gmail.com:587
00:23:49.726 INFO - Reports : 0
00:23:49.727 INFO - Didn't find custom user certificates.
00:23:49.729 INFO - Didn't find Let's Encrypt certificates.
00:23:49.729 WARN - You didn't specified 'server.host' or 'contact.email' properties in server.properties file. Automatic certificate generation is turned off. Please specify above properties for automatic certificates retrieval.
00:23:49.729 WARN - ATTENTION. Server certificate paths (cert : 'C:\Users\niall\Documents\server1', key : 'C:\Users\niall\Documents\server1') not valid. Using embedded server certs and one way ssl. This is not secure. Please replace it with your own certs.
00:23:50.801 INFO - HTTP API and WebSockets server listening at 8080 port.
00:23:50.802 INFO - HTTPS API, WebSockets and Admin page server listening at 9443 port.
00:23:50.803 INFO - Mqtt hardware server listening at 8440 port.
00:30:22.592 INFO - Using data dir '\Users\niall\Documents\server1'
00:30:23.024 INFO - Region : local. Host : 192.168.0.184.
00:30:23.508 INFO - Initializing gmail smtp mail transport. Username : niallfo@gmail.com. SMTP host : smtp.gmail.com:587
00:30:23.584 INFO - Reports : 0
00:30:23.585 INFO - Didn't find custom user certificates.
00:30:23.591 INFO - Didn't find Let's Encrypt certificates.
00:30:23.591 WARN - You didn't specified 'server.host' or 'contact.email' properties in server.properties file. Automatic certificate generation is turned off. Please specify above properties for automatic certificates retrieval.
00:30:23.591 WARN - ATTENTION. Server certificate paths (cert : 'C:\Users\niall\Documents\server1', key : 'C:\Users\niall\Documents\server1') not valid. Using embedded server certs and one way ssl. This is not secure. Please replace it with your own certs.
00:30:24.522 INFO - HTTP API and WebSockets server listening at 8080 port.
00:30:24.524 INFO - HTTPS API, WebSockets and Admin page server listening at 9443 port.
00:30:24.525 INFO - Mqtt hardware server listening at 8440 port.
00:33:52.507 INFO - Using data dir '\Users\niall\Documents\server1'
00:33:52.934 INFO - Region : local. Host : 192.168.0.184.
00:33:53.424 INFO - Initializing gmail smtp mail transport. Username : niallfo@gmail.com. SMTP host : smtp.gmail.com:587
00:33:53.506 INFO - Reports : 0
00:33:53.508 INFO - Didn't find custom user certificates.
00:33:53.511 INFO - Didn't find Let's Encrypt certificates.
00:33:53.511 WARN - You didn't specified 'server.host' or 'contact.email' properties in server.properties file. Automatic certificate generation is turned off. Please specify above properties for automatic certificates retrieval.
00:33:53.511 WARN - ATTENTION. Server certificate paths (cert : 'C:\Users\niall\Documents\server1', key : 'C:\Users\niall\Documents\server1') not valid. Using embedded server certs and one way ssl. This is not secure. Please replace it with your own certs.
00:33:55.021 INFO - HTTP API and WebSockets server listening at 8080 port.
00:33:55.023 INFO - HTTPS API, WebSockets and Admin page server listening at 9443 port.
00:33:55.024 INFO - Mqtt hardware server listening at 8440 port.
00:34:37.705 INFO - Using data dir '\Users\niall\Documents\server1'
00:34:38.170 INFO - Region : local. Host : 192.168.0.184.
00:34:38.672 INFO - Initializing gmail smtp mail transport. Username : niallfo@gmail.com. SMTP host : smtp.gmail.com:587
00:34:38.739 INFO - Reports : 0
00:34:38.741 INFO - Didn't find custom user certificates.
00:34:38.742 INFO - Didn't find Let's Encrypt certificates.
00:34:38.742 WARN - You didn't specified 'server.host' or 'contact.email' properties in server.properties file. Automatic certificate generation is turned off. Please specify above properties for automatic certificates retrieval.
00:34:38.742 WARN - ATTENTION. Server certificate paths (cert : 'C:\Users\niall\Documents\server1', key : 'C:\Users\niall\Documents\server1') not valid. Using embedded server certs and one way ssl. This is not secure. Please replace it with your own certs.
00:34:39.789 INFO - HTTP API and WebSockets server listening at 8080 port.
00:34:39.790 INFO - HTTPS API, WebSockets and Admin page server listening at 9443 port.
00:34:39.791 INFO - Mqtt hardware server listening at 8440 port.
00:37:30.229 INFO - Using data dir '\Users\niall\Documents\server1'
00:37:30.667 INFO - Region : local. Host : 192.168.0.184.
00:37:31.132 INFO - Initializing gmail smtp mail transport. Username : niallfo@gmail.com. SMTP host : smtp.gmail.com:587
00:37:31.201 INFO - Reports : 0
00:37:31.203 INFO - Didn't find custom user certificates.
00:37:31.204 INFO - Didn't find Let's Encrypt certificates.
00:37:31.205 WARN - You didn't specified 'server.host' or 'contact.email' properties in server.properties file. Automatic certificate generation is turned off. Please specify above properties for automatic certificates retrieval.
00:37:31.205 WARN - ATTENTION. Server certificate paths (cert : 'C:\Users\niall\Documents\server1', key : 'C:\Users\niall\Documents\server1') not valid. Using embedded server certs and one way ssl. This is not secure. Please replace it with your own certs.
00:37:32.067 INFO - HTTP API and WebSockets server listening at 8080 port.
00:37:32.068 INFO - HTTPS API, WebSockets and Admin page server listening at 9443 port.
00:37:32.069 INFO - Mqtt hardware server listening at 8440 port.
00:39:04.285 INFO - Using data dir '\Path'
00:39:04.738 INFO - Region : local. Host : 192.168.0.184.
00:39:05.234 INFO - Initializing gmail smtp mail transport. Username : niallfo@gmail.com. SMTP host : smtp.gmail.com:587
00:39:05.318 INFO - Reports : 0
00:39:05.320 INFO - Didn't find custom user certificates.
00:39:05.321 INFO - Didn't find Let's Encrypt certificates.
00:39:05.321 WARN - You didn't specified 'server.host' or 'contact.email' properties in server.properties file. Automatic certificate generation is turned off. Please specify above properties for automatic certificates retrieval.
00:39:05.321 WARN - ATTENTION. Server certificate paths (cert : 'C:\Users\niall\Documents\server1', key : 'C:\Users\niall\Documents\server1') not valid. Using embedded server certs and one way ssl. This is not secure. Please replace it with your own certs.
00:39:06.334 INFO - HTTP API and WebSockets server listening at 8080 port.
00:39:06.336 INFO - HTTPS API, WebSockets and Admin page server listening at 9443 port.
00:39:06.337 INFO - Mqtt hardware server listening at 8440 port.
01:10:39.625 INFO - Using data dir '\Path'
01:10:40.129 INFO - Region : local. Host : 192.168.0.184.
01:10:40.585 INFO - Initializing gmail smtp mail transport. Username : niallfo@gmail.com. SMTP host : smtp.gmail.com:587
01:10:40.664 INFO - Reports : 0
01:10:40.665 INFO - Didn't find custom user certificates.
01:10:40.666 INFO - Didn't find Let's Encrypt certificates.
01:10:40.666 WARN - You didn't specified 'server.host' or 'contact.email' properties in server.properties file. Automatic certificate generation is turned off. Please specify above properties for automatic certificates retrieval.
01:10:40.666 WARN - ATTENTION. Server certificate paths (cert : 'C:\Users\niall\Documents\server1', key : 'C:\Users\niall\Documents\server1') not valid. Using embedded server certs and one way ssl. This is not secure. Please replace it with your own certs.
01:10:41.755 INFO - HTTP API and WebSockets server listening at 8080 port.
01:10:41.755 INFO - HTTPS API, WebSockets and Admin page server listening at 9443 port.
01:10:41.755 INFO - Mqtt hardware server listening at 8440 port.
#hardware mqtt port
hardware.mqtt.port=8440

#http, plain web sockets and plain hardware port
http.port=8080

#if this property is true csv download url will use port 80 and will ignore http.port
force.port.80.for.csv=false

#if this property is true redirect_command will use 80 port and will ignore http.port
force.port.80.for.redirect=true

#secured https, web sockets and app port
https.port=9443

#address to bind to. by default bounded to all interfaces
listen.address=

#by default server uses embedded in jar cert to simplify local server installation.
#WARNNING DO NOT USE THIS CERTIFICATES ON PRODUCTION OR IN WHERE ENVIRNOMENTS REAL SECURITY REQUIRED.
#provide either full path to files either use '.' for specifying current directory. For instance "./myfile.crt"
server.ssl.cert=
server.ssl.key=
server.ssl.key.pass=

#by default System.getProperty("java.io.tmpdir")/blynk used
data.folder=

#folder for logs.
logs.folder=./logs

#log debug level. trace|debug|info|error. Defines how precise logging will be.
log.level=info

#maximum number of devices allowed per account
user.devices.limit=50

#maximum number of tags allowed per account
user.tags.limit=100

#defines maximum allowed number of user dashboards. Needed to limit possible number of tokens.
user.dashboard.max.limit=100

#defines maximum allowed widget size in KBs as json string.
user.widget.max.size.limit=20

#user is limited with 100 messages per second.
user.message.quota.limit=100

#maximum allowed number of notification queue. Queue responsible for processing email, pushes, twits sending.
#Because of performance issue - those queue is processed in separate thread, this is required due
#to blocking nature of all above operations. Usually limit shouldn't be reached.
notifications.queue.limit=2000

#Number of threads for performing blocking operations - push, twits, emails, db queries.
#Recommended to hold this value low unless you have to perform a lot of blocking operations.
blocking.processor.thread.pool.limit=6

#this setting defines how often we can send mail/tweet/push or any other notification. Specified in seconds
notifications.frequency.user.quota.limit=5

#this setting defines how often we can send webhooks. Specified in miliseconds
webhooks.frequency.user.quota.limit=1000

#this setting defines how big could be response for webhook GET request. Specified in kbs
webhooks.response.size.limit=96

#maximum size of user profile in kb's
user.profile.max.size=256

#number of strings to store in terminal widget
terminal.strings.pool.size=25

#number of strings to store in map widget
map.strings.pool.size=25

#number of strings to store in lcd widget
lcd.strings.pool.size=6

#maximum number of rows allowed
table.rows.pool.size=100

#period in millis for saving all user DB to disk.
profile.save.worker.period=60000

#period in millis for saving stats to disk.
stats.print.worker.period=60000

#max size of web request in bytes, 256 kb (256x1024) is default
web.request.max.size=524288

#maximum number of points that are fetched during CSV export
#43200 == 60 * 24 * 30 - minutes points for 1 month
csv.export.data.points.max=43200

#specifies maximum period of time when hardware socket could be idle. After which
#socket will be closed due to non activity. In seconds. Default value 10 if not provided.
#leave it empty for infinity timeout
hard.socket.idle.timeout=10

#enable DB
enable.db=false

#enable raw data storage to DB
enable.raw.db.data.store=false

#size of async logger ring buffer. should be increased for loads >2-3k req/sec
async.logger.ring.buffer.size=2048

#when true - allows reading worker to trigger hardware even app is offline
allow.reading.widget.without.active.app=false

#when enabled server will also store hardware and app IP
allow.store.ip=true

#initial amount of energy
initial.energy=100000

#ADMINISTRATION SECTION

admin.rootPath=/admin

#used for reset password page and certificate generation.
#by default current server IP is taken. could be replaced with more friendly hostname.
#it is recommended to override this property with your server IP to avoid possible problems of host resolving
#server.host=192.168.0.184

#used for fallback page for reset user password, in most cases it should be the same as server.host
#IP is not allowed here, it should be blynk-cloud.com for Blynk app
#or *.blynk.cc for private servers with own apps
restore.host=blynk-cloud.com

product.name=Blynk

#email used for certificate registration, could be omitted in case you already specified it in mail.properties
#contact.email=niallfo@gmail.com

#network interface to determine server's current IP.
#only the first characters of the interface's name are needed.
#the default setting eth will use the first ethX interface found (i.e. eth0)
net.interface=eth

#comma separated list of administrator IPs. allow access to admin UI only for those IPs.
#you may set it for 0.0.0.0/0 to allow access for all.
#you may use CIDR notation. For instance, 192.168.0.53/24
allowed.administrator.ips=0.0.0.0/0,::/0

# default admin name and password. that will be created on initial server start
admin.email=
admin.pass=

It would be useful to see these IP addresses.

Pete.

Thank you for the quick reply
Hardware is 192.168.0.198
Server is 192.168.0.184

Fix the cert issues. It looks like most of your warnings in the error log is related to that.

Personally, I don’t think it is the certificates that are causing the issue. I get very similar INFO messages as I don’t have my own certificates installed on my test server.

This isn’t necessary when your app, server and devices are all concerted to the same network.

Not sure exactly what this means, but as you’re running your server on a Windows machine, you’ll need to ensure that Windows Defender and any other AV software you are running aren’t blocking port 8080

Pete.

I have windows defender and all my other firewalls turned off to see if it might be blocking port 8080 but it’s still not working

4 years ago I had the same problem.
I never understood why.
I have since fixed the issue by changing port 8080 to 8088
Maybe this can help you.

#http, plain web sockets and plain hardware port
http.port=8088
-----------
char port[] = "8088";
1 Like

Thank you all for the help. Just tried that and forwarded port 8088 still with no luck connecting to the server. I have even tried uninstalling all AV and firewalls to see if there is anything blocking with still no success.

1 Like

Try to use a port scanner to see which ports are opened or closed.
You don’t need to forward the port till you are not outside your house.

As I said earlier, you don’t need to forward these ports unless your hardware is connected to one network and the server to another. Can you clarify that both the server and the same network, and if they are then remove the port forwarding for ports 8080 and 8088, reboot your network and your server and re-try both ports (with a server reboot between changes).

Pete.

Thanks Pete I tried removing the port forwarding 8080 and 8088 with still no success. Both server and hardware are on the same network

When you changed your port on the server did you do it via the web console, or by directly editing the server.properties file?
Changes made via the console are’t saved!

Also, did you stop and start the server, and check the logs to ensure that the new port was being used?

Obviously you need to change your sketch as well, and upload the new code to your device.

Pete.

1 Like

Yes I’ve tried changing the server port in server properties while also in sketch , restarted the server and checked logs and the new port was being used but still stuck at “Connected to WiFi”. Could it be something to do with my modem / router? Im using a coda hitron and i feel like it has heavy security.

If your router has a firewall, you have to enter the administration setup.