Commit Graph

73 Commits

Author SHA1 Message Date
Philip Gladstone 7cf7f4cb7b Merge remote-tracking branch 'origin/dev-esp32' into http-ws 2024-01-31 20:21:19 -05:00
Mike_Went 3cc1d48b83 Fix example pins in docs/modules/uart.md 2024-01-30 12:36:10 +11:00
serg3295 9a9548b0b8 fix(mqtt): select next parameter in connect() 2024-01-30 11:34:03 +11:00
Johny Mattsson 12035a7678 Upgrade to IDF v5.0.2
With minor update required to our spi module.
2024-01-30 11:34:03 +11:00
Johny Mattsson f126b6fe91 Initial migration to IDFv5.0
Plenty of dependency adjustments, printf format specificier updates,
FreeRTOS type and macro name modernisation, not to mention API changes.

Still plenty of legacy/deprecated drivers in use which will need updating.

The following features have been removed due to no longer being available
from the IDF:
  - ADC hall effect sensor reading
  - Configuration of SD SPI host via sdmmc module (now must be done first
    via the spimaster module)
  - FAT partition selection on external SD cards; only the first FAT
    partition is supported by the IDF now

On the other hand, the eth module now supports the following new chipsets:
  - KSZ8001
  - KSZ8021
  - KSZ8031
  - KSZ8051
  - KSZ8061
  - KSZ8091
  - Possibly additional models in the LAN87xx series (the IDF docs aren't
    clear on precisely which models are handled)

Further, the sdmmc module is now available on the ESP32-S3 as well.
2024-01-30 11:34:03 +11:00
Johny Mattsson 32d03a21da Prefer Lua booleans over 1/nil or 1/0
Document preference and also provide easy-to-use backwards compatible
interface.
2023-02-09 15:52:38 +11:00
Johny Mattsson bc3aaf6e4b Update wifi.sta to support new IDF functionality.
In addition to exposing additional configuration settings, it now also
provides access to the wifi station power-saving control.

Documentation updated, and wifi.sta.getconfig() has been documented. Not
sure why that wasn't already the case.
2023-02-09 15:52:38 +11:00
serg3295 1d173c818b
Fix typo in `file.md` (#3566) 2023-01-17 16:44:59 +01:00
Johny Mattsson 55dbcc79d5 Added mkdir/rmdir support to file module. 2023-01-17 14:34:26 +11:00
Johny Mattsson c684180dea Remove defunct extmod bits. 2023-01-17 14:08:47 +11:00
Tom Sutcliffe a40d69dbe8 Make sodium.random API behave consistently on all build types
By returning result as a signed 32-bit int between INT32_MIN to IN32_MAX
which is represented the same regardless of 64-bit support or
integral-only builds.

Also updated docs, fixed links and clarified behavior of random APIs
when WiFi isn't started.
2022-12-19 18:53:04 +11:00
serg3295 f592cf4ee5
Fix ledc.md (#3557)
fixes ledc.channel:fade() syntax.
2022-11-10 20:49:16 -05:00
Philip Gladstone c7cab0aba4
Adds support for settxpower (#3535)
* Adds support for settxpower

* Update docs/modules/wifi.md

Co-authored-by: Marcel Stör <marcelstoer@users.noreply.github.com>

* Update docs/modules/wifi.md

Co-authored-by: Marcel Stör <marcelstoer@users.noreply.github.com>

Co-authored-by: Marcel Stör <marcelstoer@users.noreply.github.com>
2022-09-29 21:38:32 -04:00
Philip Gladstone 9965635694
Ported the rtcmem over to ESP32 (#3544)
* Ported the rtcmem over to ESP32

* Apply review comments.

* Add the rtcmem string to the config option
2022-09-29 21:37:34 -04:00
Philip Gladstone c03e7cffb7
Add the invert option for the ledc module (#3506) 2022-05-20 07:36:36 +02:00
Philip Gladstone e0748a4b9e Improved the documentation 2022-04-30 19:48:31 -04:00
Philip Gladstone ec604d9c70 Mostly working version of the websocket support 2022-03-10 21:52:23 -05:00
Philip Gladstone ceb62993da
First attempt at adding support for the RMT device. (#3493)
* Adding the first version of the rmt documentation.

* Stub RMT module compiles.

* This version seems to work in (at least) simple cases.

* CLean up the docs

* Minor fixes

* Give the SPI module a chance of working...

* Update to the released version of idf4.4

* Try to get the CI Build to work in all cases

* Try to get the CI Build to work in all cases

* FIx a ringbuffer return issue

* Remove bogus comment

* Review comments

* Better example of transmission

* Review comments

* Add table send example

* Improved documentation

* Documentation comments

* Install the driver correctly.

* A couple of doc updates

* Fix typo
2022-03-05 17:27:11 -05:00
Johny Mattsson cb434811ca
IDF web server module (#3502)
* Added httpd module.

Lua-interface to the standard esp_http_server component.

* Added eromfs module.
2022-03-05 13:51:54 +11:00
Philip Gladstone e5892a7286
Give the SPI module a chance of working... (#3496) 2022-01-27 07:02:56 +01:00
Johny Mattsson 6e63264963
Support interface-specific hostname on ethernet interface. (#3487) 2022-01-02 13:31:58 +11:00
Johny Mattsson a0c9085cca Make node.output() RTOS thread safe.
Also removed old, very unsafe node.osoutput(). We're now integrating cleanly
with the IDF/newlib way of redirecting stdout.

Added necessary depends in Kconfig to ensure VFS support is enabled, as
otherwise you'd only get a mysterious crash when attempting to enable
output redirection.
2021-11-04 22:24:01 +11:00
Johny Mattsson 5c59c57a16 Implement tmr.wdclr() 2021-10-22 12:38:07 +11:00
Johny Mattsson a2ba49e36b Switch to IDF-provided VFS and standard `io` module.
The IDF-provided VFS resolves several issues:

 - The IDF components having a different view of the (virtual) file system
   compared to the Lua environment.

 - RTOS task/thread safety. Our legacy VFS was only ever safe to use
   from the LVM thread, which limited its usability. Upgrading it
   would have effectively required a reimplementation of the IDF VFS,
   which would have been a bigger task with larger on-going maintenance
   issues.

 - We're no longer needing to maintain our own SPIFFS component.

 - We're no longer needing to maintain our own FATFS component.

 - The legacy of the 8266's lack of standard C interface to the file system
   is no longer holding us back, meaning that we can use the standard
   Lua `io` module rather than the cobbled-together swiss army knife
   also known as the file module.

Of course, the downside is that we'll either have to declare a backwards
breakage in regard to the file module, or provide a Lua shim for the old
functions, where applicable.

Also included is some necessary integer type fixups in unrelated code,
which apparently had depended on some non-standard types in either the
SPIFFS or FATFS headers.

A memory leak issue in the sdmmc module was also found and fixed while
said module got switched over to the Espressif VFS.

Module documentation has been updated to match the new reality (and I
discovered in some places it wasn't even matching the old reality).
2021-10-20 21:49:11 +11:00
Marcel Stör 389c119a8b
Add http.put (#3462)
Replaces setpostdata() with setbody().
2021-10-05 13:33:27 +11:00
Johny Mattsson 5e52a9e200 Added heaptrace module. 2021-09-16 13:54:55 +10:00
Johny Mattsson b84138595d Add eth.set_ip() functionality.
Effectively the esp_netif version of the recent tcpip_adapter based
support added on dev-esp32 in fa6fd1a41b.
2021-09-09 19:07:51 +10:00
Johny Mattsson 37f682dd70 More ethernet module fixes. 2021-09-09 19:05:48 +10:00
Johny Mattsson 185855b69a Brought over node.setonerror() functionality.
Now properly triggering restart on non-interactive errors.
2021-08-26 11:33:42 +10:00
Johny Mattsson 0690a7d181 Make bit module handle 32/64bit integer configs. 2021-08-25 18:58:53 +10:00
Johny Mattsson e52e0a8e84 Pulled in the 5.1+5.3 docs from the esp8266 branch.
With minor modifications to drop ESP8266 specific information not
applicable to the ESP32 series. Further corrections welcome.
2021-08-22 19:25:39 +10:00
Johny Mattsson bc7b923646 Code cleanup to sort out warnings.
I2S constants have changed; docs updated.
2021-07-29 13:47:45 +10:00
Johny Mattsson dff32e8902 WiFi module updates.
- Added support for WPA3
- Evicted left-over broken WiFi auto-reconnect
- Updated docs
2021-07-28 19:09:19 +10:00
Johny Mattsson 06a0e3dc23 idf4: part 3.2 - fix bug in updated eth module
Updated docs to reflect new WiFi station connect behaviour.
2021-07-22 16:46:57 +10:00
Johny Mattsson d2f8121e22 idf4: part 2.2 - update wifi & eth modules to new APIs
Only compile-tested so far.

Of note is that the WiFi auto-connect (flag) functionality has been removed
from the IDF, and as a follow-on so has the "auto" field in the wifi config.

On the Ethernet side, support for the TLK110 PHY seems to have been removed,
but on the other hand there is now new support for several others.
2021-07-20 18:18:21 +10:00
Johny Mattsson 16ef39e255 idf4: overhaul to new build system, part 1 of 3
Yet to come:
  - part 2: dealing with deprecated and removed APIs
  - part 3: making it actually work again
2021-07-15 16:27:03 +10:00
serg3295 8e0e0cb31c
Fix ledc, otaupgrade, pulsecnt, sdmmc, sjson, touch docs (#3436)
ledc.md - formatting, add object name
otaupgrade.md - formatting, add 'Syntax' section
pulsecnt.md - formatting, fix syntax pulsecnt.create, add object name
sdmmc.md - fix typos
sjson.md - formatting, add `Parameters` section
touch.md - formatting, add object name, fix Returns in tp:read()
2021-05-23 16:29:01 +02:00
serg3295 39dc2e050f
Fix bit, bthci, can, encoder, eth, i2s docs (#3432)
* Fix bit, bthci, can, encoder, eth, i2s docs

* Fix bit, mqtt, qrcodegen, sigma-delta, sodium, time docs.

* Add object name in http.md
2021-05-19 21:02:49 +02:00
serg3295 1927b22c17
Fix adc, i2c, file, tmr docs (#3428) 2021-04-27 22:30:46 +02:00
Marcel Stör 3acb6b7c79
Add node.bootreason (#3413) 2021-04-02 08:03:17 +02:00
tomsci 6ba98f348d
Add uart.txflush() (#3390) 2021-02-14 08:43:20 +01:00
jmdasnoy fb12af06e7
Fix I2C timeout (#3377) 2021-01-22 13:01:21 +01:00
tomsci d5f0094576
Add node.sleep()(#3370)
Supporting wakeup from (non-EXT1) GPIO, UART, ULP, timer and touch
2021-01-17 09:00:12 +01:00
Kit Klein 830366188d
Add node.osoutput() method for ESP32 (#3363) 2021-01-05 12:34:35 +01:00
tomsci fa2348f36b
Support for GPIO wakeup in node.dsleep() (#3115) 2020-08-22 10:32:45 +02:00
M.K 8db97c0f52
Fix method name encoder.fromBase64 in example code (#3247) 2020-08-22 10:31:08 +02:00
Javier Peletier 084d6cabc5
Add support for external modules (#3100) 2020-07-27 19:08:19 +02:00
kiritnarain 04e01fd4ef
Fix conflict between documentation and example for method newChannel() (#3184)
It now correctly uses ledc.newChannel() and saves the return value instead of invoking ledc.setup().
2020-06-30 13:52:12 +02:00
tomsci b8e8ffa53a
Expose gpio_set_drive_capability API to Lua (#3099) 2020-05-18 19:56:43 +02:00
tomsci f7b8cf018e
Unref gpio.trig callbacks when type=INTR_DISABLE (#3072)
Fixes #2880
2020-04-27 14:29:08 +02:00