Are you sure that your module is an ESP-01 ?
Are you sure that your module is an ESP-01 ?
Explore... Chat... Share...
Moderator: igrr
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?
[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();
}
It takes about 20-25 seconds for home assistant c[…]
I tried to upgrade tof my sonoff basic R2 with the[…]
a problem Perhaps you want to define "Probl[…]
Rebooting your router will not give you a faster I[…]
There are no other notifications from esptool.py i[…]
Using the Arduino IDE, you'll learn how to set up […]
In this project, you will post to Twitter using an[…]
In this project, we will build a water level contr[…]
I guess I'm late, but I had the same problem and f[…]
Last night I received my first D1 Minis for a lear[…]
Although I am aware that this is an old post, I fe[…]