Wifi Provissioning

Hi,

I have a pro account, and I prepared a simple sketch to try the wifi provissioning for a “test” customer.

I’m using a ESP8266 NodeMCU Dev. Kit

// Fill-in information from your Blynk Template here
#define BLYNK_TEMPLATE_ID "TMPLcY2fe6tO"
#define BLYNK_DEVICE_NAME "test simple"

#define BLYNK_FIRMWARE_VERSION        "0.1.0"

#define BLYNK_PRINT Serial
//#define BLYNK_DEBUG

#define APP_DEBUG

// Uncomment your board, or configure a custom board in Settings.h
//#define USE_SPARKFUN_BLYNK_BOARD
#define USE_NODE_MCU_BOARD
//#define USE_WITTY_CLOUD_BOARD
//#define USE_WEMOS_D1_MINI

#include "BlynkEdgent.h"

BLYNK_WRITE(V0) // Lee Slider y lo envía a Serial
{
  
  Serial.println(param.asInt());

}

void setup()
{
  Serial.begin(115200);
  delay(100);

  BlynkEdgent.begin();
}

void loop() {
  BlynkEdgent.run();
  Blynk.run();
}

I uploaded with IDE to the ESP8266, and I invited to the test customer to my organization as USER role.

This user received the invitation to BLYNK console, created the password, already installed the BLYNK IoT app (the new one) and was welcomed to the organization.

When clicked on NEW DEVICE on the app, Two options appeared:

Connect to Wi-Fi
and
Scan QR-code

selected Connect to Wi-Fi

But it shows the message: You don´t have permissions, Contact Admin.

Then, the wifi provissioning wasn’t done. What I missed on the process?

Are you trying to add a new device using the user account ?

By default, the User role doesn’t have permissions to view or control devices, or to provision them.
Have you edited the User role permissions?

Also, have you created a sub-organisation for this user, if you want to segregate device control?

Pete.

1 Like

Hi Pete,

I don’t find any way to edit the user Role Permissions on the Organization Tab.

Where I can add permission to the User role?

Go to settings / roles and permissions

Thanks Jhon93,

I found the Roles and Permissions tab, but it’s a little bit confussing.

If want a User (customer) just to provissioning a new device(s) purchased, using them, and control them trough the mobile app. I believe these are the right permissions, Are you agree?

Will it’s up to you, you can enable or disable any permission as you wish.

It’s looks like isn’t so easy: I’m admin, and when I try to apply the new permissions, it shows me the following message:

You can’t set higher permissions than your current role

I tried to unchek all the new permission I granted, but the same message appear.

If you try to enable an option for a user that is disabled for you (such as View Device Actions Log in your screenshot) then you will get that message.

Pete.

Ok, When I unchecked Apply changes tu sub-organizations It allowed me to apply the new permision to the test User.

The mobile app detected the device and started the comissioning process but it couldn’t connect to the server.

I’ll hide some confidential data:

[390] Using default config.

>[390] 
    ___  __          __
   / _ )/ /_ _____  / /__
  / _  / / // / _ \/  '_/
 /____/_/\_, /_//_/_/\_\
        /___/ v1.0.1 on ESP8266

[394] --------------------------
[397] Product:  test simple
[400] Firmware: 0.1.0 (build Nov 19 2021 12:08:43)
[404] Device:   ESP8266 @ 80MHz
[407] MAC:      E8:DB:84:9B:B1:32
[410] Flash:    4096K
[412] ESP core: 3.0.2
[414] ESP SDK:  2.2.2-dev(38a443e)
[417] Boot Ver: 6
[419] Boot Mode:1
[420] FW info:  467968/1626112, MD5:9680075a3e96d5bbaca957b85846e523
[628] Free mem: 31272
[628] --------------------------
[628] INIT => WAIT_CONFIG
[1238] AP SSID: Blynk test simple-B7689
[1239] AP IP:   192.168.4.1
[1239] AP URL:  blynk.setup
[6867386] WAIT_CONFIG => CONFIGURING
[6871320] Sending board info...
[6879850] Scanning networks...
[6882039] Found networks: 17
[6904659] Applying configuration...
[6904659] WiFi SSID: BOGOTA1 Pass: diver1979XXXX
[6904660] Blynk cloud: O166KEvWGaYFw7Bx5Nwg2ViIkCqxxxxx @ blynk.cloud:443
[6904664] CONFIGURING => SWITCH_TO_STA

And the phone displayed:

Any ideas?

Just for the record, I found wath was the problem for the final connection to the server.

I deleted the Blynk.run(); statement on the loop, leaving just the BlynkEdgent.run(); and it worked right as was supposed:

Great!