Scan wifi networks and connect it

It is posible to scan wifi networks and connect the device chosing the Wifi network and introducing password from the App?
For example, I would like to a create a Domotic System for end users, with a esp8266 and Blynk App, but find the way to scan and introduce password from App, which is easier for end users without programing knowlege.

Yes the normal way is with WiFiManager.

The normal way is Blynk Provisioning :slight_smile: . You can find it in Blynk myPlant Demo App. But this is only for paid customers.

1 Like

Hi Dmitriy, is posible to create an own Blynk app for commercial purpose? For example now I have a domotic project wich is controlled by Blynk, through Blynk Server… If I want to sell my project which is the cost and the benefits of using Blynk app for commercial purpose??

The Blynk For Business link at the top of this page… takes you to

1 Like

yes and I’m doing it with my code.
if you study into Blynk.begin(), you’ve found that it call
config() and connectWiFi();
I have updated my sketch, instead calling Blynk.begin(), then you call
Blynk.config (auth);
//scan your wifi
//make a code of SSID selection
Blynk.connectWiFI (ssid, pass);
wait approx 30 sec for blynk to connect and done.
other parts of the code are remain the same.

or you can study this code


Thanks! I was watching Embedis and I found that it works with serial monitor, there is any way to use for example web browser instead of serial monitor? Cause I am thinking in the “end user” who have not any knowlegde about Arduino, programming or Blynk.

@alvaroaguero55 here is showed process of what you are asking of in commercial apps.

Great! But Can I use another devide instead of Sparkfun? For example esp8266 nodemcu? In that case which will be the code of generate the QR to my customers?

Yes. -

I’m using ESP8266 with Softserial to UNO, so I cannot give you the code of node MCU but I can give you the idea.
If you see, Blynk use Blynk.bigin (auth, ssid, pass) to initialize the connection.
All we have to do is split Blynk.being() into WiFI manager part and Blynk connection part. Here how I have done.

//Original sketch
// Blynk.begin (auth, ssid, pass);

// modify sketch
##include <SoftwareSerial.h
#include <BlynkSimpleShieldEsp8266.h

SoftwareSerial EspSerial(3, 2); // RX, TX
ESP8266 wifi(&EspSerial);

Blynk.config(wifi, auth);

// Process any wifi code here, e.g. Wifi config to get the correct ssid, pass
String APlist = wifi.getAPList ();
Serial.print (“AP List:”);
Serial.println (APlist);

GetwifiInfo (&ssid, &pass);

Blynk.connectWiFi (ssid, pass); // connect to wifi network
String resulttext = wifi.getLocalIP();
if (resulttext .startsWith("+CIFSR:STAIP,")) { // wifi connect success
Serial.print ("Connected to ");
Serial.println (ssid);
while(Blynk.connect() != true) {} // Blynk.connect() has time-out handling
if (Blynk.connected()) {
Serial.println (“Blynk connected.”);

hope this help

1 Like