https://github.com/afif718/esp32-wifimanager-https-client
ESP32 sketch for secure HTTPS data posting with WiFiManager captive portal, JSON payloads, and automatic retry/backoff logic.
https://github.com/afif718/esp32-wifimanager-https-client
arduino data-logging esp32 https iot json-captive-portal secure-connection ssl wifi-manager wifimanager
Last synced: 3 months ago
JSON representation
ESP32 sketch for secure HTTPS data posting with WiFiManager captive portal, JSON payloads, and automatic retry/backoff logic.
- Host: GitHub
- URL: https://github.com/afif718/esp32-wifimanager-https-client
- Owner: Afif718
- License: mit
- Created: 2025-09-24T17:31:10.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2025-09-24T17:45:28.000Z (4 months ago)
- Last Synced: 2025-09-24T19:32:38.422Z (4 months ago)
- Topics: arduino, data-logging, esp32, https, iot, json-captive-portal, secure-connection, ssl, wifi-manager, wifimanager
- Language: C++
- Homepage:
- Size: 6.84 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ESP32-WiFiManager-HTTPS-Client
ESP32 project that automatically manages WiFi connections and sends sensor data to a server via HTTPS.
## Features
- **Auto WiFi Management**: Connects using saved credentials or opens a captive portal for setup
- **HTTPS Data Transmission**: Securely sends JSON data to your server with API key authentication
- **Dual Data Streams**: Sends both environmental data (temperature, humidity) and water quality data (pH, dissolved oxygen, etc.)
- **Retry Logic**: Automatically retries failed connections with exponential backoff
- **Reset Function**: Press EN button to clear saved WiFi credentials
## How it Works
1. **WiFi Setup**: On first boot, creates "ESP32_AP" hotspot for WiFi configuration
2. **Auto Connect**: Remembers WiFi settings and connects automatically on subsequent boots
3. **Data Collection**: Reads sensor values (currently hardcoded for testing)
4. **HTTPS POST**: Sends data to two endpoints: `/env_data` and `/pond_data`
5. **Error Handling**: Retries failed connections up to 4 times with increasing delays
## Configuration
Update these values in the code:
```cpp
const char* server = "your-server.example.com";
const char* apiKey = "YOUR_API_KEY";
```
## Use Cases
- **Environmental Monitoring**: Temperature, humidity, pressure sensing
- **Water Quality Monitoring**: pH, dissolved oxygen, TDS measurement for ponds/aquariums
- **IoT Data Logger**: Any application requiring secure data transmission to a server
- **Remote Monitoring**: Monitor sensors from anywhere with internet connection
## JSON Data Format
**Environmental Data:**
```json
{
"api_key": "YOUR_API_KEY",
"sensor": "SHT20",
"Temperature": 22.3,
"Humidity": 55.2,
"Pressure": 0
}
```
**Water Quality Data:**
```json
{
"api_key": "YOUR_API_KEY",
"nitrogen": 0.0,
"ammonia": 0.0,
"do": 7.2,
"waterPH": 7.1,
"waterTemp": 26.4
}
```
## Installation
1. Install required libraries: `WiFiManager` and `ArduinoJson`
2. Update server URL and API key in the code
3. Upload to ESP32
4. Connect to "ESP32_AP" hotspot and configure WiFi
## Screenshots


## Libraries Used
- WiFiManager - For easy WiFi configuration
- ArduinoJson - For JSON data formatting
- WiFiClientSecure - For HTTPS connections