Commit Graph

945 Commits

Author SHA1 Message Date
dnc40085 2735426fc0 Removed pragma defines that were mistakenly left in 2018-04-22 22:02:55 -07:00
dnc40085 2e201cd835 Fixed coding errors in app/pm/swtimer.c 2018-04-22 18:36:23 -07:00
dnc40085 96e5c026a8 Refactor timer suspend portion of node.sleep (pmsleep) (#2287)
* pmsleep refactor
* Shortened swtmr disabled message 
* Added swtimer debug module option to user_modules.h.
* Added comments to user_config.h.
* Fixed error in documentation for node.sleep()
* remove blank sntp.c that got added in during rebase onto dev(6218b92)
* Added #ifdefs around SWTIMER_REG_CB to prevent inclusion of disabled
code
2018-04-13 21:41:14 +02:00
philip 81435ceecf Missed setting the ID into the data block 2018-04-12 22:09:52 -04:00
Philip Gladstone cda8da622d Put each ICACHE_RAM_ATTR function in its own section. (#2334)
* Put each ICACHE_RAM_ATTR function in its own section.

* Chached the macro names to be less likely to cause problems
2018-04-07 22:44:42 +02:00
Johny Mattsson 085f35da73 Tie in the EGC with the SDK's heap knowledge. (#2319)
Added `node.egc.meminfo()` to expose LVM usage (to make the regular
`node.egc.ON_MEM_LIMIT` option usable).

Extended the `node.egc.ON_MEM_LIMIT` option to also take negative limits,
in which case that's taken as a request to keep a certain amount of heap
available for non-Lua use.
2018-04-06 14:52:03 +02:00
dnc40085 9af4f58417 Added functions wifi.getcountry() and wifi.setcountry() (#2330) 2018-03-31 09:06:18 +02:00
Terry Ellison 477116f79f
Merge pull request #2320 from TerryE/devLuaStackFix
Fix Lua stack corruption problem
2018-03-26 18:22:15 +01:00
TerryE d78c54accd Fix Lua stack corruption problem 2018-03-26 03:44:10 +01:00
Arnim Läuger 6218b9263b
initialize new memebers in station_config and scan_config (#2309)
Initialize new members in station_config and scan_config
2018-03-23 07:27:31 +01:00
Arnim Läuger f8311855d1 revert os_delay_us() usage to uint32 (#2310) 2018-03-21 07:04:59 +01:00
Philip Gladstone c7006dfb27 Ignore lookup errors on sync request unless all lookups fail (#2298) 2018-03-21 07:02:25 +01:00
Arnim Läuger 96601b6894
Merge pull request #2269 from nwf/for-upstream-sdk22
Update to sdk 2.2
2018-03-20 21:02:20 +01:00
Terry Ellison be53d5c9f3
Merge pull request #2297 from luizfeliperj/dev
Removing large number of #defines from Makefile and push them to a separate file
2018-03-16 18:22:31 +00:00
Nathaniel Wesley Filardo f3ebfa9bfe user_version.h: use ESP_SDK* constants
Derive NODE_VERSION by concatenating string constants.
2018-03-13 19:34:42 -04:00
Nathaniel Wesley Filardo c972d86ea9 Update to sdk 2.2
Initial commit for
https://github.com/nodemcu/nodemcu-firmware/issues/2225 .

Replay patches from Espressif's repository at
https://github.com/espressif/ESP8266_NONOS_SDK between tags v2.1.0 and
v2.2.0:

	0001-sync-from-ccca00f2.patch

		Superseded by existing changes, but lines reordered in app/driver/key.c
		to minimize divergences.

	0002-sync-from-3f38ad5a.patch

		Upstream files only

	0003-Update-links.patch

		Not meaningful to NodeMCU

	0004-sync-from-01990ad0.patch
	0005-sync-from-cdf6877d.patch

		Upstream files only

	0006-sync-from-f29e744c.patch

		Upstream files only, user_interface.h override non-conflicting

	0009-feat-lwip-Move-lwip-source-code-to-third_party-folde.patch

		Merged change to lwip/app/espconn_udp.c; rest is just moves or
		appears to not apply.

	0010-feat-mbedtls-Add-mbedtls-source-code-in-third_party-.patch

		Does not apply; we use our own mbedtls

	0011-added-C-support.patch

		Merged to Makefile

	0012-feat-mbedtls-Rebuild-libmbedtls.patch

		Already applied

	0013-fix-at-Fix-some-bugs-of-AT.patch

		Upstream files only

	0014-feat-err_t-Redefine-err_t-to-s32_t.patch

		Merged to app/include/arch/cc.h and ./app/include/lwip/app/espconn.h;
		the rest is upstream files.

	0015-fix-wpa-Fix-wpa-wpa2-ptk-gtk-reinstallation-vulnerab.patch
	0016-fix-wifi-Remove-group-key-entry-before-connecting-to.patch
	0017-feat-lib-Remove-time-function-in-libmain.patch

		Upstream files only

	0018-feat-espconn-Modification-for-espconn.patch

		Merged to app/include/lwip/app/espconn.h,
		app/include/lwip/app/espconn_tcp.h, app/lwip/app/espconn.c,
		app/lwip/app/espconn_tcp.c

	0019-feat-at-Use-new-espconn_recv-to-fix-tcp-server-issue.patch
	0020-feat-examples-Update-mqtt-demo-and-auto-bin-generate.patch

		Upstream files only

	0021-wifi-Add-scan-threshold-and-dwell-time.patch
	0022-feat-wifi-Add-country-code-API.patch
	0023-feat-wifi-Record-more-information-of-scanned-ap.patch

		Upstream files only, user_interface.h override non-conflicting

	0024-fix-example-Fix-IoT_Demo-user-sector-error.patch

		Upstream files only

	0025-fix-lwip-Fix-sequence-number-error-of-RST-ACK.patch

		Merged app/lwip/core/tcp_in.c

	0026-fix-mbedtls-Fix-memory-leak.patch

		Merged app/mbedtls/app/lwIPSocket.c

	0027-fix-mbedtls-Fix-call-send-callback-function-failed.patch

		Merged app/mbedtls/app/espconn_mbedtls.c

	0028-feat-Add-USE_OPTIMIZE_PRINTF-in-third_party-Makefile.patch

		Merged app/Makefile

	0029-fix-api-Fix-ets_delay_us-declaration.patch

		Upstream files only, osapi.h override non-conflicting

	0030-fix-wifi-Remove-max_tx_power-in-wifi_country_t-in-li.patch
	0031-fix-wifi-Fix-softAP-wrong-behavior-after-call-system.patch
	0032-fix-wifi-bugfix-of-scan-fail-after-connected-if-max-.patch
	0033-feat-at-Enable-scan-time-scan-type-and-add-scan-resu.patch
	0034-feat-at-Add-command-AT-CWCOUNTRY.patch
	0035-fix-at-Fix-that-AT-CIPSTART-causes-busy-if-the-serve.patch

		Upstream files only

	0036-feat-mbedtls-Speed-up-mbedtls-handshake-process.patch

		Merged app/mbedtls/app/espconn_mbedtls.c

	0037-fix-api-Fix-os_calloc-declaration.patch

		Merged app/include/lwip/mem.h; sdk-overrides/include/mem.h
		non-conflicting.

	0038-fix-mbedtls-Fix-disconnect-callback-function-never-b.patch

		Merged app/mbedtls/app/espconn_mbedtls.c; minor revision to logic in
		6576af959b.  Whitespace fixes.

	0039-feat-at-Add-country-code-start-channel-in-AT-CWCOUNT.patch
	0040-fix-net80211-Fix-Null-pointer-in-ieee80211_rfid_locp.patch

		Upstream files only

	0041-feat-wifi-Add-new-esp_init_data_default-v08-bin.patch

		Upstream files only, but impacts Makefile

	0042-fix-mbedtls-Fix-load-cert-fail-when-the-private-key-.patch

		Merged app/mbedtls/app/espconn_mbedtls.c

	0043-fix-wifi-The-start-channel-can-be-any-valid-channel.patch
	0044-fix-wifi-Fix-scan-do-not-start-after-connect.patch
	0045-feat-wifi-Add-keep-connection-for-station-to-keep-co.patch
	0046-feat-at-Update-AT-version-to-1.6.0.0.patch
	0047-fix-at-Fix-GSLP-too-long-time.patch
	0048-fix-at-Fix-the-message-is-incorrect-when-creating-UD.patch
	0049-feat-at-Add-AT-CIPSERVERMAXCONN.patch

		Upstream files only

	0050-feat-system-Add-softap-distributes-station-ip-event.patch

		Upstream files only, user_interface.h override non-conflicting

	0051-feat-example-Use-libmbedtls.a-instead-of-libssl.a-in.patch

		Upstream files only

	0052-feat-mesh-Remove-mesh-support.patch

		Upstream files only, but go ahead and remove comment from
		ld/nodemcu.ld.

	0053-fix-example-Fix-forget-to-add-integer-parameter-when.patch

		Upstream files only

	0054-fix-mbedtls-Fix-reconnect_callback-is-not-triggered-.patch

		Merged app/mbedtls/app/espconn_mbedtls.c

	0055-feat-at-Add-AT-SYSMSG-to-enable-some-report-informat.patch
	0056-fix-at-Fix-the-incorrect-link-id-when-client-connect.patch
	0057-fix-at-Fix-the-bug-that-it-should-be-error-when-the-.patch
	0058-fix-smartconfig-Fix-the-smartconfig-scan-time-issue.patch
	0059-fix-lwip-Fix-the-bug-of-lwip-output.patch

		Upstream files only

	0060-fix-lwip-Fix-the-length-of-TCP-data-in-one-packet-is.patch
	0061-fix-lwip-Fix-send-TCP-data-with-two-or-more-pbuf.patch

		Merged app/lwip/core/tcp_out.c

	0062-fix-wifi-Fix-assert-happen-when-smartconfig-start-th.patch

		Upstream files only

	0063-fix-mbedtls-Fix-memory-leak-when-ESP8266-as-SSL-TLS-.patch

		Merged app/mbedtls/app/espconn_mbedtls.c

	0064-fix-mbedtls-Fix-already-freed-and-exception-bug-when.patch

		Merged app/mbedtls/app/lwIPSocket.c

	0065-fix-at-Fix-bug-that-there-is-no-result-when-sending-.patch
	0066-feat-example-Add-AT-bin-version.patch
	0067-feat-version-Update-version-to-2.2.0-and-add-version.patch
	0068-feat-bin-Update-AT-bin-for-SDK-2.2.0.patch

		Upstream files only

Apply local changes to build:

	app/include/lwip/app/espconn.h pulls changes (and license decl) from
	upstream SDK.  Makefile is altered to use this file ahead of the
	SDK's.

	Remove lwip's sntp support, since it was never really wired in anyway.
	See https://github.com/nodemcu/nodemcu-firmware/issues/2042 for more
	information.  Patch Makefile to strip time.o, the consumer of lwip's
	sntp functionality, from libmain.a, resulting in much
	easier-to-understand error messages.

	This has consequences for mbedtls.  The simplest thing to do, which is,
	impressively, not a change in behavior, is to completely disable TLS
	certificate time validation; a later patch can optionally couple this to
	RTCTIME support.

	Similarly, it happens that the sqlite3 import was calling time(), but
	this was not going to work out well for it.  Just stub it out to always
	return unix timestamp 0, as would have happened anyway.

Changes unprocessed:

	0007-sync-from-080c37e1.patch
	0008-feat-lib-Compile-some-libraries-with-ffunction-secti.patch

		These two make changes to the linker script; perhaps
		they are worth porting over, but I have not done so
		here.

This is build-tested (ADC, BIT, COLOR_UTILS, CRON, CRYPTO, DHT, ENCODER,
FILE, GPIO, HTTP, I2C, MQTT, NET, NODE, OW, PCM, PERF, PWM, RTCFIFO,
RTCMEM, RTCTIME, SNTP, SPI, SQLITE3, STRUCT, TLS, TMR, UART, WIFI,
WS2812, WS2812_EFFECTS) and boots, but only limited run-time testing has
been performed.  Testing done does, however, include having made a few
TLS connections through the HTTP module, so things are not hopelessly
broken, at the very least.
2018-03-13 19:28:11 -04:00
Arnim Läuger 4367e6e9e0 remove deprecated init functions in adxl345, am2320, bme280, bmp085, hdc1080, hmc58831, l3g4200d, HDC1000, lm92 (#2276) 2018-03-12 07:56:07 +01:00
Luiz Felipe Silva c7673b0224 Merge remote-tracking branch 'upstream/dev' into dev 2018-03-12 00:02:32 -03:00
Nathaniel Wesley Filardo 5c8af3c452 Update mbedTLS to 2.7.0 (#2267)
* mbedtls 2.7.0 (mbedtls-2.7.0-0-g32605dc8)

Wholesale import, with a few changes from earlier preserved through.
Ideally we would soon get to the point of having no divergences from
upstream.

* tls: add function to adjust mbedTLS debug level
2018-03-03 23:28:26 +01:00
Luiz Felipe Silva ba9a938e36 Removing large number of defines inside makefile, exporting them to a file 2018-03-03 08:49:52 -03:00
Philip Gladstone f2d605d27c Fix SNTP so that it retries DNS lookups if it needs to (#2283) 2018-03-01 23:57:55 +01:00
Arnim Läuger 4a47382e0f align wifi.sta.config table elements connected_cb and disconnected_cb with doc (#2282) 2018-03-01 11:50:14 +01:00
Philip Gladstone 76ae04f8a7 Fix problem with gpio.input (#2281) 2018-02-28 20:23:35 +01:00
Philip Gladstone 97e34ce520 Fix a number of issues with the gpio.pulse family of functions (#2260)
* Fix some subtle timing issues with gpio.pulse
* Add the pulse:update method
* Allow getstate to work on stopped pulsers
* Make gpio.mode(, gpio.OUTPUT) actually set the output mode
* Added some more documentation
2018-02-23 23:12:23 +01:00
Frank Exoo e9ed1a8c59 Disable MQTT connect error callback after successful connection (#2262)
Disable the error callback of mqtt.client:connect() after a successful connection.
This will prevent this function to be called after a future disconnection.
Instead the "offline" function is called.
2018-02-13 09:25:20 +01:00
Arnim Läuger 1a39a9f14a disable (and clear) unexpected interrupts (#2234) 2018-02-13 09:17:22 +01:00
Frank Exoo ba36cb3d2d MQTT re-connect issue (#2256)
Fix to start sending PINGREQ after a reconnect.
2018-02-09 08:13:24 +01:00
Pawel Jasinski 2a944026c5 introduced sign into read and startread (#2246)
in float build, uV and sign are included in mV
in int build, uV and mV are absolute, sign is -1, 0, 1
added rounding of uV values
added optional test function
2018-02-07 21:29:17 +01:00
Arnim Läuger e3807bd439 enforce single source for SSL buffer size (#2248) 2018-02-07 21:27:01 +01:00
Pawel Jasinski f87d68ff8f added support for ads1015 (#2231)
* ads1015 is supported, up to 4 devices can be connected at the same time

* removed debug, updated documentation

* changed to oop API

* added __gc to handle active timer cleanup

* reworked argument validation and error reporting

* stack is no longer messed up after __del
2018-01-29 22:21:16 +01:00
Konrad Hübner ed56d949ee ws2812 effects library (#2215)
* ws2812 effects and color utils modules added

* Added documentation for new modules to mkdocs.yml

* changed mode option to string, documentation, default modules fixed

* updated user_modules.h
2018-01-23 21:05:04 +01:00
devsaurus a0ea61f595 remove inline declarations 2018-01-20 19:42:55 +01:00
devsaurus d0c55876c8 initialize task ids only once at module open 2018-01-14 21:21:32 +01:00
Luiz Felipe Silva df930c2d03 Add sqlite3 module (#2008)
* add final sqlite3 patch
* remove unused defines, join caching code with esp vfs code to reduce exported symbols and shrink final file size
* Modules should by default be disabled and in alphabetical order
2018-01-10 22:45:56 +01:00
Nathaniel Wesley Filardo 6576af959b Update mbedTLS (#2214)
* mbedTLS update
* mbedtls: vsnprintf macroification
* Further update mbedTLS to 2.6.1
* mbedtls: make debugging work again
* Silence SSL messages on normal teardown
* Drop DTLS support from mbedtls
2018-01-10 21:48:36 +01:00
Arnim Läuger fc2f325029 add missing NULLification of serout.delay_table after luaM_freearray() (#2220) 2018-01-10 21:25:35 +01:00
Philip Gladstone ceadd30bca Add support for the wifi monitor mode in the SDK (#2204) 2018-01-10 21:24:41 +01:00
Philip Gladstone 77fe51050a Addition of gpio.pulse functions (#2190) 2018-01-10 21:08:39 +01:00
Johny Mattsson 452778eda8 Fix batch multi-line UART input discarding all but first line (#2217)
* Only load a single non-empty line from the uart at a time.

* Don't fall behind in processing of uart buffer.
2018-01-04 22:50:39 +01:00
Pawel Jasinski 05b0a0134c host field in HTTP header is no longer limited to 31 charcters (#2210) 2017-12-25 21:47:45 +01:00
Carlos Bastos Filho 442e3e2e6c
Update file.c
Buffer size of funtion readline is wrong  (Line 480)
Should be FILE_READ_CHUNK = 1024 bytes instead 256 bytes
2017-12-19 15:32:23 -02:00
Philip Gladstone 9aebc84b72 Add support of counting of interrupts (#2149)
* Add support of counting of interrupts

* Update the timestamp when interrupt happens during dispatch. Also
clear out interrupts when setting up a new callback
2017-12-17 21:42:54 +01:00
Philip Gladstone 11c47fa17a New version of spiffs (#2172) 2017-12-03 13:14:22 +01:00
Philip Gladstone ef91580c7b Addition of a Bloom Filter object (#2176)
* Initial checkin
* Add bloom.md into mkdocs
* Added reset and improved info
* Update bloom.c
* Update bloom.md
* Add Wikipedia link
2017-12-03 13:10:59 +01:00
Lukáš Voborský 87a6a9bdb9 Add BME680 module (#2151) 2017-11-19 20:49:07 +01:00
Mark Deneen 4af68d8360 WiFi method to adjust maximum TX power (#2171) 2017-11-19 20:00:20 +01:00
Philip Gladstone 5ece2fda20 Another dsleep fix (or rather a not-deep-sleep case) (#2155)
* Make the rtc variables not be cleared by the .bss initialization
* Move the save to the right place
* Make sure that we reset the rtctime to 0 if we didn't sleep properly.
* Setting the seconds to zero doesn't update the dsleep calibration
2017-11-03 17:50:10 +01:00
Philip Gladstone 0f7716297c Make the CRON module work reliably (#2153) 2017-10-30 11:05:41 +01:00
Terry Ellison ffc914dad0
Merge pull request #2152 from pjsg/fix-no-int
Make it build without INTERRUPT_ENABLE
2017-10-29 18:19:40 +00:00
philip f17b5ebf59 Make it build without INTERRUPT_ENABLE 2017-10-29 10:35:24 -04:00