2021-03-27 04:07:25 +01:00
# define Sprintf(f, ...) ({ char* s; asprintf(&s, f, __VA_ARGS__); String r = s; free(s); r; })
# define ESPMAC (Sprintf("%06" PRIx64, ESP.getEfuseMac() >> 24))
2021-03-27 13:46:46 +01:00
# if VERBOSE
# define LOG_LOCAL_LEVEL ESP_LOG_VERBOSE
# endif
2018-10-01 23:26:07 +02:00
//Replace with your Wifi SSID; example: #define ssid "MyWifi"
2021-03-15 20:58:17 +01:00
# define DEFAULT_WIFI_SSID "$SSID$"
2018-10-01 23:26:07 +02:00
//Replace with your Wifi password; example: #define password "12345678"
2021-03-15 20:58:17 +01:00
# define DEFAULT_WIFI_PASSWORD "$WIFI_PASSWORD$"
2018-10-01 23:26:07 +02:00
2019-05-22 01:53:27 +02:00
//Replace with a human-friendly host name. Must not contain spaces or special characters and be unique on your network
2021-03-15 20:58:17 +01:00
# define DEFAULT_HOSTNAME "esp32_room_presence"
2018-10-01 23:26:07 +02:00
2021-03-15 20:58:17 +01:00
//Replace with your MQTT Broker address
# define DEFAULT_MQTT_HOST "mqtt.z13.org"
2018-10-01 23:26:07 +02:00
2021-03-15 20:58:17 +01:00
//Replace with your MQTT Broker port
# define DEFAULT_MQTT_PORT 1883
2018-10-01 23:26:07 +02:00
2021-03-15 20:58:17 +01:00
//Replace with your MQTT Broker user
# define DEFAULT_MQTT_USER ""
2018-10-01 23:26:07 +02:00
2021-03-15 20:58:17 +01:00
//Replace with your MQTT Broker password
# define DEFAULT_MQTT_PASSWORD ""
2018-10-01 23:26:07 +02:00
2021-03-15 20:58:17 +01:00
//Replace with the room name where the node will be placed
# define DEFAULT_ROOM "living-room"
2018-10-02 02:01:29 +02:00
2021-03-16 02:11:55 +01:00
# ifdef M5STICK
2021-03-27 15:02:10 +01:00
# define LED_BUILTIN 10
# define LED_BUILTIN_ON 0
# define BUTTON 39
# define BUTTON_PRESSED 0
2021-03-27 15:58:54 +01:00
# else
# if M5ATOM
# define LED_BUILTIN 10
# define LED_BUILTIN_ON 0
# define BUTTON 39
# define BUTTON_PRESSED 0
2021-03-27 15:02:10 +01:00
# else // Huzzah32
# define LED_BUILTIN 13
# define LED_BUILTIN_ON 1
2021-03-27 15:58:54 +01:00
# endif
2021-03-16 02:11:55 +01:00
# endif
2018-12-26 20:55:33 +01:00
2021-03-25 04:40:28 +01:00
# ifdef M5STICK
2021-03-27 15:02:10 +01:00
2021-03-25 04:40:28 +01:00
# else
2021-03-27 15:02:10 +01:00
# endif
2018-12-26 20:55:33 +01:00
2021-08-21 22:48:00 +02:00
//Define the base topic for room detection. Usually "presense"
# define CHANNEL String("presense")
2019-05-22 01:53:27 +02:00
2018-12-10 20:21:06 +01:00
// Define bluetooth scan parameters
2021-03-30 14:23:55 +02:00
# define BLE_ACTIVE_SCAN false // Active scan uses more power, but get results faster
2021-03-15 20:58:17 +01:00
2021-03-31 19:36:20 +02:00
# define BLE_SCAN_INTERVAL 40 // Used to determine antenna sharing between Bluetooth and WiFi. Do not modify unless you are confident you know what you're doing
# define BLE_SCAN_WINDOW 30 // Used to determine antenna sharing between Bluetooth and WiFi. Do not modify unless you are confident you know what you're doing
2019-01-13 15:42:24 +01:00
// Maximum distance (in meters) to report. Devices that are calculated to be further than this distance in meters will not be reported
2021-03-24 19:07:54 +01:00
# define MAX_DISTANCE 16
2020-03-07 20:20:52 +01:00
2021-03-30 19:24:02 +02:00
// Max number of mac addresses to keep track of
# define MAX_MAC_ADDRESSES 50
// Number of seconds between update checks
# define CHECK_FOR_UPDATES_INTERVAL 300
2021-04-05 04:12:46 +02:00
2021-04-05 23:08:11 +02:00
# define ONE_EURO_FCMIN 0.01
2021-04-05 04:12:46 +02:00
2021-04-05 23:08:11 +02:00
# define ONE_EURO_BETA 0.005
2021-04-05 04:12:46 +02:00
# define ONE_EURO_DCUTOFF 1