Your new topic does not fit any of the above??? Check first. Then post here. Thanks.

Moderator: igrr

User avatar
By martinayotte
#30825 I understand you confusion now. Some picture named the RST pin as GPIO16, but to my knowledge it is not true. In fact on some other ESPs, there are solder pads to link GPIO16 of the chip to EXT_RST to be able to wakeup from deep-sleep. So, the schematic here, there is an X on the XPD_DCDC (which is the GPIO16) because the pads are unsoldered by default.
Image
And here, on the picture, we can see that some people did the same on ESP-01 because there are no pads for the same feature.
Image
In my sketch, I was using GPIO16 by pure coincidence, because in fact I'm using ESP-12E, so plenty of GPIOs.
Try again using GPIO2 like you've done before but with my sketch updated accordingly.
User avatar
By derek bernsen
#30826
derek bernsen wrote:I am positive that I have a ESP-01 here. On the pinout diagram I am using, it refers to the RST pin as "GPIO16".
Wait...should I be using a different pin?


I'm assuming that you (martinayotte) are saying that I shouldn't be using RST aka GPIO16 because I'm using a ESP-01?
Please clarify that.
I tried again with this code switched to pin 2 instead of pin 16 plus switched the initial digitalWrite to HIGH, as well as the looping digitalWrites are now switched, and now it works for the connection perfectly, but not to disconnected from my phone. I found out that the hotspot never starts up with that code UNLESS GPIO0 is left unconnected to anything whatsoever. GPIO2 AKA pin 2 is connected to LED then resistor, then to 3.3v power supply (see code below)
Code: Select all[code]

#include <ESP8266WiFi.h>
#include <WiFiClient.h>
#include <ESP8266WebServer.h>
extern "C" {
#include "user_interface.h"
}
#define WIFI_MODE_AP

/* Set these to your desired credentials. */
const char *ssid = "MyESPAP";
const char *password = "MyPassword";
//Reference station counter as "devices"
unsigned char devices;
// boolean ledState = false;
int alreadyBlinked = 0;
unsigned int prevMillis = 0;

ESP8266WebServer server(80);

void handleRoot() {

}

void setup() {
  delay(1000);
  Serial.begin(115200);
  Serial.println();
  pinMode(2, OUTPUT);
  digitalWrite(2, HIGH);
  WiFi.softAP(ssid, password);

  IPAddress myIP = WiFi.softAPIP();
  Serial.print("AP IP address: ");
  Serial.println(myIP);
  server.on("/", handleRoot);
  server.begin();
 
 
   }

void loop() {
  if ((millis() - prevMillis) > 1000) {
    prevMillis = millis();
    struct station_info *stat_info = wifi_softap_get_station_info();
    devices = 0;
    while (stat_info != NULL) {
      stat_info = STAILQ_NEXT(stat_info, next);
      devices++;
    }
    if (alreadyBlinked > 0) {
      digitalWrite(2, HIGH);
      prevMillis = millis();
      Serial.println("Led turned LOW");
      Serial.print("devcount=");
      Serial.println(devices);
    }
  }
  if (devices == 0) {
    alreadyBlinked = 0;
  }
  else if (alreadyBlinked == 0) {           
    digitalWrite(2,  LOW);
    Serial.println("Led turned HIGH");
    prevMillis = millis();
    alreadyBlinked = 1;
  }
  server.handleClient();
}