Skip to content

Commit

Permalink
change to use the new OTF library; bump up firmware version number
Browse files Browse the repository at this point in the history
  • Loading branch information
rayshobby committed Aug 29, 2024
1 parent 9d9cc90 commit b1e1f8c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion OpenGarage/defines.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#define _DEFINES_H

/** Firmware version, hardware version, and maximal values */
#define OG_FWV 120 // Firmware version: 120 means 1.2.0
#define OG_FWV 122 // Firmware version: 122 means 1.2.2

/** GPIO pins */
#define PIN_RELAY 15 // D8 on nodemcu
Expand Down
6 changes: 4 additions & 2 deletions OpenGarage/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ void otf_send_html_P(OTF::Response &res, const __FlashStringHelper *content) {
res.writeHeader(F("Access-Control-Allow-Origin"), F("*")); // from esp8266 2.4 this has to be sent explicitly
res.writeHeader(F("Content-Length"), strlen_P((char *) content));
res.writeHeader(F("Connection"), F("close"));
res.writeBodyChunk((char *) "%s", content);
//res.writeBodyChunk((char *) "%s", content);
res.writeBodyData(content, strlen_P((char*)content));
DEBUG_PRINT(strlen_P((char *) content));
DEBUG_PRINTLN(F(" bytes sent."));
}
Expand All @@ -92,7 +93,8 @@ void otf_send_json(OTF::Response &res, String json) {
res.writeHeader(F("Access-Control-Allow-Origin"), F("*")); // from esp8266 2.4 this has to be sent explicitly
res.writeHeader(F("Content-Length"), json.length());
res.writeHeader(F("Connection"), F("close"));
res.writeBodyChunk((char *) "%s",json.c_str());
//res.writeBodyChunk((char *) "%s",json.c_str());
res.writeBodyData(json.c_str(), json.length());
}

void otf_send_result(OTF::Response &res, byte code, const char *item = NULL) {
Expand Down
7 changes: 3 additions & 4 deletions OpenGarage/platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ src_dir = .
include_dir = .

[env:d1_mini]
platform = espressif8266@2.6.3
platform = espressif8266@4.2.1
board = d1_mini
framework = arduino
lib_ldf_mode = deep
Expand All @@ -14,9 +14,8 @@ lib_deps =
https://github.com/PaulStoffregen/OneWire/archive/refs/tags/v2.3.7.zip
https://github.com/milesburton/Arduino-Temperature-Control-Library/archive/refs/tags/3.9.1.zip
https://github.com/beegee-tokyo/DHTesp/archive/refs/tags/1.18.zip
https://github.com/OpenThingsIO/OpenThings-Framework-Firmware-Library/archive/refs/heads/master.zip
https://github.com/Links2004/arduinoWebSockets/archive/refs/tags/2.3.5.zip
https://github.com/OpenThingsIO/OpenThings-Framework-Firmware-Library @ ^0.2.0
monitor_speed=115200
board_build.flash_mode = dio
upload_speed = 460800
board_build.ldscript = eagle.flash.4m1m.ld
board_build.ldscript = eagle.flash.4m1m.ld

0 comments on commit b1e1f8c

Please sign in to comment.