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

Can´t connect with device on android Blynk IoT App

Hello, friends.
I´m facing problems when trying to add new device through android app.
I can connect my phone to device in settings/wifi but Blynk app can´t find the device.
With Iphone App i can do it smoothly, selecting “already connected”. With Android App the steps are different and even with device connected to the phone the app can´t complete the provisioning.
Motorola Edge Plus - Android 11
Any idea of what´s going on?

What do you see in your serial monitor during the provisioning process?

Pete.

Hi, Pete.

16:49:16.850 → [2748] AP SSID: Level Meter-3D34A
16:49:16.850 → [2749] AP IP: 192.168.4.1
16:49:16.850 → [2750] AP URL: blynk.setup
16:49:27.112 → [12981] WAIT_CONFIG => CONFIGURING
16:49:42.573 → E (28618) wifi: esf_buf: t=3 l=28 max:32, alloc:32 no eb, TXQ_BLOCK=0
16:49:53.952 → E (39971) wifi: esf_buf: t=3 l=28 max:32, alloc:32 no eb, TXQ_BLOCK=0
16:49:53.952 → E (39974) wifi: esf_buf: t=3 l=28 max:32, alloc:32 no eb, TXQ_BLOCK=0
16:49:58.619 → E (44645) wifi: esf_buf: t=3 l=28 max:32, alloc:32 no eb, TXQ_BLOCK=4000
16:49:58.619 → E (44648) wifi: esf_buf: t=3 l=28 max:32, alloc:32 no eb, TXQ_BLOCK=0
Thanks.

Can you send logs from the app? To send logs: open navigation menu on main app’s screen, select About option, tap Send logs button

Which version of Blynk library are you using?

I am also facing the same problem, even manually I am unable to connect to wifi of esp8266 and it shows can’t connect to this network, :frowning:

@rahul_1 I’d suggest that you start a new topic and provide all of the appropriate information rather than hijacking someone else’s topic.

Pete.

2 Likes

I am really sorry about that sir!

Hello, @BlynkAndroidDev .
See bellow part of the log from Android phone.

y4.a.m:1
d9.b.A:2
com.blynk.android.communication.CommunicationService.E:2
com.blynk.android.communication.CommunicationService.onDestroy:2
android.app.ActivityThread.handleStopService:4428
android.app.ActivityThread.access$2000:250
android.app.ActivityThread$H.handleMessage:2016
android.os.Handler.dispatchMessage:106
android.os.Looper.loop:250
android.app.ActivityThread.main:7766
java.lang.reflect.Method.invoke:-2
com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run:592
com.android.internal.os.ZygoteInit.main:958
16:19:53 DEBUG WebSocketTransport - stop
16:19:53 INFO WebSocketExecutor - onStateChanged: newState = CLOSING
16:19:53 DEBUG WebSocketExecutor - onBinaryMessage
16:19:53 INFO WebSocketExecutor - onStateChanged: newState = CLOSED
16:19:53 INFO WebSocketExecutor - onDisconnected: clientCloseFrame = WebSocketFrame(FIN=1,RSV1=0,RSV2=0,RSV3=0,Opcode=CLOSE,Length=2,CloseCode=1000,Reason=null), closedByServer = false
16:19:53 WARN WebSocketExecutor - stopThreadPool
java.lang.InterruptedException: null
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2095)
at java.util.concurrent.ThreadPoolExecutor.awaitTermination(ThreadPoolExecutor.java:1486)
at e9.c.H(WebSocketExecutor.java:2)
at e9.c.y(WebSocketExecutor.java:2)
at com.neovisionaries.ws.client.r.h(ListenerManager.java:2)
at com.neovisionaries.ws.client.l0.j(WebSocket.java:11)
at com.neovisionaries.ws.client.l0.D(WebSocket.java:1)
at com.neovisionaries.ws.client.l0.B(WebSocket.java:7)
at com.neovisionaries.ws.client.c0.G(ReadingThread.java:1)
at com.neovisionaries.ws.client.c0.b(ReadingThread.java:7)
at com.neovisionaries.ws.client.t0.run(WebSocketThread.java:3)
16:19:53 DEBUG WebSocketExecutor - write end

Thanks

Hi, @BlynkAndroidDev .
Revising the log .txt file i found those lines

16:13:15 DEBUG ProvisioningService - connectByPrefix: prefix=Blynk
16:13:15 DEBUG P.Android10orLaterConnector - connectByPrefix: prefix=Blynk connectivityManager=android.net.ConnectivityManager@ff10a8f
16:13:15 DEBUG WebSocketExecutor - onBinaryMessage
16:13:15 DEBUG CommunicationService.ServerBinder - removeOnServerResponseListener: clazz=EnhancedWiFiProvisioningActivity
16:13:15 DEBUG ProvisioningService - pause
16:13:15 DEBUG P.Android10orLaterConnector - pause

Regarding the app interface, I saw intructions pointig to devide SSID as “Blynk_XXXX”.
Maybe the Android app is waiting for this prefix to recognize device. In Iphone app is different. Does not appear this type of instruction and device connects easily.

Please attach your sketch, also please provide your library version. All devices that boybk app will connect too should start with Blynk, if your hardware has not such said, it means you had wrong set up in sketch,bor wrong library version

Hi.
I revised my code and found the issue at ConfigMode.h.

  const uint64_t chipId = ESP.getEfuseMac();
  uint32_t unique = 0;
  for (int i=0; i<4; i++) {
    unique = BlynkCRC32(&chipId, sizeof(chipId), unique);
  }
  unique &= 0xFFFFF;

  if (withPrefix) {
    snprintf(buff, len, "Blynk %s-%05X", BLYNK_DEVICE_NAME, unique);
  } else {
    snprintf(buff, len, "%s-%05X", BLYNK_DEVICE_NAME, unique);
  }
} 

I had deleted “Blynk” prefix in my code and the Iphone app was running ok.
Seems that in Android must keep the prefix.
I tried here and finally can find the device with Android phone.
I would like to suggest remove this prefix, so we can work just with Device Name.
Thanks.

@BuildInnovation no, we would not remove the prefix - it allows the fastest and easy scan during provisioning on the latest Android and iOs versions.

Still, it seems you have the wrong set-up in your sketch, @vshymanskyy please advise here.

@BuildInnovation please provide you sketch imports/defines part and version of the library you are using.

Ok, @BlynkAndroidDev.
Here is the part of the sketch you asked:

#define BLYNK_HEARTBEAT 30
#define BLYNK_TIMEOUT_MS 10000UL
#define BLYNK_PRINT Serial

#define BLYNK_TEMPLATE_ID "TMPL04st1jNQ"
#define BLYNK_DEVICE_NAME "Level Meter"
#define BLYNK_FIRMWARE_VERSION        "0.2.0" 

#define APP_DEBUG

#include "BlynkEdgent.h"
#include <esp_task_wdt.h>
#include <SoftwareSerial.h>

Library version is 1.0.1.
The only part I changed from the Edgente_Esp32 example in Arduino IDE was the prefix.
Returning with “Blynk” prefix it works for Android app provisioning.
My project is running smoothly now but @vshymanskyy eyes is always welcome.

Thanks again.

1 Like

Thanks, everything looks correct. So the issue’s cause has been the prefix removal.

The prefix is there for a good reason :wink:

But it seems that the iOS app isn’t fussy about the prefix…

Pete.

Thanks, guys.

Starting from Android 10 applications can’t request connection to hardware Wi-Fi in the same way as before, that’s why this prefix is a requirement now as it simplifies the process of Wi-Fi scan (without requesting locations permissions) and of connection to a selected point, both of which are now done on the system side, and not by Blynk app.

We have also an option for manual connection in Android app, but we do not show it straightforward, only when we received a system response that something wen wrong with the scan, or when there has been an issue later (after successful connection to the hardware Wi-Fi). Sometimes with some manufacturers devices there are strange delays before notifying the app that system has not been able to find any Wi-Fi points by the prefix, so this manual scan option is visible later than system ‘nothing found’ alert.

My nodemcu have a wireless adresa like ESP-1234, i dont change nothing from blynk_edgent esp8266 exemple. Can You help me ?