background preloader

ESP8266

Facebook Twitter

WiFi IR Blaster Hookup Guide. ESP8266 Applications - PDAControl. ESP8266 Applications Video compilation in chronological order of tests performed with the ESP8266 module in various data acquisition and hardware modification applications. For more videos you can visit Our Youtube channel PDAControl Programming PLC FPX Panasonic via ESP8266 TCP IP – Fpwin PRO ESP8266(Server Web) + DS18B20(One Wire) + Api Google Chart (Only ESP8266) ESP8266 and DS18B20 (Temperature) OneWire to Google Sheets ESP8266 + DS18B20 Onewire + Google Speadsheets (Google Docs) ESP8266 firmware update with Flasher ESP8266.

Ultra-low Power Mode ESP8266

How Servo Motors Work & How To Control Servos using Arduino. Pin Mapping Method. Reference · ESP8266 Arduino Core. Table of Contents Pin numbers in Arduino correspond directly to the ESP8266 GPIO pin numbers. pinMode, digitalRead, and digitalWrite functions work as usual, so to read GPIO2, call digitalRead(2). Digital pins 0—15 can be INPUT, OUTPUT, or INPUT_PULLUP. Pin 16 can be INPUT, OUTPUT or INPUT_PULLDOWN_16.

At startup, pins are configured as INPUT. Pins may also serve other functions, like Serial, I2C, SPI. These functions are normally activated by the corresponding library. Digital pins 6—11 are not shown on this diagram because they are used to connect flash memory chip on most modules. Note that some boards and modules (ESP-12ED, NodeMCU 1.0) also break out pins 9 and 11. Pin interrupts are supported through attachInterrupt, detachInterrupt functions. ESP8266 has a single ADC channel available to users. To read external voltage applied to ADC pin, use analogRead(A0). To read VCC voltage, ADC pin must be kept unconnected.

AnalogWrite(pin, value) enables software PWM on the given pin. WiFi IR Blaster. Two Steps Forward... I recently upgraded my phone to a Samsung Note 5 before realizing it did not have an IR blaster. I had been using a universal remote app on my Galaxy S4 to control the entertainment centers throughout my house, so this was a pretty major showstopper for me. As I was filling out the return paperwork, I started thinking about other ways to solve this problem. I've recently built an IR blaster that controls stand alone air conditioners in my house. Another previous project was a connected HVAC vent with an android connected webapp. Rapid Prototyping I grabbed some unused hardware and wired up everything I'd need to get connected to my WiFi, accept HTTP connections and send IR signals. This worked OK in that I could request a specific URL on the IP assigned to the ESP8266 and have the Arduino output a "Power" signal to the IR LED.

NodeMCU REST...ish After doing some research, I found a great tutorial for implementing a REST API for Arduino to control LEDs on adafruit. Temperature sensor comparison - DHT22 vs DS18B20 | Arduino tutorial. Connect two ESP8266s to one MQTT broker - Everything ESP8266. #include <ESP8266WiFi.h>#include <PubSubClient.h> // Update these with values suitable for your network.const char* ssid = "SSID";const char* password = "PASSWORD";const char* mqtt_server = "192.168.1.10"; WiFiClient espClient;PubSubClient client(espClient);long lastMsg = 0;char msg[50];int value = 0; //1 ( pin 0 ) if (strcmp(topic,"/home/1/ard1/p1/com")==0) { if (payload[0] == '0'){ digitalWrite(0, HIGH); Serial.print("Turning Light ON"); delay(100); client.publish("/home/1/ard1/p1/state","0"); } else if (payload[0] == '1') { digitalWrite(0, LOW); Serial.print("Turning Light OFF"); delay(100); client.publish("/home/1/ard1/p1/state","1"); } } //2 ( pin 2 ) if (strcmp(topic,"/home/1/ard1/p2/com")==0) { if (payload[0] == '0'){ digitalWrite(2, HIGH); Serial.print("Turning Light ON"); delay(100); client.publish("/home/1/ard1/p2/state","0"); } else if (payload[0] == '1') { digitalWrite(2, LOW); Serial.print("Turning Light OFF"); delay(100); client.publish("/home/1/ard1/p2/state","1"); } }

Gateway app Updated to v8.10 | LowPowerLab. LowPowerLab | Exploring and building low power IoT systems. A Beginner's Guide to the ESP8266. A Beginner's Guide to the ESP8266. Pieter P, 08-03-2017 Some time ago, I wrote a Beginner's Guide to Arduino that seems to be very popular, so I decided to create a follow-up: A Beginner's Guide to the ESP8266. That's right, a tutorial on how to use the world's most popular $3 Wi-Fi board. This is going to be a very in-depth tutorial, covering some networking concepts as well. If you're a beginner, and just want to go straight to the more exciting Wi-Fi part, feel free to do so, I included short TL;DR's in the longer, more technical parts.

A short overview of what I'll cover in this article: What is an ESP8266? This guide expects some basic knowledge of microcontrollers like the Arduino. I really want to focus on the ESP8266-specific things, like Wi-Fi and other network protocols, the ESP's hardware, software, IoT, etc ... What is an ESP8266? The ESP8266 is a System on a Chip (SoC), manufactured by the Chinese company Espressif. Programming Requirements You'll need a couple of things in order to follow this guide: JoaoLopesF/RemoteDebug: Remote debug for ESP8266 and ESP32 - Library for Arduino - Debug over telnet with Print commands like Serial Monitor. Arduino/libraries/ESP8266mDNS at 61cd8d83859524db0066a647de3de3f6a0039bb2 · esp8266/Arduino. OurWeather REST Interface to the Raspberry Pi Released. SwitchDoc Labs has now released a Python program (for the OurWeather REST Interface) that reads the OurWeather Weather Station and stores the data from the weather station in a MySQL database.

It does this by making use of the REST interface of the OurWeather Weather Kit. What is OurWeather? OurWeather is an ESP8266 based connected weather station containing 7 different sensors that will teach about electronics, software and the weather. It contains all the sensors and wires to make a fully functional, WiFi weather station. See the Grove Connector Tutorial Here. What is the REST Interface For OurWeather? The OurWeather / WeatherPlus Advanced Usage Manual is now available for download on the OurWeather product page and the WeatherPlus product page. This manual documents the REST interface present in OurWeather / WeatherPlus and tells how to program the WeatherPlus board using the Arduino IDE. Example of REST Call returns a JSON string: SDL_Pi_DataLogger Related.

IOT ESP8266 Timer Tutorial - Arduino IDE. Decode and Send 433 MHz RF Signals with Arduino. This guide shows how to use an Arduino to decode 433 MHz signals from RF remotes, and send them with an Arduino and a 433 MHz transmitter to remotely control mains switches outlets. Why Decoding RF Signals? I’ve tried different methods of controlling the mains voltage, but some of the methods require: Experience dealing with AC voltageOpening holes in your wall/ceiling/switchesModifying the electrical panelKnowing the electrical rules for each country It’s difficult to come up with a solution that is safe and works for everyone. One of the easiest and safest ways to remotely control appliances connected to mains voltage is using radio frequency (RF) controlled outlets.

Fairly inexpensiveEasy to getWorks with ESP8266 and ArduinoSafe to useWorks in any country Parts Required For this tutorial, you need the following parts: Note: you need to buy remote controlled outlets that operate at a RF of 433MHz. Example Here’s how they look: Setting the RF Channels Installing the RC Switch Library Wrapping Up. ESP8089 Overview | Espressif Systems. Comparison of ESP8266 NodeMCU development boards • my2cents. A comparison of ESP8266 NodeMCU development boards must inevitably also compare the ESP8266 chips used on those boards.

The comparison can be confusing not because there are many different boards (there’s only 3) but because there are several names for the same thing. Since this article has become quite long, and to give you an idea what to expect, I decided to put a TOC here: Names of NodeMCU development boards It’s unfortunate that there’s a mixup of version and generation names. What I put in the 3rd column is just my observation of products in (Chinese) online shops such as Banggood and AliExpress. The last item is an odd one. A while a ago I started noticing this one product marketed as V3 even though it looks like a regular V2 board to me. What further contributes to the naming jungle is precisely the fact that the hardware is open-source and anyone can produce and market NoduMCU development boards. Comparison of NodeMCU development boards 1st generation / v0.9 / V1 Announcement WiFiMCU.

Remote Debugging

OTA programming. Debugging — ESP8266 Arduino Core 2.4.0 documentation. It work with every sketch that enables the Serial interface that is selected as debug port. The Serial interface can still be used normal in the Sketch. The debug output is additional and will not disable any interface from usage in the sketch. For Developers¶ For the debug handling uses defines. The defined are set by command line. Debug Port¶ The port has the define DEBUG_ESP_PORT possible value: - Disabled: define not existing - Serial: Serial - Serial1: Serial1 Debug Level¶ All defines for the different levels starts with DEBUG_ESP_ a full list can be found here in the boards.txt Example for own debug messages¶ The debug messages will be only shown when the Debug Port in the IDE menu is set.

#ifdef DEBUG_ESP_PORT#define DEBUG_MSG(...) JoaoLopesF/RemoteDebug: Remote debug for ESP8266 and ESP32 - Library for Arduino - Debug over telnet with Print commands like Serial Monitor. Read Raspberry Pi: Measure, Record, Explore. Reference · ESP8266 Arduino Core. Table of Contents Pin numbers in Arduino correspond directly to the ESP8266 GPIO pin numbers. pinMode, digitalRead, and digitalWrite functions work as usual, so to read GPIO2, call digitalRead(2).

Digital pins 0—15 can be INPUT, OUTPUT, or INPUT_PULLUP. Pin 16 can be INPUT, OUTPUT or INPUT_PULLDOWN_16. At startup, pins are configured as INPUT. Pins may also serve other functions, like Serial, I2C, SPI. These functions are normally activated by the corresponding library. The diagram below shows pin mapping for the popular ESP-12 module. Digital pins 6—11 are not shown on this diagram because they are used to connect flash memory chip on most modules. Note that some boards and modules (ESP-12ED, NodeMCU 1.0) also break out pins 9 and 11. Pin interrupts are supported through attachInterrupt, detachInterrupt functions. ESP8266 has a single ADC channel available to users. To read external voltage applied to ADC pin, use analogRead(A0). To read VCC voltage, ADC pin must be kept unconnected. File System · ESP8266 Arduino Core.

Even though file system is stored on the same flash chip as the program, programming new sketch will not modify file system contents. This allows to use file system to store sketch data, configuration files, or content for Web server. The following diagram illustrates flash layout used in Arduino environment: |--------------|-------|---------------|--|--|--|--|--| ^ ^ ^ ^ ^ Sketch OTA update File system EEPROM WiFi config (SDK) File system size depends on the flash chip size. Depending on the board which is selected in IDE, you have the following options for flash size: Note: to use any of file system functions in the sketch, add the following include to the sketch: ESP8266FS is a tool which integrates into the Arduino IDE.

Begin This method mounts SPIFFS file system. Format Formats the file system. Open Opens a file. path should be an absolute path starting with a slash (e.g. Returns File object. File f = SPIFFS.open("/f.txt", "w");if (! Exists openDir Opens a directory given its absolute path. ESP8266 – CCTV still camera – Bernd's development stuff. Introduction When I saw this cheap Serial JPEG Camera I got the idea to convert a Fake CCTV camera into a “real” CCTV. Well, not a fully functional CCTV, because the serial camera is too slow to be able to stream video (and so is the ESP8266). But at least to get pictures from it. The idea is to trigger the camera by motion detection, capture one image and store it in the internal memory. Hardware The serial connection between the camera module and the ESP8266 is very simple.

Important here is to check the voltage level of the TX and RX lines of the camera. I was lucky with the camera module I bought. Trigger the camera To trigger the camera I found three possibilities: Motion detection by the camera moduleMotion sensor connected to the ESP8266Trigger over WiFi by another device I tested the motion detection of the camera itself and I found it over sensitive. So I looked into the other two possibilities. Software On the next pages I will go into details of the software.

ESP8266 – Switch automatically between 2 access points – Bernd's development stuff. Overview Sometimes it is necessary to switch the ESP8266’s connection between two WiFi access points. For example if you have a second AP in your house as a backup if your main AP fails. In my case I stumbled over a connectivity problem with my ESP8266 devices. On my lot I needed to have 2 WiFi access points, because the WiFi modem/router I got from my ISP has a really lousy WiFi range (internal antenna). So I worked on a solution that allows the ESP8266 to detect the loss of WiFi connection and switch to the other AP automatically.

Luckily the ESP8266-Android framework has build in callbacks for WiFi events like ‘connected‘ ‘IP assigned‘ and ‘connection lost‘. Development environment: I use Visual Studio Code with PlatformIO. Sources The complete code is available in my Bitbucket repository. The tutorial code does not need any additional libraries beside of what is in the ESP8266 framework. For easier maintenance the code is split into several header and code files. ESP32 DHT11 – Bernd's development stuff. The DHT11 (or DHT22 and similar) are cheap temperature and humidity sensors. The communicate with a uC is over a single wire, but unfortunately it is not compatible with the 1-Wire protocol defined by Dallas Semiconductors. The electric connection to the ESP32 is very simple, as the DHT series can be powered direct with 3.3V. Only 3 wires are needed: VCC, GND and the data line.

Important is that a 10kΩ or at least 4.7kΩ resistor is needed between the data line and VCC. Sometimes this resistor is already integrated in the module, sometimes its necessary to add it. The hardware connection was really easy, but the software gave me a lot of headaches. The way the DHT is sending data is that it pulls the dataline high for either 70us for a ‘1’ or 26us for a ‘0’. So during the data transmission the ESP32 has to watch the data line in a high frequency and measure the length of the pulses to detect the 0’s and 1’s. The only solution for me was to adapt an existing library to the requirements. Device Control - Arduino Libraries. Esp8266 - Arduino Libraries. A Newbie's Guide to Setup ESP8266 With Arduino Mega 2560 or Uno: 6 Steps.

Official manufacturer's documentation which doesn't work out of the box for yours truly a few dependencies 1. the baudrate in the blog post is 57600 whereas the ESP82665 on hand is 9600, with no mentioned or whatsoever w.r.t it in the blogpost of the manufacturer. 2. the CH_PD & RESET are not held at logic high in the blogpost of the manufacturer. Methodology & Observations: Setup(s) that does not work/ does work MCU: uno comm: serial0 only code: "Examples->basic->BareMinimum" en: 3.3v to ch_pd and REST cct: voltage divider baud s0: 9600 D0 rx-> tx ESP8266 D1 tx-> RX ESP8266 Serial mon on Serial0; AT and then "send" => no response MCU: uno comm: serial0 only SSCom32 on Serial0; AT and then "send" => no response code: "serial0 setup with 9600" code: "modified hello word with RGB indicator" Serial mon on Serial0 can't used MCU: mega comm: serial0 only MCU: mega comm: serial0 & serial2 for ESP8266 code: "copy s0<->s2" baud s0: 115200 baud s2: 9600.

Getting Started with ESP8266 WiFi Transceiver (Review) ESP8266 Tutorial: How to Control Anything From the Internet | Education | Maker Pro. Welcome to ESP8266 Arduino Core’s documentation! — ESP8266 Arduino Core 2.4.0 documentation. ESP8266 Thing Hookup Guide.