diff --git a/boards.txt b/boards.txt index 90c57ac4ff..1519bba24d 100644 --- a/boards.txt +++ b/boards.txt @@ -665,6 +665,216 @@ espresso_lite_v2.menu.DebugLevel.all_____.build.debug_level=-DDEBUG_ESP_CORE -DD espresso_lite_v2.build.debug_port= espresso_lite_v2.build.debug_level= +############################################################## +phoenix_v1.name=Phoenix 1.0 +phoenix_v1.upload.tool=esptool +phoenix_v1.upload.speed=115200 +phoenix_v1.upload.maximum_size=1044464 +phoenix_v1.upload.maximum_data_size=81920 +phoenix_v1.upload.wait_for_upload_port=true + +phoenix_v1.build.mcu=esp8266 +phoenix_v1.build.f_cpu=80000000L +phoenix_v1.build.board=ESP8266_PHOENIX_V1 +phoenix_v1.build.core=esp8266 +phoenix_v1.build.variant=phoenix_v1 +phoenix_v1.build.flash_mode=dio +phoenix_v1.build.flash_size=4M +phoenix_v1.build.flash_freq=40 + +phoenix_v1.menu.CpuFrequency.80=80 MHz +phoenix_v1.menu.CpuFrequency.80.build.f_cpu=80000000L +phoenix_v1.menu.CpuFrequency.160=160 MHz +phoenix_v1.menu.CpuFrequency.160.build.f_cpu=160000000L + +phoenix_v1.menu.UploadSpeed.115200=115200 +phoenix_v1.menu.UploadSpeed.115200.upload.speed=115200 +phoenix_v1.menu.UploadSpeed.57600=57600 +phoenix_v1.menu.UploadSpeed.57600.upload.speed=57600 +phoenix_v1.menu.UploadSpeed.256000.windows=256000 +phoenix_v1.menu.UploadSpeed.256000.upload.speed=256000 +phoenix_v1.menu.UploadSpeed.230400.linux=230400 +phoenix_v1.menu.UploadSpeed.230400.macosx=230400 +phoenix_v1.menu.UploadSpeed.230400.macosx=230400 +phoenix_v1.menu.UploadSpeed.230400.upload.speed=230400 +phoenix_v1.menu.UploadSpeed.460800.linux=460800 +phoenix_v1.menu.UploadSpeed.460800.macosx=460800 +phoenix_v1.menu.UploadSpeed.460800.upload.speed=460800 +phoenix_v1.menu.UploadSpeed.512000.windows=512000 +phoenix_v1.menu.UploadSpeed.512000.upload.speed=512000 +phoenix_v1.menu.UploadSpeed.921600=921600 +phoenix_v1.menu.UploadSpeed.921600.upload.speed=921600 + +phoenix_v1.menu.FlashSize.4M3M=4M (3M SPIFFS) +phoenix_v1.menu.FlashSize.4M3M.build.flash_size=4M +phoenix_v1.menu.FlashSize.4M3M.build.flash_ld=eagle.flash.4m.ld +phoenix_v1.menu.FlashSize.4M3M.build.spiffs_start=0x100000 +phoenix_v1.menu.FlashSize.4M3M.build.spiffs_end=0x3FB000 +phoenix_v1.menu.FlashSize.4M3M.build.spiffs_blocksize=8192 +phoenix_v1.menu.FlashSize.4M3M.upload.maximum_size=1044464 + +phoenix_v1.menu.FlashSize.4M1M=4M (1M SPIFFS) +phoenix_v1.menu.FlashSize.4M1M.build.flash_size=4M +phoenix_v1.menu.FlashSize.4M1M.build.flash_ld=eagle.flash.4m1m.ld +phoenix_v1.menu.FlashSize.4M1M.build.spiffs_start=0x300000 +phoenix_v1.menu.FlashSize.4M1M.build.spiffs_end=0x3FB000 +phoenix_v1.menu.FlashSize.4M1M.build.spiffs_blocksize=8192 +phoenix_v1.menu.FlashSize.4M1M.build.spiffs_pagesize=256 +phoenix_v1.menu.FlashSize.4M1M.upload.maximum_size=1044464 + +phoenix_v1.menu.ResetMethod.nodemcu=nodemcu +phoenix_v1.menu.ResetMethod.nodemcu.upload.resetmethod=nodemcu +phoenix_v1.menu.ResetMethod.ck=ck +phoenix_v1.menu.ResetMethod.ck.upload.resetmethod=ck + +phoenix_v1.menu.Debug.Disabled=Disabled +phoenix_v1.menu.Debug.Disabled.build.debug_port= +phoenix_v1.menu.Debug.Serial=Serial +phoenix_v1.menu.Debug.Serial.build.debug_port=-DDEBUG_ESP_PORT=Serial +phoenix_v1.menu.Debug.Serial1=Serial1 +phoenix_v1.menu.Debug.Serial1.build.debug_port=-DDEBUG_ESP_PORT=Serial1 + +phoenix_v1.menu.DebugLevel.None____=None +phoenix_v1.menu.DebugLevel.None____.build.debug_level= +phoenix_v1.menu.DebugLevel.Core____=Core +phoenix_v1.menu.DebugLevel.Core____.build.debug_level=-DDEBUG_ESP_CORE +phoenix_v1.menu.DebugLevel.SSL_____=Core + SSL +phoenix_v1.menu.DebugLevel.SSL_____.build.debug_level=-DDEBUG_ESP_CORE -DDEBUG_ESP_SSL +phoenix_v1.menu.DebugLevel.SSL_MEM_=Core + SSL + TLS Mem +phoenix_v1.menu.DebugLevel.SSL_MEM_.build.debug_level=-DDEBUG_ESP_CORE -DDEBUG_ESP_SSL -DDEBUG_TLS_MEM +phoenix_v1.menu.DebugLevel.WiFic___=Core + WiFi +phoenix_v1.menu.DebugLevel.WiFic___.build.debug_level=-DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI +phoenix_v1.menu.DebugLevel.WiFi____=WiFi +phoenix_v1.menu.DebugLevel.WiFi____.build.debug_level=-DDEBUG_ESP_WIFI +phoenix_v1.menu.DebugLevel.HTTPClient=HTTPClient +phoenix_v1.menu.DebugLevel.HTTPClient.build.debug_level=-DDEBUG_ESP_HTTP_CLIENT +phoenix_v1.menu.DebugLevel.HTTPClient2=HTTPClient + SSL +phoenix_v1.menu.DebugLevel.HTTPClient2.build.debug_level=-DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_SSL +phoenix_v1.menu.DebugLevel.HTTPUpdate=HTTPUpdate +phoenix_v1.menu.DebugLevel.HTTPUpdate.build.debug_level=-DDEBUG_ESP_HTTP_UPDATE +phoenix_v1.menu.DebugLevel.HTTPUpdate2=HTTPClient + HTTPUpdate +phoenix_v1.menu.DebugLevel.HTTPUpdate2.build.debug_level=-DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_HTTP_UPDATE +phoenix_v1.menu.DebugLevel.HTTPUpdate3=HTTPClient + HTTPUpdate + Updater +phoenix_v1.menu.DebugLevel.HTTPUpdate3.build.debug_level=-DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER +phoenix_v1.menu.DebugLevel.HTTPServer=HTTPServer +phoenix_v1.menu.DebugLevel.HTTPServer.build.debug_level=-DDEBUG_ESP_HTTP_SERVER +phoenix_v1.menu.DebugLevel.UPDATER=Updater +phoenix_v1.menu.DebugLevel.UPDATER.build.debug_level=-DDEBUG_ESP_UPDATER +phoenix_v1.menu.DebugLevel.OTA_____=OTA +phoenix_v1.menu.DebugLevel.OTA_____.build.debug_level=-DDEBUG_ESP_OTA +phoenix_v1.menu.DebugLevel.OTA2____=OTA + Updater +phoenix_v1.menu.DebugLevel.OTA2____.build.debug_level=-DDEBUG_ESP_OTA -DDEBUG_ESP_UPDATER +phoenix_v1.menu.DebugLevel.all_____=All +phoenix_v1.menu.DebugLevel.all_____.build.debug_level=-DDEBUG_ESP_CORE -DDEBUG_ESP_SSL -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_HTTP_SERVER -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_TLS_MEM + +phoenix_v1.build.debug_port= +phoenix_v1.build.debug_level= + +############################################################## +phoenix_v2.name=Phoenix 2.0 +phoenix_v2.upload.tool=esptool +phoenix_v2.upload.speed=115200 +phoenix_v2.upload.maximum_size=1044464 +phoenix_v2.upload.maximum_data_size=81920 +phoenix_v2.upload.wait_for_upload_port=true + +phoenix_v2.build.mcu=esp8266 +phoenix_v2.build.f_cpu=80000000L +phoenix_v2.build.board=ESP8266_PHOENIX_V2 +phoenix_v2.build.core=esp8266 +phoenix_v2.build.variant=phoenix_v2 +phoenix_v2.build.flash_mode=dio +phoenix_v2.build.flash_size=4M +phoenix_v2.build.flash_freq=40 + +phoenix_v2.menu.CpuFrequency.80=80 MHz +phoenix_v2.menu.CpuFrequency.80.build.f_cpu=80000000L +phoenix_v2.menu.CpuFrequency.160=160 MHz +phoenix_v2.menu.CpuFrequency.160.build.f_cpu=160000000L + +phoenix_v2.menu.UploadSpeed.115200=115200 +phoenix_v2.menu.UploadSpeed.115200.upload.speed=115200 +phoenix_v2.menu.UploadSpeed.57600=57600 +phoenix_v2.menu.UploadSpeed.57600.upload.speed=57600 +phoenix_v2.menu.UploadSpeed.256000.windows=256000 +phoenix_v2.menu.UploadSpeed.256000.upload.speed=256000 +phoenix_v2.menu.UploadSpeed.230400.linux=230400 +phoenix_v2.menu.UploadSpeed.230400.macosx=230400 +phoenix_v2.menu.UploadSpeed.230400.macosx=230400 +phoenix_v2.menu.UploadSpeed.230400.upload.speed=230400 +phoenix_v2.menu.UploadSpeed.460800.linux=460800 +phoenix_v2.menu.UploadSpeed.460800.macosx=460800 +phoenix_v2.menu.UploadSpeed.460800.upload.speed=460800 +phoenix_v2.menu.UploadSpeed.512000.windows=512000 +phoenix_v2.menu.UploadSpeed.512000.upload.speed=512000 +phoenix_v2.menu.UploadSpeed.921600=921600 +phoenix_v2.menu.UploadSpeed.921600.upload.speed=921600 + +phoenix_v2.menu.FlashSize.4M3M=4M (3M SPIFFS) +phoenix_v2.menu.FlashSize.4M3M.build.flash_size=4M +phoenix_v2.menu.FlashSize.4M3M.build.flash_ld=eagle.flash.4m.ld +phoenix_v2.menu.FlashSize.4M3M.build.spiffs_start=0x100000 +phoenix_v2.menu.FlashSize.4M3M.build.spiffs_end=0x3FB000 +phoenix_v2.menu.FlashSize.4M3M.build.spiffs_blocksize=8192 +phoenix_v2.menu.FlashSize.4M3M.upload.maximum_size=1044464 + +phoenix_v2.menu.FlashSize.4M1M=4M (1M SPIFFS) +phoenix_v2.menu.FlashSize.4M1M.build.flash_size=4M +phoenix_v2.menu.FlashSize.4M1M.build.flash_ld=eagle.flash.4m1m.ld +phoenix_v2.menu.FlashSize.4M1M.build.spiffs_start=0x300000 +phoenix_v2.menu.FlashSize.4M1M.build.spiffs_end=0x3FB000 +phoenix_v2.menu.FlashSize.4M1M.build.spiffs_blocksize=8192 +phoenix_v2.menu.FlashSize.4M1M.build.spiffs_pagesize=256 +phoenix_v2.menu.FlashSize.4M1M.upload.maximum_size=1044464 + +phoenix_v2.menu.ResetMethod.ck=ck +phoenix_v2.menu.ResetMethod.ck.upload.resetmethod=ck +phoenix_v2.menu.ResetMethod.nodemcu=nodemcu +phoenix_v2.menu.ResetMethod.nodemcu.upload.resetmethod=nodemcu + +phoenix_v2.menu.Debug.Disabled=Disabled +phoenix_v2.menu.Debug.Disabled.build.debug_port= +phoenix_v2.menu.Debug.Serial=Serial +phoenix_v2.menu.Debug.Serial.build.debug_port=-DDEBUG_ESP_PORT=Serial +phoenix_v2.menu.Debug.Serial1=Serial1 +phoenix_v2.menu.Debug.Serial1.build.debug_port=-DDEBUG_ESP_PORT=Serial1 + +phoenix_v2.menu.DebugLevel.None____=None +phoenix_v2.menu.DebugLevel.None____.build.debug_level= +phoenix_v2.menu.DebugLevel.Core____=Core +phoenix_v2.menu.DebugLevel.Core____.build.debug_level=-DDEBUG_ESP_CORE +phoenix_v2.menu.DebugLevel.SSL_____=Core + SSL +phoenix_v2.menu.DebugLevel.SSL_____.build.debug_level=-DDEBUG_ESP_CORE -DDEBUG_ESP_SSL +phoenix_v2.menu.DebugLevel.SSL_MEM_=Core + SSL + TLS Mem +phoenix_v2.menu.DebugLevel.SSL_MEM_.build.debug_level=-DDEBUG_ESP_CORE -DDEBUG_ESP_SSL -DDEBUG_TLS_MEM +phoenix_v2.menu.DebugLevel.WiFic___=Core + WiFi +phoenix_v2.menu.DebugLevel.WiFic___.build.debug_level=-DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI +phoenix_v2.menu.DebugLevel.WiFi____=WiFi +phoenix_v2.menu.DebugLevel.WiFi____.build.debug_level=-DDEBUG_ESP_WIFI +phoenix_v2.menu.DebugLevel.HTTPClient=HTTPClient +phoenix_v2.menu.DebugLevel.HTTPClient.build.debug_level=-DDEBUG_ESP_HTTP_CLIENT +phoenix_v2.menu.DebugLevel.HTTPClient2=HTTPClient + SSL +phoenix_v2.menu.DebugLevel.HTTPClient2.build.debug_level=-DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_SSL +phoenix_v2.menu.DebugLevel.HTTPUpdate=HTTPUpdate +phoenix_v2.menu.DebugLevel.HTTPUpdate.build.debug_level=-DDEBUG_ESP_HTTP_UPDATE +phoenix_v2.menu.DebugLevel.HTTPUpdate2=HTTPClient + HTTPUpdate +phoenix_v2.menu.DebugLevel.HTTPUpdate2.build.debug_level=-DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_HTTP_UPDATE +phoenix_v2.menu.DebugLevel.HTTPUpdate3=HTTPClient + HTTPUpdate + Updater +phoenix_v2.menu.DebugLevel.HTTPUpdate3.build.debug_level=-DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER +phoenix_v2.menu.DebugLevel.HTTPServer=HTTPServer +phoenix_v2.menu.DebugLevel.HTTPServer.build.debug_level=-DDEBUG_ESP_HTTP_SERVER +phoenix_v2.menu.DebugLevel.UPDATER=Updater +phoenix_v2.menu.DebugLevel.UPDATER.build.debug_level=-DDEBUG_ESP_UPDATER +phoenix_v2.menu.DebugLevel.OTA_____=OTA +phoenix_v2.menu.DebugLevel.OTA_____.build.debug_level=-DDEBUG_ESP_OTA +phoenix_v2.menu.DebugLevel.OTA2____=OTA + Updater +phoenix_v2.menu.DebugLevel.OTA2____.build.debug_level=-DDEBUG_ESP_OTA -DDEBUG_ESP_UPDATER +phoenix_v2.menu.DebugLevel.all_____=All +phoenix_v2.menu.DebugLevel.all_____.build.debug_level=-DDEBUG_ESP_CORE -DDEBUG_ESP_SSL -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_HTTP_SERVER -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_TLS_MEM + +phoenix_v2.build.debug_port= +phoenix_v2.build.debug_level= + ############################################################## nodemcu.name=NodeMCU 0.9 (ESP-12 Module) diff --git a/doc/boards.md b/doc/boards.md index 7ff70be73f..f500263b0d 100644 --- a/doc/boards.md +++ b/doc/boards.md @@ -12,6 +12,8 @@ title: Supported Hardware * [Olimex MOD\-WIFI\-ESP8266\-DEV](#olimex-mod-wifi-esp8266-dev) * [Olimex MOD\-WIFI\-ESP8266](#olimex-mod-wifi-esp8266) * [Olimex ESP8266\-EVB](#olimex-esp8266-evb) + * [Phoenix 1\.0](#phoenix-10) + * [Phoenix 2\.0](#phoenix-20) * [SparkFun ESP8266 Thing](#sparkfun-esp8266-thing) * [SweetPea ESP\-210](#sweetpea-esp-210) * [ESPino](#espino) @@ -44,6 +46,13 @@ ESPresso Lite 1.0 (beta version) is an Arduino-compatible Wi-Fi development boar ESPresso Lite 2.0 is an Arduino-compatible Wi-Fi development board based on an earlier V1 (beta version). Re-designed together with Cytron Technologies, the newly-revised ESPresso Lite V2.0 features the auto-load/auto-program function, eliminating the previous need to reset the board manually before flashing a new program. It also feature two user programmable side buttons and a reset button. The special distinctive features of on-board pads for I2C sensor and actuator is retained. +## Phoenix 1.0 + +Product page: http://www.espert.co + +## Phoenix 2.0 + +Product page: http://www.espert.co ## NodeMCU 0.9 diff --git a/libraries/ESP8266HTTPClient/src/ESP8266HTTPClient.cpp b/libraries/ESP8266HTTPClient/src/ESP8266HTTPClient.cpp index d426105852..7f8671fbf0 100644 --- a/libraries/ESP8266HTTPClient/src/ESP8266HTTPClient.cpp +++ b/libraries/ESP8266HTTPClient/src/ESP8266HTTPClient.cpp @@ -706,19 +706,27 @@ String HTTPClient::errorToString(int error) * @param value * @param first */ -void HTTPClient::addHeader(const String& name, const String& value, bool first) +void HTTPClient::addHeader(const String& name, const String& value, bool first, bool replace) { - // not allow set of Header handled by code if(!name.equalsIgnoreCase(F("Connection")) && !name.equalsIgnoreCase(F("User-Agent")) && !name.equalsIgnoreCase(F("Host")) && !(name.equalsIgnoreCase(F("Authorization")) && _base64Authorization.length())){ + String headerLine = name; headerLine += ": "; + + if (replace) { + int headerStart = _headers.indexOf(headerLine); + if (headerStart != -1) { + int headerEnd = _headers.indexOf('\n', headerStart); + _headers = _headers.substring(0, headerStart) + _headers.substring(headerEnd + 1); + } + } + headerLine += value; headerLine += "\r\n"; - if(first) { _headers = headerLine + _headers; } else { diff --git a/libraries/ESP8266HTTPClient/src/ESP8266HTTPClient.h b/libraries/ESP8266HTTPClient/src/ESP8266HTTPClient.h index 1619a3b58a..53a5d98844 100644 --- a/libraries/ESP8266HTTPClient/src/ESP8266HTTPClient.h +++ b/libraries/ESP8266HTTPClient/src/ESP8266HTTPClient.h @@ -160,7 +160,7 @@ class HTTPClient int sendRequest(const char * type, uint8_t * payload = NULL, size_t size = 0); int sendRequest(const char * type, Stream * stream, size_t size = 0); - void addHeader(const String& name, const String& value, bool first = false); + void addHeader(const String& name, const String& value, bool first = false, bool replace = true); /// Response handling void collectHeaders(const char* headerKeys[], const size_t headerKeysCount); diff --git a/package/package_esp8266com_index.template.json b/package/package_esp8266com_index.template.json index 9023b32e30..d764274cbb 100644 --- a/package/package_esp8266com_index.template.json +++ b/package/package_esp8266com_index.template.json @@ -43,6 +43,12 @@ { "name": "ESPresso Lite 2.0" }, + { + "name": "Phoenix 1.0" + }, + { + "name": "Phoenix 2.0" + }, { "name": "SparkFun Thing" }, diff --git a/tests/device/libraries/test_config/test_config.h.template b/tests/device/libraries/test_config/test_config.h.template index f318f91f01..740884dba9 100644 --- a/tests/device/libraries/test_config/test_config.h.template +++ b/tests/device/libraries/test_config/test_config.h.template @@ -6,3 +6,4 @@ #define AP_SSID "test_wifi_ap" #define AP_PASS "test_wifi_ap_pass" +#define SERVER_IP "192.168.10.1" diff --git a/tests/device/test_http_client/test_http_client.ino b/tests/device/test_http_client/test_http_client.ino index 85a30fc192..32e5613715 100644 --- a/tests/device/test_http_client/test_http_client.ino +++ b/tests/device/test_http_client/test_http_client.ino @@ -21,7 +21,7 @@ void setup() const char* fp = "40 A3 6C E3 8A DF A2 D4 13 B0 32 5C 87 44 54 28 0B CE C5 A4"; -TEST_CASE("HTTP GET request", "[HTTPClient]") +TEST_CASE("HTTP GET & POST requests", "[HTTPClient]") { { // small request @@ -47,7 +47,20 @@ TEST_CASE("HTTP GET request", "[HTTPClient]") } } } + { + // can do two POST requests with one HTTPClient object (#1902) + HTTPClient http; + http.begin(SERVER_IP, 8088, "/"); + http.addHeader("Content-Type", "text/plain"); + auto httpCode = http.POST("foo"); + Serial.println(httpCode); + REQUIRE(httpCode == HTTP_CODE_OK); + http.end(); + httpCode = http.POST("bar"); + REQUIRE(httpCode == HTTP_CODE_OK); + http.end(); + } } @@ -79,57 +92,6 @@ TEST_CASE("HTTPS GET request", "[HTTPClient]") } } -// TEST_CASE("HTTP GET request", "[HTTPClient]") -// { -// const int repeatCount = 10; - -// String url = createBin(false); -// int heapBefore = ESP.getFreeHeap(); -// for (int i = 0; i < repeatCount; ++i) { -// HTTPClient http; -// http.begin(url); -// auto httpCode = http.GET(); -// REQUIRE(httpCode == HTTP_CODE_OK); -// String payload = http.getString(); -// payload.replace("\n", "\\n"); -// String quotedPayload; -// quotedPayload.reserve(payload.length() + 3); -// quotedPayload += "\""; -// quotedPayload += payload; -// quotedPayload += "\""; -// Serial.println("----payload:"); -// Serial.println(quotedPayload); -// Serial.println("----"); -// Serial.println("----test_payload:"); -// Serial.println(test_payload); -// Serial.println("----"); -// CHECK(quotedPayload == test_payload); -// http.end(); -// delay(100); -// } -// int heapAfter = ESP.getFreeHeap(); -// CHECK(heapBefore - heapAfter <= 8); -// } - -// TEST_CASE("HTTPS GET request", "[HTTPClient]") -// { -// const int repeatCount = 10; - -// String url = createBin(true); -// int heapBefore = ESP.getFreeHeap(); -// for (int i = 0; i < repeatCount; ++i) { -// HTTPClient http; -// http.begin(url, mockbin_fingerprint); -// auto httpCode = http.GET(); -// REQUIRE(httpCode == HTTP_CODE_OK); -// String payload = http.getString(); -// CHECK(payload == test_payload); -// http.end(); -// delay(100); -// } -// int heapAfter = ESP.getFreeHeap(); -// CHECK(heapBefore - heapAfter <= 8); -// } void loop() { diff --git a/tests/device/test_http_client/test_http_client.py b/tests/device/test_http_client/test_http_client.py index 32c70d2d26..ac9f065bf2 100644 --- a/tests/device/test_http_client/test_http_client.py +++ b/tests/device/test_http_client/test_http_client.py @@ -5,7 +5,7 @@ import os import ssl -@setup('HTTP GET request') +@setup('HTTP GET & POST requests') def setup_http_get(e): app = Flask(__name__) def shutdown_server(): @@ -17,8 +17,9 @@ def shutdown_server(): def shutdown(): shutdown_server() return 'Server shutting down...' - @app.route("/") + @app.route("/", methods = ['GET', 'POST']) def root(): + print('Got data: ' + request.data); return 'hello!!!' @app.route("/data") def get_data(): @@ -29,7 +30,7 @@ def flaskThread(): th = Thread(target=flaskThread) th.start() -@teardown('HTTP GET request') +@teardown('HTTP GET & POST requests') def teardown_http_get(e): response = urllib2.urlopen('http://localhost:8088/shutdown') html = response.read() diff --git a/variants/phoenix_v1/pins_arduino.h b/variants/phoenix_v1/pins_arduino.h new file mode 100644 index 0000000000..129653e923 --- /dev/null +++ b/variants/phoenix_v1/pins_arduino.h @@ -0,0 +1,39 @@ +/* + pins_arduino.h - Pin definition functions for Arduino + Part of Arduino - http://www.arduino.cc/ + + Copyright (c) 2007 David A. Mellis + Modified for ESP8266 platform by Ivan Grokhotkov, 2014-2015. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General + Public License along with this library; if not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, + Boston, MA 02111-1307 USA + + $Id: wiring.h 249 2007-02-03 16:52:51Z mellis $ +*/ + +#ifndef Pins_Arduino_h +#define Pins_Arduino_h + +#include "../generic/common.h" + +#define PHOENIX_VERSION 1 + +static const uint8_t SDA = 4; +static const uint8_t SCL = 5; + +static const uint8_t LED_BUILTIN = 16; +static const uint8_t BUILTIN_LED = 16; + +#endif /* Pins_Arduino_h */ diff --git a/variants/phoenix_v2/pins_arduino.h b/variants/phoenix_v2/pins_arduino.h new file mode 100644 index 0000000000..7ae98fe363 --- /dev/null +++ b/variants/phoenix_v2/pins_arduino.h @@ -0,0 +1,39 @@ +/* + pins_arduino.h - Pin definition functions for Arduino + Part of Arduino - http://www.arduino.cc/ + + Copyright (c) 2007 David A. Mellis + Modified for ESP8266 platform by Ivan Grokhotkov, 2014-2015. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General + Public License along with this library; if not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, + Boston, MA 02111-1307 USA + + $Id: wiring.h 249 2007-02-03 16:52:51Z mellis $ +*/ + +#ifndef Pins_Arduino_h +#define Pins_Arduino_h + +#include "../generic/common.h" + +#define PHOENIX_VERSION 2 + +static const uint8_t SDA = 4; +static const uint8_t SCL = 5; + +static const uint8_t LED_BUILTIN = 2; +static const uint8_t BUILTIN_LED = 2; + +#endif /* Pins_Arduino_h */