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

2783 Commits

Author SHA1 Message Date
acosinwork
9c5c16e9c8 add board WiFi Slot (#3916) 2018-06-04 18:42:11 +02:00
acosinwork
ab7e109e4c A0 pin number can be changed in the variants (#4778) 2018-05-31 14:23:32 +02:00
david gauchard
1a9403df1b
lwip2 fix and update (#4729)
* interactive example: update with option for using DHCP again after using static IP
* lwip2: avoid crash when IP address is set to 0(any) by dhcp not getting its lease renewal in due time
* lwip2: automatically remove oldest PCBs in time-wait state, limit their number
  thanks to @me-no-dev 07f4d4c241 (diff-f8258e71e25fb9985ca3799e3d8b88ecR399)
* faq: update about tcpCleanup()
* lwip2: add a macro HAS_PHY_CAPTURE=1 indicating capture facility is available
2018-05-25 17:24:00 +02:00
david gauchard
144152ce6b update git+macos installation instructions (#4753) 2018-05-24 22:45:02 -04:00
Earle F. Philhower, III
5a033835e1
Add a build directory for libbearssl.a (#4736)
Simple git submodule and makefile for building the bearssl library
from source in the Arduino tree.
2018-05-23 19:50:26 -07:00
Earle F. Philhower, III
529baabef8
Return data in internal SSL buffers after close (#4756)
When the TCP socket is closed there may be some data left in the
BearSSL internal buffers which can be read by the application.

The BearSSL pump, however, would always return no data available
in the case the socket was disconnected before checking if the
SSL was in a state where the app could possibly read.

Fix by returning if the state is available, even if the connection
is gone.  Eventually no more data will become available to read
and the original -1 will be returned.

This should match the existing axTLS ::connected() behavior.
2018-05-23 08:24:34 -07:00
Earle F. Philhower, III
9b5f3c2882
Report connected when any bytes are available (#4754)
The SSL pipeline is multi-stage, and the TCP connection can go down
even though there is still data waiting to be decrypted or in the
decryption buffer.

Explicitly check that there if there can be any data made available
to the app, and if so report that we are still connected().  When
there is no data and there is no TCP connection, report disconnected.
2018-05-22 11:04:32 -07:00
Earle F. Philhower, III
a1a9b99af6 Add build_even/odd types to split Arduino tests (#4737)
Arduino builds are now taking 49 minutes or more, and failing due to
Travis timeouts.

Split the Arduino build task into even and odd half, where each job
will build every other test.  This will reduce any test's runtime
by 50% and speed up checks to avoid the timeout.
2018-05-21 14:34:15 -04:00
Thomas Zahari
83ab03436f Update README.md (#4730)
Clarify the folder of the git installation method for Mac
2018-05-18 13:35:10 +02:00
Earle F. Philhower, III
e3c970210f
Add BearSSL client and server, support true bidir, lower memory, modern SSL (#4273)
BearSSL (https://www.bearssl.org) is a TLS(SSL) library written by
Thomas Pornin that is optimized for lower-memory embedded systems
like the ESP8266. It supports a wide variety of modern ciphers and
is unique in that it doesn't perform any memory allocations during
operation (which is the unfortunate bane of the current axTLS).

BearSSL is also absolutely focused on security and by default performs
all its security checks on x.509 certificates during the connection
phase (but if you want to be insecure and dangerous, that's possible
too).

While it does support unidirectional SSL buffers, like axTLS,
as implemented the ESP8266 wrappers only support bidirectional
buffers. These bidirectional buffers avoid deadlocks in protocols
which don't have well separated receive and transmit periods.

This patch adds several classes which allow connecting to TLS servers
using this library in almost the same way as axTLS:
BearSSL::WiFiClientSecure - WiFiClient that supports TLS
BearSSL::WiFiServerSecure - WiFiServer supporting TLS and client certs

It also introduces objects for PEM/DER encoded keys and certificates:
BearSSLX509List - x.509 Certificate (list) for general use
BearSSLPrivateKey - RSA or EC private key
BearSSLPublicKey - RSA or EC public key (i.e. from a public website)

Finally, it adds a Certificate Authority store object which lets
BearSSL access a set of trusted CA certificates on SPIFFS to allow it
to verify the identity of any remote site on the Internet, without
requiring RAM except for the single matching certificate.
CertStoreSPIFFSBearSSL - Certificate store utility

Client certificates are supported for the BearSSL::WiFiClientSecure, and
what's more the BearSSL::WiFiServerSecure can also *require* remote clients
to have a trusted certificate signed by a specific CA (or yourself with
self-signing CAs).

Maximum Fragment Length Negotiation probing and usage are supported, but
be aware that most sites on the Internet don't support it yet.  When
available, you can reduce the memory footprint of the SSL client or server
dramatically (i.e. down to 2-8KB vs. the ~22KB required for a full 16K
receive fragment and 512b send fragment).  You can also manually set a
smaller fragment size and guarantee at your protocol level all data will
fit within it.

Examples are included to show the usage of these new features.

axTLS has been moved to its own namespace, "axtls".  A default "using"
clause allows existing apps to run using axTLS without any changes.

The BearSSL::WiFi{client,server}Secure implements the axTLS
client/server API which lets many end user applications take advantage
of BearSSL with few or no changes.

The BearSSL static library used presently is stored at
https://github.com/earlephilhower/bearssl-esp8266 and can be built
using the standard ESP8266 toolchain.
2018-05-14 20:46:47 -07:00
Marian Craciunescu
bd87970aae add http client configurable timeout usefull when download is slow on server side (#4705)
* add http client configurable timeout usefull when download is slow from server side

* member init outside constructor body.

* removed this.
2018-05-04 11:18:15 -03:00
david gauchard
76a14b1f63
lwip2: fix static address management (#4677)
+ interactive example (for debugging)
2018-05-02 01:20:55 +02:00
fabianoms
758b0bd124 Minimizing code redundancy (#4695)
String's destructor does the same as the 'invalidate' method.
2018-04-28 17:02:08 -03:00
Marcel Stör
41a64707f1 Fix WiFi status formatting issue (bullet list) (#4671) 2018-04-25 20:46:17 -03:00
Ivan Kravets
a0d1c64af8
Keep custom user flags passed via build_flags, such as a custom LD script (#4680) 2018-04-25 16:28:14 +03:00
david gauchard
d582cab938 remove autogenerated eagle.app.v6.common.ld and git-ignore it (#4618) 2018-04-22 22:33:01 +03:00
Ivan Kravets
c12c9e21cd
Merge pull request #4661 from esp8266/ivankravets-patch-4
@PlatformIO: VTables, custom lwIP, sync libs and flags
2018-04-21 01:33:28 +03:00
Ivan Kravets
f5423c40f2
@PlatformIO: VTables, custom lwIP, sync libs and flags // Resolve #4618 2018-04-21 00:56:30 +03:00
Ivan Kravets
68f04bcaaf
Merge pull request #4654 from esp8266/ivankravets-patch-3
Force ARDUINO macro to 10805
2018-04-19 17:01:45 +03:00
Ivan Kravets
1ae70adc02
Force ARDUINO macro to 10805 2018-04-19 16:07:07 +03:00
Ivan Grokhotkov
5d5ea92a4d
Move continuation stack from .bss onto sys stack (#4622) 2018-04-18 11:19:49 +08:00
Peter Hoddie
16a4f22194 save 192 RAM bytes when attachInterrupt unused (#4601) 2018-04-17 17:16:06 -03:00
Dan Worth
7820fb73a5 Added channel, ssid scan (#4636)
* Added channel, ssid scan

Overloaded scanNetworks so scan can occur on a single channel and/or for a particular ssid.

* Added parameters to scanNetworks

channel number and ssid have been added as optional parameters to the orginal scanNetworks()
2018-04-13 15:55:45 -03:00
david gauchard
b08d282673 fix connection reset by peer case (#4626)
* fix connection reset by peer case where pcb is set to null in ClientContext::_error but not reported to WiFiClient

* ClientContext: rename functions *_sent to *_acked (:sent to :ack in debug)

* use nullptr instead of 0
2018-04-11 22:25:04 -03:00
Muhammad Azeez
4305275f8d fix a very small typo in http client tests (#4633) 2018-04-11 17:38:20 +08:00
Ivan Grokhotkov
dae30eccbe host side tests: update documentation about environment variables 2018-04-11 11:19:21 +08:00
Ivan Grokhotkov
1acaa8b8f6 allow reading test environment from python mocks
This allows requesting environment variable values set in the C++ test
code, from python mock code. Use case is cross-checking test
results against values expected by the host side part of the test.
2018-04-11 11:19:21 +08:00
Ivan Grokhotkov
8bd26f2ded add support for environment variables in device tests
Previously device tests included information such as access point SSID/password at compile time. This made it difficult to compile test binaries once and then send them to multiple test runners for execution.

This change adds a command to the test library to set environment variable on the target device: “setenv key value”. C library setenv/getenv facility is used to store variables.

Test runner, tests, and makefile are updated to use this functionality.
2018-04-11 11:19:21 +08:00
david gauchard
2315ac20bc
import use of __PROG_TYPES_COMPAT__ define for compatibility with old arduino code (#4619)
restrict usage of deprecated typedefs "prog_*", and cast "pgm_read_*"'s address parameters to "const void*"  only when __PROG_TYPES_COMPAT__ is defined.
also add <avr/pgmspace.h> compatibility
2018-04-10 12:23:33 +02:00
Marcel Stör
1ca5838bed Add ESP.deepSleepMax() (#4627) 2018-04-10 03:11:03 -03:00
Peter Lerup
3138bdfc51 Update SoftwareSerial version to 3.4.1 (#4623)
* Update SoftwareSerial version to 3.4.1
2018-04-10 00:48:28 -03:00
Josef Kuchař
491c9b8b1c Fix packet typo (#4621)
* Fix packet typo

* Another packet typo fix
2018-04-08 11:12:42 -03:00
david gauchard
cc11b29ff1
board gen4iod: change flash mode from qio to dio (#4616)
on behalf of @4dsystems #4613:
Need to change flash mode from qio to dio, due to a change in supplier of Flash Memory.
Old modules work just the same with no speed difference noticed,
new modules will not work without the change to dio however.
2018-04-08 02:35:10 +02:00
Jim Watson
acbabf9895 Added new ESP_EEPROM to list of ESP libraries (#4529) 2018-04-08 01:28:26 +02:00
david gauchard
149af7618c
boards generator: new option --allgen (#4614)
useful when changing and pushing updates
2018-04-07 20:16:04 +02:00
Bryce Schober
3a110aa698 Allow other ESP debug port class types (#4611)
... by casting to void pointers before comparison to avoid compile error
2018-04-06 11:23:46 +02:00
david gauchard
b93cba1046
simple fixes (#4597)
* wemos d1 r1: move comment out of define line
* update 4M filesystem info
2018-04-03 01:58:22 +02:00
Earle F. Philhower, III
f2c7256539 Add flash for vtable destination, make it default, and add build menu to control options (#4582)
* Add flash for vtable destination, make it default

Add an option for placing vtables in flash to complement the existing
iram and heap options.  "make flash"

Now that there is a way to change it, move to vtables in flash as default
as only users with interrupts which use vtables require the vtable to
be in RAM.  For those users, if the tables are small enough they can put
them in IRAM and save heap space for their app.  If not, then the vtables
can be placed in HEAP which supports much larger tables.

* Add VTable menu, FLASH as default, remove Makefile

Convert from manual "make" operated app.ld creation to runtime creation
whose options are selected from the build menu.

Use a prelink recipe to create the output app.ld file each run, without
need for any special tools.

Update the boards.txt.py script to generate this new config.
2018-04-03 00:32:35 +02:00
Earle F. Philhower, III
8ae553d99e
I2s input API and examples (#4539)
Enables I2S stereo input via DMA using new API calls:

. i2s_rxtx_begin(bool rx, rool tx);
. i2s_read_sample(uint32_t *l, uint32_t *r);

Original API calls will only enable TX, so this is backwards compatible.

Add simple I2S input example code using Arduino serial plotter.

Add UDP transmit of I2S microphone data to a PC (remote microphone).

Clean up and reorganize code to share RX and TX logic as much as
possible.  Fix a potential WDT error while in blocking sample read
and write.
2018-04-02 07:37:21 -07:00
i3water
7ae8f98e57 add board WiFiduino (#4590) 2018-04-01 18:51:59 +02:00
Kyle Fleming
212a829942 Move cont_init from ram to flash (#4384) 2018-03-31 19:32:34 -03:00
Iman Ahmadvand
241531aa4c Adding softAP SSID & PSK query API (#4138)
* softAP SSID & PSK query API added.
Signatures:
String ESP8266WiFiAP::softAPSSID() const;
String ESP8266WiFiAP::softAPPSK() const;

* Fix for proper C-style string copy

* add API to validate input ip as string
Signatures:
static bool IPAddress::isValid(const String& arg);
static bool IPAddress::isValid(const char* arg, size_t len);

* fix indentation

* fix ip string validation to use built-in implementation.
signatures:
static bool isValid(const String& arg);
static bool isValid(const char* arg);
2018-03-28 09:27:20 -03:00
Develo
29580e8166
Fix for #4565 (rx fifo length), protect access to rx_buffer (#4568)
* Fix for #4565 (rx fifo length), protect access to rx_buffer

* Fix typo

* reworked to separate safe from unsafe functions, factorized some code, constness

* additional rework for uart_rx_fifo_available()

* swapped unsafe function definition order

* Remove static for overrun string

* Some shorthand for perf and readability
2018-03-27 22:28:39 -03:00
Earle F. Philhower, III
decfbdda5f I2S driver fixes for IRQs, protocol, factoring (#4574)
* I2S driver fixes for IRQs, protocol, factoring

All redundant ICACHE_FLASH_ATTR decorators were removed, we already do
this by default for all routines, anyway,

The actual ISR and its called function moved to to IRAM.  Used to be in flash
due to the decorator, which could lead to crashes.  Use ets_memset to mute
buffers in ISR.

Fix the I2S on-the-wire protocol by enabling the transmit delay I2STMS because
I2S is supposed to send the MSB one clock after LRCLK toggles.  This was
causing I2S to be twice as loud as intended in the best of cases, and causing
garbage/noise output when the MSB was set since data was effectively shifted.

Refactor the clock divider setting to be done in one function only, as there
is no reason to do the same complicated bit setting in two spots.

* Comment some add'l registers, use optimstic_yield

Comment the known and unknown I2S register settings for posterity, using
the ESP32 guide as a basis.

Use optimistic_yield() instead of esp_wdt_disable/enable when busy
waiting in blocking writes to ensure we don't hog the CPU completely.

Move the constant IO pins to #defines for easier understanding.
2018-03-27 20:40:34 -03:00
Earle F. Philhower, III
a3a3654584 Add linker MAP artifact to standard build process (#4186)
Generate and preserve a linker .MAP file for the project in the usual
build directory.  This map file is useful for finding out where FLASH,
IROM, and IRAM are being used as it shows gcc internally generated
things such as jump tables and constant function-local variables.
2018-03-27 14:06:56 +02:00
david gauchard
f2187f50c7
ldscripts: a Makefile to change c++ vtables location (#4567) 2018-03-26 23:35:57 +02:00
Marco Bisioli
e1ca870695 defined SDA and SCL pins for Olimex MOD-WIFI-ESP8266(-DEV) (#4562) 2018-03-26 22:47:11 +02:00
david gauchard
ee1ef4a795 restore HardwareSerial::write(str) (#4564)
* restore HardwareSerial::write(str)

* restore HardwareSerial::write(str) (this time checked)
2018-03-26 12:15:29 -03:00
Christoph Gommel
2105b8b06f Update core_esp8266_si2c.c (#3389)
With this patch the set up clock rate survives a re-init that is done by many libraries several times.

This makes e.g. an accelerated OLED display possible with the adafruit libraries
2018-03-24 17:23:25 -03:00
derSeddy
6464ae0c79 Added 50kHz operation mode for I2C/Wire library (#3401) 2018-03-24 15:46:29 -03:00