Commit Graph

114 Commits

Author SHA1 Message Date
Johny Mattsson c0145e03f9 Fix net module losing TCP data. (#2825)
The netbuf_data() function only returns data from the first pbuf in the
chain. We need to use netbuf_first() and netbuf_next() to walk the
pbuf chain and act on each in turn.
2019-07-11 09:43:25 +02:00
Johny Mattsson ca89bff073 OTA support for ESP32 (#2812)
* Implemented otaupgrade module.

* Added partition table example for otaupgrade.

* Copy-paste omission. Whoops.

* Updated otaupgrade docs after review.
2019-07-06 14:21:08 +02:00
Johny Mattsson e11087bfdf Improved crypto module for ESP32, now with HMAC (#2815)
* Leaner, meaner crypto module; now with HMAC

Based on my testing, mbedtls pulls in all its algorithm regardless of
whether the NodeMCU crypto module was using them or not. As such, the
space savings from omitting algorithms were only in the tens of bytes.

By switching to using the mbedtls generic message digest interface, the
crypto module itself could be shrunk in size and complexity. Despite
adding support for HMAC on all algorithms (plus including RIPEMD160),
this version is 330 bytes smaller.

* Updated crypto module docs.

* Removed superfluous brackets in crypto docs.

Copy-paste considered harmful... >.>
2019-07-04 23:24:59 +02:00
devsaurus 1f1eeaf358 fix unref default file descriptor while still in use 2019-07-03 23:54:08 +02:00
devsaurus 4c1d46c742 fix compile warnings for ipaddr_aton 2019-06-21 18:01:20 +02:00
John Lauer 8b9794b99d ESP32: Pulse counter module released (#2739)
* ESP32: Added pulsecnt module

The pulsecnt module let's you use the ESP32's pulse counter capabilities from Lua.

* ESP32: Pulsecnt module. Better/faster callback.

Reduced the amount of callback variables to speed things up and shift more logic to Lua than in the C code.

* ESP32: Completed docs for pulsecnt

* ESP32: Final release of pulsecnt

* ESP32: Production release of pulsecnt

* ESP32: Release (tweaked docs)

* ESP32: Pulse Counter Release. Cleaned up .gitignore

* ESP32: Pulse counter release (changed ch1 gpio to int to match ch0)
2019-06-12 22:34:24 +02:00
Skirmantas Lauzikas 6d0e45793f ESP32: Add option to set IP/dns config (#2560)
* ESP32: Add option to set IP/dns config

This commit adds support for setting:
* Hostname
* Static IP / Dns server (Sta mode)
* Changing AP network ip config
* Setting DNS server IP for DHCP

* ESP32: Documentation for setting IP/dns/hostname config

* Documented new functions
* sethostname() now returns true if success
2019-06-10 16:33:29 +02:00
devsaurus 5faf76b762 update to u8g2 2.25.10
- new displays
- binding for updateDisplay() and updateDisplayArea()
- use user_ptr instead of hal workaround
2019-04-28 22:26:37 +02:00
devsaurus 8251d0ae6f fix ucg compile for u8g2 & !ucg 2019-04-28 16:18:43 +02:00
Javier Peletier d1eab2396c ESP32: remove use of luaM_free in file module (#2631)
* file: remove use of luaM_free

* added safe pushlstring function
2019-02-20 23:26:39 +01:00
Arnim Läuger 2339726097
mqtt: add ceritificate handling to support server verification and mutual authentication (#2657)
* mqtt: add ceritificate handling to support server verification and mutual authentication

* remove superfluous include
2019-02-12 23:10:25 +01:00
Arnim Läuger e9bf51eb8f
add support for sdmmc cards in sd-spi mode (#2644) 2019-02-10 10:11:13 +01:00
Javier Peletier 1d8c4554fc node: node.output() (#2637) 2019-01-31 22:03:41 +01:00
Javier Peletier 2b006e2f9a mqtt: allow daisy-chaining subscriptions (#2638) 2019-01-31 21:08:31 +01:00
Javier Peletier 56f19e44c3 ESP32: MQTT module rewrite (#2629)
* mqtt: first pass

* mqtt: correct gc during callback bug

* mqtt: document and cleanup

* mqtt: separate lnodeaux due to copyright

* mqtt: rename lnodeaux methods

* mqtt: update docs

* mqtt: fix copyright in lnodeaux.c

* mqtt: refactor and cleanup

* mqtt: use ESP logging
2019-01-29 22:36:29 +01:00
Kevin Leung e38fc7ac66 Compilation fix (#2623) 2019-01-22 18:56:54 +01:00
Javier Peletier 746f519c47 ESP32 crypto module (#2607) 2019-01-18 12:55:26 +01:00
Javier Peletier c59ed6bbb8 ESP32: fix memory leak in encoder.fromHex and avoid use luaM_free (#2610) 2019-01-17 12:09:09 +01:00
Javier Peletier efc9a6b047 fix memory leak in http one-shot requests (#2615) 2019-01-16 21:22:07 +01:00
Arnim Läuger ab32ad2a67
Port i2s, spi_master, and ledc to helper functions for option tables (#2577)
* opt_checkint_range: extend range check to default value

* opt_checklstring added

* i2s: rework luaM_ and option table handling

* spi_master: rework option tables handling

* ledc: rework option tables handling
2018-12-02 16:20:45 +01:00
Skirmantas Lauzikas 794a07bb51 ESP32: Add time module (#2561)
* ESP32: Add time modules

New time module for manipulating system time/ calendar and controlling SNTP server

* ESP32: Time module documentation & style fixes
* added documentation for time modules
* style fixes as pointed out by @devsaurus

* ESP32: Time module small fixes
* Couple small fixes
2018-11-26 21:03:23 +01:00
Skirmantas Lauzikas 423c733db8 ESP32: Add SJSON module (#2562)
* Esp32: Add SJSON module

This adds SJSON module taken directly from master

* ESP32: Fixes for sjson lib
Fixed compilation not including config header, thus braking some of libs functionality

* ESP32: Upgraded SJSON to master
2018-11-22 20:58:27 +01:00
tomsci 72d28fa86e Adding qrcodegen module for generating QR Codes (#2543)
* Adding qrcodegen module for generating QR Codes

* Added LUA_MODULE_QRCODEGEN KConfig

* Changed qrcodegen.encodeText() to use an options table

Created common.h with new option table helper fns.

* Reworked http.c to use new common.h options table APIs
2018-11-15 22:17:43 +01:00
tomsci 1cb1aff4cd ESP32: Add Sodium module (#2550)
* Add Sodium module

* Split sodium API into subtables; updated docs

* Fixed refactored names of crypto_box fns
2018-11-15 18:04:00 +01:00
tomsci d2345f2beb esp32: Add node.uptime() function using esp_timer_get_time() (#2533)
* esp32: Reinstate tmr.now() function using esp_timer_get_time()

Also added larger limit before wrapping if Lua's number type supports
it.

* Renamed tmr.now() to node.uptime()

Added second return value to indicate timer wrap
2018-11-10 14:53:10 +01:00
tomsci 5db5d8edeb Changed ESP32 http user agent to "NodeMCU (ESP32)" (#2551) 2018-11-08 21:14:15 +01:00
tomsci 73b13e4197 Add ESP32 http module (#2540)
* ESP32: Added http module

* add asynchronous flavor for context:request()

(cherry picked from commit e65b90cc8fc5296f7fe6cae1978835e06a9f44bb)

* http: More asynchronous support, more options

* Fix docs typo

* Code review comments from @devsaurus

Fixes some cleanup issues with asynchronous mode

* Added http.md to mkdocs.yml

* Align connection:close() to template
2018-11-08 20:24:18 +01:00
devsaurus 955a63881f i2s: fix memory leak for pending tx data when node_i2s_stop() deletes the tx task 2018-11-04 23:28:21 +01:00
devsaurus fdb96f51be update file and vfs to master 2018-11-04 00:42:08 +01:00
devsaurus 30ada6f084 add i2s.mute() 2018-11-02 22:31:49 +01:00
tomsci 48b9518d76 Add object-based file API to dev-esp32 branch (#2524)
* #2521: Add object-based file API to dev-esp32 branch

Merged in from master@c708828bbe853764b9de58fb8113a70f5a24002d minus
some VFS changes and similar.

* Updated file docs from master

Omitting:
* file.mount()
* reference to rtctime.epoch2cal()
* file.stat()

As these are not available in dev-esp32 branch

Unsure about whether "directories are not supported" is still true
2018-10-29 07:09:41 +01:00
devsaurus 7ded3960eb fix net hold/unhold 2018-10-20 22:58:57 +02:00
devsaurus 3fb2c7d402 fix intr_alloc setting
re-enable i2s.read()
2018-10-18 22:47:39 +02:00
devsaurus daa5848431 rework parts of I2S 2018-10-14 18:05:48 +02:00
devsaurus 5e64def682 add dac module 2018-10-14 12:29:30 +02:00
zelll d094944b9b fixed a leak 2018-10-13 14:12:11 +02:00
zelll a4c0d7180e fix spaces 2018-10-13 14:10:34 +02:00
zelll 34e486fb7f i2s extension 2018-10-13 14:10:03 +02:00
Ryan Hartlage d6c593b722 Use esp-mqtt from esp-idf (#2509)
* Use esp-mqtt from esp-idf

* Fix formatting

* Revert changes to u8g2 submodule
2018-10-08 20:58:28 +02:00
devsaurus 45c63a8236 Add ucg module. 2018-10-07 16:31:28 +02:00
devsaurus 358379fd90 Updated ESP-IDF to latest. 2018-10-07 12:33:40 +02:00
Arnim Läuger bf5808495c
Merge pull request #2501 from ryanplusplus/mqtt-rometatable
Mqtt rometatable
2018-10-02 19:00:04 +02:00
Ryan Hartlage c8e3a11a00 Use alphabetical order for lua modules in kconfig 2018-07-14 15:07:39 -04:00
Ryan Hartlage 74fd5184dd Use RO metatable for MQTT module; add link to docs in mkdocs.yml 2018-07-14 13:40:21 -04:00
devsaurus a63da92e82 set auto_connect before station configuration
idf 3.1 connects automatically upon esp_wifi_sta_config()
2018-04-04 09:09:41 +02:00
Andrew Gough 33232b501d Upgrade to espmqttc head 2018-03-19 19:31:38 +11:00
Andrew Gough 4207d6c8ad Add espmqtt library + bindings 2018-02-01 21:03:10 +11:00
devsaurus 4702c1f181 align source from esp8266 port 2017-12-18 22:06:47 +01:00
devsaurus 0b998e5612 tolerate multiple netconn callbacks for a single send job 2017-11-12 17:41:29 +01:00
devsaurus b2f09da2e2 ignore return code from netconn_delete, fix #2096 2017-09-12 22:22:00 +02:00