1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-04-25 20:02:37 +03:00

2970 Commits

Author SHA1 Message Date
Earle F. Philhower, III
bde83e8ea2
Fix waveform missing edges on cycle rollover (#4945)
When the ESP cycle counter rolls over, the "now" can be smaller than the
next-edge time of a waveform generator.  This would cause the edge to be
missed on that specific pin, and make it look like PWM was hung.

Use proper comparison between current time and edge time.

Fixes #4944

Also remove the "sigma-delta.c.unused" file which was replaced by a
working one some time ago.
2018-07-21 18:46:51 -07:00
Jack Shao
3906ee4d91 Add support for Seeed Wio Link board (#4943) 2018-07-20 14:51:32 -04:00
LaborEtArs
3f6be5ecc8 Adjusted buffer size algorithm (#4934)
Use cencode.h defined macros to calculate the needed buffer size.
2018-07-19 18:16:51 -04:00
Earle F. Philhower, III
63ab79e549
Fix overlapping memcpy call in String::trim (#4938)
memcpy() is undefined when source and destination overlap.  String::trim
uses it when shifting the string left to remove left padding.

Replace with memmove() which is always safe, even when overlapped.
2018-07-18 18:36:31 -07:00
brendanvanbreda
e5648f3dfd Add support for XinaBox (#4929)
Add support for the XinaBox CW01;
2018-07-17 11:53:26 -07:00
A C SREEDHAR REDDY
79a7ff8263 Update stack_dump.rst (#4933) 2018-07-17 09:22:13 -04:00
Earle F. Philhower, III
96a340eb51 Fix intermittent host tests failure (#4932)
MD5Builder tests have been randomly, non-repeatably failing due to a problem
with the returned value of MD5Builder.

Valgrind detected a strncpy with an overlapping memory range, which is
an undefined operation.  Fix it with a memmove instead, and get rid
of a couple #define redefinitions which were causing compile warnings
on the host side as well.
2018-07-16 23:22:55 -04:00
Earle F. Philhower, III
53091882b8
Fix minor BearSSL API issues (#4901)
Fixes #4882 and updates GitHub certificate fingerprint to the current one
in BearSSL_Validation example.

When setting a authentication mode or stopping, clear all others out in case
the object is being re-used.

Add in a yield during the SSL handshake to allow a graceful timeout and not
a WDT error when the remote server hiccups.  Thanks to @Jeroen88 for
finding and testing this.
2018-07-16 09:35:00 -07:00
Earle F. Philhower, III
fcf2ac5d3d
Optimize waveform stop routines (#4920)
Thanks to ideas from @shimarin for offering ideas to speed up the stopWaveform
calls which may help things like SoftwareSerial run better.

Optimize the stopWaveform routine to abort fast and early whenever possible.

Remove the stopWaveform call from digitalRead().  If you're running a waveform
on a pin and try to read it, that is a logic error and you'll end up reading the
waveform and not the outside world's view of the pin.
2018-07-12 12:45:48 -07:00
teejaydub
60b21ef568 Copy the existing flash mode over the one set in an OTA update image. (#4877) 2018-07-11 12:30:56 -04:00
Tomoatsu Shimada
e6af980b85 Avoid unnecessary waveform de-initialization which corrupts softwareserial (#4913) 2018-07-10 12:40:14 -07:00
david gauchard
ce33c2cffe
informative message on top of boards.txt (#4910) 2018-07-09 18:36:39 +02:00
Earle F. Philhower, III
00c35be985
Update to latest BearSSL library version, fixes #4898 (#4900)
* Update to latest BearSSL library version, fixes #4898

* Actually install the updated BearSSL lib/headers
2018-07-09 06:05:40 -07:00
Earle F. Philhower, III
89d2f42153
Note that CERTS.IDX file is generated on-chip (#4902)
Several users have been worried that they need to generate the IDX file,
but don't know how.  The CertStore code actually writes this file on object
creation, and the user never needs to explicitly generate or upload it.

Add a comment to the example explicitly noting this.
2018-07-08 21:54:40 -07:00
Earle F. Philhower, III
945535ae78
Make ar compatible with GNU and BSD in example (#4907)
Change the "ar" options in the example CertStore.AR archive generator to
make them compatible with both Linux and MacOS.
2018-07-08 21:12:32 -07:00
Earle F. Philhower, III
d948a1ff2a
Don't stop a waveform simply by calling pinMode (#4906)
Setting a pin direction would cause a waveform generator attached to it to stop.
This could cause PWM to stop if pinMode() is called while running (as it was
called in __analogWrite()).

Remove the stopWaveform call from pinMode, the Tone, analogWrite, or Servo
that initiated the waveform has responsibility for stopping it (and it does)
when complete, irrespective of the pinMode.

Fixes #4905
2018-07-08 20:27:13 -07:00
david gauchard
e486887f18
optionally allow WPS (#4889) 2018-07-06 16:45:25 +02:00
A C SREEDHAR REDDY
e0b6242e04 clear mdns.queryservice()'s previous result when called (#4894)
cleared the linkedlist.
* issue #4893
2018-07-05 23:17:53 -04:00
liebman
12d52220ae pin 16 is allowed for analogWrite (#4895) 2018-07-05 18:19:52 -07:00
hreintke
87991aba9f ScheduledInterrupts should still use current schedule_function(..) (#4890) 2018-07-04 12:55:07 -04:00
david gauchard
672c3f8d79
boards updates: nodemcu doc update (@lrmoreno007 #4715) + 512k32spiffs (@carlymx #4871) (#4880)
* boards updates: nodemcu doc update (@lrmoreno007 #4715) + 512k32spiffs (@carlymx #4871)

* sometimes -> usually
2018-07-03 22:14:06 +02:00
david gauchard
7dd2ca355c
scripts for comparing core closed libs against esp-nonos-sdk ones (#4855) 2018-07-03 11:45:22 +02:00
klucsik
b126a9c526 https fingerprint clue (#4863)
Adding a clue on the https part that yo will definitely need the fingerprint. 
(My first commit)
2018-07-03 00:40:50 -04:00
david gauchard
d580f40e44
fix scheduled interrupt #4609 by @shimarin (#4879) 2018-07-02 23:33:55 +02:00
Earle F. Philhower, III
be7a732b9d Compatibility and IRQ fixed for waveform/tone/pwm (#4872)
* Compatibility and IRQ fixed for waveform/tone/pwm

Fix a compiler ambiguity introduced with a floating point frequency option
for tone().  Thanks to @Rob58329 for discovering this and proposing the
fix.

Match original analogWrite behavior by going from 0...1023 (PWMRANGE) and
not 0...1024, and also explicitly set the analogWrite pin to an OUTPUT.
Thanks to @jandrassy for finding this.

Fixes #4380 discovered by @cranphin where interrupts were disabled on a
stopWaveform().  Remove that completely and bracket the update of non-atomic
fields in the structure with disable/enable IRQs for safety.

* Fix tone(int,int,int) infinite loop

Explicitly cast the frequency, when passed in as an int, to an
unsigned int.  Verified with snippet:
  tone(D1, (int)1000, 500);
  tone(D1, (unsigned int)1000, 500);
  tone(D1, 1000.0, 500);
  tone(D1, (int)1000);
  tone(D1, (unsigned int)1000);
  tone(D1, 1000.0);
2018-07-02 13:02:49 -04:00
ZaPpInG
1eb0645dcb Improve the compatibility of the doc between Github and RTD... (#4800)
* Update requirements.txt

* Update conf.py

* Update libraries.rst

* Update libraries.rst

* Update libraries.rst

* Update stack_dump.rst

* Update client-examples.rst

* Update readme.rst

* Update readme.rst

* Update server-class.rst

* Update server-examples.rst

* Update soft-access-point-class.rst

* Update station-class.rst

* Update station-examples.rst

* Update udp-class.rst

* Update udp-examples.rst

* Update a04-board-generic-is-unknown.rst

* Update readme.rst

* Update readme.rst

* Update readme.rst
2018-06-28 10:58:33 -04:00
gojimmypi
0f34bd85d8 Windows 10 instructions (#4797)
* Instructions update

added correction for Windows 10 git install directory

* Update installing.md

* Update installing.rst

* Reminder for VisualMicro

install clarifications

* tidy up links 

markup works differently in rst vs md

* formatting cleanup

* corrected default sketch directory

the default Arduino Sketchbook directory is C:\users\{username}\Documents\Arduino (thanks @Juppit)

https://github.com/esp8266/Arduino/pull/4797#issuecomment-396650538

* check for directory before creating
2018-06-27 18:04:35 -04:00
david gauchard
74819a763b
lwip2: fix disconnection, fix reconnection (#4851) 2018-06-27 10:47:17 +02:00
hreintke
641c5cdc61 Scheduled Interrupt (#4609)
* Scheduled Interrupt

* use capital letter for Schedule.h

* Prevent memory leak when attach is called multiple times without detach

* Add improved schedule_function

* WIP : Integrate FunctionalInterrupt & ScheduledInterrupt

* Fix travis error
2018-06-19 17:26:57 -04:00
harlock974
91bb97ddb3 update Wemos D1 Mini Lite informations (#4809) 2018-06-14 10:39:19 +02:00
Earle F. Philhower, III
794630e068
Remove dependency on SD/SPIFFS from CertStore (#4760)
Due to popular demand, remove the hardcoded dependency on SPIFFS
or SD from the CertStore by factoring out the file interface into
a new class (CertStoreFile) that the user will need to implement
as a thin wrapper around either a SPIFFS.file or a SD.file

Combine the downloaded certificates into a UNIX "ar" archive
and parse that on-the-fly to allow easy inspection and creation
of the Cert Store database.

Examples updated with a new certificate downloader that creates
the certs.ar archive and with a single sample that can be built
for either SPIFFS or SD with a #define.  Users can copy the
implementation of the CertStoreFile they need to their own code
as it is self-contained.

Also move the CertStore to the BearSSL namespace and remove the
suffix and separate SPIFFS/SD sources.

Remove the "deep+" change from the CI build as well (no special
options needed on any PIO or makefile build).

We'll revisit the filesystem wrapper for 2.5.0, hopefully having a
unified template for both filesystem usage at a global level.  For
current users, be aware the interface may change (simplify!) in
release 2.5.0.

Fixes #4740
2018-06-12 19:06:26 -07:00
Earle F. Philhower, III
c0cfe875c2
Make BearSSL::write() blocking, match axTLS (#4804)
When a message is sent by the app that is larger than the SSL buffer,
it will take multiple TLS fragments to transfer.  Writes will loop
through and not return until either all data is transferred or there
is an error.
2018-06-12 13:18:00 -07:00
Earle F. Philhower, III
ebda795f34
Support multiple tone(), analogWrite(), and Servo (#4640)
Remove and rewrite all the parts of the core/libraries using TIMER1
and consolidate into a single, shared waveform generation interrupt
structure.  Tone, analogWrite(), Servo all now just call into this
shared resource to perform their tasks so are all compatible
and can be used simultaneously.

This setup enables multiple tones, analogWrites, servos, and stepper
motors to be controlled with reasonable accuracy.  It uses both TIMER1
and the internal ESP cycle counter to handle timing of waveform edges.
TIMER1 is used in non-reload mode and only edges cause interrupts.  The
interrupt is started and stopped as required, minimizing overhead when
these features are not being used.

A generic "startWaveform(pin, high-US, low-US, runtime-US)" and
"stopWaveform(pin)" allow for further types of interfaces.  Minimum
high or low period is ~1 us.

Add a tone(float) method, useful when working with lower frequencies.

Fixes #4321.  Fixes 4349.
2018-06-07 18:38:58 -07:00
Mike Morrison
ea4720b03e fix issue with compressed pointer (issue 4648) (#4752) 2018-06-07 12:31:49 -04:00
david gauchard
73d36bbc80
fix base64_encode_expected_len (#4786) 2018-06-07 15:40:17 +02:00
Balázs Kelemen
8cda9655e3 Allow to update credentials after setup performed. (#4789) 2018-06-07 13:13:45 +02:00
Nitin Dahyabhai
9db33e1827 Update to point to current Eclipse version (#4794) 2018-06-07 09:39:42 +02:00
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