Commit Graph

103 Commits

Author SHA1 Message Date
Song Ruo Jing
e13a4ad963 ci: Disable some unit-test-apps for esp32c6 to pass ci build stage 2022-11-28 11:58:30 +08:00
Armando
aba9f80cd2 partition: use esp_partition_munmap instead of spi_flash_munmap 2022-11-09 20:15:17 +08:00
Martin Vychodil
c9c7573f71 Storage: Partition APIs moved to the new component 'esp_partition'
All the partition handling API functions and data-types were moved from the 'spi_flash' component to the new one named 'esp_partition'. See Storage 5.x migration guide for more details
2022-11-02 21:54:45 +01:00
Euripedes Rocha
736424c366 [MQTT] Simplifies MQTT CMakeLists file
- Uses mocks from tools instead of creating them.
- Move host based definition to test code.
2022-09-19 09:11:15 +00:00
Ivan Grokhotkov
401c10ecfb build system: re-add -Wno-format as private flag for some components 2022-08-03 16:42:47 +04:00
yuanjm
66e0171c42 test: Add mqtt5 unit-test 2022-07-28 06:24:43 +00:00
yuanjm
5a7b17ff7d mqtt: Add mqtt5 Kconfig 2022-07-28 06:24:43 +00:00
David Cermak
5c383d7b73 esp_netif/lwip: Fix deps cycles to "lwip -> esp_netif -> phy-drivers"
Fix dependency tree so that lwip doesn't depend on any specific network
interface component.
Network interface drivers shall depend on esp_netif.
esp_netif shall depend on lwip (but not on any specific interface
driver) -- it optionally depends on vfs and esp_eth (need ethernet
header for L2/bridge mode)
2022-07-20 14:59:07 +02:00
Euripedes Rocha
ff1c405ed1 [MQTT] - Updates esp_mqtt configuration struct
- Layered config struct
- Fix examples.
2022-07-15 12:32:50 -03:00
Fu Hanxi
c0568611dd docs: changes docs supported targets tables 2022-07-14 08:26:32 +08:00
Euripedes Rocha
33fccf6405 [MQTT] - Adds esp-timer as dependency and change version.
- Current time is now from esp_timer.
2022-06-29 11:50:32 +00:00
David Čermák
a6980a6b6a Merge branch 'bugfix/mqtt_host_test' into 'master'
MQTT: Fix compilation of networking host tests

Closes IDF-4286

See merge request espressif/esp-idf!18099
2022-06-13 13:13:00 +08:00
David Cermak
877eb62602 mqtt: Update tests to start with valid transport 2022-06-11 14:23:35 +02:00
David Cermak
0aea4bf50d mqtt: Fix client_enqueue(len=0), Improve transport memory
* Update submodule: git log --oneline 64f88b4412ea6649dbf207a07370c2617160d044..a21c387d6280260894981c22494017c893d505b9

Detailed description of the changes:
* mqtt_client: Added checks for cleanly-closed connection and timeout
  - See merge request espressif/esp-mqtt!118
  - Added checks for cleanly-closed connection and timeout (espressif/esp-mqtt@e05d873)
* mqtt_client: fix esp_mqtt_client_enqueue for len=0 (GitHub PR)
  - See merge request espressif/esp-mqtt!135
  - mqtt_client: fix esp_mqtt_client_enqueue for len=0 (espressif/esp-mqtt@69b6493)
* Fix implicit malloc/free inclusion
  - See merge request espressif/esp-mqtt!134
  - See commit https://github.com/espressif/esp-mqtt/commit/9299f54
* feat(mqtt): Optimize mqtt transport list and remove unused transport
  - See merge request espressif/esp-mqtt!131
  - See commit https://github.com/espressif/esp-mqtt/commit/647e0ef
* Fix WSS default port selection through menuconfig.
  - See merge request espressif/esp-mqtt!132
  - - Closes https://github.com/espressif/esp-mqtt/issues/223
  - See commit https://github.com/espressif/esp-mqtt/commit/f6caaff
2022-06-11 14:23:35 +02:00
David Cermak
1ad3e2db17 mqtt: Fix and add mqtt host test to CI 2022-06-11 14:23:30 +02:00
David Cermak
5e19b9c951 esp-netif: Make dependency on esp-eth optional
* esp-netif to optionally depend on esp-eth (only for l2tap config)
* esp_eth.h now includes the original ethernet header and the
ethernet-netif glue layer
* Updated examples and test to explicitely use esp-eth dependency if
needed
2022-06-09 07:55:40 +00:00
Djordje Nedic
facab8c5a7 tools: Increase the minimal supported CMake version to 3.16
This updates the minimal supported version of CMake to 3.16, which in turn enables us to use more CMake features and have a cleaner build system.
This is the version that provides most new features and also the one we use in our latest docker image for CI.
2022-06-01 06:35:02 +00:00
David Cermak
58cf25193d mqtt: Fix incorrect reads on error; Update ping processing
* Update submodule: git log --oneline 4874bab35659bd2301e65fd849f6559d7380d4f1..64f88b4412ea6649dbf207a07370c2617160d044

Detailed description of the changes:
* Fix documentation of config struct
  - See merge request espressif/esp-mqtt!129
  - See commit https://github.com/espressif/esp-mqtt/commit/e31834c
* Changes the moment we update keepalive_tick.
  - See merge request espressif/esp-mqtt!127
  - See commit https://github.com/espressif/esp-mqtt/commit/2c2e6f3
* MQTT: Fix signature matching for some integer values
  - See merge request espressif/esp-mqtt!128
  - Closes https://github.com/espressif/esp-idf/issues/8482
  - MQTT: Fix signature matching for integer values (espressif/esp-mqtt@6b794e4)
* Make the mqtt submodule logging tags lower case
  - See merge request espressif/esp-mqtt!122
  - See commit https://github.com/espressif/esp-mqtt/commit/fb3184c

Closes https://github.com/espressif/esp-idf/issues/8482
Closes https://github.com/espressif/esp-idf/issues/8550
2022-05-16 20:23:26 +02:00
Ivan Grokhotkov
47659be5b8
build system: remove lwip from common requirements
lwip was added to common requirements list to provide "sys/socket.h"
header to all components without additional requirements specified.

However, lwip pulls in a lot of dependencies on other components.
This commit removes lwip from common requirements to reduce the number
of components in G1-only apps.

To compensate for this removal, the following changes are made:
- newlib (which is a common requirement) has a public dependency on
  lwip if lwip is present in the build. This ensures that sys/socket.h
  is available as long as lwip component is included into the build.
- lwip is now a public requirement of esp-tls since esp_tls.h includes
  sys/socket.h header.
- lwip is now a public requirement o esp_http_client because
  sys/socket.h is included from esp_http_client.h
- lwip is now a private requirement of esp_wifi for "smartconfig_ack"
- lwip is now a private requirement of mqtt for socket functions
- lwip is now a public requirement of tcp_transport because
  esp_transport_tcp.h includes sys/socket.h header.
- mbedtls checks if lwip component is present in the build. If yes,
  net_sockets.c is added to the build, along with the dependency on
  lwip. Previously lwip was a public requirement of mbedtls
  unconditionally.

system/g1_components test app is updated to reflect the changes

Default public dependencies of a component before and after this
change, except common requirements:

- esp_timer (public dependency of freertos)
- bootloader_support (public dependency of esp_hw_support)
- vfs (public dependency of lwip)
- esp_wifi (public dependency of lwip)
- esp_event (public dependency of esp_wifi)
- esp_netif (public dependency of esp_event)
- esp_eth (public dependency of esp_netif)
- esp_phy (public dependency of esp_wifi)

After:

- esp_timer (public dependency of freertos)
- bootloader_support (public dependency of esp_hw_support)

Altogether, the following components have been always added as
public requirements to all other components, and are not added now
([breaking-change]):

- lwip
- vfs
- esp_wifi
- esp_event
- esp_netif
- esp_eth
- esp_phy

Application components now need to explicitly declare dependencies on
these components.
2022-05-02 20:47:17 +02:00
Anton Maklakov
e27f1331e4 components: correct printf() placeholder for time_t
Using C99 %jd, https://en.cppreference.com/w/c/chrono/time_t
2022-03-14 14:05:47 +07:00
Anton Maklakov
e1ee578281 Merge branch 'bugfix/fix_mqtt_warnings' into 'master'
esp-mqtt: fix warnings (clang)

See merge request espressif/esp-idf!17357
2022-03-11 16:02:48 +08:00
Mahavir Jain
99e7059cbe Merge branch 'bugfix/kconfig_defaults' into 'master'
kconfig: Changed default values of `bool` configs

Closes IDF-4747

See merge request espressif/esp-idf!17447
2022-03-11 11:48:17 +08:00
Laukik Hase
25c5c214f3
kconfig: Changed default values of bool configs
- Some bool configs were using default values true and false,
  instead of y and n.
2022-03-10 14:26:37 +05:30
Sagar Bijwe
6501eff7f5 Remove legacy system event framework. 2022-03-09 15:53:45 +05:30
Anton Maklakov
b4ebc77975 esp-mqtt: fix warnings 2022-03-08 11:30:56 +07:00
Sudeep Mohanty
a9fda54d39 esp_hw_support/esp_system: Re-evaluate header inclusions and include directories
This commit updates the visibility of various header files and cleans up
some unnecessary inclusions. Also, this commit removes certain header
include paths which were maintained for backward compatibility.
2022-03-07 11:18:08 +05:30
Darian Leung
5f5daaa420 freertos: Remove legacy hooks
This commit refactors the legacy hooks as follows:

- Removed CONFIG_FREERTOS_LEGACY_HOOKS
- FreeRTOS hooks are now enabled via:
    - CONFIG_FREERTOS_USE_IDLE_HOOK
    - CONFIG_FREERTOS_USE_TICK_HOOK
- Update IDF hooks documentation
2022-02-18 19:56:35 +08:00
David Cermak
8da2e4088c esp_eth: Update esp32's EMAC API to decouple driver and vendor config 2022-02-14 16:17:29 +00:00
David Cermak
2d4cd7772e mqtt: Fix sending log data; dup flag after queue
* Fix sending mqtt message longer than Tx buffer size
* Fix enqueue API to send data with correct dup flag
* Update submodule: git log --oneline b86d42c130ac64a916ce6cf299d99f9756692394..985078affa8a2d2b56b87c8e6455252850f895c6

Detailed description of the changes:
* Isolate IDF env for v4.4 and v5.0(master)
  - See merge request espressif/esp-mqtt!111
  - ci: Isolate IDF env for v4.4 and v5.0(master) (espressif/esp-mqtt@4c5a65c)
* Client: Remove usage of legacy FreeRTOS types
  - See merge request espressif/esp-mqtt!120
  - ci: Fix build issues with IDF-4.4 against master (espressif/esp-mqtt@c28a56d)
  - See commit https://github.com/espressif/esp-mqtt/commit/6ef98d6
* mqtt_client: Fix mqtt send long data error
  - See merge request espressif/esp-mqtt!117
  - Closes https://github.com/espressif/esp-mqtt/issues/214
  - See commit https://github.com/espressif/esp-mqtt/commit/372b323
* Client: Fix use esp_mqtt_client_enqueue API to send data, data dup flag will be set 1
  - See merge request espressif/esp-mqtt!116
  - See commit https://github.com/espressif/esp-mqtt/commit/df8dc92
2022-01-20 12:58:55 +01:00
David Cermak
c9794ad08f mqtt: Add docs on MQTT_CUSTOM_OUTBOX implentation
Closes https://github.com/espressif/esp-mqtt/issues/217
2022-01-17 10:47:59 +01:00
Mahavir Jain
e7db313c63 mqtt: replace nghttp with http_parser references 2022-01-11 10:26:25 +05:30
Jakob Hasse
16514f93f0 refactor (test_utils)!: separate file for memory check functions
Memory check (leaks and heap tracing) functions for unit tests
now have a separate file now and are renamed for more consistency.

BREAKING CHANGE: renamed memory check function names which may be used
                 in unit tests outside IDF.
2021-12-08 11:06:00 +08:00
David Cermak
cd085992c6 MQTT: Fix disconnect/reconnect, Adds empty client id, ...
Updated MQTT submodule: git log --oneline 89894bd0c611b1392967fe90bb49682eba858383...b86d42c130ac64a916ce6cf299d99f9756692394
* Added support for client with empty id
* Fixed user requested disconnect to correctly send MQTT disconnection message
* Fixed reconnection request with disabled autoreconnect
* Added qos and dup flags to data events
* Added Support for suback massage payload in mqtt events

Detailed description of the changes (89894bd0c6...b86d42c130):
* Adds the possibility of client with empty id
    - See merge request esp-mqtt!114
    - esp_mqtt commit 09287a1156
    - esp_mqtt commit 1fd50dd2cb
    - Related IDF-4124
* Client: Disconnect/Reconnect improvements
    - See merge request esp-mqtt!113
    - esp_mqtt commit 3f05b1aedc
    - esp_mqtt commit 86e40f8615
    - Related https://github.com/espressif/esp-mqtt/issues/206
    - Related https://github.com/espressif/esp-mqtt/issues/208
* Events: Support qos/dup flags and suback payload in mqtt events (GitHub PR)
    - See merge request esp-mqtt!112
    - esp_mqtt commit de47f1c341
    - esp_mqtt commit e1d5a9402f
    - Related https://github.com/espressif/esp-mqtt/issues/200
    - Related https://github.com/espressif/esp-mqtt/pull/203
2021-11-26 13:57:32 +01:00
David Cermak
3b0dcf8901 MQTT: Add more tests 2021-11-26 13:34:56 +01:00
David Cermak
acf0caa04a MQTT: Add more unit tests with actual broker 2021-11-26 11:45:32 +01:00
Darian Leung
9b3796d2f1 freertos: Add portTRY_ENTRY_CRITICAL() and deprecate legacy spinlock fucntions
Add TRY_ENTRY_CRITICAL() API to all for timeouts when entering critical sections.
The following port API were added:
- portTRY_ENTER_CRITICAL()
- portTRY_ENTER_CRITICAL_ISR()
- portTRY_ENTER_CRITICAL_SAFE()

Deprecated legacy spinlock API in favor of spinlock.h. The following API were deprecated:
- vPortCPUInitializeMutex()
- vPortCPUAcquireMutex()
- vPortCPUAcquireMutexTimeout()
- vPortCPUReleaseMutex()

Other Changes:
- Added portMUX_INITIALIZE() to replace vPortCPUInitializeMutex()
- The assembly of the critical section functions ends up being about 50 instructions longer,
  thus the spinlock test pass threshold had to be increased to account for the extra runtime.

Closes https://github.com/espressif/esp-idf/issues/5301
2021-11-22 13:28:39 +08:00
Roland Dobai
766aa57084 Build & config: Remove leftover files from the unsupported "make" build system 2021-11-11 15:32:36 +01:00
Sudeep Mohanty
4846222102 freertos: update freertos folder structure to match upstream
The following changes have been made:
1. All FreeRTOS kernel source files are now placed in the
   freertos/FreeRTOS-Kernel folder to match with the upstream folder structure.
2. All kernel include files are now placed in freertos/FreeRTOS-Kernel/include.
3. All port files are now placed in freertos/FreeRTOS-Kernel/portable.
4. All additions/customizations are placed in freertos/esp_additions.
5. All other miscellaneous files (README, License files etc.) are moved to
   freertos/FreeRTOS-Kernel folder to match with the upstream.
6. Updated esp-cryptoauthlib to latest commit to resolve FreeRTOS
   include dependencies.

Signed-off-by: Sudeep Mohanty <sudeep.mohanty@espressif.com>
2021-10-29 12:05:13 +08:00
David Cermak
5b0b0d36ff MQTT: Fix build if CONFIG_WS_TRANSPORT is not set and client cleanups
Updated MQTT submodule: git log --oneline f10321a53b53a146ee299cfecc320b89c0cf6611...89894bd0c611b1392967fe90bb49682eba858383
* Fix build issue if cert bundle disabled
* Fix build issue if ws transport disabled
* Add config to set retransmission interval

Detailed description of the changes (f10321a53b...89894bd0c6):
* Added config option to configure custom retransmission interval
    - See merge request espressif/esp-mqtt!110
    - esp_mqtt commit 1b009c840b
    - Related https://github.com/espressif/esp-mqtt/pull/199
* Configuration conflicts were verified, logged but not reported to the user.
    - See merge request espressif/esp-mqtt!102
    - esp_mqtt commit 88f4b8ed50
* Fixed build issue if cert bundle disabled
    - See merge request espressif/esp-mqtt!109
    - esp_mqtt commit 4a89bff610
    - esp_mqtt commit 1b71980575
    - esp_mqtt commit 5b3c81ee48
    - Related https://github.com/espressif/esp-mqtt/pull/198
    - Related https://github.com/espressif/esp-idf/issues/7535
* Removes unnecessary outbox_cleanup
    - This function were used on old version to handle QoS 2 messages. It's no longer necessary in current implementation.
    - See merge request espressif/esp-mqtt!108
    - esp_mqtt commit ebef896b00
* Fixed return an error when fail to enqueue
    - The functions that enqueue messages didn't had a return for the handler, with this the error was only logged instead of returned whichmay cause the user to have an ID for a message that was not published.
    - See merge request espressif/esp-mqtt!103
    - esp_mqtt commit 7471177fe7
* CI: Use qemu image based on esp-env:v4.4-1
    - Replaced the temporary qemu image with the official qemu:v4.4-1-20210517 derived from the esp-env:v4.4-1 test environment
    - See merge request espressif/esp-mqtt!107
    - esp_mqtt commit 231b274962

Closes https://github.com/espressif/esp-idf/issues/7535
2021-09-22 13:28:50 +02:00
Zim Kalinowski
701c4fb2e3 upgrade freertos version and history 2021-09-02 11:02:34 +08:00
Euripedes Rocha Filho
f6d23bfee1 mqtt: Adds host tests for mqtt client 2021-06-30 08:55:39 +01:00
David Cermak
4f637e886f MQTT: Support for certificate bundle; Client clean-up
* Closes https://github.com/espressif/esp-idf/issues/7040
* Merges https://github.com/espressif/esp-idf/pull/7041
* Update submodule: git log --oneline 9fdf7b61385633075d5c3b84803f2dd0578d7869..f10321a53b53a146ee299cfecc320b89c0cf6611

Detailed description of the changes:
* Remove unnecessary parentheses
  - esp-mqtt commit: db13533904
  - esp-mqtt MR: espressif/esp-mqtt!101
* outbox: Cleanup all items when connection closes
  - esp-mqtt commit: 1a94efe8b9
  - esp-mqtt MR: espressif/esp-mqtt!104
* Outbox: Removes unnecessary calls to outbox_set_pending
  - esp-mqtt commit: 36a3990404
  - esp-mqtt MR: espressif/esp-mqtt!105
* MQTT: Makes abort connection function void.
  - esp-mqtt commit: 67553aba45
  - esp-mqtt MR: espressif/esp-mqtt!106
* Client: Removes unused defines
  - esp-mqtt commit: eec6f0e17d
  - esp-mqtt MR: espressif/esp-mqtt!100
  - Closes https://github.com/espressif/esp-mqtt/issues/194
* Config: Added support for certificate bundle
  - esp-mqtt commit: 06157be118
  - esp-mqtt MR: espressif/esp-mqtt!98
  - Closes https://github.com/espressif/esp-mqtt/issues/190
* Config: Adds missing field at config struct (path field)
  - esp-mqtt commit: 5b27d1896e
  - esp-mqtt MR: espressif/esp-mqtt!96
* Client: Add support for partial transport writes
  - esp-mqtt commit: d8c9c7a9e7
  - esp-mqtt MR: espressif/esp-mqtt!99
  - Partially addresses https://github.com/espressif/esp-idf/issues/6940
* Client: Add support for Retain flag in messages posted by events
  - esp-mqtt commit: a00a3134c6
  - esp-mqtt MR: espressif/esp-mqtt!99
  - Closes https://github.com/espressif/esp-mqtt/issues/193
* esp-mqtt: Added nullchecks for public APIs
  - esp-mqtt commit: 2f57985c0b
  - esp-mqtt MR: espressif/esp-mqtt!94
  - Closes https://github.com/espressif/esp-mqtt/issues/185
* esp-mqtt: Reduce the includes used in all files
  - esp-mqtt commit: 87fcce72c9
  - esp-mqtt MR: espressif/esp-mqtt!93
* mqtt_outbox: Use STAILQ_FOREACH for outbox_delete_single_expired
  - esp-mqtt commit: ff8e64839a
  - esp-mqtt MR: espressif/esp-mqtt!97
  - Merges https://github.com/espressif/esp-mqtt/pull/187
* Client: Add optimize for depend on ssl
  - esp-mqtt commit: 8f3cac8c36
  - esp-mqtt MR: espressif/esp-mqtt!95
2021-06-25 03:28:46 +08:00
liuhan
8b02c9026a transport: Add CONFI_WS_TRANSPORT for optimize the code size 2021-06-22 10:51:04 +08:00
David Cermak
badcbe0fcb mqtt: Moved weekend tests to test apps 2021-06-10 09:09:14 +02:00
Angus Gratton
74fa52668c esp-mqtt: Remove __FILE__ macro from error logs 2021-03-03 10:26:57 +11:00
Fu Hanxi
0146f258d7 style: format python files with isort and double-quote-string-fixer 2021-01-26 10:49:01 +08:00
David Cermak
5472deec6e ci: Add MQTT publish test to standard test apps 2021-01-05 12:04:36 +00:00
David Cermak
9740db5004 ci: Extend the MQTT weekend test to check mqtt-enqueue api 2021-01-05 12:04:36 +00:00
David Cermak
9185f8f42c MQTT: Add new config modes (outbox related, incremental id) 2021-01-05 12:04:36 +00:00
David Cermak
4291ffa753 MQTT: Update submodule reference to support new config modes
* Queueing publish messages to outbox when the client is not connected (default=off -> messages are queued if disconnected)
* Use of incremental msg-id instead of random id (default=off -> msg-id uses platform_random())
* Posting a new event-id if a queued message gets deleted from the outbox (default=off -> events are not posted)

Detailed description of included `esp-mqtt` changes
(da850b0add1e71b3659bfac5d797cc834dc3e89b...9ea804e0ab5368d5ab53ae2301a5fec9d1f12f1a)
* mqtt: Remove unused mqtt_header_state_t
  - esp-mqtt commit: b7158a4aea
  - esp-mqtt MR: espressif/esp-mqtt!84
  - Merges https://github.com/espressif/esp-mqtt/pull/180
* Cleanup public include dirs
  - esp-mqtt commit: f65d5d05db
  - esp-mqtt MR: espressif/esp-mqtt!85
* Config: Add a new option to use incremental message id
  - esp-mqtt commit: 8bb4a26f46
  - esp-mqtt MR: espressif/esp-mqtt!85
  - Closes https://github.com/espressif/esp-mqtt/issues/176
* Publish: Add new API to enqueue qos>0 messages
  - esp-mqtt commit: dc7fd5c0b1
  - esp-mqtt MR: espressif/esp-mqtt!85
  - Closes https://github.com/espressif/esp-mqtt/issues/155
* Config: Add a new option to disable publishing when disconnected
  - esp-mqtt commit: f44dcb1c26
  - esp-mqtt MR: espressif/esp-mqtt!85
  - Related https://github.com/espressif/esp-mqtt/issues/177
* Events: Add new event to report deleted messages from outbox
  - esp-mqtt commit: 2e35d4d4d5
  - esp-mqtt MR: espressif/esp-mqtt!85
* Publish: Allow for qos=0 messages to be stored using esp_mqtt_client_enqueue()
  - esp-mqtt commit: e2de0f3e3e
  - esp-mqtt MR: espressif/esp-mqtt!85
2021-01-05 12:04:36 +00:00