Notifications ESP32 & Android

I think we need to see your code (correctly formatted of course).


Hi Pete, thank you for your fast replie.

I will post the necessary parts of the code because it is a big project and i´m working in Tabs in Arduino IDE.

void Blynk_TimerEvent()
  if (pinValueV8 == 1) {
    Blynk.virtualWrite(V16, 1); //Schalter Frostwächter Frischwasser
    //Blynk.notify("Yaaay...Wasserpumpe ist an");
    else {
    Blynk.virtualWrite(V16, 0); //Schalter Frostwächter Frischwasser
    //Blynk.notify("Ohhhh...Wasserpumpe ist ausk");

In Setup and Loop Tab there is:

void setup() { 
 Blynk.config(auth, server, port);  // non-blocking, even if no server connection
  timer.setInterval(1000L, Blynk_TimerEvent);
void loop() {;;

Tab for global things

//Globale Variablen
#define BLYNK_PRINT Serial
// defines pins numbers Ultrasonic
const int trigPin = 23;
const int echoPin = 22;

// defines variables Ultrasonic
long duration;
int distance;

//WiFi reconnect variables
int lastConnectionAttempt = millis();
int connectionDelay = 5000; // try to reconnect every 5 seconds

#include <SPI.h>
#include <WiFi.h>
#include <WiFiClient.h>
#include <BlynkSimpleEsp32.h>
#include <TimeLib.h>
#include <WidgetRTC.h>
#include <Wire.h>
#include <Adafruit_INA219.h>
#include "DS3231.h"

char ssid[] = "some";
char pass[] = "hidden";
char auth[] = "stuff";
char server[] = "";  // IP for your Local Server
int port = 8080;
int measurement = 0;
int pinValueV1;
int pinValueV8;

// This is called when Smartphone App is opened
  Serial.println("App Connected.");
// This is called when Smartphone App is closed
  Serial.println("App Disconnected.");

Adafruit_INA219 ina219;

#ifdef __cplusplus
extern "C" {
uint8_t temprature_sens_read();
#ifdef __cplusplus
uint8_t temprature_sens_read();

BlynkTimer timer;
WidgetRTC rtc;

  // Synchronize time on connection

not sure if it is the cause of the issue, but you are sending a virtual write command and a notification every second.

Maybe add a flag so they are only sent if pinValueV8 changes. It may not be such an issue with the virtual write command, but maybe with the notification.

Do you have the disconnection issue with the notification commented out?

Yes you are right, i will add a flag for the notification. I have no issues when commenting out the notification.

Edit: I didn´t added a flag. I changed the code and added it in my write Tab so it will do it only if i change the state of the button.

// This function will be called every time a Widget or Button
// in Blynk app writes values to the Virtual Pin
  pinValueV1 = param.asInt(); // assigning incoming value from pin V1 to a variable

  // process received value
  pinValueV8 = param.asInt(); // assigning incoming value from pin V8 to a variable

  // process received value

    if (pinValueV8 == 1) {
    Blynk.virtualWrite(V16, 1); //Schalter Frostwächter Frischwasser
    Blynk.notify("Yaaay...Wasserpumpe ist an");
    else {
    Blynk.virtualWrite(V16, 0); //Schalter Frostwächter Frischwasser
    Blynk.notify("Ohhhh...Wasserpumpe ist aus");

Same issue

Have you checked your server logs?
Messaging uses the GCM - service. If you see any log entries about this then that will be a clue about your issue.


My logs seems crazy. With ls -l in home/Blynk/logs the changedate of the logfile is one month ago? In these logfiles are no entrys with GCM. Are these the correct logfiles?

In logs is blynk.log, postgres.log, stats.log, worker.log

More info here:


Very strange things happen. In my i changed log Level to debug but there are no new logs created. I also tried different log Locations. Also my attached RTC to the Pi had a time drift this morning for about 3hours. Now the RTC is still available with i2detect but i cant read or write the time anymore.

I will Setup the Pi new this Weekend and i will inform you of the result when i finished. Hopefully the notifications will work then.

I tried alot in the past but didn´t managed it. I think notifications won´t work on local server without internet connection or?

Also i found out that there will be no log files created when i start the server automatically on reboot with following entry in /etc/rc.local:

java -jar /home/pi/Blynk/server-0.41.11-java8.jar -dataFolder /home/pi/Blynk -serverConfig /home/pi/Blynk/ -mailConfig /home/pi/Blynk/ &

Logfile blynk.log:

01:08:41.405 INFO - Using data dir '/home/pi/Blynk'
01:08:41.911 DEBUG- Starting reading user DB.
01:08:49.293 DEBUG- Reading user DB finished.
01:08:49.296 INFO - Region : local. Host :
01:08:54.697 INFO - Initializing gmail smtp mail transport. Username : SMTP host :
01:08:55.045 INFO - Reports : 0
01:08:55.084 INFO - Didn't find Let's Encrypt certificates.
01:08:55.086 WARN - You didn't specified '' or '' properties in file. Automatic certificate generation is turned off. Please specify above properties for automatic certificates retrieval.
01:08:55.088 WARN - ATTENTION. Server certificate paths (cert : '/home/pi/./server.crt', key : '/home/pi/./server.pem') not valid. Using embedded server certs and one way ssl. This is not secure. Please replace it with your own certs.
01:09:28.928 DEBUG- hard.socket.idle.timeout = 10
01:09:29.531 INFO - HTTP API and WebSockets server listening at 8080 port.
01:09:29.545 INFO - HTTPS API, WebSockets and Admin page server listening at 9443 port.
01:09:29.550 INFO - Mqtt hardware server listening at 8440 port.
01:09:32.393 DEBUG- completeLogin. [id: 0x9d025e49, L:/ - R:/]
01:09:32.484 INFO - hardware joined.
01:09:33.176 DEBUG- Re registering app channel. [id: 0xde0f5608, L:/ - R:/]
01:09:33.244 INFO - Blynk-app (android-22710) joined.
01:09:35.737 DEBUG- Aborting Future NettyResponseFuture{currentRetry=0,
	future=java.util.concurrent.CompletableFuture@8bcfea[Not completed],

01:09:35.738 DEBUG- unknown error unknown error
	at Method) ~[?:1.8.0_65]
	at$2.lookupAllHostAddr( ~[?:1.8.0_65]
	at ~[?:1.8.0_65]
	at ~[?:1.8.0_65]
	at ~[?:1.8.0_65]
	at ~[?:1.8.0_65]
	at io.netty.util.internal.SocketUtils$ ~[server-0.41.11-java8.jar:?]
	at io.netty.util.internal.SocketUtils$ ~[server-0.41.11-java8.jar:?]
	at Method) ~[?:1.8.0_65]
	at io.netty.util.internal.SocketUtils.allAddressesByName( ~[server-0.41.11-java8.jar:?]
	at io.netty.resolver.DefaultNameResolver.doResolveAll( ~[server-0.41.11-java8.jar:?]
	at io.netty.resolver.SimpleNameResolver.resolveAll( ~[server-0.41.11-java8.jar:?]
	at io.netty.resolver.SimpleNameResolver.resolveAll( ~[server-0.41.11-java8.jar:?]
	at org.asynchttpclient.resolver.RequestHostnameResolver.resolve( ~[server-0.41.11-java8.jar:?]
	at org.asynchttpclient.netty.request.NettyRequestSender.resolveAddresses( ~[server-0.41.11-java8.jar:?]
	at org.asynchttpclient.netty.request.NettyRequestSender.sendRequestWithNewChannel( ~[server-0.41.11-java8.jar:?]
	at org.asynchttpclient.netty.request.NettyRequestSender.sendRequestWithCertainForceConnect( ~[server-0.41.11-java8.jar:?]
	at org.asynchttpclient.netty.request.NettyRequestSender.sendRequest( ~[server-0.41.11-java8.jar:?]
	at org.asynchttpclient.DefaultAsyncHttpClient.execute( ~[server-0.41.11-java8.jar:?]
	at org.asynchttpclient.DefaultAsyncHttpClient.executeRequest( ~[server-0.41.11-java8.jar:?]
	at org.asynchttpclient.BoundRequestBuilder.execute( ~[server-0.41.11-java8.jar:?]
	at cc.blynk.server.notifications.push.GCMWrapper.send( ~[server-0.41.11-java8.jar:?]
	at cc.blynk.server.core.model.widgets.notifications.Notification.push( ~[server-0.41.11-java8.jar:?]
	at cc.blynk.server.hardware.handlers.hardware.logic.PushLogic.messageReceived( ~[server-0.41.11-java8.jar:?]
	at cc.blynk.server.hardware.handlers.hardware.HardwareHandler.messageReceived( ~[server-0.41.11-java8.jar:?]
	at cc.blynk.server.hardware.handlers.hardware.HardwareHandler.messageReceived( ~[server-0.41.11-java8.jar:?]
	at cc.blynk.server.common.BaseSimpleChannelInboundHandler.channelRead( ~[server-0.41.11-java8.jar:?]
	at ~[server-0.41.11-java8.jar:?]
	at ~[server-0.41.11-java8.jar:?]
	at ~[server-0.41.11-java8.jar:?]
	at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead( ~[server-0.41.11-java8.jar:?]
	at io.netty.handler.codec.ByteToMessageDecoder.channelRead( ~[server-0.41.11-java8.jar:?]
	at ~[server-0.41.11-java8.jar:?]
	at ~[server-0.41.11-java8.jar:?]
	at ~[server-0.41.11-java8.jar:?]
	at io.netty.handler.timeout.IdleStateHandler.channelRead( ~[server-0.41.11-java8.jar:?]
	at ~[server-0.41.11-java8.jar:?]
	at ~[server-0.41.11-java8.jar:?]
	at ~[server-0.41.11-java8.jar:?]
	at$HeadContext.channelRead( ~[server-0.41.11-java8.jar:?]
	at ~[server-0.41.11-java8.jar:?]
	at ~[server-0.41.11-java8.jar:?]
	at ~[server-0.41.11-java8.jar:?]
	at$ ~[server-0.41.11-java8.jar:?]
	at ~[server-0.41.11-java8.jar:?]
	at ~[server-0.41.11-java8.jar:?]
	at ~[server-0.41.11-java8.jar:?]
	at ~[server-0.41.11-java8.jar:?]
	at io.netty.util.concurrent.SingleThreadEventExecutor$ ~[server-0.41.11-java8.jar:?]
	at io.netty.util.internal.ThreadExecutorMap$ ~[server-0.41.11-java8.jar:?]
	at ~[server-0.41.11-java8.jar:?]
	at [?:1.8.0_65]
01:09:35.741 ERROR- Error sending push. Reason unknown error
01:09:36.649 DEBUG- Re registering app channel. [id: 0x69886736, L:/ - R:/]
01:09:36.659 INFO - Blynk-app (android-22710) joined.



But only push notifications can’t be done without Internet connection.

According to following site, notifications should be possible:

Blynk uses the GCM service for the notification widget, both on Android and iOS. GCM requires internet access for it to work.


This information should be added to the blynk docs. Not everybody is confirm with the Google Cloud Messaging or knows how push notifications works in general.

Maybe Blynk is able to use normal notifications in the future?! Is it possible to generate a request?

Blynk is an IoT system, and as such it expected that it will be connected to the Internet.
Yes, some people use a local server in a closed environment, but in that situation it should be expected that some functionality will dork differently, or not at all.

I don’t think that there is a messaging system that will work with both Android and iOS which will meet your needs, but if you are aware of one then you could submit your idea here:

You should be aware that the developers are currently working hard on Blynk V2, and (at least in the initial release) this will be 100% cloud based. The option to install a local server version may follow later (or not).


I have the same problem on my own blynk server. It is connected to internet and everything works just fine except for the notifications. If i send a notification [Blynk.notify(“TEST”);] i don’t receive anything on my pixel 4a Android phone.
The Blynk version is v0.41.16.
Any ideas?
Thanks in advance

What Blynk library version are you using?

Pete. beta3 I can give the released version 0.6.1 a try?

Notifications don’t work with the 1.0.0-Beta-x versions of the library. You should be using 0.6.1


Thank you very much!
That was the problem. I changed to 0.6.1 and it is working now…
Should have posted this earlier, spend a lot of time trying to fix this. :see_no_evil:
Is that documented? I could not find anything about that on the internet.

Covered many times, you just need to do a quick search…


1 Like