1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-04-22 21:23:07 +03:00

1324 Commits

Author SHA1 Message Date
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
david gauchard
85078f47a0 yet less warnings for Wall Wextra guys 2017-05-18 06:43:22 -05:00
david gauchard
fed925149b update readme about automated crash with GDBStub 2017-05-18 06:43:22 -05:00
david gauchard
8c7d1b780e automate crash for GDBStub 2017-05-18 06:43:22 -05:00
wuweixin
0fa34430e6 ESP8266WebServer: add application/json content type 2017-05-15 18:38:24 +08:00
Ivan Grokhotkov
283eb97cd3 docs: convert to .rst and add readthedocs 2017-05-14 11:44:16 -05:00
Ivan Grokhotkov
ace0622e46 ESP8266HTTPUpdateServer: fix responses after uploading
- fix response not being delivered to the browser after upload is done
  (https://github.com/esp8266/Arduino/issues/2221)

- if Update.begin fails, don’t attempt to write data

- if update is not successful, send error message from Update to the
  client

- move strings into PROGMEM
2017-05-10 09:49:47 -05:00
Korzo
b623613b2a Remove SD file available size saturation 2017-05-09 06:17:55 -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
Ivan Grokhotkov
03baea27ef ArduinoOTA: forward errors from Update.begin to espota.py
If Update.begin fails, instead of printing “No response from device”,
espota.py will print the actual error message from the Updater.
2017-05-09 06:17:06 -05:00
Chris Mullins
8b27047911 Put SSDP constants in progmem (#3142)
* Put constant strings in progmem

* strlen -> strlen_P
2017-05-09 06:16:40 -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
jpmendoza
af0f5ed956 Issue #1062: Implement support for HSPI overlap mode. 2017-05-08 03:04:11 -05:00
Chris Mullins
72ed29ad5f allow for overridable value for HTTP_UPLOAD_BUFLEN 2017-05-01 05:33:20 -05:00
Christopher Cooper
0c66c8a88f [Issue #3145] ESP8266mDNS: Improve compliance with DNS-SD RFC6763
- When the "_services._dns_sd._udp.local" meta-query is received, an
enumeration of services types is now returned (e.g. "_http._tcp.local")
instead of an enumeration of instances (e.g.
"MyService._http._tcp.local").  This is consistent with Section 9 of the
RFC.

- When a response is sent, the response records are now properly
partitioned as either answers or additional records.  Only response
records that were explicitly requested as a result of the questions
should be treated as answers.  This is consistent with Section 12 of the
RFC.

- The "MDNSResponder::advertiseServices()" method has been removed as it
was declared as "private" and is no longer being called.  This method
was sending a response on multiple interfaces when available, but this
wasn't really necessary since the interface from which the request was
received that caused it to be invoked is known.
2017-05-01 05:31:10 -05:00
Stephen Warren
2450ec6803 ESP8266mDNS: support multiple interfaces in query code
Add a loop over all known interfaces to queryService() so that it will
find devices attached to all available WiFi networks.
2017-05-01 05:31:10 -05:00
Stephen Warren
4cf7909df9 Fix typo in MDNS multi-interface advertising code
MDNSResponder::advertiseServices() was transmitting all service adverts
on the same interface (AP) rather than once on STA and once on AP. Fix
this simple mistake.

With this change, both "ping esp8266.local" and "avahi-browse -a" see
the ESP8266 from a test Linux PC, on both AP and STA interfaces (where
applicable), with the ESP8266 running mDNS_Web_Server.ino modified for
each of AP-only, STA-only and AP+STA modes.

Note that no attempt has been made to make MDNSResponder::queryService()
operate correctly with multiple interfaces, either in this commit or the
commit this commit fixes.

Fixes: a546d64e07d2 ("ESP8266mDNS: support AP and STA interfaces at once")
Fixes #3101
2017-05-01 05:31:10 -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
Stephen Warren
04df3adb54 Add an LLMNR responder implementation (#2880)
This is a simple implementation of an LLMNR responder for the ESP8266
Arduino package. Only support for advertizing a single hostname is
currently implemented.

LLMNR is a very similar protocol to MDNS. The primary practical
difference is that Windows systems (at least Windows 7 and later;
perhaps earlier) support the protocol out-of-the-box, whereas additional
software is required to support MDNS. However, Linux support is
currently more complex, and MacOS X support appears non-existent.
2017-02-20 21:18:49 -06: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
Stephen Warren
a546d64e07 ESP8266mDNS: support AP and STA interfaces at once
Bind the UDP connection to IP_ADDR_ANY rather than a specific interface
IP, so that it can receive queries from all interfaces at once.

When processing a query, detect which interface it was received on, and
pass this information to the reply code. Set the IP multicast interface
before each transmission, so that we can route each packet to a
different interface if required. These changes enable the code to
respond correctly on both AP and STA interfaces at once. The original
code only worked correctly for the STA interface if both were enabled.

When advertizing all services, do it on both AP and STA interfaces if
they're both enabled.

Provide an API for the application to notify the MDNS code if the AP
configuration changes (enabled, disabled, IP changed). Ideally, the WiFi
core would provide an event callback for this purpose, as it does for
STA changes, but it does not appear to, so the application must provide
this information.
2017-01-17 10:06:01 +08:00
Stephen Warren
eb1ac103e4 Revert "ESP8266mDNS using the provided IP in the begin method (#2349)"
Manually specifying the AP IP isn't required; the next change will modify
the MDNS code to correctly handle any combination of AP and STA modes, and
correctly respond to requests on all active interfaces.

This reverts commit b682d597c5f100ac71e74997880d95404200d759.
2017-01-17 10:06:01 +08:00
Jose M Viloria
0291a6e32a Update Blink.ino
Typo
2017-01-05 11:50:43 -06:00
Adam Bogdał
b4368ba870 Update curl command 2017-01-05 11:43:26 -06:00
Albert J wong
c6c54e710f Use correct cast for downcasting reference.
For downcasting, static_cast<> is the appropriate cast. Using reinterpret_cast<> will NOT correctly adjust the `this` pointer and dereferencing such a value is undefined by spec. See [expr.reinterpret.cast]p7 for the relevant passage. The only legal use of this pointer is in another set of reinterpret_cast expressions that either land it into a numeric value, or back to the original type.
2017-01-05 11:36:56 -06:00
Ivan Grokhotkov
7ccafadb41 Merge pull request #2649 from WereCatf/WiFiClientExamples
Use WIFI_STA in WiFiClient-examples
2016-11-14 11:02:00 -06: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
Allen Smith
4dd9fef491 Fixed PUT(String) method, it called POST in error
About the simplest change possible, just delete two characters and add one. The PUT(String) convenience method called the full POST method instead of calling the PUT method
2016-10-28 14:12:38 -04:00
Me No Dev
4897e0006b match headers using equalsIgnoreCase (#2474)
Should fix: https://github.com/esp8266/Arduino/issues/2131
2016-09-02 11:49:14 +03:00
Me No Dev
889775c6fe ArduinoOTA optimizations (#2445)
- Added option to control if the ESP should be rebooted on success
- Added delay before ESP.restart() is called
- Added some comments to the header
2016-08-27 18:32:26 +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
martinayotte
4754f4317c SD: change 'char *' parameters to 'const char *' to fix bad recursion (#2398) 2016-08-22 21:11:34 +08:00
Clemens Kirchgatterer
4ececda82b fixed crash in mDNS destructor (#2389) 2016-08-12 21:51:11 +03:00
Me No Dev
0718188264 fix NetBIOS example file name (#2354) 2016-08-01 11:52:44 +03:00
Radu Pascal
b682d597c5 ESP8266mDNS using the provided IP in the begin method (#2349)
this fix forces the mDNS to use the provided IP in the begin method
instead of the auto detected IP. this is required if the ESP8266 starts
in the AP_STA mode and activates only the AP initially.
2016-08-01 11:49:47 +08:00
Me No Dev
c4c207a85e Optimize MDNS to prevent overflow and endless loop (#2333)
* Optimize MDNS to prevent overflow and endless loop

* Handle better non-esp services

* leave debug off

* better name resolution for external devices

* strip name length (did not show in IDE)
2016-08-01 11:48:23 +08: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