Chat freely about anything...

User avatar
By lucasromeiro
#82016 Hello!

I am developing a system that needs to connect using WPS.
(Yes, I know WPS is not necessarily secure. But that's not the point.)
I've read that ESP8266 can do that, I've already done some testing.
But I could not access the Password so I can save.
I only had access to the SSID.
When I am connected by WPS and request the password, it always returns blank.

Can someone tell me how I can access the password?

I need to save to recover at certain times.

Thank you everyone's attention.
User avatar
By jankop
#82037 I use WPS quite often and absolutely without problems

Code: Select allvoid setup() {
  Serial.begin(9600);
  WiFi.begin(); 
...
}
void loop() {
  ...
}
/* Service Wi-Fi Protected Setup with Push Button Configuration */
void StartWpsWaiting(void) {
  WiFi.persistent(false);
  WiFi.mode(WIFI_STA);
  bool    RafHo = false;
  String  HowDelka = "";
  /* Wait for access point WPS */
  do {
    RafHo = WiFi.beginWPSConfig();
    HowDelka = WiFi.SSID();
  }
  while (RafHo == false || HowDelka.length() == 0);
//Serial.println (WiFi.SSID());
//Serial.println (WiFi.psk());
  delay(500);
  ESP.restart();
}


http://esp8266.fancon.cz/esp8266-web-barometer-arduino/esp8266-bmp280-barometer-thermometer.html
User avatar
By lucasromeiro
#82039
jankop wrote:I use WPS quite often and absolutely without problems

Code: Select allvoid setup() {
  Serial.begin(9600);
  WiFi.begin(); 
...
}
void loop() {
  ...
}
/* Service Wi-Fi Protected Setup with Push Button Configuration */
void StartWpsWaiting(void) {
  WiFi.persistent(false);
  WiFi.mode(WIFI_STA);
  bool    RafHo = false;
  String  HowDelka = "";
  /* Wait for access point WPS */
  do {
    RafHo = WiFi.beginWPSConfig();
    HowDelka = WiFi.SSID();
  }
  while (RafHo == false || HowDelka.length() == 0);
//Serial.println (WiFi.SSID());
//Serial.println (WiFi.psk());
  delay(500);
  ESP.restart();
}


http://esp8266.fancon.cz/esp8266-web-barometer-arduino/esp8266-bmp280-barometer-thermometer.html


Cool, I'll take a look!
Do these lines work?
For me the password command always returns blank.

Serial.println (WiFi.psk());