Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IRMQTTServer: Build a minimal OTA image via PlatformIO. #1541

Merged
merged 1 commit into from
Jul 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions examples/IRMQTTServer/IRMQTTServer.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Send & receive arbitrary IR codes via a web server or MQTT.
* Copyright David Conran 2016, 2017, 2018, 2019, 2020
* Copyright David Conran 2016-2021
*/
#ifndef EXAMPLES_IRMQTTSERVER_IRMQTTSERVER_H_
#define EXAMPLES_IRMQTTSERVER_IRMQTTSERVER_H_
Expand Down Expand Up @@ -101,8 +101,9 @@ const IPAddress kSubnetMask = IPAddress(255, 255, 255, 0);
// The unset default is 8%.
// (Uncomment to enable)
// Do you want/need mdns enabled? (https://en.wikipedia.org/wiki/Multicast_DNS)
#ifndef MDNS_ENABLE
#define MDNS_ENABLE true // `false` to disable and save ~21k of program space.

#endif // MDNS_ENABLE
// ----------------------- HTTP Related Settings -------------------------------
#define FIRMWARE_OTA true // Allow remote update of the firmware via http.
// Less secure if enabled.
Expand Down Expand Up @@ -197,7 +198,9 @@ const uint16_t kMinUnknownSize = 2 * 10;
// can understand the individual settings of the remote.
// e.g. Aquire the A/C settings from an actual A/C IR remote and override
// any local settings set via MQTT/HTTP etc.
#ifndef USE_DECODED_AC_SETTINGS
#define USE_DECODED_AC_SETTINGS true // `false` to disable. `true` to enable.
#endif // USE_DECODED_AC_SETTINGS
// Should we allow or ignore an A/C IR remote to override the A/C protocol/model
// as set via MQTT or HTTP?
// e.g. If `true`, you can use any fully supported A/C remote to control
Expand Down
16 changes: 15 additions & 1 deletion examples/IRMQTTServer/platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,21 @@ lib_deps = ${common_esp32.lib_deps_external}

[env:esp01_1m]
board = esp01_1m
board_build.ldscript = eagle.flash.1m64.ld
lib_deps = ${common_esp8266.lib_deps_external}

; This is just to help enable swapping IRMQTTServer via OTA on platforms with
; limited flash space. It doesn't do *ANY* IR stuff. It has almost everything
; turned off except OTA over http.
; Produces a ".bin" file of ~380k.
[env:esp8266_1m_OTA_minimal]
board = esp01_1m
board_build.ldscript = eagle.flash.1m64.ld
build_flags =
${env.build_flags}
-Wl,-Teagle.flash.1m64.ld
-DMQTT_ENABLE=false
-D_IR_ENABLE_DEFAULT_=false
-DEXAMPLES_ENABLE=false
-DMDNS_ENABLE=false
-DUSE_DECODED_AC_SETTINGS=false
lib_deps = ${common_esp8266.lib_deps_external}
8 changes: 4 additions & 4 deletions src/IRrecv.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@ const uint8_t kDefaultESP32Timer = 3;
#if DECODE_AC
// Hitachi AC is the current largest state size.
const uint16_t kStateSizeMax = kHitachiAc2StateLength;
#else
// Just define something
const uint16_t kStateSizeMax = 0;
#endif
#else // DECODE_AC
// Just define something (a uint64_t)
const uint16_t kStateSizeMax = sizeof(uint64_t);
#endif // DECODE_AC

// Types

Expand Down