Categories
ESP8266 (ESP-01/01S) Internet Of Things Microcontrollers

WiFi Access Point

Requirements

ESP8266 ESP-01/ESP-01S

Arduino Sketch / Code

#include <ESP8266WiFi.h>

void setup()
{
  Serial.begin(115200);
  Serial.println();

  Serial.print("Setting soft-AP ... ");
  boolean result = WiFi.softAP("ESPsoftAP_01", "pass-to-soft-AP");
  if(result == true)
  {
    Serial.println("Ready");
  }
  else
  {
    Serial.println("Failed!");
  }
}

void loop()
{
  Serial.printf("Stations connected = %d\n", WiFi.softAPgetStationNum());
  delay(3000);
}

Access Point SSID name and password

boolean result = WiFi.softAP("ESPsoftAP_01", "pass-to-soft-AP");

edit the above bold word with your own SSID name and password. Save and recompile your code again.
 

Categories
ESP32 ESP8266 (ESP-01/01S) Microcontrollers

Storing Data SPIFFS

Requirements

  • DHT11 Temperature and Humidity
  • USB to UART ESP01 Programmer
  • ESP8266 ESP01/01s (512KB / 1 Mbyte)
  • File System Uploader plug-in installed

Circuity

Code

#include "FS.h"
#include "DHT.h"

#define DHTPIN 2 // the digital pin we are connected to
#define DHTTYPE DHT11 // define type of DHT sensor we are using

DHT dht(DHTPIN, DHTTYPE); // create DHT object

void setup() {
  Serial.begin(115200);
  dht.begin(); // intialize DHT object
  
  // always use this to "mount" the filesystem
  bool ok = SPIFFS.begin();
  if (ok) {
    Serial.println("SPIFFS initialized successfully");
  }
  else{
    Serial.println("SPIFFS intialization error");
  }
  
}

void loop() {
  // Wait a few seconds between measurements.
  delay(2000);
  //read temperature as Celcius
  float t = dht.readTemperature(); 
  
  // Check if any reads failed and exit early (to try again).
  if (isnan(t)) {
    Serial.println("Failed to read from DHT sensor!");
    return;
  }
  //open log.txt file 
  File f = SPIFFS.open("/log.txt", "a");
  if (!f) {
    Serial.println("file open failed");
  }
  // save temperature reading
  f.print(t);
  f.println("deg C");
  //close file
  f.close();
  delay(8000);
}

Resources

https://arduino-esp8266.readthedocs.io/en/latest/filesystem.html

https://thebigpotatoe.github.io/Effortless-SPIFFS/

https://www.arduino.cc/reference/en/libraries/effortless-spiffs/

Categories
ESP8266 (ESP-01/01S) Microcontrollers

Troubleshooting ESP8266

The board stops working when things are connected to some pins

There are some pins on the ESP8266 board that are used for reset functions and for boot mode functions. Therefore, ensure that:

  • CH_PD (EN) is always pulled high because it will disable the ESP8266 when it is pulled low
  • RST is always pulled high because it will disable the ESP8266 when it is pulled low
  • GPIO 0 is pulled high during power up/reset for the user program to run, otherwise the module will enter bootloader mode. It is normally pulled high by the red LED
  • GPIO 2 is pulled high on power up/reset
  • GPIO 15 is pulled low on power up/reset
Categories
ESP8266 (ESP-01/01S) Microcontrollers

NodeMCU (Lua Based Firmware) for ESP8266

ESP8266 Modules comes with NodeMCU firmware

  • WeMOS D1 Mini

Flash Size : 4MB / 32Mbit

Pin Out

PIN MAP

ADC Voltage Range (Analog Output pin A0) for modules

0 to 3.3V

Noted: With exception to ESP8266 chip-based (barebone), voltage range 0 to 1V

Categories
ESP32 ESP8266 (ESP-01/01S) Microcontrollers

Reading Digital Signal (GPIO Pin)

GPIO pin can be used to read values off from sensor devices and monitor sensor data.

Serial console to display the read of the value from GND/3.3V pins of ESP8266

Requirements

  • Breadboard
  • Jumper wires
  • USB cable
  • ESP8266 D1 Wemos Mini
  • CH340 Driver (USB-UART)
  • Arduino IDE (ESP8266 Library / Board : Lolin D1 Mini)

Layout

D1 Wemos Mini (GPIO 5 – D1 and GND)

Arduino IDE Sketch Code

// Setup the GPIO 5 Pin
// D1 Wemos Mini pin GPIO5
 
int inputPin = 5;
int val = 0;

void setup() {
  // Setup the serial console baud speed
  Serial.begin(115200);
  pinMode(inputPin, INPUT);
}

void loop() {
  // Read the value off GPIO 5 Pin
  val = digitalRead(inputPin);

  // Display state of input pin
  Serial.println(val);
  delay(1000);
}
Arduino IDE’s Serial console output (reading from GND pin)

Resource

https://www.wemos.cc/en/latest/d1/d1_mini.html

https://arduino-esp8266.readthedocs.io/en/latest/

Categories
ESP32 ESP8266 (ESP-01/01S) Microcontrollers Security

MAC Address Randomization

Resources

https://source.android.com/devices/tech/connect/wifi-mac-randomization#:~:text=MAC%20randomization%20prevents%20listeners%20from,and%20Wi%2DFi%20RTT%20operations.

Categories
ESP8266 (ESP-01/01S) Microcontrollers

ESP8266 WiFi Sniffing

Resources

https://github.com/SpacehuhnTech/esp8266_deauther

https://www.varonis.com/blog/hacking-wi-fi-with-the-esp8266/

https://github.com/spacehuhn/ArduinoPcap

https://github.com/spacehuhn/DeauthDetector

https://cifertech.net/detect-deauth-attacks-on-wi-fi-network-using-esp8266/

https://maker.pro/arduino/projects/visitor-flow-rate-counting-with-esp32

https://github.com/RicardoOliveira/FriendDetector

Categories
ESP8266 (ESP-01/01S) Microcontrollers

FreeRTOS and ESP8266 (E-12)

https://www.freecodecamp.org/news/how-to-get-started-with-freertos-and-esp8266-7a16035ddd71/

Categories
ESP8266 (ESP-01/01S) Microcontrollers

Espresso Lite V2.0 (Discontinue)

ESPresso Lite V2.0
Jual Perangkat Elektronik Lainnya Espresso Lite V2.0 -ESP8266  Arduino-compatible Wi-Fi board- di Lapak Erica Aimee | Bukalapak

Espresso Lite V2.0 Specs and Features:

  • Features Espressif System’s ESP8266 WROOM-02 Wi-Fi module (with 4MB flash / 32Mbit)
  • Design for IoT with free espert.io cloud and app service
  • Support the Arduino IDE (boards manager) and libraries
  • Auto program loading from Arduino IDE, using UC00A (or other compatible USB to Serial)
  • Vin: 5 to 12VDC
  • Operating Voltage: 3.3VDC
  • On board 3.3V Voltage Regulator with maximum current of 800mA continuous, 1A peak
  • One Reset button, two User Programmable buttons
  • WROOM-02 module is FCC, CE & TELEC certified
  • Breadboard friendly breakout pins
  • Ready pads for I2C Oled panel

WROOM-02 Specs and Features:

  • Operating Voltage: 3.0 to 3.6VDC
  • Operating Current: Average = 80mA
  • IEEE 802.11b/g/n at 2.4 GHz
  • WiFi mode: SoftAP/Station/SoftAP + Station
  • Security: WPA/WPA2
  • Encrytion: WEP/TKIP/AES
  • Integrated low power 32-bit MCU
  • Integrated 10-bit ADC
  • Integrated TCP/IP protocol stack
  • Integrated TR switch, balun, LNA, power amplifier and matching network
  • Integrated PLL, regulators, and power management units
  • Various interfaces available, including SDIO, HSPI, UART, I2C, I2S, IR, PWM, GPIO, etc.
  • Supports antenna diversity
  • Deep sleep power <10uA, Power down leakage current < 5uA
  • Wake up and transmit packets in < 2ms
  • Standby power consumption of < 1.0mW (DTIM3)
  • +20dBm output power in 802.11b mode
  • Operating temperature range -40C ~ 125C
  • FCC, CE and TELEC certified

ESP-WROOM-02 Pins

Uploading Arduino IDE Binary Code / Firmware Using USB-UART

ESPresso Lite V2 with AT Firmware | Tutorials of Cytron Technologies

Categories
ESP8266 (ESP-01/01S) Microcontrollers

ESP8266EX

External Flash


ESP8266EX uses external SPI flash to store user programs and supports up to 16 MB memory capacity theoretically.

The minimum flash memory of ESP8266EX is shown below:

  • OTA disabled for 512 kB (4Mbits)
  • OTA enabled for 1 MB (8Mbits) at least

Programming Mode