- 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
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.
- 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.
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
- 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
* minimum changes for libraries to compile with lwip2
* add WiFiClient::availableForWrite() (similar to Serial::) which indicates how much data can be sent without buffering
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.
- 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.
* 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.
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.
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.
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.
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.
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
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.
* 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)
* 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