To be thorough, here is the regulator: https://www.adafruit.com/products/2165
On the input I am using this capacitor: https://www.adafruit.com/products/2195
On the output I am using a 100 uF, 16V capacitor that I had laying around.
I have VCC connected to CHPD on the ESP because I couldn't get it to work without doing that. The ESP's pinout is very frustrating. Not very convenient!
Here is my code I am using that I am getting the wifi issues with.
Code: Select all
#include <Adafruit_ESP8266.h>
#define ESP_RST 4
#define WLAN_SSID "network"
#define WLAN_PSWD "password"
#define HOST "api.pushingbox.com"
#define PORT 80
#define PAGE "/pushingbox?devid=abcd"
int led_pin = 13;
int buzzer_pin = 10;
int door_pin = 6;
Adafruit_ESP8266 wifi(&Serial1, &Serial, ESP_RST);
void setup() {
pinMode(led_pin, OUTPUT);
pinMode(buzzer_pin, OUTPUT);
pinMode(door_pin, INPUT);
for(uint8_t i=0; i<3; i++) {
digitalWrite(13, HIGH); delay(1000);
digitalWrite(13, LOW); delay(1000);
}
while (!Serial);
Serial1.begin(9600);
Serial.begin(57600); while(!Serial);
Serial.println(F("Device started..."));
wifi.setBootMarker(F("Version:0.9.2.4]\r\n\r\nready"));
if (!wifi.softReset())
Serial.println(F("no response"));
while (wifi.connectToAP(F(WLAN_SSID), F(WLAN_PSWD)) != true) {
Serial.println(F("not connected"));
}
/* if (wifi.connectToAP(F(WLAN_SSID), F(WLAN_PSWD)))
Serial.println(F("connected"));
else
Serial.println(F("connect failed"));
*/
beep(1000);
beep(1000);
beep(1000);
Serial.println(F("Beeps done"));
}
void loop() {
int sensor_data = digitalRead(door_pin);
if (!sensor_data) {
// door open
Serial.println(F("Door opened!"));
beep(1000);
beep(1000);
beep(1000);
beep(1000);
beep(1000);
if (wifi.connectTCP(F(HOST), PORT)) {
Serial.println(F("TCP session connected"));
wifi.requestURL(F(PAGE));
}
delay(2000);
}
/*
digitalWrite(led_pin, HIGH);
delay(1000);
digitalWrite(led_pin, LOW);
delay(1000);
*/
}
void beep(unsigned char delayms) {
analogWrite(buzzer_pin, 500);
delay(delayms);
analogWrite(buzzer_pin, 0);
delay(delayms);
}
Code: Select all
Device started...
---> AT+RST
<--- '
[Vendor:www.ai-thinker.com Version:0.9.2.4]
ready'
---> ATE0
<--- '
ATE0
OK
'
---> AT+CWMODE=1
<--- 'no change'
---> AT+CWJAP="network","password"
<--- ''
not connected
---> AT+CWMODE=1
<--- 'F=Oÿ!£yñÊtxð¦ÀÙ*ðCÇb'
not connected
---> AT+CWMODE=1
<--- '[Vendor:www.ai-thinker.com Version:0.9.2.4]'
not connected
---> AT+CWMODE=1
<--- ''
not connected
---> AT+CWMODE=1
<--- 'ready'
not connected
---> AT+CWMODE=1
<--- 'AT+CWMODE=1'
not connected
---> AT+CWMODE=1
<--- 'AT+CWMODE=1'
not connected
---> AT+CWMODE=1
<--- '[Vendor:www.ai-thinker.com Version:0.9.2.4]'
not connected
---> AT+CWMODE=1
<--- ''
not connected
---> AT+CWMODE=1
<--- 'ready'
not connected
---> AT+CWMODE=1
<--- 'AT+CWMODE=1'
not connected
---> AT+CWMODE=1
<--- 'AT+CWMODE=1'
not connected
---> AT+CWMODE=1
<--- '[Vendor:www.ai-thinker.com Version:0.9.2.4]'
not connected
---> AT+CWMODE=1
<--- ''
not connected
---> AT+CWMODE=1
<--- 'ready'
not connected
---> AT+CWMODE=1
<--- 'AT+CWMODE=1'
not connected
---> AT+CWMODE=1
<--- 'AT+CWMODE=1'
not connected
---> AT+CWMODE=1
<--- '[Vendor:www.ai-thinker.com Version:0.9.2.4]'
not connected
---> AT+CWMODE=1
<--- ''
not connected
---> AT+CWMODE=1
<--- 'ready'
not connected
---> AT+CWMODE=1
<--- 'AT+CWMODE=1'
not connected
---> AT+CWMODE=1
<--- 'AT+CWMODE=1'
not connected
---> AT+CWMODE=1
<--- '[Vendor:www.ai-thinker.com Version:0.9.2.4]'
not connected
---> AT+CWMODE=1
<--- ''
not connected
---> AT+CWMODE=1
<--- 'ready'
not connected
---> AT+CWMODE=1
<--- 'AT+CWMODE=1'
not connected
---> AT+CWMODE=1
<--- 'AT+CWMODE=1'
not connected
---> AT+CWMODE=1
<--- '[Vendor:www.ai-thinker.com Version:0.9.2.4]'
not connected
---> AT+CWMODE=1
<--- ''
not connected
---> AT+CWMODE=1
<--- 'ready'
not connected
---> AT+CWMODE=1
<--- 'AT+CWMODE=1'
not connected
---> AT+CWMODE=1
<--- 'AT+CWMODE=1'
not connected
---> AT+CWMODE=1
<--- '[Vendor:www.ai-thinker.com Version:0.9.2.4]'
not connected
---> AT+CWMODE=1
<--- ''
not connected
---> AT+CWMODE=1
<--- 'ready'
not connected
---> AT+CWMODE=1
<--- 'AT+CWMODE=1'
not connected
---> AT+CWMODE=1
<--- 'AT+CWMODE=1'