Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ESP-IDF web_server and captive_portal port (uses ESPAsyncWebServer and AsyncTCP) #1649

Closed
grischard opened this issue Feb 22, 2022 · 17 comments

Comments

@grischard
Copy link

grischard commented Feb 22, 2022

Describe the problem you have/What new integration you would like

Implement web_server and captive_portal to the ESP-IDF framework

Please describe your use case for this integration and alternatives you've tried:

The web_server and captive_portal features depend on ESPAsyncWebServer and AsyncTCP, which are arduino libraries not yet ported to the ESP-IDF framework.

Additional context

This is a follow-up from #1414

See also #1650 for mqtt.

@ThisIsTheOnlyUsernameAvailable

This feature would be greatly appreciated. I use web_server as an important component when bulk-flashing devices.

@codersaur
Copy link

+1. I would like to use web_server with ESP-IDF.

@the-smart-home-maker
Copy link

+1 I also really miss the web_server component with the ESP-IDF framework

@Malle355
Copy link

+1 Also would appreciate this one.

@marshn
Copy link

marshn commented Oct 17, 2022

Web server for ESP-IDF is provided by PR 3500, esphome/esphome#3500

For about six months I have had this in my esphome yaml files, and the webserver work fine on ESP-IDF:

external_components:
  - source: github://pr#3500
    components:
      # list all components modified by this Pull Request here
      - web_server
      - web_server_idf
      - web_server_base
      - captive_portal

No idea when it will be incorporated into a release unfortunately. It doesn't seem to be a priority at the moment.

@the-smart-home-maker
Copy link

the-smart-home-maker commented Oct 19, 2022

Sounds promising! Will try that out. Thank you!

@bkbartk
Copy link

bkbartk commented Jan 29, 2023

This solution worked for me up until today.
now I get

Compiling /data/trapkast-light/.pioenvs/trapkast-light/src/esphome/components/web_server_idf/web_server_idf_ota.o
src/esphome/components/web_server/web_server.cpp: In lambda function:
src/esphome/components/web_server/web_server.cpp:107:40: error: 'class esphome::Application' has no member named 'get_friendly_name'
                    root["title"] = App.get_friendly_name().empty() ? App.get_name() : App.get_friendly_name();
                                        ^~~~~~~~~~~~~~~~~
src/esphome/components/web_server/web_server.cpp:107:91: error: 'class esphome::Application' has no member named 'get_friendly_name'
                    root["title"] = App.get_friendly_name().empty() ? App.get_name() : App.get_friendly_name();
                                                                                           ^~~~~~~~~~~~~~~~~
src/esphome/components/web_server/web_server.cpp:108:42: error: 'class esphome::Application' has no member named 'get_comment'; did you mean 'get_name'?
                    root["comment"] = App.get_comment();
                                          ^~~~~~~~~~~
                                          get_name
Compiling /data/trapkast-light/.pioenvs/trapkast-light/src/esphome/components/wifi/wifi_component.o
Compiling /data/trapkast-light/.pioenvs/trapkast-light/src/esphome/components/wifi/wifi_component_esp32_arduino.o
*** [/data/trapkast-light/.pioenvs/trapkast-light/src/esphome/components/web_server/web_server.o] Error 1
========================= [FAILED] Took 154.92 seconds =========================

esphome 2022.12.8
I guess some methods have been changed or renamed.

Is there another solution to get this to work?

@nagyrobi
Copy link
Member

Same for me

@grischard
Copy link
Author

See the comments on esphome/esphome#3500 for a temporary fix. Please help keep the signal/noise ratio high.

@hlyi
Copy link

hlyi commented Feb 7, 2023

+1 would appreciate integrating this PR for next release.

@EMP83
Copy link

EMP83 commented Feb 25, 2023

`external_components:

  • source: github://pr#3500
    components:
    • web_server
    • web_server_idf
    • web_server_base
    • captive_portal`

Whith last esphome update i get this errors:

`INFO Reading configuration /config/esphome/refrigerateur.yaml...
ERROR Unexpected exception while reading configuration:
Traceback (most recent call last):

File "/usr/local/bin/esphome", line 33, in
sys.exit(load_entry_point('esphome', 'console_scripts', 'esphome')())

File "/esphome/esphome/main.py", line 963, in main
return run_esphome(sys.argv)

File "/esphome/esphome/main.py", line 941, in run_esphome
config = read_config(dict(args.substitution) if args.substitution else {})

File "/esphome/esphome/config.py", line 986, in read_config
res = load_config(command_line_substitutions)

File "/esphome/esphome/config.py", line 840, in load_config
return _load_config(command_line_substitutions)

File "/esphome/esphome/config.py", line 828, in _load_config
result = validate_config(config, command_line_substitutions)

File "/esphome/esphome/config.py", line 756, in validate_config
result.run_validation_steps()

File "/esphome/esphome/config.py", line 125, in run_validation_steps
task.step.run(self)

File "/esphome/esphome/config.py", line 308, in run
for load in component.auto_load:

TypeError: 'function' object is not iterable`

@nagyrobi
Copy link
Member

Same here

@grischard
Copy link
Author

grischard commented Jul 20, 2023

Fixed in esphome/esphome@7a55108 and released in 2023.7.0. Thank you @dentra for your heroic efforts, and @jesserockz for helping get it over the finish line!

@grischard
Copy link
Author

See also the project board for "The road to ESP-IDF for any component": https://github.com/orgs/esphome/projects/5

@Tietziano90
Copy link

Hi all,

I came across this thread and i am having problems implementing the http request.
I am using the seeed_ciao_esp32c3 board and framework: type esp-idf.

Can someone post a esphome code using this component and sending a post?

My error /config/esphome/windturbine-esp.yaml:52:7: error: 'http_request' was not declared in this scope

`external_components:

  • source: github://pr#3500
    components:
    • web_server
    • web_server_idf
    • web_server_base
    • captive_portal

# I2C setup
i2c:
  sda: 6
  scl: 7
  frequency: 100kHz

script:
  - id: send_json
    then:
      - lambda: |-
          http_request.post:
              url: http://192.168.1.5:8081/windturbine
              verify_ssl: false
              json: |-
                root["key"] = "halkhdaih";
                root["greeting"] = "Hello World";`

I really appreciate any help to find a solution

@bkbartk
Copy link

bkbartk commented Oct 24, 2023

no solution,
but I think your are looking for this
esphome/issues#3426

@Tietziano90
Copy link

Thank you for your response.

I guess no solution at all or can it be done? Unfortunately I am not so experienced with esphome etc.

Would that be a fix? Any solution to just send 5 values will help me a lot

esphome:
name: ${device_name}
comment: ${device_description}
platformio_options:
platform_packages:
- framework-arduinoespressif32 @ https://github.com/tasmota/arduino-esp32/releases/download/2.0.5/framework-arduinoespressif32-solo1.zip
board_build.f_cpu: 160000000L
project:
name: "${project_name}"
version: "${project_version}"

esp32:
board: esp32doit-devkit-v1
variant: esp32
framework:
type: arduino
version: 2.0.5
platform_version: 5.2.0

@github-actions github-actions bot locked and limited conversation to collaborators Feb 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests