pitrix/include/config.sample.h

119 lines
4.4 KiB
C
Raw Normal View History

2019-06-05 04:29:47 +00:00
#pragma once
2019-05-30 11:11:42 +00:00
#include <Arduino.h>
#define FASTLED_INTERNAL
#include <FastLED.h>
2019-10-04 13:58:56 +00:00
#include "settings.h"
2019-05-30 11:11:42 +00:00
//#define DEBUG // Uncomment this to enable Debug messages via Serial and, if enabled, MQTT.
2019-06-06 04:41:11 +00:00
//#define CONFIG_USABLE // Uncomment this by removing the // at the beginning!
#define WIFI_SSID "..." // SSID of the wifi to connect to
#define WIFI_PASS "..." // Password of the wifi
2019-05-21 03:52:57 +00:00
#define LED_WIDTH 16 // Number of LEDs in horizontal direction
#define LED_HEIGHT 16 // Number of LEDs in vertical direction
#define LED_COUNT 256 // Total number of LEDs. WIDTH*HEIGHT.
#define LED_TYPE WS2812B // Type of LEDs
#define DATA_PIN 14 // PIN the LEDs are connected to on the microcontroller
#define COLOR_ORDER GRB // Order of the colors of the LEDs. If you get unexpected colors, you should change this.
#define BRIGHTNESS 20 // Default brightness of the LEDs. 1 (lowest)-255 (brightest)
#define TEMPORAL_DITHERING 0 // Use temporal dithering. Can lead to flickering.
#define LED_MAX_MILLIAMPS 0 // If your power supply is too small, you can set this to a maximum mA value. FastLED should then honor this. Setting it to 0 disables this limit.
2019-05-21 03:52:57 +00:00
#define NTP_SERVER "pool.ntp.org" // NTP server to use to fetch the current time
#define NTP_INTERVAL 300000 // Interval in ms to update the time from the NTP server. 300000 ms = 5 minutes
#define NTP_OFFSET 7200 // Offset of your local time from UTC in seconds. Germany, daylight savings time = 2 hours = 7200 seconds
2019-05-21 03:52:57 +00:00
2019-06-12 18:57:31 +00:00
#define HTTP_SERVER_ENABLE
#define HTTP_SERVER_PORT 80
#define MQTT_ENABLE // Use MQTT. Add slashes to the start of the line to disable MQTT completely.
#define MQTT_SERVER "..." // Data for connecting to the MQTT server
2019-05-21 03:52:57 +00:00
#define MQTT_PORT 1883
2019-05-30 11:11:42 +00:00
#define MQTT_USER "..."
#define MQTT_PASS "..."
#define MQTT_TOPIC "pitrix/" // MQTT topic to listen to. Must not start with a slash, but must end with one.
#define MQTT_REPORT_METRICS // Whether to report metrics via MQTT. Disable if unwanted.
2019-06-07 04:30:15 +00:00
#define MQTT_TOPIC_WEATHER "accuweather/pitrix/" // MQTT topic to listen for weather data. Must not start with a slash, but must end with one.
#define MQTT_TOPIC_TIMER "alexa/timer"
#define MQTT_TOPIC_HOMEASSISTANT "homeassistant"
2019-05-21 03:52:57 +00:00
#define HOSTNAME "pitrix-%08X" // Hostname of the ESP to use for OTA and MQTT client id. %08X will be replaced by the chip id.
#define OTA_STARTUP_DELAY 10 // How many seconds to wait at startup. This is useful to prevent being unable to flash OTA by a bug in the code. Set to 0 to disable.
2019-05-21 03:52:57 +00:00
#define FPS 50
#define SHOW_TEXT_DELAY 100
#define MONITOR_LOOP_TIMES false
#define MONITOR_LOOP_TIME_THRESHOLD 500
#define MONITOR_LOOP_TIME_COUNT_MAX 10
// settings.effects.cycle.time = 300; // Time in seconds between cycling effects.
// settings.effects.cycle.random = true;
2019-05-30 11:11:42 +00:00
// settings.effects.matrix.length_min = 4;
// settings.effects.matrix.length_max = 20;
// settings.effects.matrix.speed_min = 1;
// settings.effects.matrix.speed_max = 10;
2019-05-30 11:11:42 +00:00
// .dynamic.single_loop_time = 40;
// .dynamic.multi_loop_time = 1400;
// .dynamic.big_loop_time = 50;
// .dynamic.big_size = 3;
2019-05-30 11:11:42 +00:00
// .fire.cooldown = 192;
// .fire.spark_chance = 5;
// .firework.drag = 255;
// .firework.bounce = 200;
// .firework.gravity = 10;
// .firework.sparks = 12;
2019-05-31 03:45:07 +00:00
// .gol.start_percentage = 90;
// .gol.blend_speed = 10;
// .gol.restart_after_steps = 100;
// .sines.count = 5;
2019-06-07 04:24:16 +00:00
// .snake.direction_change = 5;
// .snake.slowdown = 2;
2019-06-05 04:29:47 +00:00
// Stop editing here
2019-05-30 11:11:42 +00:00
#ifdef DEBUG
2019-06-07 04:24:16 +00:00
#ifdef MQTT_ENABLE
#include "my_mqtt.h"
#define LOG(msg, ...) do { \
char buffer[128]; \
snprintf_P(buffer, 128, PSTR(msg), ##__VA_ARGS__);\
mqtt_log(buffer);\
Serial.print(buffer);\
} while (0);
#define LOGln(msg, ...) do {\
char buffer[128]; \
snprintf_P(buffer, 128, PSTR(msg), ##__VA_ARGS__);\
mqtt_log_ln(buffer);\
Serial.println(buffer);\
} while (0);
2019-06-07 04:24:16 +00:00
#else
#define LOG(x, ...) Serial.printf(x, ##__VA_ARGS__);
2020-04-30 04:53:35 +00:00
#define LOGln(x, ...) { Serial.printf(x, ##__VA_ARGS__); Serial.println(); }
2019-06-07 04:24:16 +00:00
#endif
2020-04-30 04:53:35 +00:00
#define DBG(msg, ...) { Serial.printf(msg, ##__VA_ARGS__); Serial.println(); }
2019-05-30 11:11:42 +00:00
#else
#define LOG(x) do {} while(0);
#define LOGln(x) do {} while(0);
#define DBG(msg, ...) do {} while(0);
2019-05-30 11:11:42 +00:00
#endif
2019-06-06 04:41:11 +00:00
#if !defined( ESP8266 ) && !defined( ESP32 )
#error "Neither ESP8266 nor ESP32 are set. Maybe you are compiling this for another platform...?"
#endif
2019-06-06 04:41:11 +00:00
#ifndef CONFIG_USABLE
2019-06-07 04:24:16 +00:00
#error "CONFIG_USABLE isn't set!"
2019-06-06 04:41:11 +00:00
#endif