ESPRESSIF ESP32

Introduction

ESP32 is a series of low-cost, low-power system on a chip microcontrollers with integrated Wi-Fi and dual-mode Bluetooth. There are multiple modules based on this microcontroller that includes different kinds of antennas, pinouts and memory extensions. It is the successor to the ESP8266 microcontroller and is designed to be one of the most relevant IoT impulsor during the next years and there is a great diversity of variants that exploit its capacities together with other peripherals, integrating LoRa communication, audio amplifiers, LCD screens, etc.
ESP32 WROOM DEV MODULE

Install On Arduino IDE

This device can be programmed directly from the Arduino IDE by including the ESP32 core libraries with Arduino Boards Manager. For this step, you will need first to include https://dl.espressif.com/dl/package_esp32_index.json into Additional Board Manager URLs field in the Arduino preferences.
Next, go to the Boards manager to install the ESP32 package. Search for the esp32 and install the package esp32 by Espressif Systems
After this process you should be able to select this board on your Arduino IDE and start creating your IoT projects with Thinger.io.

ESP32 WiFi

The following example will allow connecting your device to the cloud platform in a few lines via WiFi interface. Just modify the arduino_secrets.h file with your own information.
ESP32.ino
arduino_secrets.h
1
#define THINGER_SERIAL_DEBUG
2
3
#include <ThingerESP32.h>
4
#include "arduino_secrets.h"
5
6
ThingerESP32 thing(USERNAME, DEVICE_ID, DEVICE_CREDENTIAL);
7
8
void setup() {
9
// open serial for debugging
10
Serial.begin(115200);
11
12
pinMode(16, OUTPUT);
13
14
thing.add_wifi(SSID, SSID_PASSWORD);
15
16
// digital pin control example (i.e. turning on/off a light, a relay, configuring a parameter, etc)
17
thing["GPIO_16"] << digitalPin(16);
18
19
// resource output example (i.e. reading a sensor value)
20
thing["millis"] >> outputValue(millis());
21
22
// more details at http://docs.thinger.io/arduino/
23
}
24
25
void loop() {
26
thing.handle();
27
}
Copied!
1
#define USERNAME "your_user_name"
2
#define DEVICE_ID "your_device_id"
3
#define DEVICE_CREDENTIAL "your_device_credential"
4
5
#define SSID "your_wifi_ssid"
6
#define SSID_PASSWORD "your_wifi_ssid_password"
Copied!

ESP32 Ethernet

ESP32Eth.ino
arduino_secrets.h
1
// It may be required to define this according to your specific board
2
// This example works for Olimex ESP32-PoE-ISO
3
4
//#define ETH_PHY_ADDR 0
5
#define ETH_CLK_MODE ETH_CLOCK_GPIO17_OUT
6
//#define ETH_PHY_TYPE ETH_PHY_LAN8720
7
#define ETH_PHY_POWER 12
8
//#define ETH_PHY_MDC 23
9
//#define ETH_PHY_MDIO 18
10
//#define ETH_CLK_MODE ETH_CLOCK_GPIO0_IN
11
12
// enable debug output over serial
13
#define THINGER_SERIAL_DEBUG
14
15
#include <ThingerESP32Eth.h>
16
#include "arduino_secrets.h"
17
18
ThingerESP32Eth thing(USERNAME, DEVICE_ID, DEVICE_CREDENTIAL);
19
20
void setup() {
21
22
// enable serial for debugging
23
Serial.begin(115200);
24
25
// example of fixed ip address (dhcp is used by default)
26
//thing.set_address("192.168.1.55", "192.168.1.1", "255.255.255.0", "8.8.8.8", "8.8.4.4");
27
28
// set desired hostname
29
thing.set_hostname("ESP32Eth");
30
31
// resource output example (i.e. reading a sensor value)
32
thing["eth"] >> [](pson& out){
33
out["hostname"] = ETH.getHostname();
34
out["mac"] = ETH.macAddress();
35
out["ip"] = ETH.localIP().toString();
36
out["link"] = ETH.linkSpeed();
37
};
38
39
// more details at http://docs.thinger.io/arduino/
40
}
41
42
void loop() {
43
thing.handle();
44
}
Copied!
1
#define USERNAME "your_user_name"
2
#define DEVICE_ID "your_device_id"
3
#define DEVICE_CREDENTIAL "your_device_credential"
Copied!

ESP32 WiFi WebConfig

Coming soon

ESP32 WiFi SmartConfig

Coming soon
Last modified 2mo ago