Is it possible to add WIFI-name and password from Blynk app to hardware?

Hi,

I really dont know is this possible, so i thought to ask from you. So is it possible to add WIFI-name and password from Blynk app to the hardware?

If i add Wifi-settings with “text input”-widget?

Thanks for your answer.

,Tomi

In theory, it would be possible to take that data, write it into EEPROM or SPIFFS memory, retrieve it at the next boot-up of the device and use it as your Wi-Fi login credentials.
I’ve never seen it done, and it has a few drawbacks that make it impractical…

To connect to the device using Blynk, so you can enter these credentials, it needs to have already connected to your Wi-Fi network. So, you have a bit of a ‘chicken and egg’ situation going off. It can’t connect without the credentials, and it can’t be given the credentials without connecting.

Secondly, if you had a device that was already connected to Wi-Fi and Blynk, but you wanted to change the Wi-Fi credentials that it used next time it stared up then entered the wrong credentials would make the device totally inaccessible (without re-flashing the device with a new sketch)

A far better solution is to use Wi-Fi Manager as a way of entering the Wi-Fi credentials (and Blynk auth code if you wish) via a web portal.

If you’ve not heard of Wi-Fi Manager then do a quick search of this forum, and of the internet if you want non Blynk-specific information on it.

Pete.

Thanks. I haven´t heard about it. Have to do some research about this WIFI-manager. So that is one option how to do it i guess… Is other possible option to add some “screen” to my hardware, which includes some buttons, so i can type my WIFI-settings that way on hardware side?

Or does it loose these settings i´ve typed immeaditely when I turn the power off. So I need to type these settings everytime I turn the “machine” on?

,Tomi

It sounds to me like you’re making this far to complicated. Wi-Fi manager is a tried and tested solution which works well, however, not many people really need these facilities anyway.

You only need this if you’re regularly taking your device to places where the SSID and password are different from the ones that you hard-coded into your sketch. If you’re taking a device to two or three different places where you know the Wi-Fi details in advance then it’s fairly simple to hard-code all of these into your device and have it try each one in turn.

The real advantage of Wi-Fi manager and other similar provisioning solutions is where you send devices to other people and you want them to have the facility to connect to their own Wi-Fi system without you having to flash new code to the device.

If this is just for home use and you’re trying to accommodate a situation where your Wi-Fi details might change in future then it’s probably best top re-flash the device if this happens. Using OTA updates makes this very simple, you don’t even have to be able to touch your device to do it.

Maybe if you shared more information about what you’re actually trying to achieve, and the hardware that you’re using, we might be able to help more.

Pete.

Thanks again. Yes I read about that manager. It seems to absolutely the best choice for this situation. I´ve made an Full automated hydroponic watering system and would be really nice to make these more, cause people are interested. But changing the code with every new device is really hard way to do this. So Wi-Fi-manager could help indeed.

This “machine” of mine is based to 2 NodeMCU´s. NAME and PASS are these same, but I need 2 diffrent Blynk auth codes to make this work. I guess I need to Modify this Wi-Fi-manager-site a little. Or could there be some other way? Anyway I would like using these configurations to be as simple as possible.

,Tomi

Sounds to me like you’re after Dynamic Auth Token Provisioning. Refer to this example. You enter the wi-fi name (SSID) and password from the Blynk app exactly as you’ve described. A unique auth token is dynamically assigned to each device. All of the information is stored in EEPROM and, consequently, persists across resets.

Last time I checked, dynamic auth token provisioning doesn’t support the Bridge Widget. Not sure if you’re using the Bridge Widget with your two NodeMCU’s, but be aware of this restriction.

And I assume you’re not profiting from your fully-automated hydroponic watering system. If you are, read https://blynk.io/pricing.

3 Likes

Big thanks again. Yes sounds like this is what i need now. I don´t use/need that Bridge with this device, if it still doesn´t work with dynamic auth. And of course im not profiting from making couple of these devices for my friends. Just helping them cause I have a chance.

,Tomi