[GH-ISSUE #756] Init SSID & password #633

Closed
opened 2026-02-28 01:26:18 +03:00 by kerem · 4 comments
Owner

Originally created by @dontsovcmc on GitHub (Oct 18, 2018).
Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/756

Sorry if this question for ESP8266Wifi library, but maybe smbd can helps me:

I need to initialise SSID and password when first turn on firmware. I try to read configuration from EEPROM and see nothing - I want to fill SSID & password that time.

As I see this is 'wifi_station_set_config' function in user_interface.h arduinoespressif8266 framework..

It helps to test devices faster. Thanks a lot!

Originally created by @dontsovcmc on GitHub (Oct 18, 2018). Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/756 Sorry if this question for ESP8266Wifi library, but maybe smbd can helps me: I need to initialise SSID and password when first turn on firmware. I try to read configuration from EEPROM and see nothing - I want to fill SSID & password that time. As I see this is 'wifi_station_set_config' function in user_interface.h arduinoespressif8266 framework.. It helps to test devices faster. Thanks a lot!
kerem 2026-02-28 01:26:18 +03:00
  • closed this issue
  • added the
    Question
    label
Author
Owner

@tablatronix commented on GitHub (Oct 18, 2018):

Initialize for real, or to a var, or input?
Begin(ssid,pass) is all you gotta do. There might be a build flag, but I do not recall seeing one.

If you want to write directly to flash , I guess thats an option too but not easy.

<!-- gh-comment-id:431196469 --> @tablatronix commented on GitHub (Oct 18, 2018): Initialize for real, or to a var, or input? Begin(ssid,pass) is all you gotta do. There might be a build flag, but I do not recall seeing one. If you want to write directly to flash , I guess thats an option too but not easy.
Author
Owner

@dontsovcmc commented on GitHub (Oct 19, 2018):

Yes, write to flash.
first turn on:
ESP read ssid & password and connect to wifi.
I don"t want to turn on ConfigPortal for write default settings.

<!-- gh-comment-id:431283388 --> @dontsovcmc commented on GitHub (Oct 19, 2018): Yes, write to flash. first turn on: ESP read ssid & password and connect to wifi. I don"t want to turn on ConfigPortal for write default settings.
Author
Owner

@tablatronix commented on GitHub (Oct 19, 2018):

That is what begin(ssid,pass) does by default

<!-- gh-comment-id:431350999 --> @tablatronix commented on GitHub (Oct 19, 2018): That is what begin(ssid,pass) does by default
Author
Owner

@dontsovcmc commented on GitHub (Nov 9, 2018):

In my task, I initialise settings and run. So I think that call:
WiFi.begin(VALUE(SSID_NAME), VALUE(SSID_PASS), 0, NULL, false);
before WiFi.begin(); is better than WiFi.begin(VALUE(SSID_NAME), VALUE(SSID_PASS));

VALUE macro to convert compile definition variable value to string:

#define VALUE_TO_STRING(x) #x
#define VALUE(x) VALUE_TO_STRING(x)
#define VAR_NAME_VALUE(var) #var "="  VALUE(var)

platfomio.ini piece:

src_build_flags = -D SSID_NAME=wifi-name
                  -D SSID_PASS=wifi-pass
<!-- gh-comment-id:437359955 --> @dontsovcmc commented on GitHub (Nov 9, 2018): In my task, I initialise settings and run. So I think that call: `WiFi.begin(VALUE(SSID_NAME), VALUE(SSID_PASS), 0, NULL, false);` before` WiFi.begin();` is better than `WiFi.begin(VALUE(SSID_NAME), VALUE(SSID_PASS));` VALUE macro to convert compile definition variable value to string: ``` #define VALUE_TO_STRING(x) #x #define VALUE(x) VALUE_TO_STRING(x) #define VAR_NAME_VALUE(var) #var "=" VALUE(var) ``` platfomio.ini piece: ``` src_build_flags = -D SSID_NAME=wifi-name -D SSID_PASS=wifi-pass ```
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/WiFiManager#633
No description provided.