Compare commits

...
13 Commits
Author SHA1 Message Date
Khoi Hoang a91b9a48be v1.10.1 to fix bug of wrong reqStates
### Releases v1.10.1

1. Fix bug of wrong `reqStates`. Check [Release 1.9 breakes previously running code #39](https://github.com/khoih-prog/AsyncHTTPRequest_Generic/issues/39) and [Callback behaviour is buggy (ESP8266) #43](https://github.com/khoih-prog/AsyncHTTPRequest_Generic/issues/43)
2. Optional larger `DEFAULT_RX_TIMEOUT` from default 3s, for slower networks
2022-10-21 15:12:46 -04:00
Khoi Hoang e97224acf8 v1.10.1 to fix bug of wrong reqStates
### Releases v1.10.1

1. Fix bug of wrong `reqStates`
2. Optional larger `DEFAULT_RX_TIMEOUT` from default 3s, for slower networks
2022-10-21 15:11:17 -04:00
Khoi Hoang 40e15e30f9 v1.10.1 to fix bug of wrong reqStates
### Releases v1.10.1

1. Fix bug of wrong `reqStates`
2. Optional larger `DEFAULT_RX_TIMEOUT` from default 3s, for slower networks
2022-10-21 15:09:41 -04:00
Khoi Hoang fb494cae0f v1.10.0 to fix bug and clean-up
### Releases v1.10.0

1. Fix bug.
2. Clean up
2022-10-20 16:58:27 -04:00
Khoi Hoang dc076f7fc1 v1.10.0 to fix bug and clean-up
### Releases v1.10.0

1. Fix bug.
2. Clean up
2022-10-20 16:56:12 -04:00
Khoi Hoang 89d10346df v1.10.0 to fix bug and clean-up
### Releases v1.10.0

1. Fix bug.
2. Clean up
2022-10-20 16:54:51 -04:00
Khoi Hoang 89079c915e v1.9.2 not to reconnect after connected
### Releases v1.9.2

1. Not try to reconnect to the same host:port after connected. Check [setReuse feature #12](https://github.com/khoih-prog/AsyncHTTPSRequest_Generic/issues/12)
2. Update `Packages' Patches`
2022-10-18 22:42:35 -04:00
Khoi Hoang 5bdf91736a v1.9.2 not to reconnect after connected
### Releases v1.9.2

1. Not try to reconnect to the same host:port after connected. Check [setReuse feature #12](https://github.com/khoih-prog/AsyncHTTPSRequest_Generic/issues/12)
2. Update `Packages' Patches`
2022-10-18 22:40:07 -04:00
Khoi Hoang 79f62c3f4a v1.9.2 not to reconnect after connected
### Releases v1.9.2

1. Not try to reconnect to the same host:port after connected. Check [setReuse feature #12](https://github.com/khoih-prog/AsyncHTTPSRequest_Generic/issues/12)
2. Update `Packages' Patches`
2022-10-18 22:36:53 -04:00
Khoi Hoang dcdf3dc5f9 Update Packages' Patches 2022-10-18 22:35:39 -04:00
Khoi Hoang a1d91e3f3c v1.9.1 to fix ESP32 chipID
### Releases v1.9.1

1. Fix ESP32 chipID for example `AsyncHTTPRequest_ESP_WiFiManager`
2. Remove dependency on `LittleFS_esp32` library to prevent PIO error when using new ESP32 core v1.0.6+
2022-09-09 23:06:15 -04:00
Khoi Hoang 7eb3b1b470 v1.9.1 to fix ESP32 chipID
### Releases v1.9.1

1. Fix ESP32 chipID for example `AsyncHTTPRequest_ESP_WiFiManager`
2. Remove dependency on `LittleFS_esp32` library to prevent PIO error when using new ESP32 core v1.0.6+
2022-09-09 23:04:17 -04:00
Khoi Hoang 3b52e27f7c Fix typo 2022-09-09 11:51:08 -04:00
30 changed files with 1772 additions and 596 deletions
+4 -4
View File
@@ -15,7 +15,7 @@ If you don't find anything, please [open a new issue](https://github.com/khoih-p
Please ensure to specify the following:
* Arduino IDE version (e.g. 1.8.19) or Platform.io version
* `ESP8266`,`ESP32` or `STM32` Core Version (e.g. ESP8266 core v3.0.2, ESP32 v2.0.4 or STM32 v2.3.0)
* `ESP8266`,`ESP32` or `STM32` Core Version (e.g. ESP8266 core v3.0.2, ESP32 v2.0.5 or STM32 v2.3.0)
* Contextual information (e.g. what you were trying to achieve)
* Simplest possible steps to reproduce
* Anything that might be relevant in your opinion, such as:
@@ -27,12 +27,12 @@ Please ensure to specify the following:
```
Arduino IDE version: 1.8.19
ESP32 Core Version 2.0.4
ESP32 Core Version 2.0.5
OS: Ubuntu 20.04 LTS
Linux xy-Inspiron-3593 5.15.0-46-generic #49~20.04.1-Ubuntu SMP Thu Aug 4 19:15:44 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
Linux xy-Inspiron-3593 5.15.0-50-generic #56~20.04.1-Ubuntu SMP Tue Sep 27 15:51:29 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
Context:
I encountered an endless loop while trying to connect to Local WiFi.
I encountered a crash when using this library
Steps to reproduce:
1. ...
@@ -0,0 +1,181 @@
/*
Arduino.h - Main include file for the Arduino SDK
Copyright (c) 2014 Arduino LLC. All right reserved.
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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef Arduino_h
#define Arduino_h
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#define CORE_HAS_LIBB64
typedef bool boolean;
typedef uint8_t byte;
typedef uint16_t word;
// some libraries and sketches depend on this AVR stuff,
// assuming Arduino.h or WProgram.h automatically includes it...
//
#include "avr/pgmspace.h"
#include "avr/interrupt.h"
#include "avr/dtostrf.h"
#include "avr/io.h"
#include "binary.h"
#include "itoa.h"
#ifdef __cplusplus
extern "C"{
#endif // __cplusplus
// Include Atmel headers
#include "sam.h"
#include "wiring_constants.h"
#define clockCyclesPerMicrosecond() ( SystemCoreClock / 1000000L )
#define clockCyclesToMicroseconds(a) ( ((a) * 1000L) / (SystemCoreClock / 1000L) )
#define microsecondsToClockCycles(a) ( (a) * (SystemCoreClock / 1000000L) )
void yield( void ) ;
/* system functions */
int main( void );
void init( void );
/* sketch */
void setup( void ) ;
void loop( void ) ;
int __debug_buf(const char* head, char* buf, int len);
#include "WVariant.h"
#ifdef __cplusplus
} // extern "C"
#endif
// The following headers are for C++ only compilation
#ifdef __cplusplus
#include "WCharacter.h"
#include "WString.h"
#include "Tone.h"
#include "WMath.h"
#include "HardwareSerial.h"
#include "pulse.h"
#endif
#include "delay.h"
#ifdef __cplusplus
#include "Uart.h"
#endif
// Include board variant
#include "variant.h"
#include "wiring.h"
#include "wiring_digital.h"
#include "wiring_analog.h"
#include "wiring_shift.h"
#include "wiring_pwm.h"
#include "WInterrupts.h"
// undefine stdlib's abs if encountered
#ifdef abs
#undef abs
#endif // abs
// undefine stdlib's abs if encountered
#ifdef abs
#undef abs
#endif // abs
#ifdef __cplusplus
template<class T, class L>
auto min(const T& a, const L& b) -> decltype((b < a) ? b : a)
{
return (b < a) ? b : a;
}
template<class T, class L>
auto max(const T& a, const L& b) -> decltype((b < a) ? b : a)
{
return (a < b) ? b : a;
}
#else
#ifndef min
#define min(a,b) \
({ __typeof__ (a) _a = (a); \
__typeof__ (b) _b = (b); \
_a < _b ? _a : _b; })
#endif
#ifndef max
#define max(a,b) \
({ __typeof__ (a) _a = (a); \
__typeof__ (b) _b = (b); \
_a > _b ? _a : _b; })
#endif
#endif
#define abs(x) ((x)>0?(x):-(x))
#define constrain(amt,low,high) ((amt)<(low)?(low):((amt)>(high)?(high):(amt)))
#define round(x) ((x)>=0?(long)((x)+0.5):(long)((x)-0.5))
#define radians(deg) ((deg)*DEG_TO_RAD)
#define degrees(rad) ((rad)*RAD_TO_DEG)
#define sq(x) ((x)*(x))
#define interrupts() __enable_irq()
#define noInterrupts() __disable_irq()
#ifndef interruptsStatus
static inline unsigned char __interruptsStatus(void) __attribute__((always_inline, unused));
static inline unsigned char __interruptsStatus(void)
{
// See http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0497a/CHDBIBGJ.html
return (__get_PRIMASK() ? 0 : 1);
}
#define interruptsStatus() __interruptsStatus()
#endif
#define lowByte(w) ((uint8_t) ((w) & 0xff))
#define highByte(w) ((uint8_t) ((w) >> 8))
#define bitRead(value, bit) (((value) >> (bit)) & 0x01)
#define bitSet(value, bit) ((value) |= (1UL << (bit)))
#define bitClear(value, bit) ((value) &= ~(1UL << (bit)))
#define bitWrite(value, bit, bitvalue) (bitvalue ? bitSet(value, bit) : bitClear(value, bit))
#define bit(b) (1UL << (b))
#if (ARDUINO_SAMD_VARIANT_COMPLIANCE >= 10606)
// Interrupts
#define digitalPinToInterrupt(P) ( P )
#endif
// USB
#ifdef USE_TINYUSB
#include "Adafruit_TinyUSB_Core.h"
#else
#include "USB/USBDesc.h"
#include "USB/USBCore.h"
#include "USB/USBAPI.h"
#include "USB/USB_host.h"
#endif
#endif // Arduino_h
@@ -0,0 +1,420 @@
/*
Copyright (c) 2014 Arduino. All right reserved.
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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <stdlib.h>
#include <stdarg.h>
#include <stdio.h>
#include <string.h>
#include <math.h>
#include "Arduino.h"
#include "Print.h"
//using namespace arduino;
// Public Methods //////////////////////////////////////////////////////////////
/* default implementation: may be overridden */
size_t Print::write(const uint8_t *buffer, size_t size)
{
size_t n = 0;
while (size--) {
if (write(*buffer++)) n++;
else break;
}
return n;
}
size_t Print::print(const __FlashStringHelper *ifsh)
{
return print(reinterpret_cast<const char *>(ifsh));
}
size_t Print::print(const String &s)
{
return write(s.c_str(), s.length());
}
size_t Print::print(const char str[])
{
return write(str);
}
size_t Print::print(char c)
{
return write(c);
}
size_t Print::print(unsigned char b, int base)
{
return print((unsigned long) b, base);
}
size_t Print::print(int n, int base)
{
return print((long) n, base);
}
size_t Print::print(unsigned int n, int base)
{
return print((unsigned long) n, base);
}
size_t Print::print(long n, int base)
{
if (base == 0) {
return write(n);
} else if (base == 10) {
if (n < 0) {
int t = print('-');
n = -n;
return printNumber(n, 10) + t;
}
return printNumber(n, 10);
} else {
return printNumber(n, base);
}
}
size_t Print::print(unsigned long n, int base)
{
if (base == 0) return write(n);
else return printNumber(n, base);
}
size_t Print::print(long long n, int base)
{
if (base == 0) {
return write(n);
} else if (base == 10) {
if (n < 0) {
int t = print('-');
n = -n;
return printULLNumber(n, 10) + t;
}
return printULLNumber(n, 10);
} else {
return printULLNumber(n, base);
}
}
size_t Print::print(unsigned long long n, int base)
{
if (base == 0) return write(n);
else return printULLNumber(n, base);
}
size_t Print::print(double n, int digits)
{
return printFloat(n, digits);
}
size_t Print::println(const __FlashStringHelper *ifsh)
{
size_t n = print(ifsh);
n += println();
return n;
}
size_t Print::print(const Printable& x)
{
return x.printTo(*this);
}
size_t Print::println(void)
{
return write("\r\n");
}
size_t Print::println(const String &s)
{
size_t n = print(s);
n += println();
return n;
}
size_t Print::println(const char c[])
{
size_t n = print(c);
n += println();
return n;
}
size_t Print::println(char c)
{
size_t n = print(c);
n += println();
return n;
}
size_t Print::println(unsigned char b, int base)
{
size_t n = print(b, base);
n += println();
return n;
}
size_t Print::println(int num, int base)
{
size_t n = print(num, base);
n += println();
return n;
}
size_t Print::println(unsigned int num, int base)
{
size_t n = print(num, base);
n += println();
return n;
}
size_t Print::println(long num, int base)
{
size_t n = print(num, base);
n += println();
return n;
}
size_t Print::println(unsigned long num, int base)
{
size_t n = print(num, base);
n += println();
return n;
}
size_t Print::println(long long num, int base)
{
size_t n = print(num, base);
n += println();
return n;
}
size_t Print::println(unsigned long long num, int base)
{
size_t n = print(num, base);
n += println();
return n;
}
size_t Print::println(double num, int digits)
{
size_t n = print(num, digits);
n += println();
return n;
}
size_t Print::println(const Printable& x)
{
size_t n = print(x);
n += println();
return n;
}
size_t Print::printf(const char * format, ...)
{
char buf[256];
int len;
va_list ap;
va_start(ap, format);
len = vsnprintf(buf, 256, format, ap);
this->write(buf, len);
va_end(ap);
return len;
}
// Private Methods /////////////////////////////////////////////////////////////
size_t Print::printNumber(unsigned long n, uint8_t base)
{
char buf[8 * sizeof(long) + 1]; // Assumes 8-bit chars plus zero byte.
char *str = &buf[sizeof(buf) - 1];
*str = '\0';
// prevent crash if called with base == 1
if (base < 2) base = 10;
do {
char c = n % base;
n /= base;
*--str = c < 10 ? c + '0' : c + 'A' - 10;
} while(n);
return write(str);
}
// REFERENCE IMPLEMENTATION FOR ULL
// size_t Print::printULLNumber(unsigned long long n, uint8_t base)
// {
// // if limited to base 10 and 16 the bufsize can be smaller
// char buf[65];
// char *str = &buf[64];
// *str = '\0';
// // prevent crash if called with base == 1
// if (base < 2) base = 10;
// do {
// unsigned long long t = n / base;
// char c = n - t * base; // faster than c = n%base;
// n = t;
// *--str = c < 10 ? c + '0' : c + 'A' - 10;
// } while(n);
// return write(str);
// }
// FAST IMPLEMENTATION FOR ULL
size_t Print::printULLNumber(unsigned long long n64, uint8_t base)
{
// if limited to base 10 and 16 the bufsize can be 20
char buf[64];
uint8_t i = 0;
uint8_t innerLoops = 0;
// prevent crash if called with base == 1
if (base < 2) base = 10;
// process chunks that fit in "16 bit math".
uint16_t top = 0xFFFF / base;
uint16_t th16 = 1;
while (th16 < top)
{
th16 *= base;
innerLoops++;
}
while (n64 > th16)
{
// 64 bit math part
uint64_t q = n64 / th16;
uint16_t r = n64 - q*th16;
n64 = q;
// 16 bit math loop to do remainder. (note buffer is filled reverse)
for (uint8_t j=0; j < innerLoops; j++)
{
uint16_t qq = r/base;
buf[i++] = r - qq*base;
r = qq;
}
}
uint16_t n16 = n64;
while (n16 > 0)
{
uint16_t qq = n16/base;
buf[i++] = n16 - qq*base;
n16 = qq;
}
size_t bytes = i;
for (; i > 0; i--)
write((char) (buf[i - 1] < 10 ?
'0' + buf[i - 1] :
'A' + buf[i - 1] - 10));
return bytes;
}
size_t Print::printFloat(double number, int digits)
{
if (digits < 0)
digits = 2;
size_t n = 0;
if (isnan(number)) return print("nan");
if (isinf(number)) return print("inf");
if (number > 4294967040.0) return print ("ovf"); // constant determined empirically
if (number <-4294967040.0) return print ("ovf"); // constant determined empirically
// Handle negative numbers
if (number < 0.0)
{
n += print('-');
number = -number;
}
// Round correctly so that print(1.999, 2) prints as "2.00"
double rounding = 0.5;
for (uint8_t i=0; i<digits; ++i)
rounding /= 10.0;
number += rounding;
// Extract the integer part of the number and print it
unsigned long int_part = (unsigned long)number;
double remainder = number - (double)int_part;
n += print(int_part);
// Print the decimal point, but only if there are digits beyond
if (digits > 0) {
n += print(".");
}
// Extract digits from the remainder one at a time
while (digits-- > 0)
{
remainder *= 10.0;
unsigned int toPrint = (unsigned int)remainder;
n += print(toPrint);
remainder -= toPrint;
}
return n;
}
size_t Print::printBuffer(uint8_t const buffer[], int len, char delim, int byteline)
{
if (buffer == NULL || len == 0) return 0;
for(int i=0; i<len; i++)
{
if ( i != 0 ) print(delim);
if ( byteline && (i%byteline == 0) ) println();
this->printf("%02X", buffer[i]);
}
return (len*3 - 1);
}
size_t Print::printBufferReverse(uint8_t const buffer[], int len, char delim, int byteline)
{
if (buffer == NULL || len == 0) return 0;
for(int i=0; i<len; i++)
{
if (i != 0) print(delim);
if ( byteline && (i%byteline == 0) ) println();
this->printf("%02X", buffer[len-1-i]);
}
return (len*3 - 1);
}
@@ -0,0 +1,108 @@
/*
Copyright (c) 2016 Arduino LLC. All right reserved.
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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#pragma once
#include <inttypes.h>
#include <stdio.h> // for size_t
#include <stdarg.h> // for printf
#include "WString.h"
#include "Printable.h"
#define DEC 10
#define HEX 16
#define OCT 8
#define BIN 2
class Print
{
private:
int write_error;
size_t printNumber(unsigned long, uint8_t);
size_t printULLNumber(unsigned long long, uint8_t);
size_t printFloat(double, int);
protected:
void setWriteError(int err = 1) { write_error = err; }
public:
Print() : write_error(0) {}
int getWriteError() { return write_error; }
void clearWriteError() { setWriteError(0); }
virtual size_t write(uint8_t) = 0;
size_t write(const char *str) {
if (str == NULL) return 0;
return write((const uint8_t *)str, strlen(str));
}
virtual size_t write(const uint8_t *buffer, size_t size);
size_t write(const char *buffer, size_t size) {
return write((const uint8_t *)buffer, size);
}
// default to zero, meaning "a single write may block"
// should be overridden by subclasses with buffering
virtual int availableForWrite() { return 0; }
size_t print(const __FlashStringHelper *);
size_t print(const String &);
size_t print(const char[]);
size_t print(char);
size_t print(unsigned char, int = DEC);
size_t print(int, int = DEC);
size_t print(unsigned int, int = DEC);
size_t print(long, int = DEC);
size_t print(unsigned long, int = DEC);
size_t print(long long, int = DEC);
size_t print(unsigned long long, int = DEC);
size_t print(double, int = 2);
size_t print(const Printable&);
size_t println(const __FlashStringHelper *);
size_t println(const String &s);
size_t println(const char[]);
size_t println(char);
size_t println(unsigned char, int = DEC);
size_t println(int, int = DEC);
size_t println(unsigned int, int = DEC);
size_t println(long, int = DEC);
size_t println(unsigned long, int = DEC);
size_t println(long long, int = DEC);
size_t println(unsigned long long, int = DEC);
size_t println(double, int = 2);
size_t println(const Printable&);
size_t println(void);
size_t printf(const char * format, ...);
size_t printBuffer(uint8_t const buffer[], int len, char delim=' ', int byteline = 0);
size_t printBuffer(char const buffer[], int size, char delim=' ', int byteline = 0)
{
return printBuffer((uint8_t const*) buffer, size, delim, byteline);
}
size_t printBufferReverse(uint8_t const buffer[], int len, char delim=' ', int byteline = 0);
size_t printBufferReverse(char const buffer[], int size, char delim=' ', int byteline = 0)
{
return printBufferReverse((uint8_t const*) buffer, size, delim, byteline);
}
virtual void flush() { /* Empty implementation for backward compatibility */ }
};
@@ -0,0 +1,204 @@
# Copyright (c) 2014-2015 Arduino LLC. All right reserved.
#
# 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
# Arduino SAMD Core and platform.
#
# For more info:
# https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5---3rd-party-Hardware-specification
name=Seeed SAMD (32-bits ARM Cortex-M0+ and Cortex-M4) Boards
version=1.8.3
# Compile variables
# -----------------
compiler.warning_flags=-w
compiler.warning_flags.none=-w
compiler.warning_flags.default=
compiler.warning_flags.more=-Wall -Wno-expansion-to-defined
compiler.warning_flags.all=-Wall -Wextra -Wno-expansion-to-defined
compiler.path={runtime.tools.arm-none-eabi-gcc-7-2017q4.path}/bin/
compiler.c.cmd=arm-none-eabi-gcc
compiler.c.flags=-mcpu={build.mcu} -mthumb -c -g -Os {compiler.warning_flags} -std=gnu11 -ffunction-sections -fdata-sections -nostdlib --param max-inline-insns-single=500 -MMD -D__SKETCH_NAME__="""{build.project_name}"""
compiler.c.elf.cmd=arm-none-eabi-g++
compiler.c.elf.flags=-Os -Wl,--gc-sections -save-temps
compiler.S.cmd=arm-none-eabi-gcc
compiler.S.flags=-c -g -x assembler-with-cpp -MMD
compiler.cpp.cmd=arm-none-eabi-g++
compiler.cpp.flags=-mcpu={build.mcu} -mthumb -c -g -Os {compiler.warning_flags} -std=gnu++14 -ffunction-sections -fdata-sections -fno-threadsafe-statics -nostdlib --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -MMD -D__SKETCH_NAME__="""{build.project_name}"""
compiler.ar.cmd=arm-none-eabi-ar
compiler.ar.flags=rcs
compiler.objcopy.cmd=arm-none-eabi-objcopy
compiler.objcopy.eep.flags=-O ihex -j .eeprom --set-section-flags=.eeprom=alloc,load --no-change-warnings --change-section-lma .eeprom=0
compiler.elf2hex.bin.flags=-O binary
compiler.elf2hex.hex.flags=-O ihex -R .eeprom
compiler.elf2hex.cmd=arm-none-eabi-objcopy
compiler.ldflags=-mcpu={build.mcu} -mthumb -Wl,--cref -Wl,--check-sections -Wl,--gc-sections -Wl,--unresolved-symbols=report-all -Wl,--warn-common -Wl,--warn-section-align -u _printf_float -u _scanf_float -Wl,--wrap,_write -u __wrap__write
compiler.size.cmd=arm-none-eabi-size
compiler.define=-DARDUINO=
compiler.readelf.cmd=arm-none-eabi-readelf
# this can be overriden in boards.txt
build.extra_flags=
build.project_flags=
build.cache_flags=
build.flags.optimize=
build.flags.maxspi=
build.flags.maxqspi=
build.flags.usbstack=
build.flags.debug=
build.flags.role=
build.flags.txrxled=
# These can be overridden in platform.local.txt
compiler.c.extra_flags=
compiler.c.elf.extra_flags=
#compiler.c.elf.extra_flags=-v
compiler.cpp.extra_flags=
compiler.S.extra_flags=
compiler.ar.extra_flags=
compiler.elf2hex.extra_flags=
compiler.arm.cmsis.c.flags="-I{runtime.tools.CMSIS-5.7.0.path}/CMSIS/Core/Include/" "-I{runtime.tools.CMSIS-5.7.0.path}/CMSIS/DSP/Include/" "-I{runtime.tools.CMSIS-Atmel-1.2.1.path}/CMSIS-Atmel/CMSIS/Device/ATMEL/"
compiler.arm.cmsis.ldflags="-L{runtime.tools.CMSIS-5.7.0.path}/CMSIS/DSP/Lib/GCC/" -larm_cortexM0l_math -lm
compiler.libraries.ldflags=
# USB Flags
# ---------
build.usb_flags=-DUSB_VID={build.vid} -DUSB_PID={build.pid} -DUSBCON -DUSB_CONFIG_POWER={build.usb_power} '-DUSB_MANUFACTURER={build.usb_manufacturer}' '-DUSB_PRODUCT={build.usb_product}' {build.flags.usbstack} {build.flags.debug} {build.flags.role} "-I{build.core.path}/TinyUSB" "-I{build.core.path}/TinyUSB/Adafruit_TinyUSB_ArduinoCore" "-I{build.core.path}/TinyUSB/Adafruit_TinyUSB_ArduinoCore/tinyusb/src"
# Default advertised device power setting in mA
build.usb_power=100
# Default usb manufacturer will be replaced at compile time using
# numeric vendor ID if available or by board's specific value.
build.usb_manufacturer="Unknown"
# Compile patterns
# ----------------
## Compile c files
## KH Add -DBOARD_NAME="{build.board}"
recipe.c.o.pattern="{compiler.path}{compiler.c.cmd}" {compiler.c.flags} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DBOARD_NAME="{build.board}" -DARDUINO_ARCH_{build.arch} {compiler.c.extra_flags} {build.extra_flags} {build.project_flags} {build.cache_flags} {build.flags.debug} {build.flags.txrxled} {build.flags.role} {build.flags.optimize} {build.flags.maxspi} {build.flags.maxqspi} {compiler.arm.cmsis.c.flags} {includes} "{source_file}" -o "{object_file}"
## Compile c++ files
## KH Add -DBOARD_NAME="{build.board}"
recipe.cpp.o.pattern="{compiler.path}{compiler.cpp.cmd}" {compiler.cpp.flags} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DBOARD_NAME="{build.board}" -DARDUINO_ARCH_{build.arch} {compiler.cpp.extra_flags} {build.extra_flags} {build.project_flags} {build.cache_flags} {build.flags.debug} {build.flags.txrxled} {build.flags.role} {build.flags.optimize} {build.flags.maxspi} {build.flags.maxqspi} {build.extra_flags} {build.project_flags} {compiler.arm.cmsis.c.flags} {includes} "{source_file}" -o "{object_file}"
## Compile S files
## KH Add -DBOARD_NAME="{build.board}"
recipe.S.o.pattern="{compiler.path}{compiler.S.cmd}" {compiler.S.flags} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DBOARD_NAME="{build.board}" -DARDUINO_ARCH_{build.arch} {compiler.S.extra_flags} {build.extra_flags} {build.project_flags} {build.cache_flags} {compiler.arm.cmsis.c.flags} {includes} "{source_file}" -o "{object_file}"
## Create archives
# archive_file_path is needed for backwards compatibility with IDE 1.6.5 or older, IDE 1.6.6 or newer overrides this value
archive_file_path={build.path}/{archive_file}
recipe.ar.pattern="{compiler.path}{compiler.ar.cmd}" {compiler.ar.flags} {compiler.ar.extra_flags} "{archive_file_path}" "{object_file}"
## Combine gc-sections, archives, and objects
recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" "-L{build.path}" {compiler.c.elf.flags} {compiler.c.elf.extra_flags} "-T{build.variant.path}/{build.ldscript}" "-Wl,-Map,{build.path}/{build.project_name}.map" --specs=nano.specs --specs=nosys.specs {compiler.ldflags} -o "{build.path}/{build.project_name}.elf" {object_files} {compiler.libraries.ldflags} -Wl,--start-group {compiler.arm.cmsis.ldflags} "-L{build.variant.path}" -lm "{build.path}/{archive_file}" -Wl,--end-group
## Create output (bin file)
recipe.objcopy.bin.pattern="{compiler.path}{compiler.elf2hex.cmd}" {compiler.elf2hex.bin.flags} {compiler.elf2hex.extra_flags} "{build.path}/{build.project_name}.elf" "{build.path}/{build.project_name}.bin"
## Create output (hex file)
recipe.objcopy.hex.pattern="{compiler.path}{compiler.elf2hex.cmd}" {compiler.elf2hex.hex.flags} {compiler.elf2hex.extra_flags} "{build.path}/{build.project_name}.elf" "{build.path}/{build.project_name}.hex"
build.preferred_out_format=bin
## Save hex
recipe.output.tmp_file={build.project_name}.{build.preferred_out_format}
recipe.output.save_file={build.project_name}.{build.variant}.{build.preferred_out_format}
## Compute size
recipe.size.pattern="{compiler.path}{compiler.size.cmd}" -A "{build.path}/{build.project_name}.elf"
recipe.size.regex=\.text\s+([0-9]+).*
#
# BOSSA
#
tools.bossac.path={runtime.tools.bossac-1.7.0-arduino3.path}
tools.bossac.cmd=bossac
tools.bossac.cmd.windows=bossac.exe
tools.bossac.upload.params.verbose=-i -d
tools.bossac.upload.params.quiet=
tools.bossac.upload.pattern="{path}/{cmd}" {upload.verbose} --port={serial.port.file} -U {upload.native_usb} -i -e -w -v "{build.path}/{build.project_name}.bin" -R
tools.bossac_remote.upload.pattern=/usr/bin/run-bossac {upload.verbose} --port=ttyATH0 -U {upload.native_usb} -e -w -v /tmp/sketch.bin -R
tools.bossac.network_cmd={runtime.tools.arduinoOTA.path}/bin/arduinoOTA
tools.bossac.upload.network_pattern="{network_cmd}" -address {serial.port} -port 65280 -username arduino -password "{network.password}" -sketch "{build.path}/{build.project_name}.bin" -upload /sketch -b
# v1.8.0
tools.bossac18.path={runtime.tools.bossac-1.8.0-48-gb176eee.path}
tools.bossac18.cmd=bossac
tools.bossac18.upload.params.verbose=-i -d
tools.bossac18.upload.params.quiet=
tools.bossac18.upload.pattern="{path}/{cmd}" {upload.verbose} --port={serial.port.file} -U -i --offset={upload.offset} -w -v "{build.path}/{build.project_name}.bin" -R
tools.bossac18.network_cmd={runtime.tools.arduinoOTA.path}/bin/arduinoOTA
tools.bossac18.upload.network_pattern="{network_cmd}" -address {serial.port} -port 65280 -username arduino -password "{network.password}" -sketch "{build.path}/{build.project_name}.bin" -upload /sketch -b
#
# BOSSA (ignore binary size)
#
tools.bossacI.path={runtime.tools.bossac-1.7.0-arduino3.path}
tools.bossacI.cmd=bossac
tools.bossacI.cmd.windows=bossac.exe
tools.bossacI.upload.params.verbose=-i -d
tools.bossacI.upload.params.quiet=
tools.bossacI.upload.pattern="{path}/{cmd}" {upload.verbose} --port={serial.port.file} -I -U {upload.native_usb} -i -e -w "{build.path}/{build.project_name}.bin" -R
tools.bossacI_remote.upload.pattern=/usr/bin/run-bossac {upload.verbose} --port=ttyATH0 -U {upload.native_usb} -e -w -v /tmp/sketch.bin -R
tools.bossacI.network_cmd={runtime.tools.arduinoOTA.path}/bin/arduinoOTA
tools.bossacI.upload.network_pattern="{network_cmd}" -address {serial.port} -port 65280 -username arduino -password "{network.password}" -sketch "{build.path}/{build.project_name}.bin" -upload /sketch -b
#
# OpenOCD sketch upload
#
tools.openocd.path={runtime.tools.openocd-0.10.0-arduino7.path}
tools.openocd.cmd=bin/openocd
tools.openocd.cmd.windows=bin/openocd.exe
tools.openocd.upload.params.verbose=-d2
tools.openocd.upload.params.quiet=-d0
tools.openocd.upload.pattern="{path}/{cmd}" {upload.verbose} -s "{path}/share/openocd/scripts/" -f "{runtime.platform.path}/variants/{build.variant}/{build.openocdscript}" -c "telnet_port disabled; program {{build.path}/{build.project_name}.bin} verify reset 0x2000; shutdown"
tools.openocd.network_cmd={runtime.tools.arduinoOTA.path}/bin/arduinoOTA
tools.openocd.upload.network_pattern={network_cmd} -address {serial.port} -port 65280 -username arduino -password "{network.password}" -sketch "{build.path}/{build.project_name}.bin" -upload /sketch -b
# Program flashes the binary at 0x0000, so use the linker script without_bootloader
tools.openocd.program.params.verbose=-d2
tools.openocd.program.params.quiet=-d0
tools.openocd.program.pattern="{path}/{cmd}" {program.verbose} -s "{path}/share/openocd/scripts/" -f "{runtime.platform.path}/variants/{build.variant}/{build.openocdscript}" -c "telnet_port disabled; program {{build.path}/{build.project_name}.elf} verify reset; shutdown"
tools.openocd.erase.params.verbose=-d3
tools.openocd.erase.params.quiet=-d0
tools.openocd.erase.pattern=
tools.openocd.bootloader.params.verbose=-d2
tools.openocd.bootloader.params.quiet=-d0
tools.openocd.bootloader.pattern="{path}/{cmd}" {bootloader.verbose} -s "{path}/share/openocd/scripts/" -f "{runtime.platform.path}/variants/{build.variant}/{build.openocdscript}" -c "telnet_port disabled; init; halt; at91samd bootloader 0; program {{runtime.platform.path}/bootloaders/{bootloader.file}} verify reset; shutdown"
#
# OpenOCD sketch upload - version with configurable bootloader size
# FIXME: this programmer is a workaround for default options being overwritten by uploadUsingPreferences
#
tools.openocd-withbootsize.path={runtime.tools.openocd-0.10.0-arduino7.path}
tools.openocd-withbootsize.cmd=bin/openocd
tools.openocd-withbootsize.cmd.windows=bin/openocd.exe
tools.openocd-withbootsize.upload.params.verbose=-d2
tools.openocd-withbootsize.upload.params.quiet=-d0
tools.openocd-withbootsize.upload.pattern="{path}/{cmd}" {upload.verbose} -s "{path}/share/openocd/scripts/" -f "{runtime.platform.path}/variants/{build.variant}/{build.openocdscript}" -c "telnet_port disabled; program {{build.path}/{build.project_name}.bin} verify reset {bootloader.size}; shutdown"
# Program flashes the binary at 0x0000, so use the linker script without_bootloader
tools.openocd-withbootsize.program.params.verbose=-d2
tools.openocd-withbootsize.program.params.quiet=-d0
tools.openocd-withbootsize.program.pattern="{path}/{cmd}" {program.verbose} -s "{path}/share/openocd/scripts/" -f "{runtime.platform.path}/variants/{build.variant}/{build.openocdscript}" -c "telnet_port disabled; program {{build.path}/{build.project_name}.elf} verify reset; shutdown"
tools.openocd-withbootsize.erase.params.verbose=-d3
tools.openocd-withbootsize.erase.params.quiet=-d0
tools.openocd-withbootsize.erase.pattern=
tools.openocd-withbootsize.bootloader.params.verbose=-d2
tools.openocd-withbootsize.bootloader.params.quiet=-d0
tools.openocd-withbootsize.bootloader.pattern="{path}/{cmd}" {bootloader.verbose} -s "{path}/share/openocd/scripts/" -f "{runtime.platform.path}/variants/{build.variant}/{build.openocdscript}" -c "telnet_port disabled; init; halt; at91samd bootloader 0; program {{runtime.platform.path}/bootloaders/{bootloader.file}} verify reset; shutdown"
@@ -0,0 +1,22 @@
#!/usr/bin/env bash
portenta_h7_rules () {
echo ""
echo "# Portenta H7 bootloader mode UDEV rules"
echo ""
cat <<EOF
SUBSYSTEMS=="usb", ATTRS{idVendor}=="2341", ATTRS{idProduct}=="035b", GROUP="plugdev", MODE="0666"
EOF
}
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
portenta_h7_rules > /etc/udev/rules.d/49-portenta_h7.rules
# reload udev rules
echo "Reload rules..."
udevadm trigger
udevadm control --reload-rules
@@ -0,0 +1,122 @@
/*
pgmspace.h - Definitions for compatibility with AVR pgmspace macros
Copyright (c) 2015 Arduino LLC
Based on work of Paul Stoffregen on Teensy 3 (http://pjrc.com)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE
*/
#ifndef __PGMSPACE_H_
#define __PGMSPACE_H_ 1
#include <inttypes.h>
#define PROGMEM
#define PGM_P const char *
#define PSTR(str) (str)
#define _SFR_BYTE(n) (n)
typedef void prog_void;
typedef char prog_char;
typedef unsigned char prog_uchar;
typedef int8_t prog_int8_t;
typedef uint8_t prog_uint8_t;
typedef int16_t prog_int16_t;
typedef uint16_t prog_uint16_t;
typedef int32_t prog_int32_t;
typedef uint32_t prog_uint32_t;
typedef int64_t prog_int64_t;
typedef uint64_t prog_uint64_t;
typedef const void* int_farptr_t;
typedef const void* uint_farptr_t;
#define memchr_P(s, c, n) memchr((s), (c), (n))
#define memcmp_P(s1, s2, n) memcmp((s1), (s2), (n))
#define memccpy_P(dest, src, c, n) memccpy((dest), (src), (c), (n))
#define memcpy_P(dest, src, n) memcpy((dest), (src), (n))
#define memmem_P(haystack, haystacklen, needle, needlelen) memmem((haystack), (haystacklen), (needle), (needlelen))
#define memrchr_P(s, c, n) memrchr((s), (c), (n))
#define strcat_P(dest, src) strcat((dest), (src))
#define strchr_P(s, c) strchr((s), (c))
#define strchrnul_P(s, c) strchrnul((s), (c))
#define strcmp_P(a, b) strcmp((a), (b))
#define strcpy_P(dest, src) strcpy((dest), (src))
#define strcasecmp_P(s1, s2) strcasecmp((s1), (s2))
#define strcasestr_P(haystack, needle) strcasestr((haystack), (needle))
#define strcspn_P(s, accept) strcspn((s), (accept))
#define strlcat_P(s1, s2, n) strlcat((s1), (s2), (n))
#define strlcpy_P(s1, s2, n) strlcpy((s1), (s2), (n))
#define strlen_P(a) strlen((a))
#define strnlen_P(s, n) strnlen((s), (n))
#define strncmp_P(s1, s2, n) strncmp((s1), (s2), (n))
#define strncasecmp_P(s1, s2, n) strncasecmp((s1), (s2), (n))
#define strncat_P(s1, s2, n) strncat((s1), (s2), (n))
#define strncpy_P(s1, s2, n) strncpy((s1), (s2), (n))
#define strpbrk_P(s, accept) strpbrk((s), (accept))
#define strrchr_P(s, c) strrchr((s), (c))
#define strsep_P(sp, delim) strsep((sp), (delim))
#define strspn_P(s, accept) strspn((s), (accept))
#define strstr_P(a, b) strstr((a), (b))
#define strtok_P(s, delim) strtok((s), (delim))
#define strtok_rP(s, delim, last) strtok((s), (delim), (last))
#define strlen_PF(a) strlen((a))
#define strnlen_PF(src, len) strnlen((src), (len))
#define memcpy_PF(dest, src, len) memcpy((dest), (src), (len))
#define strcpy_PF(dest, src) strcpy((dest), (src))
#define strncpy_PF(dest, src, len) strncpy((dest), (src), (len))
#define strcat_PF(dest, src) strcat((dest), (src))
#define strlcat_PF(dest, src, len) strlcat((dest), (src), (len))
#define strncat_PF(dest, src, len) strncat((dest), (src), (len))
#define strcmp_PF(s1, s2) strcmp((s1), (s2))
#define strncmp_PF(s1, s2, n) strncmp((s1), (s2), (n))
#define strcasecmp_PF(s1, s2) strcasecmp((s1), (s2))
#define strncasecmp_PF(s1, s2, n) strncasecmp((s1), (s2), (n))
#define strstr_PF(s1, s2) strstr((s1), (s2))
#define strlcpy_PF(dest, src, n) strlcpy((dest), (src), (n))
#define memcmp_PF(s1, s2, n) memcmp((s1), (s2), (n))
#define sprintf_P(s, f, ...) sprintf((s), (f), __VA_ARGS__)
#define snprintf_P(s, f, ...) snprintf((s), (f), __VA_ARGS__)
#define pgm_read_byte(addr) (*(const unsigned char *)(addr))
#define pgm_read_word(addr) (*(const unsigned short *)(addr))
#define pgm_read_dword(addr) (*(const unsigned long *)(addr))
#define pgm_read_float(addr) (*(const float *)(addr))
#define pgm_read_ptr(addr) (*(const void **)(addr))
#define pgm_read_byte_near(addr) pgm_read_byte(addr)
#define pgm_read_word_near(addr) pgm_read_word(addr)
#define pgm_read_dword_near(addr) pgm_read_dword(addr)
#define pgm_read_float_near(addr) pgm_read_float(addr)
#define pgm_read_ptr_near(addr) pgm_read_ptr(addr)
#define pgm_read_byte_far(addr) pgm_read_byte(addr)
#define pgm_read_word_far(addr) pgm_read_word(addr)
#define pgm_read_dword_far(addr) pgm_read_dword(addr)
#define pgm_read_float_far(addr) pgm_read_float(addr)
#define pgm_read_ptr_far(addr) pgm_read_ptr(addr)
#define pgm_get_far_address(addr) (&(addr))
#endif
+158 -151
View File
@@ -173,16 +173,16 @@ Support for LAN8720 has been **removed** from STM32 core v2.3.0
1. [`Arduino IDE 1.8.19+` for Arduino](https://github.com/arduino/Arduino). [![GitHub release](https://img.shields.io/github/release/arduino/Arduino.svg)](https://github.com/arduino/Arduino/releases/latest)
2. [`ESP8266 Core 3.0.2+`](https://github.com/esp8266/Arduino) for ESP8266-based boards. [![Latest release](https://img.shields.io/github/release/esp8266/Arduino.svg)](https://github.com/esp8266/Arduino/releases/latest/)
3. [`ESP32 Core 2.0.4+`](https://github.com/espressif/arduino-esp32) for ESP32-based boards. [Latest stable release ![Release Version](https://img.shields.io/github/release/espressif/arduino-esp32.svg?style=plastic)
3. [`ESP32 Core 2.0.5+`](https://github.com/espressif/arduino-esp32) for ESP32-based boards. [Latest stable release ![Release Version](https://img.shields.io/github/release/espressif/arduino-esp32.svg?style=plastic)
5. [`Arduino Core for STM32 2.3.0+`](https://github.com/stm32duino/Arduino_Core_STM32) for for STM32 using built-in Ethernet LAN8742A. [![GitHub release](https://img.shields.io/github/release/stm32duino/Arduino_Core_STM32.svg)](https://github.com/stm32duino/Arduino_Core_STM32/releases/latest)
6. [`ESPAsyncTCP v1.2.2+`](https://github.com/me-no-dev/ESPAsyncTCP) for ESP8266.
7. [`AsyncTCP v1.1.1+`](https://github.com/me-no-dev/AsyncTCP) for ESP32.
8. [`STM32Ethernet library v1.3.0+`](https://github.com/stm32duino/STM32Ethernet) for STM32 using built-in Ethernet LAN8742A on (Nucleo-144, Discovery). [![GitHub release](https://img.shields.io/github/release/stm32duino/STM32Ethernet.svg)](https://github.com/stm32duino/STM32Ethernet/releases/latest)
9. [`LwIP library v2.1.2+`](https://github.com/stm32duino/LwIP) for STM32 using built-in Ethernet LAN8742A on (Nucleo-144, Discovery). [![GitHub release](https://img.shields.io/github/release/stm32duino/LwIP.svg)](https://github.com/stm32duino/LwIP/releases/latest)
10. [`STM32AsyncTCP library v1.0.1+`](https://github.com/khoih-prog/STM32AsyncTCP) for built-in Ethernet on (Nucleo-144, Discovery). To install manually for Arduino IDE.
11. [`ESPAsync_WiFiManager library v1.13.0+`](https://github.com/khoih-prog/ESPAsync_WiFiManager) for ESP32/ESP8266 using some examples. [![GitHub release](https://img.shields.io/github/release/khoih-prog/ESPAsync_WiFiManager.svg)](https://github.com/khoih-prog/ESPAsync_WiFiManager/releases)
12. [`LittleFS_esp32 v1.0.6+`](https://github.com/lorol/LITTLEFS) for ESP32-based boards using LittleFS **only with ESP32 core v1.0.5-**. To install, check [![arduino-library-badge](https://www.ardu-badge.com/badge/LittleFS_esp32.svg?)](https://www.ardu-badge.com/LittleFS_esp32).
13. [`WebServer_WT32_ETH01 library v1.5.0+`](https://github.com/khoih-prog/WebServer_WT32_ETH01) if necessary to use WT32_ETH01 boards. To install, check [![arduino-library-badge](https://www.ardu-badge.com/badge/WebServer_WT32_ETH01.svg?)](https://www.ardu-badge.com/WebServer_WT32_ETH01)
11. [`ESPAsync_WiFiManager library v1.15.0+`](https://github.com/khoih-prog/ESPAsync_WiFiManager) for ESP32/ESP8266 using some examples. [![GitHub release](https://img.shields.io/github/release/khoih-prog/ESPAsync_WiFiManager.svg)](https://github.com/khoih-prog/ESPAsync_WiFiManager/releases)
12. [`LittleFS_esp32 v1.0.6+`](https://github.com/lorol/LITTLEFS) for ESP32-based boards using LittleFS with ESP32 core **v1.0.5-**. To install, check [![arduino-library-badge](https://www.ardu-badge.com/badge/LittleFS_esp32.svg?)](https://www.ardu-badge.com/LittleFS_esp32). **Notice**: This [`LittleFS_esp32 library`](https://github.com/lorol/LITTLEFS) has been integrated to Arduino [ESP32 core v1.0.6+](https://github.com/espressif/arduino-esp32/tree/master/libraries/LITTLEFS) and **you don't need to install it if using ESP32 core v1.0.6+**
13. [`WebServer_WT32_ETH01 library v1.5.1+`](https://github.com/khoih-prog/WebServer_WT32_ETH01) if necessary to use WT32_ETH01 boards. To install, check [![arduino-library-badge](https://www.ardu-badge.com/badge/WebServer_WT32_ETH01.svg?)](https://www.ardu-badge.com/WebServer_WT32_ETH01)
---
@@ -257,13 +257,13 @@ In Platform IO, to fix the error when using [`LittleFS_esp32 v1.0.6`](https://gi
from
```
```cpp
//#define CONFIG_LITTLEFS_FOR_IDF_3_2 /* For old IDF - like in release 1.0.4 */
```
to
```
```cpp
#define CONFIG_LITTLEFS_FOR_IDF_3_2 /* For old IDF - like in release 1.0.4 */
```
@@ -280,14 +280,14 @@ The current library implementation, using `xyz-Impl.h` instead of standard `xyz.
You can include this `.hpp` file
```
```cpp
// Can be included as many times as necessary, without `Multiple Definitions` Linker Error
#include "AsyncHTTPRequest_Generic.hpp" //https://github.com/khoih-prog/AsyncHTTPRequest_Generic
```
in many files. But be sure to use the following `.h` file **in just 1 `.h`, `.cpp` or `.ino` file**, which must **not be included in any other file**, to avoid `Multiple Definitions` Linker Error
```
```cpp
// To be included only in main(), .ino with setup() to avoid `Multiple Definitions` Linker Error
#include "AsyncHTTPRequest_Generic.h" //https://github.com/khoih-prog/AsyncHTTPRequest_Generic
```
@@ -305,13 +305,13 @@ In Platform IO, to fix the error when using [`LittleFS_esp32 v1.0`](https://gith
from
```
```cpp
//#define CONFIG_LITTLEFS_FOR_IDF_3_2 /* For old IDF - like in release 1.0.4 */
```
to
```
```cpp
#define CONFIG_LITTLEFS_FOR_IDF_3_2 /* For old IDF - like in release 1.0.4 */
```
@@ -478,14 +478,14 @@ Please take a look at other examples, as well.
#### 1. File [AsyncHTTPRequest_STM32.ino](examples/AsyncHTTPRequest_STM32/AsyncHTTPRequest_STM32.ino)
https://github.com/khoih-prog/AsyncHTTPRequest_Generic/blob/07e2add9960fb3ab7333acd84fb2c697f3efc6a6/examples/AsyncHTTPRequest_STM32/AsyncHTTPRequest_STM32.ino#L43-L148
https://github.com/khoih-prog/AsyncHTTPRequest_Generic/blob/40e15e30f934e4b269b16a8ab8727558f0ab7b03/examples/AsyncHTTPRequest_STM32/AsyncHTTPRequest_STM32.ino#L43-L148
---
#### 2. File [defines.h](examples/AsyncHTTPRequest_STM32/defines.h)
https://github.com/khoih-prog/AsyncHTTPRequest_Generic/blob/07e2add9960fb3ab7333acd84fb2c697f3efc6a6/examples/AsyncHTTPRequest_STM32/defines.h#L22-L134
https://github.com/khoih-prog/AsyncHTTPRequest_Generic/blob/40e15e30f934e4b269b16a8ab8727558f0ab7b03/examples/AsyncHTTPRequest_STM32/defines.h#L22-L134
---
@@ -497,43 +497,43 @@ https://github.com/khoih-prog/AsyncHTTPRequest_Generic/blob/07e2add9960fb3ab7333
```
Start AsyncHTTPRequest_STM32 on NUCLEO_F767ZI
AsyncHTTPRequest_Generic v1.9.0
AsyncHTTPRequest_Generic v1.10.1
AsyncHTTPRequest @ IP : 192.168.2.178
**************************************
abbreviation: EDT
client_ip: aaa.bbb.ccc.ddd
datetime: 2022-04-13T22:00:07.669102-04:00
day_of_week: 3
day_of_year: 103
datetime: 2022-10-20T16:16:16.759058-04:00
day_of_week: 4
day_of_year: 293
dst: true
dst_from: 2022-03-13T07:00:00+00:00
dst_offset: 3600
dst_until: 2022-11-06T06:00:00+00:00
raw_offset: -18000
timezone: America/Toronto
unixtime: 1649901607
utc_datetime: 2022-04-14T02:00:07.669102+00:00
unixtime: 1666296976
utc_datetime: 2022-10-20T20:16:16.759058+00:00
utc_offset: -04:00
week_number: 15
week_number: 42
*********************
**************************************
abbreviation: EDT
client_ip: aaa.bbb.ccc.ddd
datetime: 2022-04-13T22:01:07.647308-04:00
day_of_week: 3
day_of_year: 103
datetime: 2022-10-20T16:17:16.713722-04:00
day_of_week: 4
day_of_year: 293
dst: true
dst_from: 2022-03-13T07:00:00+00:00
dst_offset: 3600
dst_until: 2022-11-06T06:00:00+00:00
raw_offset: -18000
timezone: America/Toronto
unixtime: 1649901667
utc_datetime: 2022-04-14T02:01:07.647308+00:00
unixtime: 1666297036
utc_datetime: 2022-10-20T20:17:16.713722+00:00
utc_offset: -04:00
week_number: 15
week_number: 42
```
---
@@ -542,7 +542,7 @@ week_number: 15
```
Starting AsyncHTTPRequest_ESP_WiFiManager using LittleFS on ESP8266_NODEMCU
AsyncHTTPRequest_Generic v1.9.0
AsyncHTTPRequest_Generic v1.10.1
Stored: SSID = HueNet1, Pass = 12345678
Got stored Credentials. Timeout 120s
ConnectMultiWiFi in setup
@@ -551,19 +551,19 @@ H
**************************************
abbreviation: EDT
client_ip: aaa.bbb.ccc.ddd
datetime: 2022-04-13T22:02:07.647703-04:00
day_of_week: 3
day_of_year: 103
datetime: 2022-10-20T16:19:16.751279-04:00
day_of_week: 4
day_of_year: 293
dst: true
dst_from: 2022-03-13T07:00:00+00:00
dst_offset: 3600
dst_until: 2022-11-06T06:00:00+00:00
raw_offset: -18000
timezone: America/Toronto
unixtime: 1649901727
utc_datetime: 2022-04-14T02:02:07.647703+00:00
unixtime: 1666297156
utc_datetime: 2022-10-20T20:19:16.751279+00:00
utc_offset: -04:00
week_number: 15
week_number: 42
**************************************
HHHHHH
```
@@ -574,7 +574,7 @@ HHHHHH
```
Starting AsyncHTTPRequest_ESP_WiFiManager using SPIFFS on ESP32_DEV
AsyncHTTPRequest_Generic v1.9.0
AsyncHTTPRequest_Generic v1.10.1
Stored: SSID = HueNet1, Pass = 12345678
Got stored Credentials. Timeout 120s
ConnectMultiWiFi in setup
@@ -583,37 +583,37 @@ H
**************************************
abbreviation: EDT
client_ip: aaa.bbb.ccc.ddd
datetime: 2022-04-13T22:03:07.647977-04:00
day_of_week: 3
day_of_year: 103
datetime: 2022-10-20T16:20:16.719881-04:00
day_of_week: 4
day_of_year: 293
dst: true
dst_from: 2022-03-13T07:00:00+00:00
dst_offset: 3600
dst_until: 2022-11-06T06:00:00+00:00
raw_offset: -18000
timezone: America/Toronto
unixtime: 1649901787
utc_datetime: 2022-04-14T02:03:07.647977+00:00
unixtime: 1666297216
utc_datetime: 2022-10-20T20:20:16.719881+00:00
utc_offset: -04:00
week_number: 15
week_number: 42
**************************************
HHHHHHHHH HHHHHHHHHH HHHHHHHHHH H
**************************************
abbreviation: EDT
client_ip: aaa.bbb.ccc.ddd
datetime: 2022-04-13T22:04:07.648721-04:00
day_of_week: 3
day_of_year: 103
datetime: 2022-10-20T16:21:16.728312-04:00
day_of_week: 4
day_of_year: 293
dst: true
dst_from: 2022-03-13T07:00:00+00:00
dst_offset: 3600
dst_until: 2022-11-06T06:00:00+00:00
raw_offset: -18000
timezone: America/Toronto
unixtime: 1649901847
utc_datetime: 2022-04-14T02:04:07.648721+00:00
unixtime: 1666297276
utc_datetime: 2022-10-20T20:21:16.728312+00:00
utc_offset: -04:00
week_number: 15
week_number: 42
**************************************
HHHHHHHHH HHHHHHHHHH HHHHHHHHHH
```
@@ -624,7 +624,7 @@ HHHHHHHHH HHHHHHHHHH HHHHHHHHHH
```
Starting AsyncHTTPRequest_ESP using ESP8266_NODEMCU
AsyncHTTPRequest_Generic v1.9.0
AsyncHTTPRequest_Generic v1.10.1
Connecting to WiFi SSID: HueNet1
...........
HTTP WebServer is @ IP : 192.168.2.81
@@ -632,19 +632,19 @@ HTTP WebServer is @ IP : 192.168.2.81
**************************************
abbreviation: EDT
client_ip: aaa.bbb.ccc.ddd
datetime: 2022-04-13T22:03:07.647977-04:00
day_of_week: 3
day_of_year: 103
datetime: 2022-10-20T16:22:16.769386-04:00
day_of_week: 4
day_of_year: 293
dst: true
dst_from: 2022-03-13T07:00:00+00:00
dst_offset: 3600
dst_until: 2022-11-06T06:00:00+00:00
raw_offset: -18000
timezone: America/Toronto
unixtime: 1649901787
utc_datetime: 2022-04-14T02:03:07.647977+00:00
unixtime: 1666297336
utc_datetime: 2022-10-20T20:22:16.769386+00:00
utc_offset: -04:00
week_number: 15
week_number: 42
**************************************
HHHHHHHHH HHHHHHHHHH HHHHHHHHHH H
```
@@ -656,7 +656,7 @@ HHHHHHHHH HHHHHHHHHH HHHHHHHHHH H
```
Start AsyncWebClientRepeating_STM32 on NUCLEO_F767ZI
AsyncHTTPRequest_Generic v1.9.0
AsyncHTTPRequest_Generic v1.10.1
AsyncHTTPRequest @ IP : 192.168.2.72
**************************************
@@ -709,27 +709,27 @@ AsyncHTTPRequest @ IP : 192.168.2.72
```
Starting AsyncHTTPRequest_WT32_ETH01 on ESP32_DEV with ETH_PHY_LAN8720
WebServer_WT32_ETH01 v1.5.0
AsyncHTTPRequest_Generic v1.9.0
WebServer_WT32_ETH01 v1.5.1
AsyncHTTPRequest_Generic v1.10.1
ETH MAC: A8:03:2A:A1:61:73, IPv4: 192.168.2.232, FULL_DUPLEX, 100Mbps
AsyncHTTPRequest @ IP : 192.168.2.232
**************************************
abbreviation: EDT
client_ip: aaa.bbb.ccc.ddd
datetime: 2022-04-13T22:04:07.648721-04:00
day_of_week: 3
day_of_year: 103
datetime: 2022-10-20T16:23:16.733395-04:00
day_of_week: 4
day_of_year: 293
dst: true
dst_from: 2022-03-13T07:00:00+00:00
dst_offset: 3600
dst_until: 2022-11-06T06:00:00+00:00
raw_offset: -18000
timezone: America/Toronto
unixtime: 1649901847
utc_datetime: 2022-04-14T02:04:07.648721+00:00
unixtime: 1666297396
utc_datetime: 2022-10-20T20:23:16.733395+00:00
utc_offset: -04:00
week_number: 15
week_number: 42
**************************************
```
@@ -739,8 +739,8 @@ week_number: 15
```
Starting AsyncHTTPRequest_ESP_WiFiManager using LittleFS on ESP32C3_DEV
ESPAsync_WiFiManager v1.13.0
AsyncHTTPRequest_Generic v1.9.0
ESPAsync_WiFiManager v1.15.0
AsyncHTTPRequest_Generic v1.10.1
Stored: SSID = HueNet1, Pass = password
Got stored Credentials. Timeout 120s
ConnectMultiWiFi in setup
@@ -749,37 +749,37 @@ H
**************************************
abbreviation: EDT
client_ip: aaa.bbb.ccc.ddd
datetime: 2022-04-13T22:05:07.648251-04:00
day_of_week: 3
day_of_year: 103
datetime: 2022-10-20T16:25:16.750043-04:00
day_of_week: 4
day_of_year: 293
dst: true
dst_from: 2022-03-13T07:00:00+00:00
dst_offset: 3600
dst_until: 2022-11-06T06:00:00+00:00
raw_offset: -18000
timezone: America/Toronto
unixtime: 1649901907
utc_datetime: 2022-04-14T02:05:07.648251+00:00
unixtime: 1666297516
utc_datetime: 2022-10-20T20:25:16.750043+00:00
utc_offset: -04:00
week_number: 15
week_number: 42
**************************************
HHHHHH
**************************************
abbreviation: EDT
client_ip: aaa.bbb.ccc.ddd
datetime: 2022-04-13T22:06:07.648775-04:00
day_of_week: 3
day_of_year: 103
datetime: 2022-10-20T16:26:16.747520-04:00
day_of_week: 4
day_of_year: 293
dst: true
dst_from: 2022-03-13T07:00:00+00:00
dst_offset: 3600
dst_until: 2022-11-06T06:00:00+00:00
raw_offset: -18000
timezone: America/Toronto
unixtime: 1649901967
utc_datetime: 2022-04-14T02:06:07.648775+00:00
unixtime: 1666297576
utc_datetime: 2022-10-20T20:26:16.747520+00:00
utc_offset: -04:00
week_number: 15
week_number: 42
**************************************
```
@@ -790,8 +790,8 @@ week_number: 15
```
Starting AsyncHTTPRequest_ESP_WiFiManager using LittleFS on ESP32S3_DEV
ESPAsync_WiFiManager v1.13.0
AsyncHTTPRequest_Generic v1.9.0
ESPAsync_WiFiManager v1.15.0
AsyncHTTPRequest_Generic v1.10.1
Stored: SSID = HueNet1, Pass = password
Got stored Credentials. Timeout 120s
ConnectMultiWiFi in setup
@@ -800,38 +800,38 @@ H
**************************************
abbreviation: EDT
client_ip: aaa.bbb.ccc.ddd
datetime: 2022-04-13T22:07:07.649344-04:00
day_of_week: 3
day_of_year: 103
datetime: 2022-10-20T16:22:16.769386-04:00
day_of_week: 4
day_of_year: 293
dst: true
dst_from: 2022-03-13T07:00:00+00:00
dst_offset: 3600
dst_until: 2022-11-06T06:00:00+00:00
raw_offset: -18000
timezone: America/Toronto
unixtime: 1649902027
utc_datetime: 2022-04-14T02:07:07.649344+00:00
unixtime: 1666297336
utc_datetime: 2022-10-20T20:22:16.769386+00:00
utc_offset: -04:00
week_number: 15
week_number: 42
**************************************
HHHHHH
**************************************
abbreviation: EDT
client_ip: aaa.bbb.ccc.ddd
datetime: 2022-04-13T22:08:07.649062-04:00
day_of_week: 3
day_of_year: 103
datetime: 2022-10-20T16:23:16.733395-04:00
day_of_week: 4
day_of_year: 293
dst: true
dst_from: 2022-03-13T07:00:00+00:00
dst_offset: 3600
dst_until: 2022-11-06T06:00:00+00:00
raw_offset: -18000
timezone: America/Toronto
unixtime: 1649902087
utc_datetime: 2022-04-14T02:08:07.649062+00:00
unixtime: 1666297396
utc_datetime: 2022-10-20T20:23:16.733395+00:00
utc_offset: -04:00
week_number: 15
week_number: 42
**************************************
```
@@ -843,7 +843,7 @@ The terminal output of [AsyncHTTPRequest_ESP_Multi example](examples/AsyncHTTPRe
```
Starting AsyncHTTPRequest_ESP_Multi using ESP32_DEV
AsyncHTTPRequest_Generic v1.9.0
AsyncHTTPRequest_Generic v1.10.1
Connecting to WiFi SSID: HueNet1
.......
AsyncHTTPSRequest @ IP : 192.168.2.88
@@ -853,21 +853,21 @@ Sending request: http://worldtimeapi.org/api/timezone/Europe/Prague.txt
Sending request: http://www.myexternalip.com/raw
**************************************
abbreviation: CET
abbreviation: CEST
client_ip: aaa.bbb.ccc.ddd
datetime: 2022-02-26T01:54:15.753826+01:00
day_of_week: 6
day_of_year: 57
dst: false
dst_from:
dst_offset: 0
dst_until:
datetime: 2022-10-19T04:06:40.111091+02:00
day_of_week: 3
day_of_year: 292
dst: true
dst_from: 2022-03-27T01:00:00+00:00
dst_offset: 3600
dst_until: 2022-10-30T01:00:00+00:00
raw_offset: 3600
timezone: Europe/Prague
unixtime: 1645836855
utc_datetime: 2022-02-26T00:54:15.753826+00:00
utc_offset: +01:00
week_number: 8
unixtime: 1666145200
utc_datetime: 2022-10-19T02:06:40.111091+00:00
utc_offset: +02:00
week_number: 42
**************************************
**************************************
@@ -877,21 +877,21 @@ aaa.bbb.ccc.ddd
Sending request: http://worldtimeapi.org/api/timezone/America/Toronto.txt
**************************************
abbreviation: EST
abbreviation: EDT
client_ip: aaa.bbb.ccc.ddd
datetime: 2022-02-25T19:54:15.822746-05:00
day_of_week: 5
day_of_year: 56
dst: false
dst_from:
dst_offset: 0
dst_until:
datetime: 2022-10-18T22:06:42.109821-04:00
day_of_week: 2
day_of_year: 291
dst: true
dst_from: 2022-03-13T07:00:00+00:00
dst_offset: 3600
dst_until: 2022-11-06T06:00:00+00:00
raw_offset: -18000
timezone: America/Toronto
unixtime: 1645836855
utc_datetime: 2022-02-26T00:54:15.822746+00:00
utc_offset: -05:00
week_number: 8
unixtime: 1666145202
utc_datetime: 2022-10-19T02:06:42.109821+00:00
utc_offset: -04:00
week_number: 42
**************************************
HHH
```
@@ -904,44 +904,44 @@ The terminal output of [AsyncHTTPRequest_ESP8266_Ethernet example](examples/Asyn
```
Starting AsyncHTTPRequest_ESP8266_Ethernet on ESP8266_NODEMCU_ESP12E using ESP8266_W5500 Ethernet
AsyncHTTPRequest_Generic v1.9.0
AsyncHTTPRequest_Generic v1.10.1
Connecting ethernet..
Ethernet IP address: 192.168.2.187
**************************************
abbreviation: EDT
client_ip: aaa.bbb.ccc.ddd
datetime: 2022-04-13T21:58:31.037966-04:00
day_of_week: 3
day_of_year: 103
datetime: 2022-10-20T16:24:16.747577-04:00
day_of_week: 4
day_of_year: 293
dst: true
dst_from: 2022-03-13T07:00:00+00:00
dst_offset: 3600
dst_until: 2022-11-06T06:00:00+00:00
raw_offset: -18000
timezone: America/Toronto
unixtime: 1649901511
utc_datetime: 2022-04-14T01:58:31.037966+00:00
unixtime: 1666297456
utc_datetime: 2022-10-20T20:24:16.747577+00:00
utc_offset: -04:00
week_number: 15
week_number: 42
**************************************
HHHHHH
**************************************
abbreviation: EDT
client_ip: aaa.bbb.ccc.ddd
datetime: 2022-04-13T21:59:31.025188-04:00
day_of_week: 3
day_of_year: 103
datetime: 2022-10-20T16:25:16.750043-04:00
day_of_week: 4
day_of_year: 293
dst: true
dst_from: 2022-03-13T07:00:00+00:00
dst_offset: 3600
dst_until: 2022-11-06T06:00:00+00:00
raw_offset: -18000
timezone: America/Toronto
unixtime: 1649901571
utc_datetime: 2022-04-14T01:59:31.025188+00:00
unixtime: 1666297516
utc_datetime: 2022-10-20T20:25:16.750043+00:00
utc_offset: -04:00
week_number: 15
week_number: 42
**************************************
HH
```
@@ -954,48 +954,47 @@ The terminal output of [AsyncHTTPRequest_ESP8266_Ethernet example](examples/Asyn
```
Starting AsyncHTTPRequest_ESP8266_Ethernet on ESP8266_NODEMCU_ESP12E using ESP8266_ENC28J60 Ethernet
AsyncHTTPRequest_Generic v1.9.0
AsyncHTTPRequest_Generic v1.10.1
Connecting to network : ..........................................................
Ethernet IP address: 192.168.2.187
**************************************
abbreviation: EDT
client_ip: aaa.bbb.ccc.ddd
datetime: 2022-04-13T23:54:42.973735-04:00
day_of_week: 3
day_of_year: 103
datetime: 2022-10-20T16:16:16.759058-04:00
day_of_week: 4
day_of_year: 293
dst: true
dst_from: 2022-03-13T07:00:00+00:00
dst_offset: 3600
dst_until: 2022-11-06T06:00:00+00:00
raw_offset: -18000
timezone: America/Toronto
unixtime: 1649908482
utc_datetime: 2022-04-14T03:54:42.973735+00:00
unixtime: 1666296976
utc_datetime: 2022-10-20T20:16:16.759058+00:00
utc_offset: -04:00
week_number: 15
week_number: 42
**************************************
HHHHHH
**************************************
abbreviation: EDT
client_ip: aaa.bbb.ccc.ddd
datetime: 2022-04-13T23:55:42.894333-04:00
day_of_week: 3
day_of_year: 103
datetime: 2022-10-20T16:17:16.713722-04:00
day_of_week: 4
day_of_year: 293
dst: true
dst_from: 2022-03-13T07:00:00+00:00
dst_offset: 3600
dst_until: 2022-11-06T06:00:00+00:00
raw_offset: -18000
timezone: America/Toronto
unixtime: 1649908542
utc_datetime: 2022-04-14T03:55:42.894333+00:00
unixtime: 1666297036
utc_datetime: 2022-10-20T20:17:16.713722+00:00
utc_offset: -04:00
week_number: 15
week_number: 42
```
---
---
@@ -1057,7 +1056,10 @@ Submit issues to: [AsyncHTTPRequest_Generic issues](https://github.com/khoih-pro
17. Add support to ESP8266 using **ENC28J60** with [**lwIP_enc28j60**](https://github.com/esp8266/Arduino/tree/master/libraries/lwIP_enc28j60) library
18. Fix long timeout if using `IPAddress`.
19. Remove support to STM32 using **LAN8720** due to problem with new STM32 core v2.3.0
20. Fix ESP32 chipID for example`AsyncHTTPRequest_ESP_WiFiManager`
21. Remove dependency on `LittleFS_esp32` library to prevent PIO error when using new ESP32 core v1.0.6+
22. Not try to reconnect to the same `host:port` after connected
23. Fix bug of wrong `reqStates` introduced from `v1.9.0`
---
---
@@ -1066,15 +1068,17 @@ Submit issues to: [AsyncHTTPRequest_Generic issues](https://github.com/khoih-pro
This library is based on, modified, bug-fixed and improved from:
1. [Bob Lemaire's **asyncHTTPrequest Library**](https://github.com/boblemaire/asyncHTTPrequest) to use the better **asynchronous** features of these following Async TCP Libraries : ( [`ESPAsyncTCP`](https://github.com/me-no-dev/ESPAsyncTCP), [`AsyncTCP`](https://github.com/me-no-dev/AsyncTCP), and [`STM32AsyncTCP`](https://github.com/philbowles/STM32AsyncTCP) ).
2. Thanks to [Daniel Brunner](https://github.com/0xFEEDC0DE64) to report and make PR in [Fixed linker errors when included in multiple .cpp files](https://github.com/khoih-prog/AsyncHTTPRequest_Generic/pull/1) leading to v1.0.1. See [**HOWTO Fix `Multiple Definitions` Linker Error**](https://github.com/khoih-prog/AsyncHTTPRequest_Generic#HOWTO-Fix-Multiple-Definitions-Linker-Error)
3. Thanks to [gleniat](https://github.com/gleniat) to make enhancement request in [Add support for sending PUT, PATCH, DELETE request](https://github.com/khoih-prog/AsyncHTTPRequest_Generic/issues/5) leading to v1.1.0.
4. Thanks to [BadDwarf](https://github.com/baddwarf) to report [**compatibility with ESPAsyncWebServer #11**](https://github.com/khoih-prog/AsyncHTTPRequest_Generic/issues/11) leading to the enhancement in v1.1.2.
5. Thanks to [spdi](https://github.com/spdi) to report [**'Connection' header expects 'disconnect' instead 'close' ? #13**](https://github.com/khoih-prog/AsyncHTTPRequest_Generic/issues/13) leading to new release v1.1.3 to fix bug.
6. Thanks to [andrewk123](https://github.com/andrewk123) to report [**Http GET polling causes crash when host disconnected #22**](https://github.com/khoih-prog/AsyncHTTPRequest_Generic/issues/22) leading to new release v1.4.0 to fix bug.
7. Thanks to [DavidAntonin](https://github.com/DavidAntonin) to report [Cannot send requests to different addresses #4](https://github.com/khoih-prog/AsyncHTTPSRequest_Generic/issues/4) leading to new release v1.7.1 to demonstrate how to send requests to multiple addresses and receive responses from them.
8. Thanks to [per1234](https://github.com/per1234) to make PR [Remove unavailable items from depends field of library.properties](https://github.com/khoih-prog/AsyncHTTPRequest_Generic/pull/35) leading to v1.8.2
9. Thanks to [miwied](https://github.com/miwied) to report [setTimeout() hasn't any effect #38](https://github.com/khoih-prog/AsyncHTTPRequest_Generic/issues/38) leading to new release v1.9.0
1. [Bob Lemaire's **asyncHTTPrequest Library**](https://github.com/boblemaire/asyncHTTPrequest) to use the better **asynchronous** features of these following Async TCP Libraries : ( [`ESPAsyncTCP`](https://github.com/me-no-dev/ESPAsyncTCP), [`AsyncTCP`](https://github.com/me-no-dev/AsyncTCP), and [`STM32AsyncTCP`](https://github.com/philbowles/STM32AsyncTCP) ).
2. Thanks to [Daniel Brunner](https://github.com/0xFEEDC0DE64) to report and make PR in [Fixed linker errors when included in multiple .cpp files](https://github.com/khoih-prog/AsyncHTTPRequest_Generic/pull/1) leading to v1.0.1. See [**HOWTO Fix `Multiple Definitions` Linker Error**](https://github.com/khoih-prog/AsyncHTTPRequest_Generic#HOWTO-Fix-Multiple-Definitions-Linker-Error)
3. Thanks to [gleniat](https://github.com/gleniat) to make enhancement request in [Add support for sending PUT, PATCH, DELETE request](https://github.com/khoih-prog/AsyncHTTPRequest_Generic/issues/5) leading to v1.1.0.
4. Thanks to [BadDwarf](https://github.com/baddwarf) to report [**compatibility with ESPAsyncWebServer #11**](https://github.com/khoih-prog/AsyncHTTPRequest_Generic/issues/11) leading to the enhancement in v1.1.2.
5. Thanks to [spdi](https://github.com/spdi) to report [**'Connection' header expects 'disconnect' instead 'close' ? #13**](https://github.com/khoih-prog/AsyncHTTPRequest_Generic/issues/13) leading to new release v1.1.3 to fix bug.
6. Thanks to [andrewk123](https://github.com/andrewk123) to report [**Http GET polling causes crash when host disconnected #22**](https://github.com/khoih-prog/AsyncHTTPRequest_Generic/issues/22) leading to new release v1.4.0 to fix bug.
7. Thanks to [DavidAntonin](https://github.com/DavidAntonin) to report [Cannot send requests to different addresses #4](https://github.com/khoih-prog/AsyncHTTPSRequest_Generic/issues/4) leading to new release v1.7.1 to demonstrate how to send requests to multiple addresses and receive responses from them.
8. Thanks to [per1234](https://github.com/per1234) to make PR [Remove unavailable items from depends field of library.properties](https://github.com/khoih-prog/AsyncHTTPRequest_Generic/pull/35) leading to v1.8.2
9. Thanks to [miwied](https://github.com/miwied) to report [setTimeout() hasn't any effect #38](https://github.com/khoih-prog/AsyncHTTPRequest_Generic/issues/38) leading to new release v1.9.0
10. Thanks to [ValentinsStorre](https://github.com/ValentinsStorre) to report [Release 1.9 breakes previously running code #39](https://github.com/khoih-prog/AsyncHTTPRequest_Generic/issues/39) leading to new release v1.10.1
11. Thanks to [Dirk Vranckaert](https://github.com/dirkvranckaert) to report [Callback behaviour is buggy (ESP8266) #43](https://github.com/khoih-prog/AsyncHTTPRequest_Generic/issues/43) leading to new release v1.10.1
<table>
<tr>
@@ -1089,6 +1093,8 @@ This library is based on, modified, bug-fixed and improved from:
<td align="center"><a href="https://github.com/DavidAntonin"><img src="https://github.com/DavidAntonin.png" width="100px;" alt="DavidAntonin"/><br /><sub><b>DavidAntonin</b></sub></a><br /></td>
<td align="center"><a href="https://github.com/per1234"><img src="https://github.com/per1234.png" width="100px;" alt="per1234"/><br /><sub><b>per1234</b></sub></a><br /></td>
<td align="center"><a href="https://github.com/miwied"><img src="https://github.com/miwied.png" width="100px;" alt="miwied"/><br /><sub><b>miwied</b></sub></a><br /></td>
<td align="center"><a href="https://github.com/ValentinsStorre"><img src="https://github.com/ValentinsStorre.png" width="100px;" alt="ValentinsStorre"/><br /><sub><b>ValentinsStorre</b></sub></a><br /></td>
<td align="center"><a href="https://github.com/dirkvranckaert"><img src="https://github.com/dirkvranckaert.png" width="100px;" alt="dirkvranckaert"/><br /><sub><b>Dirk Vranckaert</b></sub></a><br /></td>
</tr>
</table>
@@ -1102,6 +1108,7 @@ If you want to contribute to this project:
- Create issues and pull requests
- Tell other people about this library
---
---
### License and credits ###
+24
View File
@@ -12,6 +12,10 @@
## Table of Contents
* [Changelog](#changelog)
* [Releases v1.10.1](#releases-v1101)
* [Releases v1.10.0](#releases-v1100)
* [Releases v1.9.2](#releases-v192)
* [Releases v1.9.1](#releases-v191)
* [Releases v1.9.0](#releases-v190)
* [Releases v1.8.2](#releases-v182)
* [Releases v1.8.1](#releases-v181)
@@ -40,6 +44,26 @@
## Changelog
### Releases v1.10.1
1. Fix bug of wrong `reqStates`. Check [Release 1.9 breakes previously running code #39](https://github.com/khoih-prog/AsyncHTTPRequest_Generic/issues/39) and [Callback behaviour is buggy (ESP8266) #43](https://github.com/khoih-prog/AsyncHTTPRequest_Generic/issues/43)
2. Optional larger `DEFAULT_RX_TIMEOUT` from default 3s, for slower networks
### Releases v1.10.0
1. Fix bug.
2. Clean up
### Releases v1.9.2
1. Not try to reconnect to the same host:port after connected. Check [setReuse feature #12](https://github.com/khoih-prog/AsyncHTTPSRequest_Generic/issues/12)
2. Update `Packages' Patches`
### Releases v1.9.1
1. Fix ESP32 chipID for example `AsyncHTTPRequest_ESP_WiFiManager`
2. Remove dependency on `LittleFS_esp32` library to prevent PIO error when using new ESP32 core v1.0.6+
### Releases v1.9.0
1. Fix long timeout if using `IPAddress`. Check [setTimeout() hasn't any effect #38](https://github.com/khoih-prog/AsyncHTTPRequest_Generic/issues/38)
@@ -24,8 +24,8 @@
//char GET_ServerAddress[] = "192.168.2.110/";
char GET_ServerAddress[] = "http://worldtimeapi.org/api/timezone/America/Toronto.txt";
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MIN_TARGET "AsyncHTTPRequest_Generic v1.9.0"
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MIN 1009000
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MIN_TARGET "AsyncHTTPRequest_Generic v1.10.1"
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MIN 1010001
// 600s = 10 minutes to not flooding, 60s in testing
#define HTTP_REQUEST_INTERVAL_MS 60000 //600000
@@ -35,8 +35,8 @@ const char GET_ServerAddress[] = "dweet.io";
// use your own thing name here
String dweetName = "/dweet/for/currentSecond?second=";
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MIN_TARGET "AsyncHTTPRequest_Generic v1.9.0"
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MIN 1009000
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MIN_TARGET "AsyncHTTPRequest_Generic v1.10.1"
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MIN 1010001
// 600s = 10 minutes to not flooding, 60s in testing
#define HTTP_REQUEST_INTERVAL_MS 60000 //600000
@@ -29,8 +29,8 @@ const char POST_ServerAddress[] = "dweet.io";
// use your own thing name here
String dweetName = "/dweet/for/pinA0-Read?";
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MIN_TARGET "AsyncHTTPRequest_Generic v1.9.0"
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MIN 1009000
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MIN_TARGET "AsyncHTTPRequest_Generic v1.10.1"
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MIN 1010001
// 600s = 10 minutes to not flooding, 60s in testing
#define HTTP_REQUEST_INTERVAL_MS 60000 //600000
@@ -44,8 +44,8 @@
#error This code is intended to run on the ESP8266 or ESP32 platform! Please check your Tools->Board setting.
#endif
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MIN_TARGET "AsyncHTTPRequest_Generic v1.9.0"
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MIN 1009000
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MIN_TARGET "AsyncHTTPRequest_Generic v1.10.1"
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MIN 1010001
// Level from 0-4
#define ASYNC_HTTP_DEBUG_PORT Serial
@@ -68,6 +68,9 @@ const char* password = "your_pass";
#include <WiFi.h>
#endif
// Seconds for timeout, default is 3s
#define DEFAULT_RX_TIMEOUT 10
// To be included only in main(), .ino with setup() to avoid `Multiple Definitions` Linker Error
#include <AsyncHTTPRequest_Generic.h> // https://github.com/khoih-prog/AsyncHTTPRequest_Generic
@@ -46,7 +46,7 @@
// Level from 0-4
#define ASYNC_HTTP_DEBUG_PORT Serial
#define _ASYNC_HTTP_LOGLEVEL_ 1
#define _ASYNC_HTTP_LOGLEVEL_ 4
// 300s = 5 minutes to not flooding
#define HTTP_REQUEST_INTERVAL 60 //300
@@ -65,8 +65,11 @@ const char* password = "your_pass";
#include <WiFi.h>
#endif
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MIN_TARGET "AsyncHTTPRequest_Generic v1.9.0"
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MIN 1009000
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MIN_TARGET "AsyncHTTPRequest_Generic v1.10.1"
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MIN 1010001
// Seconds for timeout, default is 3s
#define DEFAULT_RX_TIMEOUT 10
// To be included only in main(), .ino with setup() to avoid `Multiple Definitions` Linker Error
#include <AsyncHTTPRequest_Generic.h> // https://github.com/khoih-prog/AsyncHTTPRequest_Generic
@@ -95,8 +95,11 @@ using TCPClient = WiFiClient;
//////////////////////////////////////////////////////////
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MIN_TARGET "AsyncHTTPRequest_Generic v1.9.0"
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MIN 1009000
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MIN_TARGET "AsyncHTTPRequest_Generic v1.10.1"
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MIN 1010001
// Seconds for timeout, default is 3s
#define DEFAULT_RX_TIMEOUT 10
// To be included only in main(), .ino with setup() to avoid `Multiple Definitions` Linker Error
#include <AsyncHTTPRequest_Generic.h> // https://github.com/khoih-prog/AsyncHTTPRequest_Generic
@@ -1,3 +1,23 @@
/****************************************************************************************************************************
AsyncHTTPRequest_ESP_Multi.ino - Dead simple AsyncHTTPRequest for ESP8266, ESP32 and currently STM32 with built-in LAN8742A Ethernet
For ESP8266, ESP32 and STM32 with built-in LAN8742A Ethernet (Nucleo-144, DISCOVERY, etc)
AsyncHTTPRequest_Generic is a library for the ESP8266, ESP32 and currently STM32 run built-in Ethernet WebServer
Based on and modified from asyncHTTPrequest Library (https://github.com/boblemaire/asyncHTTPrequest)
Built by Khoi Hoang https://github.com/khoih-prog/AsyncHTTPRequest_Generic
Licensed under MIT license
Copyright (C) <2018> <Bob Lemaire, IoTaWatt, Inc.>
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License
as published bythe Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program 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 General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
*****************************************************************************************************************************/
#if !( defined(ESP8266) || defined(ESP32) )
#error This code is intended to run on the ESP8266 or ESP32 platform! Please check your Tools->Board setting.
#endif
@@ -24,6 +44,9 @@ const char* password = "your_pass";
#include <WiFi.h>
#endif
// Seconds for timeout, default is 3s
#define DEFAULT_RX_TIMEOUT 10
// To be included only in main(), .ino with setup() to avoid `Multiple Definitions` Linker Error
#include <AsyncHTTPRequest_Generic.h> // http://github.com/khoih-prog/AsyncHTTPRequest_Generic
@@ -119,15 +142,14 @@ void sendRequests()
reqCount[1] = NUM_ENTRIES_SITE_1;
}
void requestCB0(void* optParm, AsyncHTTPRequest* thisRequest, int readyState)
{
(void) optParm;
if (readyState == readyStateDone)
{
AHTTP_LOGERROR(F("\n**************************************"));
AHTTP_LOGERROR1(F("Response Code = "), request->responseHTTPString());
AHTTP_LOGWARN(F("\n**************************************"));
AHTTP_LOGWARN1(F("Response Code = "), request->responseHTTPString());
if (request->responseHTTPcode() == 200)
{
@@ -151,8 +173,8 @@ void requestCB1(void* optParm, AsyncHTTPRequest* thisRequest, int readyState)
if (readyState == readyStateDone)
{
AHTTP_LOGERROR(F("\n**************************************"));
AHTTP_LOGERROR1(F("Response Code = "), request->responseHTTPString());
AHTTP_LOGWARN(F("\n**************************************"));
AHTTP_LOGWARN1(F("Response Code = "), request->responseHTTPString());
if (request->responseHTTPcode() == 200)
{
@@ -187,7 +209,7 @@ void setup()
while (WiFi.status() != WL_CONNECTED)
{
delay(500);
delay(1000);
Serial.print(".");
}
@@ -211,12 +233,11 @@ void loop()
for (int index = 0; index < NUM_DIFFERENT_SITES; index++)
{
if ((reqCount[index] > 0) && readySend[index])
// OK but have to use delay(100)
//if ( reqCount[index] > 0 )
{
sendRequestCB[index]();
//delay(100);
// Don't send too fast
delay(1000);
}
}
}
@@ -46,11 +46,11 @@
#error This code is intended to run on the ESP8266 or ESP32 platform! Please check your Tools->Board setting.
#endif
#define ESP_ASYNC_WIFIMANAGER_VERSION_MIN_TARGET "ESPAsync_WiFiManager v1.13.0"
#define ESP_ASYNC_WIFIMANAGER_VERSION_MIN 1013000
#define ESP_ASYNC_WIFIMANAGER_VERSION_MIN_TARGET "ESPAsync_WiFiManager v1.15.0"
#define ESP_ASYNC_WIFIMANAGER_VERSION_MIN 1015000
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MIN_TARGET "AsyncHTTPRequest_Generic v1.9.0"
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MIN 1009000
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MIN_TARGET "AsyncHTTPRequest_Generic v1.10.1"
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MIN 1010001
// Level from 0-4
#define ASYNC_HTTP_DEBUG_PORT Serial
@@ -115,8 +115,6 @@
#endif
//////
#define ESP_getChipId() ((uint32_t)ESP.getEfuseMac())
#define LED_BUILTIN 2
#define LED_ON HIGH
#define LED_OFF LOW
@@ -42,8 +42,8 @@
#include "defines.h"
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MIN_TARGET "AsyncHTTPRequest_Generic v1.9.0"
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MIN 1009000
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MIN_TARGET "AsyncHTTPRequest_Generic v1.10.1"
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MIN 1010001
// 600s = 10 minutes to not flooding, 60s in testing
#define HTTP_REQUEST_INTERVAL_MS 60000 //600000
@@ -24,8 +24,8 @@
//char GET_ServerAddress[] = "ipv4bot.whatismyipaddress.com/";
char GET_ServerAddress[] = "http://worldtimeapi.org/api/timezone/America/Toronto.txt";
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MIN_TARGET "AsyncHTTPRequest_Generic v1.9.0"
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MIN 1009000
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MIN_TARGET "AsyncHTTPRequest_Generic v1.10.1"
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MIN 1010001
// 600s = 10 minutes to not flooding, 60s in testing
#define HTTP_REQUEST_INTERVAL_MS 60000 //600000
@@ -26,8 +26,8 @@ const char GET_ServerAddress[] = "arduino.tips";
// GET location
String GET_Location = "/asciilogo.txt";
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MIN_TARGET "AsyncHTTPRequest_Generic v1.9.0"
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MIN 1009000
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MIN_TARGET "AsyncHTTPRequest_Generic v1.10.1"
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MIN 1010001
// 600s = 10 minutes to not flooding, 60s in testing
#define HTTP_REQUEST_INTERVAL_MS 60000 //600000
@@ -57,8 +57,8 @@
#include <WebServer_WT32_ETH01.h> // https://github.com/khoih-prog/WebServer_WT32_ETH01
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MIN_TARGET "AsyncHTTPRequest_Generic v1.9.0"
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MIN 1009000
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MIN_TARGET "AsyncHTTPRequest_Generic v1.10.1"
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MIN 1010001
// To be included only in main(), .ino with setup() to avoid `Multiple Definitions` Linker Error
#include <AsyncHTTPRequest_Generic.h> // https://github.com/khoih-prog/AsyncHTTPRequest_Generic
@@ -57,8 +57,8 @@
#include <WebServer_WT32_ETH01.h> // https://github.com/khoih-prog/WebServer_WT32_ETH01
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MIN_TARGET "AsyncHTTPRequest_Generic v1.9.0"
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MIN 1009000
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MIN_TARGET "AsyncHTTPRequest_Generic v1.10.1"
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MIN 1010001
// To be included only in main(), .ino with setup() to avoid `Multiple Definitions` Linker Error
#include <AsyncHTTPRequest_Generic.h> // https://github.com/khoih-prog/AsyncHTTPRequest_Generic
@@ -19,8 +19,8 @@
#error This code is intended to run on the ESP8266, ESP32 or STM32 platform! Please check your Tools->Board setting.
#endif
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MIN_TARGET "AsyncHTTPRequest_Generic v1.9.0"
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MIN 1009000
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MIN_TARGET "AsyncHTTPRequest_Generic v1.10.1"
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MIN 1010001
#include "multiFileProject.h"
+5 -4
View File
@@ -1,6 +1,6 @@
{
"name":"AsyncHTTPRequest_Generic",
"version": "1.9.0",
"version": "1.10.1",
"description":"Simple Async HTTP Request library, supporting GET, POST, PUT, PATCH, DELETE and HEAD, on top of AsyncTCP libraries, such as AsyncTCP, ESPAsyncTCP, AsyncTCP_STM32, etc.. for ESP32 (including ESP32_S2, ESP32_S3 and ESP32_C3), WT32_ETH01 (ESP32 + LAN8720), ESP8266 (WiFi, W5x00 or ENC28J60) and currently STM32 with built-in LAN8742A Ethernet.",
"keywords":"communication, async, tcp, http, ESP8266, ESP32, ESP32-S2, ESP32-S3, ESP32-C3, wt32-eth01, stm32, ethernet, wifi, lan8742a, nucleo-144, stm32f7, W5x00, ENC28J60",
"authors": [
@@ -45,7 +45,7 @@
{
"owner": "khoih-prog",
"name": "ESPAsync_WiFiManager",
"version": ">=1.13.0",
"version": ">=1.15.0",
"platforms": ["espressif8266", "espressif32"]
},
{
@@ -63,12 +63,13 @@
{
"owner": "khoih-prog",
"name": "WebServer_WT32_ETH01",
"version": ">=1.5.0",
"version": ">=1.5.1",
"platforms": ["espressif32"]
},
{
"name": "STM32AsyncTCP",
"version": "https://github.com/khoih-prog/STM32AsyncTCP"
"version": "https://github.com/khoih-prog/STM32AsyncTCP",
"platforms": "ststm32"
}
],
"license": "LGPL-3.0",
+3 -3
View File
@@ -1,12 +1,12 @@
name=AsyncHTTPRequest_Generic
version=1.9.0
version=1.10.1
author=Bob Lemaire,Khoi Hoang <khoih.prog@gmail.com>
maintainer=Khoi Hoang <khoih.prog@gmail.com>
icense=GPLv3
license=GPLv3
sentence=Simple Async HTTP Request library, supporting GET, POST, PUT, PATCH, DELETE and HEAD, on top of AsyncTCP libraries, such as AsyncTCP, ESPAsyncTCP, AsyncTCP_STM32, etc.. for ESP32 (including ESP32_S2, ESP32_S3 and ESP32_C3), WT32_ETH01 (ESP32 + LAN8720), ESP8266 (WiFi, W5x00 or ENC28J60) and currently STM32 with LAN8720 or built-in LAN8742A Ethernet.
paragraph=This AsyncHTTPRequest_Generic Library, supporting GET, POST, PUT, PATCH, DELETE and HEAD, for ESP32 (including ESP32-S2), ESP8266 (WiFi, W5x00 or ENC28J60) and STM32 built-in LAN8742A Ethernet, such as Nucleo-144 F767ZI, etc.
category=Communication,AsyncTCP,AsyncHTTP
url=https://github.com/khoih-prog/AsyncHTTPRequest_Generic
architectures=*
depends=depends=ESPAsync_WiFiManager, STM32duino LwIP, STM32duino STM32Ethernet, WebServer_WT32_ETH01
depends=ESPAsync_WiFiManager, STM32duino LwIP, STM32duino STM32Ethernet, WebServer_WT32_ETH01
includes=AsyncHTTPRequest_Generic.h,AsyncHTTPRequest_Generic.hpp
+45 -7
View File
@@ -35,6 +35,8 @@ upload_speed = 921600
; Checks for the compatibility with frameworks and dev/platforms
lib_compat_mode = strict
lib_ldf_mode = chain+
;lib_ldf_mode = deep+
lib_deps =
; PlatformIO 4.x
@@ -43,20 +45,20 @@ lib_deps =
; https://github.com/khoih-prog/STM32AsyncTCP.git
; STM32duino LwIP@>=2.1.2
; STM32duino STM32Ethernet@>=1.3.0
; ESPAsync_WiFiManager@>=1.13.0
; ESPAsync_WiFiManager@>=1.15.0
; LittleFS_esp32@>=1.0.6
; WebServer_WT32_ETH01@>=1.5.0
; WebServer_WT32_ETH01@>=1.5.1
;
; PlatformIO 5.x
me-no-dev/AsyncTCP@>=1.1.1
me-no-dev/ESPAsyncTCP@>=1.2.2
; me-no-dev/AsyncTCP@>=1.1.1
; me-no-dev/ESPAsyncTCP@>=1.2.2
; philbowles/STM32AsyncTCP
; https://github.com/khoih-prog/STM32AsyncTCP.git
; stm32duino/STM32duino LwIP@>=2.1.2
; stm32duino/STM32duino STM32Ethernet@>=1.3.0
khoih-prog/ESPAsync_WiFiManager@>=1.13.0
; khoih-prog/ESPAsync_WiFiManager@>=1.15.0
; lorol/LittleFS_esp32@>=1.0.6
; khoih-prog/WebServer_WT32_ETH01@>=1.5.0
; khoih-prog/WebServer_WT32_ETH01@>=1.5.1
build_flags =
; set your debug output (default=Serial)
@@ -67,6 +69,16 @@ build_flags =
[env:ESP8266]
platform = espressif8266
framework = arduino
lib_deps =
; PlatformIO 4.x
; ESPAsyncTCP@>=1.2.2
; ESPAsync_WiFiManager@>=1.15.0
;
; PlatformIO 5.x
me-no-dev/ESPAsyncTCP@>=1.2.2
khoih-prog/ESPAsync_WiFiManager@>=1.15.0
; ============================================================
; Board configuration
; choose your board by uncommenting one of the following lines
@@ -112,6 +124,20 @@ board = nodemcuv2
[env:ESP32]
platform = espressif32
framework = arduino
lib_deps =
; PlatformIO 4.x
; AsyncTCP@>=1.1.1
; ESPAsync_WiFiManager@>=1.15.0
; LittleFS_esp32@>=1.0.6
; WebServer_WT32_ETH01@>=1.5.1
;
; PlatformIO 5.x
me-no-dev/AsyncTCP@>=1.1.1
khoih-prog/ESPAsync_WiFiManager@>=1.15.0
; lorol/LittleFS_esp32@>=1.0.6
khoih-prog/WebServer_WT32_ETH01@>=1.5.1
; ============================================================
; Board configuration
; choose your board by uncommenting one of the following lines
@@ -248,6 +274,18 @@ board = feather52840
platform = ststm32
framework = arduino
lib_deps =
; PlatformIO 4.x
; https://github.com/khoih-prog/STM32AsyncTCP.git
; STM32duino LwIP@>=2.1.2
; STM32duino STM32Ethernet@>=1.3.0
;
; PlatformIO 5.x
philbowles/STM32AsyncTCP
https://github.com/khoih-prog/STM32AsyncTCP.git
stm32duino/STM32duino LwIP@>=2.1.2
stm32duino/STM32duino STM32Ethernet@>=1.3.0
; ============================================================
; Choose your board by uncommenting one of the following lines
; ============================================================
+8 -3
View File
@@ -15,9 +15,10 @@
as published bythe Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program 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 General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
You should have received a copy of the GNU General Public License along with this program.
If not, see <https://www.gnu.org/licenses/>.
Version: 1.9.0
Version: 1.10.1
Version Modified By Date Comments
------- ----------- ---------- -----------
@@ -28,7 +29,11 @@
1.8.0 K Hoang 13/04/2022 Add support to ESP8266 using W5x00 with lwip_W5100 or lwip_W5500 library
1.8.1 K Hoang 13/04/2022 Add support to ESP8266 using ENC28J60 with lwip_enc28j60 library
1.8.2 K Hoang 10/08/2022 Fix library.properties to remove unavailable items from depends
1.9.0 K Hoang 30/08/2022 Fix bug. Improve debug messages. Optimize code.
1.9.0 K Hoang 30/08/2022 Fix bug. Improve debug messages. Optimize code
1.9.1 K Hoang 09/09/2022 Fix ESP32 chipID for example `AsyncHTTPRequest_ESP_WiFiManager`
1.9.2 K Hoang 18/10/2022 Not try to reconnect to the same host:port after connected
1.10.0 K Hoang 20/10/2022 Fix bug. Clean up
1.10.1 K Hoang 21/10/2022 Fix bug of wrong reqStates
*****************************************************************************************************************************/
#pragma once
+8 -3
View File
@@ -15,9 +15,10 @@
as published bythe Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program 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 General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
You should have received a copy of the GNU General Public License along with this program.
If not, see <https://www.gnu.org/licenses/>.
Version: 1.9.0
Version: 1.10.1
Version Modified By Date Comments
------- ----------- ---------- -----------
@@ -28,7 +29,11 @@
1.8.0 K Hoang 13/04/2022 Add support to ESP8266 using W5x00 with lwip_W5100 or lwip_W5500 library
1.8.1 K Hoang 13/04/2022 Add support to ESP8266 using ENC28J60 with lwip_enc28j60 library
1.8.2 K Hoang 10/08/2022 Fix library.properties to remove unavailable items from depends
1.9.0 K Hoang 30/08/2022 Fix bug. Improve debug messages. Optimize code.
1.9.0 K Hoang 30/08/2022 Fix bug. Improve debug messages. Optimize code
1.9.1 K Hoang 09/09/2022 Fix ESP32 chipID for example `AsyncHTTPRequest_ESP_WiFiManager`
1.9.2 K Hoang 18/10/2022 Not try to reconnect to the same host:port after connected
1.10.0 K Hoang 20/10/2022 Fix bug. Clean up
1.10.1 K Hoang 21/10/2022 Fix bug of wrong reqStates
*****************************************************************************************************************************/
#pragma once
+106 -66
View File
@@ -15,9 +15,10 @@
as published bythe Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program 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 General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
You should have received a copy of the GNU General Public License along with this program.
If not, see <https://www.gnu.org/licenses/>.
Version: 1.9.0
Version: 1.10.1
Version Modified By Date Comments
------- ----------- ---------- -----------
@@ -28,7 +29,11 @@
1.8.0 K Hoang 13/04/2022 Add support to ESP8266 using W5x00 with lwip_W5100 or lwip_W5500 library
1.8.1 K Hoang 13/04/2022 Add support to ESP8266 using ENC28J60 with lwip_enc28j60 library
1.8.2 K Hoang 10/08/2022 Fix library.properties to remove unavailable items from depends
1.9.0 K Hoang 30/08/2022 Fix bug. Improve debug messages. Optimize code.
1.9.0 K Hoang 30/08/2022 Fix bug. Improve debug messages. Optimize code
1.9.1 K Hoang 09/09/2022 Fix ESP32 chipID for example `AsyncHTTPRequest_ESP_WiFiManager`
1.9.2 K Hoang 18/10/2022 Not try to reconnect to the same host:port after connected
1.10.0 K Hoang 20/10/2022 Fix bug. Clean up
1.10.1 K Hoang 21/10/2022 Fix bug of wrong reqStates
*****************************************************************************************************************************/
#pragma once
@@ -36,18 +41,24 @@
#ifndef ASYNC_HTTP_REQUEST_GENERIC_HPP
#define ASYNC_HTTP_REQUEST_GENERIC_HPP
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION "AsyncHTTPRequest_Generic v1.9.0"
////////////////////////////////////////
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION "AsyncHTTPRequest_Generic v1.10.1"
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MAJOR 1
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MINOR 9
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_PATCH 0
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MINOR 10
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_PATCH 1
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_INT 1009000
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_INT 1010001
////////////////////////////////////////
#include <Arduino.h>
#include "AsyncHTTPRequest_Debug_Generic.h"
////////////////////////////////////////
#ifndef DEBUG_IOTA_PORT
#define DEBUG_IOTA_PORT Serial
#endif
@@ -58,11 +69,20 @@
#define DEBUG_IOTA_HTTP_SET false
#endif
////////////////////////////////////////
// KH add
#define SAFE_DELETE(object) if (object) { delete object;}
#define SAFE_DELETE_ARRAY(object) if (object) { delete[] object;}
#define ASYNC_HTTP_PREFIX "HTTP://"
#define ASYNC_HTTP_PORT 80
#define ASYNC_HTTPS_PREFIX "HTTPS://"
#define ASYNC_HTTPS_PORT 443
////////////////////////////////////////
#if ESP32
#include <AsyncTCP.h>
@@ -84,9 +104,9 @@
#define _AHTTP_lock
#define _AHTTP_unlock
#elif ( defined(STM32F0) || defined(STM32F1) || defined(STM32F2) || defined(STM32F3) ||defined(STM32F4) || defined(STM32F7) || \
defined(STM32L0) || defined(STM32L1) || defined(STM32L4) || defined(STM32H7) ||defined(STM32G0) || defined(STM32G4) || \
defined(STM32WB) || defined(STM32MP1) )
#elif ( defined(STM32F0) || defined(STM32F1) || defined(STM32F2) || defined(STM32F3) ||defined(STM32F4) || \
defined(STM32F7) || defined(STM32L0) || defined(STM32L1) || defined(STM32L4) || defined(STM32H7) || \
defined(STM32G0) || defined(STM32G4) || defined(STM32WB) || defined(STM32MP1) )
#include "STM32AsyncTCP.h"
@@ -97,10 +117,12 @@
#endif
////////////////////////////////////////
#include <pgmspace.h>
// Merge xbuf
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////
struct xseg
{
@@ -108,6 +130,8 @@ struct xseg
uint8_t data[];
};
////////////////////////////////////////
class xbuf: public Print
{
public:
@@ -156,8 +180,7 @@ class xbuf: public Print
String peekString(int);
/* In addition to the above functions,
the following inherited functions from the Print class are available.
/* In addition to the above functions, the following inherited functions from the Print class are available.
size_t printf(const char * format, ...) __attribute__ ((format (printf, 2, 3)));
size_t printf_P(PGM_P format, ...) __attribute__((format(printf, 2, 3)));
@@ -201,13 +224,17 @@ class xbuf: public Print
};
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////
#define DEBUG_HTTP(format,...) if(_debug){\
DEBUG_IOTA_PORT.printf("Debug(%3ld): ", millis()-_requestStartTime);\
DEBUG_IOTA_PORT.printf_P(PSTR(format),##__VA_ARGS__);}
#define DEFAULT_RX_TIMEOUT 3 // Seconds for timeout
#if !defined(DEFAULT_RX_TIMEOUT)
#define DEFAULT_RX_TIMEOUT 3 // Seconds for timeout
#endif
////////////////////////////////////////
#define HTTPCODE_CONNECTION_REFUSED (-1)
#define HTTPCODE_SEND_HEADER_FAILED (-2)
@@ -221,6 +248,8 @@ class xbuf: public Print
#define HTTPCODE_STREAM_WRITE (-10)
#define HTTPCODE_TIMEOUT (-11)
////////////////////////////////////////
typedef enum
{
readyStateUnsent = 0, // Client created, open not yet called
@@ -229,68 +258,70 @@ typedef enum
readyStateLoading = 3, // receiving, partial data available
readyStateDone = 4 // Request complete, all data available.
} reqStates;
////////////////////////////////////////
class AsyncHTTPRequest
{
struct header
struct header
{
header* next;
char* name;
char* value;
header(): next(nullptr), name(nullptr), value(nullptr)
{};
~header()
{
header* next;
char* name;
char* value;
header(): next(nullptr), name(nullptr), value(nullptr)
{};
~header()
{
SAFE_DELETE_ARRAY(name)
SAFE_DELETE_ARRAY(value)
SAFE_DELETE(next)
//delete[] name;
//delete[] value;
//delete next;
}
};
SAFE_DELETE_ARRAY(name)
SAFE_DELETE_ARRAY(value)
SAFE_DELETE(next)
}
};
struct URL
{
char *buffer;
char *scheme;
char *host;
int port;
char *path;
char *query;
char *buffer;
char *scheme;
char *host;
int port;
char *path;
char *query;
URL(): buffer(nullptr), scheme(nullptr), host(nullptr),
port(80), path(nullptr), query(nullptr)
{};
URL(): buffer(nullptr), scheme(nullptr), host(nullptr),
port(80), path(nullptr), query(nullptr)
{};
~URL()
{
SAFE_DELETE_ARRAY(buffer)
SAFE_DELETE_ARRAY(scheme)
SAFE_DELETE_ARRAY(host)
SAFE_DELETE_ARRAY(path)
SAFE_DELETE_ARRAY(query)
}
};
typedef std::function<void(void*, AsyncHTTPRequest*, int readyState)> readyStateChangeCB;
typedef std::function<void(void*, AsyncHTTPRequest*, size_t available)> onDataCB;
~URL()
{
SAFE_DELETE_ARRAY(buffer)
SAFE_DELETE_ARRAY(scheme)
SAFE_DELETE_ARRAY(host)
SAFE_DELETE_ARRAY(path)
SAFE_DELETE_ARRAY(query)
}
};
typedef std::function<void(void*, AsyncHTTPRequest*, int readyState)> readyStateChangeCB;
typedef std::function<void(void*, AsyncHTTPRequest*, size_t available)> onDataCB;
////////////////////////////////////////
public:
AsyncHTTPRequest();
~AsyncHTTPRequest();
//External functions in typical order of use:
//__________________________________________________________________________________________________________*/
////////////////////////////////////////
void setDebug(bool); // Turn debug message on/off
bool debug(); // is debug on or off?
bool open(const char* /*GET/POST*/, const char* URL); // Initiate a request
void onReadyStateChange(readyStateChangeCB, void* arg = 0); // Optional event handler for ready state change
// or you can simply poll readyState()
void onReadyStateChange(readyStateChangeCB, void* arg = 0); // Optional event handler for ready state change or you can simply poll readyState()
void setTimeout(int); // overide default timeout (seconds)
void setReqHeader(const char* name, const char* value); // add a request header
@@ -304,7 +335,7 @@ class AsyncHTTPRequest
#endif
bool send(); // Send the request (GET)
bool send(const String& body); // Send the request (POST)
bool send(const String& body); // Send the request (POST)
bool send(const char* body); // Send the request (POST)
bool send(const uint8_t* buffer, size_t len); // Send the request (POST) (binary data?)
bool send(xbuf* body, size_t len); // Send the request (POST) data in an xbuf
@@ -338,16 +369,23 @@ class AsyncHTTPRequest
size_t responseRead(uint8_t* buffer, size_t len); // Read response into buffer
uint32_t elapsedTime(); // Elapsed time of in progress transaction or last completed (ms)
String version(); // Version of AsyncHTTPRequest
//___________________________________________________________________________________________________________________________________
////////////////////////////////////////
private:
// New in v1.1.1
bool _requestReadyToSend;
//////
// New in v1.1.0
typedef enum { HTTPmethodGET, HTTPmethodPOST, HTTPmethodPUT, HTTPmethodPATCH, HTTPmethodDELETE, HTTPmethodHEAD, HTTPmethodMAX } HTTPmethod;
typedef enum
{
HTTPmethodGET,
HTTPmethodPOST,
HTTPmethodPUT,
HTTPmethodPATCH,
HTTPmethodDELETE,
HTTPmethodHEAD,
HTTPmethodMAX
} HTTPmethod;
HTTPmethod _HTTPmethod;
@@ -412,4 +450,6 @@ class AsyncHTTPRequest
bool _collectHeaders();
};
////////////////////////////////////////
#endif // ASYNC_HTTP_REQUEST_GENERIC_HPP
File diff suppressed because it is too large Load Diff