mag1024 / esphome-nat-ap Goto Github PK
View Code? Open in Web Editor NEWAn ESPHome custom component that implements a WIFI repeater (NAT-ing AP)
An ESPHome custom component that implements a WIFI repeater (NAT-ing AP)
Hey, thanks for this!
I'm playing around with a esp32-c6 which requires the esp-idf 5.1 which has a lot of breaking changes, particularily with dhcps_set_option_info. I thought I would pick your brain to see if you had any ideas how I could adapt this to work with 5.1.
Error:
In file included from src/main.cpp:17:
src/nat-ap.h: In function 'void ap_config(esp_netif_t*)':
src/nat-ap.h:66:33: error: invalid use of incomplete type 'esp_netif_t' {aka 'struct esp_netif_obj'}
66 | dhcps_set_option_info(ap_netif->dhcps, 6, &dhcps_dns_value, sizeof(dhcps_dns_value));
| ^~
In file included from /data/cache/platformio/packages/framework-espidf/components/esp_netif/include/esp_netif.h:13,
from /data/cache/platformio/packages/framework-espidf/components/esp_wifi/include/esp_wifi_default.h:10,
from /data/cache/platformio/packages/framework-espidf/components/esp_wifi/include/esp_wifi.h:58,
from src/nat-ap.h:6:
/data/cache/platformio/packages/framework-espidf/components/esp_netif/include/esp_netif_types.h:47:8: note: forward declaration of 'esp_netif_t' {aka 'struct esp_netif_obj'}
47 | struct esp_netif_obj;
| ^~~~~~~~~~~~~
src/nat-ap.h:69:31: error: invalid use of incomplete type 'esp_netif_t' {aka 'struct esp_netif_obj'}
69 | dhcps_dns_setserver(ap_netif->dhcps, &dnsserver);
| ^~
/data/cache/platformio/packages/framework-espidf/components/esp_netif/include/esp_netif_types.h:47:8: note: forward declaration of 'esp_netif_t' {aka 'struct esp_netif_obj'}
47 | struct esp_netif_obj;
| ^~~~~~~~~~~~~
My setup:
esphome:
name: esp32-c6-a
friendly_name: esp32-c6-a
includes:
- nat-ap.h
esp32:
board: esp32-c6-devkitc-1
variant: esp32c6
framework:
type: esp-idf
version: 5.1.0
platform_version: https://github.com/stintel/platform-espressif32#esp32-c6-test
sdkconfig_options:
CONFIG_COMPILER_OPTIMIZATION_SIZE: y
CONFIG_LWIP_IP_FORWARD: y
CONFIG_LWIP_IPV4_NAPT: y
I think this is how they want us to use it now: https://docs.espressif.com/projects/esp-faq/en/latest/software-framework/wifi.html#lwip-how-to-configure-the-option-contents-of-dhcp-server-in-esp-idf but I couldn't get it to work.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.