Commit Graph

281 Commits

Author SHA1 Message Date
Philip Gladstone e88b23ebd8 Clean up and add more debug (normally compiled out) 2024-02-01 20:30:17 -05:00
Philip Gladstone 7cf7f4cb7b Merge remote-tracking branch 'origin/dev-esp32' into http-ws 2024-01-31 20:21:19 -05:00
serg3295 796fd7ad0e Fix time.get() for 5.3-int32-singlefp firmware on IDF v5.0.2 2024-01-30 11:34:03 +11:00
serg3295 096164a75c fix(mqtt): adds parameter checking to nil 2024-01-30 11:34:03 +11:00
serg3295 9a9548b0b8 fix(mqtt): select next parameter in connect() 2024-01-30 11:34:03 +11:00
serg3295 9633b03af3 fix: mqtt 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
Philip Gladstone bf84d4aafc
Updated to IDF 4.4.6 (#3621)
* Updated to IDF 4.4.6

* Use the version that doesn't have my monitor fix in it
2024-01-23 09:17:15 -05:00
Felix Penzlin f125b2d059 configure ledc to auto select clock 2023-05-18 12:46:49 +10:00
Tom Sutcliffe 4523bbb36d Fix i2c.setup() for pins >= 32
Which includes SDA and SCL on esp32s2.
2023-05-13 20:03:06 +10:00
Tom Sutcliffe 7155d7197a Fix platform_rmt_allocate for esp32-S3
By not relying on ifdefing for specific targets, but instead using the
SOC_RMT_xxx macros to figure it out.
2023-05-13 19:32:39 +10:00
Tom Sutcliffe 1b38d8e6eb Fix ws2812 on later esp32 variants
By not relying on the internal details of the RMT registers. For example
on the esp32s2, the threshold event bits start at bit 12 not bit 24, and
on the esp32s3 the memory buffers are only 48 words not 64. Also the
esp-idf recommends against hooking the rmt ISR in the first place.

Instead, use the published rmt APIs (specifically rmt_write_sample and
rmt_translator_init) and the default rmt ISR, which should be much more
resilient against future esp32 SoC changes.
2023-05-13 19:32:39 +10: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
Johny Mattsson 55dbcc79d5 Added mkdir/rmdir support to file module. 2023-01-17 14:34:26 +11:00
Johny Mattsson ccb3b5002d Improvements to external component/module support.
Based on feedback from @tomsci - thanks!
2023-01-17 14:08:47 +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
Tom Sutcliffe ed85e21a9b Allow LUA_INIT_STRING to be set in menuconfig 2022-11-17 17:26:51 +11:00
Tom Sutcliffe e3883cd27b Fix file.list() zero sizes. Fixes #3549.
The modern spiffs backend doesn't like stat("./somefile") for something
on the root of the filesystem, and instead only accepts "somefile"
(it also doesn't like "/somefile"). The error from stat was being
ignored which is why the file sizes all appeared to be zero.

The fix is to change file.list() to pass just the filename, unless a
directory was passed to list(). Also improved error handling a bit.
2022-11-08 16:10:47 +11:00
Johny Mattsson 38ccd7b2ba Upgrade IDF to v4.4.2
Slightly reworked embed_lfs.sh to better cope with attribute size changes
in future compiler versions, without needing to be updated again.

RMT register naming changed once again...
2022-10-12 16:14:40 +11:00
Philip Gladstone d8f07ddf90 Remove another not-compiling module 2022-10-05 14:53:25 +11:00
Philip Gladstone fef57344db Remove the touch driver as well 2022-10-05 14:53:25 +11:00
Philip Gladstone b9d6e2722e The i2s module doesn't appear to build 2022-10-05 14:53:25 +11:00
Philip Gladstone f15470e44f Include the rmt device for the esp32-c3 (and other missing devices) 2022-10-05 14:53:25 +11: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
Joo Aun Saw d24f2ae459 platform uart: really feed uart data to both console and on-data cb 2022-08-30 18:14:57 +10:00
Joo Aun Saw 0e71189c11 uart: further clean up 2022-08-30 10:38:29 +10:00
Joo Aun Saw 5e6cb4d1fa uart: slight clean up of uart.setup 2022-08-30 10:38:29 +10:00
Joo Aun Saw ddc770a6f7 uart: do not use uninitialized uart pins config 2022-08-29 20:54:31 +10:00
Joo Aun Saw ca0a2b3f47 platform: platform_uart_setup handles null ptr 2022-08-29 20:53:17 +10:00
Joo Aun Saw 01b94f31dc uart: feed rx data to both lua console and on-data callback 2022-08-29 20:52:03 +10:00
h2zero b8ae6ca6f8 Explicitly set RMT config::flags.
If this variable is not set in the config it may contain random data and set the clock source to the REF_CLK
resulting in timing errors, the DHTx, DS18B20 and ws2812 devices to not communicate.
2022-06-04 16:00:19 +10:00
h2zero 484a7721b5 Ensure flash address is set before obtaining memory mapped address.
Before this change the struck member add_phys would contain random data and the call to spi_flash_phys2cache
could return an incorrect memory address.
2022-06-04 15:57:18 +10:00
h2zero c75ec760aa Fix node.compile fwrite size check.
The return value from fwrite was being checked against the size of the data rather than the number of bytes written.
This caused node.compile() to falsely return failure.
2022-06-04 15:55:00 +10:00
Philip Gladstone c03e7cffb7
Add the invert option for the ledc module (#3506) 2022-05-20 07:36:36 +02:00
Philip Gladstone 2280953821 Remove the printf debugging 2022-05-03 20:01:21 -04:00
Philip Gladstone 6899d8ed0c Better handling of lifetime of WS object 2022-05-02 20:24:02 -04:00
Philip Gladstone ff116b760a Minor cleanup 2022-05-02 19:29:27 -04:00
Philip Gladstone 75fdcd9747 Make it compile without websocket support 2022-04-30 19:51:42 -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
Philip Gladstone 8f9295b09e
Update to the released version of idf4.4 (#3498)
* Update to the released version of idf4.4

* Try to get the CI Build to work in all cases
2022-01-25 20:54:17 -05:00
Johny Mattsson 670bf2d6a6
Make UART buffer sizes configurable. (#3500)
Also corrects assumption about number of UARTs available.
2022-01-26 11:32:24 +11:00
Christoph Thelen 8b1ef35b66
Consider RMT channel limitations at allocation time. (#3481)
* Consider RMT channel limitations at allocation time.

The ESP32-C3 is limited to TX on channel 0-1 and RX on channel 2-3.
2022-01-07 14:50:28 +11:00
Johny Mattsson 6e63264963
Support interface-specific hostname on ethernet interface. (#3487) 2022-01-02 13:31:58 +11:00
Johny Mattsson 4b4ce47ed1 Fix file listing on submounts. 2021-11-13 12:26:49 +11:00