Witty Fox - ESP32 Storm Board with Support for Battery Charging & Wireless Programming
The Witty Fox ESP32 Storm Board is a feature-rich, compact development board designed for IoT applications. It integrates the powerful ESP32 microcontroller, supporting Wi-Fi and Bluetooth connectivity, along with battery charging and wireless programming capabilities. This board is ideal for rapid prototyping and development of IoT projects, especially those requiring low-power wireless communication and autonomous operation.
ESP32 microcontroller with Wi-Fi and Bluetooth capabilities
Onboard USB-C port for programming and debugging
Battery charging circuit with charging indicator LED
Wireless programming support using the ESP32's built-in OTA (Over-The-Air) updates
16MB of flash memory and 520KB of SRAM
Operating voltage: 3.3V
Compatible with various IoT development frameworks, including Arduino, MicroPython, and ESP-IDF
### Example 1: Wi-Fi Connection and Web Server (Arduino IDE)
In this example, we'll demonstrate how to connect the Witty Fox ESP32 Storm Board to a Wi-Fi network and create a simple web server using the Arduino IDE.
Witty Fox ESP32 Storm Board
Micro-USB cable
Computer with Arduino IDE installed
Code:
```cpp
#include <WiFi.h>
#include <WebServer.h>
const char ssid = "your_wifi_ssid";
const char password = "your_wifi_password";
void setup() {
Serial.begin(115200);
// Connect to Wi-Fi
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
delay(1000);
Serial.println("Connecting to WiFi...");
}
Serial.println("Connected to WiFi");
Serial.println("IP Address: ");
Serial.println(WiFi.localIP());
// Start the web server
server.begin();
}
void loop() {
server.handleClient();
}
void handleRoot() {
server.send(200, "text/html", "<h1>Hello from Witty Fox ESP32 Storm Board!</h1>");
}
```
Explanation:
1. Include the necessary libraries for Wi-Fi and web server functionality.
2. Define the Wi-Fi network credentials and create a `WebServer` object on port 80.
3. In `setup()`, connect to the Wi-Fi network and start the web server.
4. In `loop()`, handle incoming client requests.
5. The `handleRoot()` function serves a simple HTML page with a greeting message when the board's IP address is accessed in a web browser.
### Example 2: Bluetooth Low Energy (BLE) Advertising (MicroPython)
In this example, we'll demonstrate how to use the Witty Fox ESP32 Storm Board as a BLE advertiser using MicroPython.
Witty Fox ESP32 Storm Board
Computer with MicroPython firmware installed on the board
Code:
```python
import ubluetooth
# Create a BLE adapter
bt = ubluetooth.BLE()
# Set the device name
bt.set_device_name("WittyFoxESP32")
# Create a BLE service
svc = bt.service(0x180F, True) # Generic Attribute Profile
# Create a BLE characteristic
char = svc.characteristic(0x2902, True) # Client Characteristic Configuration
# Start advertising
bt.start_advertising()
print("BLE advertising started")
```
Explanation:
1. Import the `ubluetooth` module, which provides BLE functionality.
2. Create a BLE adapter and set the device name.
3. Create a BLE service and characteristic using the Generic Attribute Profile.
4. Start advertising the BLE service.
Note: Make sure to install the necessary MicroPython firmware on the Witty Fox ESP32 Storm Board before running this example.
These examples demonstrate the versatility of the Witty Fox ESP32 Storm Board and its potential applications in IoT development.