I would like to know how to keep running code while using the Blynk dynamic provisioning option

I would like to know how to keep running code while using the Blynk provisioning option. I’m trying to create an online/offline solution for customers who are not going to fiddle around in code to put in ssid and server info but may sometimes have wifi and would like to control their device. All examples I have found for working around and reconnecting do not show anything about the provisioning feature or how to circumvent it in the case of no wifi available. I don’t code on a regular basis but seeing as this is supposed to be “easy” I would expect this feature would be a no brainer as a lot of home automation devices have buttons on them that work even when not connected to wifi and still allow you to provision them later. Am I just looking in the wrong place?

I found this elsewhere in the forum but it seems like a dirty fix:

You can use BLYNK_DISCONNECTED . If you want to run it repeatedly, you could add another state (+ modify state transitions), and run your code there: https://github.com/blynkkk/blynk-library/blob/2b28da0851ffb435a8c5bb825f41dc66ee9d5f92/examples/Export_Demo/Template_ESP8266/BlynkProvisioning.h#L54

I have no issue with using the timer to keep the main loop clean but the timer doesn’t even start if you can’t get past provisioning.

Here is what I would like to do:

If you turn the device on it runs code so that physical buttons and I/O work. If you hold down a button it maybe goes into dynamic provisioning mode to try to connect to a network. If it doesn’t connect after a certain amount of time (ex:2 mins) it exits dynamic provisioning mode and runs the code like normal. Also maybe you can exit dynamic provisioning early mode by holding down the same button again.

@dsap4004,

Would you please read this,

https://help.blynk.cc/publishing-apps-made-with-blynk/dynamic-auth-token-provisioning

I was with you through the second sentence,

That kind of sounds like Blynk dynamic auth token provisioning. As the name implies, “Dynamic auth token provisioning” dynamically assigns devices the SSID, password and an auth token. All of the devices execute the same code. I can’t imagine a “customer” would ever modify code.

However, beyond the second sentence, I was somewhat lost.

Does Blynk dynamic auth token provisioning (as decribed in Pavel’s article) sound like the “Blynk provisioning option” you’re talking about? Or are you talking about something different?

Joe

I’m leveraging Blynk dynamic provisioning, but not in the way you’ve described. Let’s see if someone else will chime in. If not, you and I may need to dig into it a little deeper.

Please repost your code… properly formatted, as required in the Welcome Topic, thank you.

Why, to hard to do? :stuck_out_tongue_winking_eye:

I did it for you this time… but thanks for following the forum rules :wink:

Blynk%20-%20FTFC

Interesting take on how you’ve been treated - two in-depth and knowledgeable responses from @wickedbeernut within a couple of hours of the question being asked translates into…

I’m guessing that you’ve never tried asking a question over at the Arduino forum - you’d still be waiting for your initial post to be moderated!

Would you like me to suspend your account here?

Pete.

No knowledge exchanged hands. He didn’t even understand what I was trying to do. I solved the problem on my own.

In this case I don’t agree, and I’ve been all over this forum reading his responses to many other people’s issues which quickly devolve into people giving up or coming up with their own solutions. If you are saying this place is separate from the support I would get with a paid account then that alleviates my concern about receiving support somewhat. I get the idea of helping out and thankless tasks but that doesn’t mean you get to be a sarcastic snob without it reflecting poorly on the company and community as a whole. As for needing support at all, I was looking for a friendly suggestion so I wouldn’t have to spend all day finding out if the code could actually do what we needed before committing a lot of time and effort into a dead end. That said, I do not wish to contribute my own findings to a forum that largely ignored me and then defended a mod who was obviously reading my post but decided to only respond to community guideline “violations” which amounted to a text formatting error. This is laughable as a defense for acting the way he did and is the same as going around finding his posts and picking apart the grammatical errors and siting the community guidelines that say you have to speak in English. If you don’t understand that then okay but since you said this place is not connected to the paid support I can only hope they are better or that I don’t actually need this forums help in the future.

I beg you to suspend my account. Just prove to me you don’t want my business. Please. It’s not like I’m doing this for a project that already sells over 10 million a year or anything. So please. Go ahead.

Also I have nothing against wicked. He at least tried. I’m talking about Gunner and we both know that.

You seriously think people don’t take note of how they are treated on the forums as how they might be treated by the company as a whole? Sarcastic and ignoring responses from a mod? You are a mod so you can read the whole dialog. You know what happened so don’t come at me with “two in-depth and knowledgeable responses from @wickedbeernut”. He has nothing to do with it and he was as clueless as me.

If this is a commercial project, and your paying your $166 per month to blynk.io then you’re asking your support questions in the wrong place.
This forum is the location for community support of the free app. If you’re trying to do a “try before you buy” test then I’d advise you to discuss your requirements with the guys over at blynk.io

Being a volunteer moderator on this forum is a thankless task, but @Gunner does a great job as far as I’m concerned. It’s a pity you don’t happen to agree.

Pete.

I just wanted to start by making sure I understood what you meant by “Blynk provisioning option”. I’ve hacked the Blynk state machine to handle invalidated dynamically-provisioned auth tokens. I just thought we’d see if others had solved your exact problem. I get the sense there aren’t too many people on the “free side” of Blynk using dynamic auth token provisioning. It has some rather severe limitations at the moment (limitations I’m hoping we’ll be able to overcome with the next major release of Blynk). Of course, I assume just about everyone on the “business side” uses dynamic auth token provisioning. I can’t imagine manufacturers shipping devices with static auth tokens.

It sounds like you got what you were after. Sorry I couldn’t have been of more help.

1 Like

I have a feeling that the Blynk provisioning reference was a bit of a red herring. I think it was really a question about non-blocking Blynk connection options, but then I might be as clueless as you :roll_eyes:

Pete.

I understood the question to be non-blocking connection options with Blynk dynamic auth token provisioning,

void setup(void) {
   BlynkProvisioning.begin();
}

void loop(void) {
   BlynkProvisioning.run();
}
1 Like

I really don’t have a clue, because I’ve never looked at Blynk provisioning, but you’re probably right.
It’s a bit of a moot point now, but it must be annoying for you when you try to help someone out and get a response like this.
Thankfully this type of response falls into the 1% category, otherwise we’d never bother trying to help anyone.

Pete.

1 Like

Wow…lots of angst here I think an anger management forum is what this OP really needed. :stuck_out_tongue:

@dsap4004 firstly, I have no experience with provisioning, never need it, never used it. So all I did was some standard forum moderation. Yours was just one of many I do every single day. So, sorry you didn’t get the personal hand holding experience you seem to crave… I volunteer when, where and how I can, not based on your demands.

Since you “fixed it yourself” we can mark this as solved and closed (different then removed, so sorry, can’t grant your wish there either :wink: )