arendst / Tasmota

Alternative firmware for ESP8266 and ESP32 based devices with easy configuration using webUI, OTA updates, automation using timers or rules, expandability and entirely local control over MQTT, HTTP, Serial or KNX. Full documentation at
https://tasmota.github.io/docs
GNU General Public License v3.0
21.97k stars 4.77k forks source link

Bear SSL Compile Error on ESP32 (env. webcam) #10897

Closed FotoFieber closed 3 years ago

FotoFieber commented 3 years ago

PROBLEM DESCRIPTION

Target ESP32-webcam doesn't compile when USE_MQTT_TLS is defined.

REQUESTED INFORMATION

Make sure your have performed every step and checked the applicable boxes before submitting your issue. Thank you!

- [ ] If using rules, provide the output of this command: `Backlog Rule1; Rule2; Rule3`:
```lua
  Rules output here:
- [ ] Set `weblog` to 4 and then, when you experience your issue, provide the output of the Console log:
```lua
  Console output here:

TO REPRODUCE

Steps to reproduce the behavior:

  1. Enable TLS for MQTT according to https://tasmota.github.io/docs/TLS/

  2. Enable target tasmota32-webcam.

  3. Build tasmota32-webcam.

EXPECTED BEHAVIOUR

Compile a binary.

SCREENSHOTS

` C:/Users/mm/Documents/PlatformIO/Tasmota-development-esp32/tasmota/tasmota.ino:45:25: fatal error: t_bearssl.h: No such file or directory


ADDITIONAL CONTEXT

Compilation is then aborted.

(Please, remember to close the issue when the problem has been addressed)

sfromis commented 3 years ago

As the docs already tell, the standard build setup does not allow adding stuff to the tasmota32-xxxxxx environments, only to the base "tasmota32". Also, as webcam is already a very heavy task for ESP32, adding the also rather heavy TLS would not be a good mix.

FotoFieber commented 3 years ago

I followed the docs for the MQTT TLS setup and added

define USE_MQTT_TLS

to user_config_override.h

I didn't add stuff to tasmota32-xxxxxx environments.

sfromis commented 3 years ago

You do. tasmota32-webcam is one of the tasmota-xxxxxx environments.

FotoFieber commented 3 years ago

I did no modification to tasmota32-webcam.

I edited platformio_tasmota32.ini according to the description in the file:

; ***              BETA ESP32 Tasmota version                 ***
; ***  expect the unexpected. Some features not working!!!    ***

[platformio]

; *** Tasmota build variant selection
default_envs                =  ${build_envs.default_envs}
; *** **Uncomment by deleting** ";" in the line(s) below to select version(s)
;               tasmota32
                tasmota32-webcam
FotoFieber commented 3 years ago

Patched platformio_tasmota_env32.ini and it is compiling now.

[env:tasmota32-webcam] extends = env:tasmota32 board = esp32cam board_build.f_cpu = 240000000L build_flags = ${common32.build_flags} -DFIRMWARE_WEBCAM lib_extra_dirs = lib/libesp32, lib/lib_basic, lib/lib_ssl

sfromis commented 3 years ago

Yes you did. Enabling TLS will affect all builds you do thereafter, and you specifically selected tasmota32-webcam. "Add stuff to" does not mean changing the definition of tasmota32-webcam, only doing changes leading to that target being amended.

sfromis commented 3 years ago

What I mean is that what you experienced is working as designed, not an issue. While it is not impossible to go outside the standard build setup, webcam and TLS is still a bad combo for the small processor.

FotoFieber commented 3 years ago

Maybe we can add a warning message when the USE_MQTT_TLS is enabled on an esp32_webcam and let the user decide, if he wants to use it or not?

I will test the stability of this setup. Space doesn't seem to be a problem:

RAM:   [==        ]  22.2% (used 72736 bytes from 327680 bytes)
Flash: [=======   ]  67.5% (used 1370597 bytes from 2031616 bytes)

Using Tasmota without encryption is in my opinion a really bad practice unless you have a complete separate network. I have TLS enabled for MQTT on all my Tasmota devices. (And Web disabled.)

ascillato2 commented 3 years ago

Closing this issue as it has been answered.


Support Information

See Docs for more information. See Chat for more user experience. See Code of Conduct