Initial commit: ZNET Temperature Sensor ESP32 firmware
- PlatformIO project for Meshnology ESP32 LoRa V3 - DS18B20 dual sensor support for tank verification - OLED display for local temperature visibility - HTTP POST to ZNET Web API - WiFiManager for easy WiFi configuration - Offline buffering when network unavailable Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,100 @@
|
||||
/**
|
||||
* ZNET Temperature Sensor Configuration
|
||||
*
|
||||
* Edit these values for your installation.
|
||||
*/
|
||||
|
||||
#ifndef CONFIG_H
|
||||
#define CONFIG_H
|
||||
|
||||
// ============================================================================
|
||||
// NETWORK CONFIGURATION
|
||||
// ============================================================================
|
||||
|
||||
// WiFi credentials (can also be set via WiFiManager portal)
|
||||
#define WIFI_SSID "" // Leave empty to use WiFiManager
|
||||
#define WIFI_PASSWORD ""
|
||||
|
||||
// ZNET Web API endpoint
|
||||
#define ZNET_API_URL "http://192.168.1.100:8000/api/v1/sensors/readings"
|
||||
|
||||
// Device identification
|
||||
#define DEVICE_ID "tank_gateway_1"
|
||||
#define DEVICE_NAME "E-Coat Tank Gateway"
|
||||
|
||||
// ============================================================================
|
||||
// SENSOR CONFIGURATION
|
||||
// ============================================================================
|
||||
|
||||
// DS18B20 1-Wire data pin
|
||||
#ifndef ONEWIRE_PIN
|
||||
#define ONEWIRE_PIN 7
|
||||
#endif
|
||||
|
||||
// Temperature reading interval (milliseconds)
|
||||
#define TEMP_READ_INTERVAL_MS 30000 // 30 seconds
|
||||
|
||||
// Number of readings to average for stability
|
||||
#define TEMP_AVG_READINGS 3
|
||||
|
||||
// Sensor IDs (auto-detected, but can be named)
|
||||
#define SENSOR_1_NAME "tank_primary"
|
||||
#define SENSOR_2_NAME "tank_secondary"
|
||||
|
||||
// Temperature validation range (Fahrenheit)
|
||||
#define TEMP_MIN_VALID_F 32.0
|
||||
#define TEMP_MAX_VALID_F 150.0
|
||||
|
||||
// ============================================================================
|
||||
// DISPLAY CONFIGURATION
|
||||
// ============================================================================
|
||||
|
||||
// OLED I2C address
|
||||
#define OLED_ADDRESS 0x3C
|
||||
|
||||
// Display update interval (milliseconds)
|
||||
#define DISPLAY_UPDATE_INTERVAL_MS 1000
|
||||
|
||||
// ============================================================================
|
||||
// LORA CONFIGURATION (for future remote sensor nodes)
|
||||
// ============================================================================
|
||||
|
||||
// LoRa frequency (915 MHz for US)
|
||||
#define LORA_FREQUENCY 915.0
|
||||
|
||||
// LoRa bandwidth (125 kHz)
|
||||
#define LORA_BANDWIDTH 125.0
|
||||
|
||||
// LoRa spreading factor (7-12, higher = longer range but slower)
|
||||
#define LORA_SPREADING_FACTOR 9
|
||||
|
||||
// LoRa coding rate (5-8)
|
||||
#define LORA_CODING_RATE 7
|
||||
|
||||
// LoRa sync word (private network)
|
||||
#define LORA_SYNC_WORD 0x12
|
||||
|
||||
// ============================================================================
|
||||
// API RETRY CONFIGURATION
|
||||
// ============================================================================
|
||||
|
||||
// Maximum retries for API calls
|
||||
#define API_MAX_RETRIES 3
|
||||
|
||||
// Retry delay (milliseconds)
|
||||
#define API_RETRY_DELAY_MS 5000
|
||||
|
||||
// HTTP timeout (milliseconds)
|
||||
#define HTTP_TIMEOUT_MS 10000
|
||||
|
||||
// ============================================================================
|
||||
// BUFFER CONFIGURATION (for offline operation)
|
||||
// ============================================================================
|
||||
|
||||
// Maximum readings to buffer when offline
|
||||
#define OFFLINE_BUFFER_SIZE 100
|
||||
|
||||
// Save buffer to flash on reboot
|
||||
#define BUFFER_PERSIST_TO_FLASH true
|
||||
|
||||
#endif // CONFIG_H
|
||||
Reference in New Issue
Block a user