1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-04-21 10:26:06 +03:00

316 Commits

Author SHA1 Message Date
Ivan Grokhotkov
d6f1f0d5d7 WiFiClient: apply write timeout to single chunk (#3273)
WiFiClient write timeouts introduced in #3257 applied to the whole write
operation, which could take long time if data size was large. This
change makes the timeout happen per chunk. Timeout now happens if no
data has been delivered within a given interval.
2017-05-22 20:08:16 +08:00
Ivan Grokhotkov
f6d232f1ac WiFiClientSecure: match CN and SANs ignoring case
Some websites have certificates with uppercase letters in CN. This change
makes _verifyDN function accept such certificates by converting all names
to lower case before comparing them.

Resolves #2978
2017-05-21 22:00:33 -05:00
Ivan Grokhotkov
a8e8ecb687 WiFiClientSecure: add example of setCACert/verifyCertChain
Ref #1851
2017-05-21 22:00:33 -05:00
Ivan Grokhotkov
79cfad5d46 WiFiClientSecure: initialize ssl_ctx when loading certificate
Fixes #2470
2017-05-21 22:00:33 -05:00
Ivan Grokhotkov
4812cae8e2 WiFiClient: initialize _timeout properly 2017-05-20 12:20:03 +08:00
Ivan Grokhotkov
684b5f1629 WiFiClient: set default timeout to 5000ms for compatibility 2017-05-19 09:35:01 -05:00
Ivan Grokhotkov
71512653ca WiFiClient: use Stream::_timeout for write operations 2017-05-19 09:35:01 -05:00
Ivan Grokhotkov
eebcc656ed WiFiClient: add support for connect timeout 2017-05-19 09:35:01 -05:00
Ivan Grokhotkov
2aeac91c90 ESP8266WiFi: support timeout for WiFi.hostByName 2017-05-19 09:35:01 -05:00
Ivan Grokhotkov
7de81270a3 ClientContext: don’t read DataSource in TCP callback
Previously, _write_some function would be called each time TCP stack
notifies the application that some data was delivered (via the `sent`
callback). In turn, _write_some would obtain more data to be sent from
the DataSource. In case of a DataSource backed by a Stream, this would
read from a stream. Some libraries (such as SD) may call `yield` and
other blocking operations from Stream read function, which can not be
used in TCP stack callbacks.

This change moves the data sending loop back into the Arduino task, with
a negligible loss of performance. TCP callback now wakes the main task
via `esp_schedule`, which performs stream read and provides more data
to the TCP stack.

Possible future optimization would be to buffer Stream data ahead of
time. That way, buffered data could be sent immediately from the TCP
callback. On the other hand, this optimization would need extra TCP_MSS
of temporary storage, per connection.

Fixes #2399.
2017-05-09 06:17:32 -05:00
Trygve Laugstøl
2d9e767630 Fixing a few compiler warnings to allow compilation with -Wall -Wextra and -Werror. (#3153) 2017-05-08 04:56:08 -05:00
Ivan Grokhotkov
c5c138ec5a axtls: update to bddda2a0
- update ssl_client_new signature
- add max fragment length negotiation support (hardcoded to 4096 bytes)
- build axtls with -f{function,data}-sections, ~1k less DRAM usage,
  ~3k less flash
- strip prefix from build paths in debug symbols
2017-04-29 22:58:19 +08:00
david gauchard
a41f55c469 prepare lwip2 (#3129)
* minimum changes for libraries to compile with lwip2

* add WiFiClient::availableForWrite() (similar to Serial::) which indicates how much data can be sent without buffering
2017-04-25 08:55:01 -05:00
Ivan Grokhotkov
93413efcf4 Remove queue.h contents originating from BSD (#2982)
fixes #2981
2017-02-19 05:36:30 +03:00
Frank Sautter
af58a74cc0 Allow usage of byte arrays to set RootCAs (#2968) 2017-02-15 14:22:23 +03:00
wosk
e9dea9af99 Update keywords.txt for coloring syntax (#2892)
Add ESP keywords and update ESP8266Wifi library
2017-02-06 13:25:27 +03:00
Ivan Grokhotkov
808bf50ff2 wifi: add SoftAPModeProbeRequestReceived event handler (#2917)
- add probe request event handler (#2910)
- update WiFi events handling example to use new handler

Pro tip: replace blinking LED with ‘analogWrite’ and connect the pin to
a loudspeaker (or use a servo to hit a bell). Get notified when someone
with a smartphone wanders around your country house.
2017-02-06 13:24:34 +03:00
joelucid
61787b23af ClientConnection uses too much heap when streaming files #2871 (#2874)
* ClientConnection uses too much heap when streaming files #2871

* make write_chunk_size a member variable

* untabify
2017-01-31 11:04:45 +03:00
Rodion Kvashnin
2126146e20 Fix warnings (#2881)
* Suppressed -Wunused-parameter and -Wunused-function by casting to void unused identifiers.

* Explicit initialization of all fields to suppress -Wmissing-field-initializers.

* Fixed signed/unsigned integer comparison.

* memset initialization of structs.

* More -Wunused-parameter fixes.
2017-01-31 10:07:59 +03:00
WereCatf
d46d742db1 Use WIFI_STA in WiFiClient-examples
Many people have problems with using ESP8266 as WiFi-client due to
none of the examples mentioning that you should use WIFI_STA if you
only want the ESP8266 to act as a WiFi-client. Many WiFi-devices
will randomly try to connect to the ESP8266 if used as STA+AP and
complain about not being able to access the Internet or other devices
on the network.
2016-10-29 12:40:06 +03:00
Ivan Grokhotkov
b41266097f WiFiClientSecure: certificate loading refactoring, support for CA root cert verification 2016-08-25 13:01:10 +08:00
Me No Dev
45f177f985 weaken axTLS methods so they can be overwritten by the async library (#2423) 2016-08-23 01:11:06 +03:00
Jean-Baptiste
db5e20f237 proposal for issue #1845 wifi_wps_status_cb get an undefined status 4 and missed wifi_wps_disable (#2312) 2016-08-01 11:46:29 +08:00
Stefano-Orsolini
c52088c774 set max_connection from code (when less than 4 is needed) (#2326)
* Update ESP8266WiFiAP.cpp

It is not very common but some might require to set the maximum number of clients, from code, to smaller than 4.
in my case i must allow only one client at a time (TESTED WORKING)

* Update ESP8266WiFiAP.h

as discussed in the .cpp (set max connections)

* Update ESP8266WiFiAP.cpp

corrected indentation @70 
add param comment @86

* Update ESP8266WiFiAP.cpp
2016-08-01 11:45:34 +08:00
Sergey Anisimov
98fe5617eb Adding onComplete event handler support for the asynchronous network scanning. (#2287) 2016-07-18 19:30:41 +08:00
Me No Dev
07f4d4c241 Lwip addons (#2260)
* Add multicast TTL to UDP and rework UdpContext

* Add limit for TCP TIME_WAIT pcbs

* Add liblwip_gcc.a

* Make the changes be backward compatible with the current xcc version
2016-07-11 21:07:45 +08:00
SteveToulouse
86067333f5 Fix2115 (#2244)
* Update ESP8266WiFiMulti.cpp

Fix #2115

* Update ESP8266WiFiMulti.cpp

Fix #2115. Cleaner version (catch strdup("") fail).
2016-07-08 10:12:22 +08:00
Ivan Grokhotkov
39212baeb0 Fix WiFi.onStationModeDHCPTimeout (#2195) 2016-07-04 15:47:55 +08:00
Ivan Grokhotkov
8db4dcea42 WifiClient::write refactoring (second attempt) (#2177)
* WiFiClient: use DataSource for writes

* ESP8266WebServer: delegate writing to WiFiClient

* ESP8266WebServer: set write timeout before sending content
2016-06-23 17:47:18 +08:00
Ivan Grokhotkov
e64e32b329 Fix regression in WiFiClientSecure, update HTTPS test case (#2150) 2016-06-15 11:49:51 +08:00
Ivan Grokhotkov
da17d5425a Fix regression in WiFi.onEvent, add testcase (thanks @everslick) 2016-06-14 13:09:46 +08:00
Ivan Grokhotkov
b4490cd76d Fix issue when WiFi.begin(ssid, pass) is called right after WiFi.mode(WIFI_OFF)
If ssid and pass matched the values in flash, wifi_station_connect was not called and no connection was attempted
2016-06-14 13:07:08 +08:00
Ivan Grokhotkov
43412970ae Fix for crash in WiFiClientSecure when WiFi is disconnected (#2139)
* WiFiClient: implement stopAll() via stop()

* WiFiClientSecure: clean up ClientContext used by axTLS when stop is called (#2097)
2016-06-13 18:36:30 +08:00
Ivan Grokhotkov
9dd7910aed Enable SO_REUSE in LwIP and WiFiServer (#1431) (#2140) 2016-06-13 10:36:10 +08:00
Ivan Grokhotkov
00065ac347 Allow DHCP client to be re-enabled using WiFi.config(0U, 0U, 0U) (#1896) 2016-06-12 14:44:15 +08:00
Ivan Grokhotkov
de166c9dd7 WiFi event handling refactoring (#2119) 2016-06-10 07:46:10 +08:00
Ivan Grokhotkov
7fd7ca6834 WiFiServer: fix error when calling close more than once 2016-06-08 17:32:45 +08:00
Anton Sokolchenko
533a600d95 Add virtual destructor to WiFiServer class (#2116)
Without this line compiler complains about :

Warning		22:9: warning: deleting object of polymorphic class type 'WiFiServer' which has non-virtual destructor might cause undefined behaviour [-Wdelete-non-virtual-dtor]		\\Mac\Home\Documents\Visual Studio 2015\Projects\BlinkESP8266_12\ActAsWiFi_server\SVServer.cpp	22

Reason for this is that I would like to init WiFiServer with port which can by dynamically chosen (for example by serial port)

internalServer = new WiFiServer(port);
2016-06-08 15:51:50 +08:00
Ivan Grokhotkov
e8b8a606e4 Update axTLS to 139914f
- Fix occasional software WDT due to lengthy bigint operations
- Implement truly blocking reads as a workaround for half-duplex nature of axTLS
2016-05-10 23:34:33 +08:00
Ivan Grokhotkov
f2fb43cabf Prevent WiFi config corruption (#1997 #1856 #1699 #1675) 2016-05-10 15:27:06 +08:00
Ivan Grokhotkov
a2b82ed6b6 Use gcc-built LwIP by default (#1926)
It is still possible to use xcc-built LwIP by selecting "Core Development" board from tools menu.
2016-05-06 20:09:15 +08:00
luc
f95f0ed321 Fix WiFiSleepType_t values to match SDK ones 2016-05-05 19:38:32 +02:00
Ivan Grokhotkov
33723a9b52 Fix UdpContext::peek to return int (#1946) 2016-04-26 16:02:07 +08:00
Ivan Grokhotkov
8c65f2fcd0 Update axTLS to fe4518d, SNI support in WiFiClientSecure (#1285)
Fixes #1933
2016-04-19 08:29:13 +03:00
Ivan Grokhotkov
18f66e9969 Merge pull request #1892 from me-no-dev/lwipsrc
Update and move lwIP headers, add options to use different lwIP build for generic device
2016-04-13 14:32:04 +03:00
Ivan Grokhotkov
e82b74eab2 Merge pull request #1850 from 4m1g0/fixPSK
Allow PSK instead of passphrase in WiFiSTA::begin
2016-04-13 14:17:46 +03:00
Ivan Grokhotkov
fa7e9037a4 Merge pull request #1880 from sauttefk/master
Re-enable old behaviour if passphrase string is empty
2016-04-13 14:17:13 +03:00
4m1g0
a06ceb8191 Merge branch 'master' into fixPSK 2016-04-10 23:38:52 +02:00
Me No Dev
bfe9f7be69 Update and move lwIP headers, add options to use different lwIP build for generic device
Makefile added to lwip source folder to build and install liblwip_gcc.a
2016-04-10 21:55:22 +03:00
Jacob Killelea
1bfec4ea8e Spelling correction in comments 2016-04-08 19:21:58 -06:00