Giter VIP home page Giter VIP logo

esp32_nat_router's Introduction

ESP32 NAT Router with WPA2 Enterprise support

This is a firmware to use the ESP32 as WiFi NAT router. It can be used as

  • Simple range extender for an existing WiFi network
  • Setting up an additional WiFi network with different SSID/password for guests or IOT devices
  • Convert a corporate (WPA2-Enterprise) network to a regular network, for simple devices.

It can achieve a bandwidth of more than 15mbps.

The code is based on the Console Component and the esp-idf-nat-example.

Performance

All tests used IPv4 and the TCP protocol.

Board Tools Optimization CPU Frequency Throughput Power
ESP32D0WDQ6 iperf3 0g 240MHz 16.0 MBits/s 1.6 W
ESP32D0WDQ6 iperf3 0s 240MHz 10.0 MBits/s 1.8 W
ESP32D0WDQ6 iperf3 0g 160MHz 15.2 MBits/s 1.4 W
ESP32D0WDQ6 iperf3 0s 160MHz 14.1 MBits/s 1.5 W

First Boot

After first boot the ESP32 NAT Router will offer a WiFi network with an open AP and the ssid "ESP32_NAT_Router". Configuration can either be done via a simple web interface or via the serial console.

Web Config Interface

The web interface allows for the configuration of all parameters. Connect you PC or smartphone to the WiFi SSID "ESP32_NAT_Router" and point your browser to "http://192.168.4.1". This page should appear:

First enter the appropriate values for the uplink WiFi network, the "STA Settings". Leave password blank for open networks. Click "Connect". The ESP32 reboots and will connect to your WiFi router.

Now you can reconnect and reload the page and change the "Soft AP Settings". Click "Set" and again the ESP32 reboots. Now it is ready for forwarding traffic over the newly configured Soft AP. Be aware that these changes also affect the config interface, i.e. to do further configuration, connect to the ESP32 through one of the newly configured WiFi networks.

If you want to enter a '+' in the web interface you have to use HTTP-style hex encoding like "Mine%2bYours". This will result in a string "Mine+Yours". With this hex encoding you can enter any byte value you like, except for 0 (for C-internal reasons).

It you want to disable the web interface (e.g. for security reasons), go to the CLI and enter:

nvs_namespace esp32_nat
nvs_set lock str -v 1

After restart, no webserver is started any more. You can only re-enable it with:

nvs_namespace esp32_nat
nvs_set lock str -v 0

If you made a mistake and have lost all contact with the ESP you can still use the serial console to reconfigure it. All parameter settings are stored in NVS (non volatile storage), which is not erased by simple re-flashing the binaries. If you want to wipe it out, use "esptool.py -p /dev/ttyUSB0 erase_flash".

Access devices behind the router

If you want to access a device behind the esp32 NAT router? PC -> local router -> esp32NAT -> server

Lets say "server" is exposing a webserver on port 80 and you want to access that from your PC.
For that you need to configure a portmap (e.g. by connecting via the arduino IDE uart monitor through USB)

portmap add TCP 8080 192.168.4.2 80
                                 ↑ port of the webserver
                            ↑ server's ip in esp32NAT network
                  ↑ exposed port in the local router's network

Assuming the esp32NAT's ip address in your local router is 192.168.0.57 you can acces the server by typing 192.168.0.57:8080 into your browser now.

Interpreting the on board LED

If the ESP32 is connected to the upstream AP then the on board LED should be on, otherwise off. If there are devices connected to the ESP32 then the on board LED will keep blinking as many times as the number of devices connected.

For example:

One device connected to the ESP32, and the ESP32 is connected to upstream:

*****.*****

Two devices are connected to the ESP32, but the ESP32 is not connected to upstream:

....*.*....

Command Line Interface

For configuration you have to use a serial console (Putty or GtkTerm with 115200 bps). Use the "set_sta" and the "set_ap" command to configure the WiFi settings. Changes are stored persistently in NVS and are applied after next restart. Use "show" to display the current config. The NVS namespace for the parameters is "esp32_nat"

Enter the help command get a full list of all available commands:

help 
  Print the list of registered commands

free 
  Get the current size of free heap memory

heap 
  Get minimum size of free heap memory that was available during program execu
  tion

version 
  Get version of chip and SDK

restart 
  Software reset of the chip

deep_sleep  [-t <t>] [--io=<n>] [--io_level=<0|1>]
  Enter deep sleep mode. Two wakeup modes are supported: timer and GPIO. If no
  wakeup option is specified, will sleep indefinitely.
  -t, --time=<t>  Wake up time, ms
      --io=<n>  If specified, wakeup using GPIO with given number
  --io_level=<0|1>  GPIO level to trigger wakeup

light_sleep  [-t <t>] [--io=<n>]... [--io_level=<0|1>]...
  Enter light sleep mode. Two wakeup modes are supported: timer and GPIO. Mult
  iple GPIO pins can be specified using pairs of 'io' and 'io_level' arguments
  . Will also wake up on UART input.
  -t, --time=<t>  Wake up time, ms
      --io=<n>  If specified, wakeup using GPIO with given number
  --io_level=<0|1>  GPIO level to trigger wakeup

tasks 
  Get information about running tasks

nvs_set  <key> <type> -v <value>
  Set key-value pair in selected namespace.
Examples:
 nvs_set VarName i32 -v 
  123 
 nvs_set VarName str -v YourString 
 nvs_set VarName blob -v 0123456789abcdef 
         <key>  key of the value to be set
        <type>  type can be: i8, u8, i16, u16 i32, u32 i64, u64, str, blob
  -v, --value=<value>  value to be stored

nvs_get  <key> <type>
  Get key-value pair from selected namespace. 
Example: nvs_get VarName i32
         <key>  key of the value to be read
        <type>  type can be: i8, u8, i16, u16 i32, u32 i64, u64, str, blob

nvs_erase  <key>
  Erase key-value pair from current namespace
         <key>  key of the value to be erased

nvs_namespace  <namespace>
  Set current namespace
   <namespace>  namespace of the partition to be selected

nvs_list  <partition> [-n <namespace>] [-t <type>]
  List stored key-value pairs stored in NVS.Namespace and type can be specified
  to print only those key-value pairs.
  
Following command list variables stored inside 'nvs' partition, under namespace 'storage' with type uint32_t
  Example: nvs_list nvs -n storage -t u32 

   <partition>  partition name
  -n, --namespace=<namespace>  namespace name
  -t, --type=<type>  type can be: i8, u8, i16, u16 i32, u32 i64, u64, str, blob

nvs_erase_namespace  <namespace>
  Erases specified namespace
   <namespace>  namespace to be erased

set_sta  <ssid> <passwd>
  Set SSID and password of the STA interface
        <ssid>  SSID
      <passwd>  Password
  --, -u, ----username=<ent_username>  Enterprise username
  --, -a, ----anan=<ent_identity>  Enterprise identity

set_sta_static  <ip> <subnet> <gw>
  Set Static IP for the STA interface
          <ip>  IP
      <subnet>  Subnet Mask
          <gw>  Gateway Address

set_ap  <ssid> <passwd>
  Set SSID and password of the SoftAP
        <ssid>  SSID of AP
      <passwd>  Password of AP

set_ap_ip  <ip>
  Set IP for the AP interface
          <ip>  IP

portmap  [add|del] [TCP|UDP] <ext_portno> <int_ip> <int_portno>
  Add or delete a portmapping to the router
     [add|del]  add or delete portmapping
     [TCP|UDP]  TCP or UDP port
  <ext_portno>  external port number
      <int_ip>  internal IP
  <int_portno>  internal port number

show 
  Get status and config of the router

If you want to enter non-ASCII or special characters (incl. ' ') you can use HTTP-style hex encoding (e.g. "My%20AccessPoint" results in a string "My AccessPoint").

Set console output to UART or USB_SERIAL_JTAG (USB-OTG)

All newer ESP32 boards have a built in USB Serial/JTAG Controller. If the USB port is connected directly to the USB Serial/JTAG Controller, you wont be able to use the console over UART.

You can change the console output to USB_SERIAL_JTAG:

Menuconfig: Component config -> ESP System Settings -> Channel for console output -> USB Serial/JTAG Controller

Changing sdkconfig directly

CONFIG_ESP_CONSOLE_UART_DEFAULT=n
CONFIG_ESP_CONSOLE_USB_SERIAL_JTAG=y

Board comparison list

Flashing the prebuild Binaries

Get and install esptool:

cd ~
python3 -m pip install pyserial
git clone https://github.com/espressif/esptool
cd esptool
python3 setup.py install

Go to esp32_nat_router project directory and build for any kind of esp32 target.

For esp32:

esptool.py --chip esp32 \
--before default_reset --after hard_reset write_flash \
-z --flash_mode dio --flash_freq 40m --flash_size detect \
0x1000 build/esp32/bootloader.bin \
0x8000 build/esp32/partitions.bin \
0x10000 build/esp32/firmware.bin

For esp32c3:

esptool.py --chip esp32c3 \
--before default_reset --after hard_reset write_flash \
-z --flash_size detect \
0x0 build/esp32c3/bootloader.bin \
0x8000 build/esp32c3/partitions.bin \
0x10000 build/esp32c3/firmware.bin

As an alternative you might use Espressif's Flash Download Tools with the parameters given in the figure below (thanks to mahesh2000), update the filenames accordingly:

image

Note that the prebuilt binaries do not include WPA2 Enterprise support.

Building the Binaries (Method 1 - ESPIDF)

The following are the steps required to compile this project:

  1. Download and setup the ESP-IDF.

  2. In the project directory run make menuconfig (or idf.py menuconfig for cmake).

    1. *Component config -> LWIP > [x] Enable copy between Layer2 and Layer3 packets.
    2. *Component config -> LWIP > [x] Enable IP forwarding.
    3. *Component config -> LWIP > [x] Enable NAT (new/experimental).
  3. Build the project and flash it to the ESP32.

A detailed instruction on how to build, configure and flash a ESP-IDF project can also be found the official ESP-IDF guide.

Building the Binaries (Method 2 - Platformio)

The following are the steps required to compile this project:

  1. Download Visual Studio Code, and the Platform IO extension.
  2. In Platformio, install the ESP-IDF framework.
  3. Build the project and flash it to the ESP32.

DNS

As soon as the ESP32 STA has learned a DNS IP from its upstream DNS server on first connect, it passes that to newly connected clients. Before that by default the DNS-Server which is offerd to clients connecting to the ESP32 AP is set to 8.8.8.8. Replace the value of the MY_DNS_IP_ADDR with your desired DNS-Server IP address (in hex) if you want to use a different one.

Troubleshooting

Line Endings

The line endings in the Console Example are configured to match particular serial monitors. Therefore, if the following log output appears, consider using a different serial monitor (e.g. Putty for Windows or GtkTerm on Linux) or modify the example's UART configuration.

This is an example of ESP-IDF console component.
Type 'help' to get the list of commands.
Use UP/DOWN arrows to navigate through command history.
Press TAB when typing command name to auto-complete.
Your terminal application does not support escape sequences.
Line editing and history features are disabled.
On Windows, try using Putty instead.
esp32>

esp32_nat_router's People

Contributors

adam-ah avatar hougaard22 avatar iceychris avatar j-rios avatar jeremyfix avatar joba-1 avatar marci07iq avatar martin-ger avatar phucnguyentrong avatar sdp74 avatar stheid avatar wxh06 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

esp32_nat_router's Issues

ESP32 don't connect to uplink WiFi on Channels 12/13 ? / Setting ESP32 WiFi-Bandwidth 20/40MHz ?

[1]
When I use my home AP on channels 1-11, there is an uplink connection quickly, everything works fine.
If I set my home AP to channel 12 or 13 (Fritzbox, 20MHz bandwidth), no uplink connection succeeds, never.
Is there a limitation or is it default restricted to US channels (1-11) ?
(esp_wifi_set_country(WIFI_COUNTRY_xxx)
WIFI_COUNTRY_CN = 0, /**< country China, channel range [1, 14] */
WIFI_COUNTRY_JP, /**< country Japan, channel range [1, 14] */
WIFI_COUNTRY_US, /**< country USA, channel range [1, 11] */
WIFI_COUNTRY_EU, /**< country Europe, channel range [1, 13] */
WIFI_COUNTRY_MAX
WIFI_COUNTRY_POLICY_AUTO, /**< Country policy is auto, use the country info of AP

[2]
Is it possible to configure the channel bandwidth down to 20MHz for the ESP32-AP ? (Defaults to 40MHz)
That gives me more room for a optimized channel distribution (1/5/9/13).

which idf version?

hi,

i used idf 4.4, got:
WARNING: Missing submodule components/micro-ecc/micro-ecc...
Attempting 'git submodule update --init components/micro-ecc/micro-ecc' in esp-idf root directory...
error: pathspec 'components/micro-ecc/micro-ecc' did not match any file(s) known to git.
/home/tom/esp/esp-idf/make/project.mk:703: recipe for target '/home/tom/esp/esp-idf/components/micro-ecc/micro-ecc/.git' failed

which version did u use to compile?

Question/Feature Request

Hello ,
Is there any way that you can protect the setup page
Also is there any way I can configure the router using post requests from python eg

import requests as r
r.post('ip_address_here',{'setup_login_password':'1234,'static_ip':'',...}

Thanks

Failed more than 2 NAT Router.

Hi, I created 3 ESP32 NAT router and not works, just max 2.

This not works:
SmartPhone --> ESP32-NAT-03 --> ESP32-NAT-02 --> ESP32-NAT-01 --> REAL-WIFI-ROUTER --> INTERNET
Problem: SmartPhone connect to ESP32-NAT-03 but internet NOT WORKS. Just change SmartPhone to connect to ESP32-NAT-02 and everything works. If I change order between 03 and 02, so 02 not works anymore, like this: ESP32-NAT-02 --> ESP32-NAT-03 --> ESP32-NAT-01
So I think there are a limitation about more than 2 NAT nodes, is it correct?

This works fine:
SmartPhone --> ESP32-NAT-02 --> ESP32-NAT-01 --> REAL-WIFI-ROUTER --> INTERNET

Any ideia?

Thanks

Header fields are too long for server to interpret

  1. Flashed firmware
  2. Connected to ESP32_NAT_Router AP
  3. Setting STA Settings: SSID=foobar Password=[63 ASCII chars]
  4. Click connect

The I get Header fields are too long for server to interpret as response.

63 chars is the max password length for WPA2. Is it possible, that the firmware cannot handle this?

sta connection maximum SSID: 31char

  1. When set an SSID with 32 char, the sta try to connect to an SSID with first 31 entered char (last char is ignored)
  2. User interface is too small to show all the 32 char in the web server, but the complete SSID is present in that field. Console print SSID with all chars

Google DNS inaccessible in China

Thank you very much for this awesome application !
I can successfully flash and setup the ESP32 but for some reasons in can’t pen any websites.
I suspect this is because of the DNS being set to google 8.8.8.8 DNS, because google is blocked in China.
The problem is because of my total lack of experience I’m totally unable to change the bin files.

Is there a possibility to provide the bin files with another DNS please? Or even the possibility to set the DNS in the setting webpage without having to change the program and recompile everything?
thank you in advance for your consideration!

What's the maxmum client number please

For esp8266 max client numbers are 8 due to the ESP's limit. How many clients can connect simultaneously for esp32? I have lots of IoT devices need to connect to it. I just want to know if there is a limit too. Bandwidth is not a problem for these devices, but 8 client is too small for me :( Thanks.

Esp32 nat router + eth8720

Good afternoon, I am trying to implement the possibility of putting a LAN8720 in your project, I have managed to make it work with this phy, but the nat stops working and I am left without an internet connection from the AP, what do you think it can be?
It happens to me when using the function

esp_wifi_internal_reg_rxcb (ESP_IF_WIFI_STA, (wifi_rxcb_t) tcpip_adapter_sta_input_eth_output);

Portmap

I don't understand what I have to send via terminal. I have a device where I connected with 192.168.4.1 and need to map to port 2000. Could you please help me. Thanks a lot

Build failed

I was trying to build this project on Linux Mint 19 and followed all the steps in the ReadMe. The build is failing with the following message:

`idf.py build
Executing action: all (aliases: build)
Running ninja in directory /home/dhiraj/Workplace/esp32_nat_router/build
Executing "ninja all"...
[1/461] cd /home/dhiraj/Workplace/esp32_nat_router/build/esp-idf/partit...**********************************************************************"
Partition table binary generated. Contents:


ESP-IDF Partition Table

Name, Type, SubType, Offset, Size, Flags

nvs,data,nvs,0x9000,24K,
phy_init,data,phy,0xf000,4K,
factory,app,factory,0x10000,1M,
storage,data,fat,0x110000,1M,


[2/461] Performing build step for 'bootloader'
ninja: no work to do.
[12/459] Building C object esp-idf/driver/CMakeFiles/__idf_driver.dir/spi_bus_lock.c.obj
FAILED: esp-idf/driver/CMakeFiles/__idf_driver.dir/spi_bus_lock.c.obj
/home/dhiraj/.espressif/tools/xtensa-esp32-elf/esp-2020r1-8.2.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc -Iconfig -I/home/dhiraj/Workplace/esp-idf/components/driver/include -I/home/dhiraj/Workplace/esp-idf/components/driver/esp32/include -I/home/dhiraj/Workplace/esp-idf/components/driver/include/driver -I/home/dhiraj/Workplace/esp-idf/components/newlib/platform_include -I/home/dhiraj/Workplace/esp-idf/components/freertos/include -I/home/dhiraj/Workplace/esp-idf/components/freertos/xtensa/include -I/home/dhiraj/Workplace/esp-idf/components/heap/include -I/home/dhiraj/Workplace/esp-idf/components/log/include -I/home/dhiraj/Workplace/esp-idf/components/lwip/include/apps -I/home/dhiraj/Workplace/esp-idf/components/lwip/include/apps/sntp -I/home/dhiraj/Workplace/esp-idf/components/lwip/lwip/src/include -I/home/dhiraj/Workplace/esp-idf/components/lwip/port/esp32/include -I/home/dhiraj/Workplace/esp-idf/components/lwip/port/esp32/include/arch -I/home/dhiraj/Workplace/esp-idf/components/soc/src/esp32/. -I/home/dhiraj/Workplace/esp-idf/components/soc/src/esp32/include -I/home/dhiraj/Workplace/esp-idf/components/soc/include -I/home/dhiraj/Workplace/esp-idf/components/esp_rom/include -I/home/dhiraj/Workplace/esp-idf/components/esp_common/include -I/home/dhiraj/Workplace/esp-idf/components/esp_system/include -I/home/dhiraj/Workplace/esp-idf/components/xtensa/include -I/home/dhiraj/Workplace/esp-idf/components/xtensa/esp32/include -I/home/dhiraj/Workplace/esp-idf/components/esp32/include -I/home/dhiraj/Workplace/esp-idf/components/esp_ringbuf/include -I/home/dhiraj/Workplace/esp-idf/components/efuse/include -I/home/dhiraj/Workplace/esp-idf/components/efuse/esp32/include -I/home/dhiraj/Workplace/esp-idf/components/espcoredump/include -I/home/dhiraj/Workplace/esp-idf/components/esp_timer/include -I/home/dhiraj/Workplace/esp-idf/components/soc/soc/esp32/. -I/home/dhiraj/Workplace/esp-idf/components/soc/soc/esp32/include -I/home/dhiraj/Workplace/esp-idf/components/soc/soc/esp32/../include -I/home/dhiraj/Workplace/esp-idf/components/vfs/include -I/home/dhiraj/Workplace/esp-idf/components/esp_wifi/include -I/home/dhiraj/Workplace/esp-idf/components/esp_wifi/esp32/include -I/home/dhiraj/Workplace/esp-idf/components/esp_event/include -I/home/dhiraj/Workplace/esp-idf/components/esp_netif/include -I/home/dhiraj/Workplace/esp-idf/components/esp_eth/include -I/home/dhiraj/Workplace/esp-idf/components/tcpip_adapter/include -I/home/dhiraj/Workplace/esp-idf/components/app_trace/include -mlongcalls -Wno-frame-address -ffunction-sections -fdata-sections -fstrict-volatile-bitfields -Wall -Werror=all -Wno-error=unused-function -Wno-error=unused-but-set-variable -Wno-error=unused-variable -Wno-error=deprecated-declarations -Wextra -Wno-unused-parameter -Wno-sign-compare -ggdb -Og -Wno-parentheses -Wno-sizeof-pointer-memaccess -Wno-clobbered -Wno-format-overflow -Wno-stringop-truncation -Wno-misleading-indentation -Wno-cast-function-type -Wno-implicit-fallthrough -Wno-unused-const-variable -Wno-switch-unreachable -Wno-format-truncation -Wno-memset-elt-size -Wno-int-in-bool-context -std=gnu99 -Wno-old-style-declaration -D_GNU_SOURCE -DIDF_VER="v4.2-dev-1097-g2e14149bf-dirty" -DESP_PLATFORM -MD -MT esp-idf/driver/CMakeFiles/__idf_driver.dir/spi_bus_lock.c.obj -MF esp-idf/driver/CMakeFiles/__idf_driver.dir/spi_bus_lock.c.obj.d -o esp-idf/driver/CMakeFiles/__idf_driver.dir/spi_bus_lock.c.obj -c /home/dhiraj/Workplace/esp-idf/components/driver/spi_bus_lock.c
/home/dhiraj/Workplace/esp-idf/components/driver/spi_bus_lock.c: In function 'spi_bus_lock_init_main_dev':
/home/dhiraj/Workplace/esp-idf/components/driver/spi_bus_lock.c:822:41: error: implicit declaration of function 'xSemaphoreCreateBinaryStatic'; did you mean 'xSemaphoreCreateBinary'? [-Werror=implicit-function-declaration]
g_spi_lock_main_flash_dev->semphr = xSemaphoreCreateBinaryStatic(&main_flash_semphr);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
xSemaphoreCreateBinary
/home/dhiraj/Workplace/esp-idf/components/driver/spi_bus_lock.c:822:39: warning: assignment to 'SemaphoreHandle_t' {aka 'void *'} from 'int' makes pointer from integer without a cast [-Wint-conversion]
g_spi_lock_main_flash_dev->semphr = xSemaphoreCreateBinaryStatic(&main_flash_semphr);
^
cc1: some warnings being treated as errors
[21/459] Building C object esp-idf/esp32/CMakeFiles/__idf_esp32.dir/sleep_modes.c.obj
ninja: build stopped: subcommand failed.
ninja failed with exit code 1`

Any ideas as to what maybe causing this?

What version of ESP-IDF to use?

Hello, I have a question. What version if ESP-IDF should I use?

When using 4.0 I get this error:

../main/esp32_nat_router.c: In function 'initialize_console':
../main/esp32_nat_router.c:110:14: error: 'uart_config_t' {aka 'const struct <anonymous>'} has no member named 'source_clk'
             .source_clk = UART_SCLK_REF_TICK,
              ^~~~~~~~~~
../main/esp32_nat_router.c:110:27: error: 'UART_SCLK_REF_TICK' undeclared (first use in this function); did you mean 'UART_CLK_EN_M'?
             .source_clk = UART_SCLK_REF_TICK,
                           ^~~~~~~~~~~~~~~~~~
                           UART_CLK_EN_M
../main/esp32_nat_router.c:110:27: note: each undeclared identifier is reported only once for each function it appears in
ninja: build stopped: subcommand failed.
ninja failed with exit code 1

When using 3.3 I get this error:

-- Building for target esp32
-- ccache will be used for faster builds
CMake Error at .../esp32_nat_router-master/components/cmd_nvs/CMakeLists.txt:1 (idf_component_register):
  Unknown CMake command "idf_component_register".

ESP32 cannot get internet on the 3rd node.

Hello @martin-ger

We created a daisy chain with the esp32s with 3 repeaters. For some reason on the 3rd one we have no internet access at all. Why is this? How was the esp8266 able to achieve 5 nodes?

Please let us know.
I can tell you are not active on replying to issues but we would be grateful if you could. Only since you didn't open source the library so there is no way for other people to just fix the issues so the least of your concerns should be to help people.

Thanks for understanding.
Kind Regards
Sagar

i this project able to "nat" between 802.11-B and 802.11-LR (Long Range)?

hi,

i am wondering, if it is possible to do not only do "nat" between same wifi standards. would it be possible to to "nat" between wifi standard 80.2.11-B and 802.11-LR with one and the same ESP32?

so my PC can communicate with its wifi to the ESP32 via standard 802.11-B
and the ESP32 would move the network packets from the PC to the ESP32 sensors i have via the ESP32 propriatary wifi standard 802.11-LR, that can reach a theoretical line of sight distance of about 1km at low speed.

https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/wifi.html#lr-compatibility

Port forwarding?

I use this project for my smart lights because they can't connect to my router (It's too far). But my computer is connected via LAN and I can't get into the web interface of my lights. How can I port forwarding?

PPPoS to WiFi Nat not working

Hi,
I've built a simple application to connect my Ubuntu Laptop via PPPoS with the Esp32. The esp is connected to my Smartphone via wifi.

Pinging the esp with Ubuntu works, like Pinging the esp with Another Laptop connected to the same wifi.
But Pinging my Smartphone by Ubuntu falls.

The simple wifi Station - access point example works pretty fine with my Smartphone as Hotspot.

Is there an issue in this nat Implementation?

Feature request: oled Status

For a ESP32 Dev board with Oled and battery, it would be great to show a Status.
Like Signal strange, IP, clients and so on...

No documentation on port forwarding

Hi there.
This is a very useful tool to have and absolutely love it! I'm surprised how well this works by both your code and the ESP32. Thank you.

I have a pc in my garage which I use for 3d printing/CNC and showing electronic projects on screen ect ect

It want to be able to RDP to it via TCP:3389 but seeing its on a different network 192.168.4.xxx
Its not reachable from my WIFI LAN on 192.168.1.xxx. how can port forward from my network 192.168.1.xxx to 192.168.4.2 ?

Apology if this has been covered, I don't see any documentation.

Missing an status-indicating GPIO-LED

At first I've tested your ESP8266-nat-router, it works ... But unfortunately it was much too slow for my Smart TV. Also the connection to AP (Fritzbox) after Powerup/Reset did not always work. (I admit: The signal strength is low at RSSI: -80)
With the ESP32-software here it works now much more reliably and fast enough at exact the same position and orientation of the ESP-Antenna.
What I'am missing compared to the ESP8266-Version is a LED-Output (maybe GPIO2) to indicate
"No AP connect"/"AP connect"/"AP connect with traffic".
Maybe you will find some time to integrate that later.
Regards.

Failed building with idf.py tool

i tried to build the binary,but it s failing here
/main/http_server.c:24:10: fatal error: esp32_nat_router.h: No such file or directory
#include "esp32_nat_router.h"

build failed

I Setup ESP-IDF and try to build...

../main/esp32_nat_router.c:110:27: error: 'UART_SCLK_REF_TICK' undeclared (first
use in this function); did you mean 'UART_CLK_EN_M'?
.source_clk = UART_SCLK_REF_TICK,
^~~~~~~~~~~~~~~~~~
UART_CLK_EN_M
../main/esp32_nat_router.c:110:27: note: each undeclared identifier is reported
only once for each function it appears in
[819/827] Building C object esp-idf/cm.../__idf_cmd_system.dir/cmd_system.c.obj
FAILED: esp-idf/cmd_system/CMakeFiles/__idf_cmd_system.dir/cmd_system.c.obj
C:\Users\Joerg.espressif.espressif\tools\xtensa-esp32-elf\esp-2019r2-8.2.0\xte
nsa-esp32-elf\bin\xtensa-esp32-elf-gcc.exe -Iconfig -I../components/cmd_system
-IC:/Users/Joerg/Desktop/esp-idf/components/newlib/platform_include -IC:/Users/J
oerg/Desktop/esp-idf/components/freertos/include -IC:/Users/Joerg/Desktop/esp-id
f/components/heap/include -IC:/Users/Joerg/Desktop/esp-idf/components/log/includ
e -IC:/Users/Joerg/Desktop/esp-idf/components/soc/esp32/include -IC:/Users/Joerg
/Desktop/esp-idf/components/soc/include -IC:/Users/Joerg/Desktop/esp-idf/compone
nts/esp_rom/include -IC:/Users/Joerg/Desktop/esp-idf/components/esp_common/inclu
de -IC:/Users/Joerg/Desktop/esp-idf/components/xtensa/include -IC:/Users/Joerg/D
esktop/esp-idf/components/xtensa/esp32/include -IC:/Users/Joerg/Desktop/esp-idf/
components/esp32/include -IC:/Users/Joerg/Desktop/esp-idf/components/driver/incl
ude -IC:/Users/Joerg/Desktop/esp-idf/components/esp_ringbuf/include -IC:/Users/J
oerg/Desktop/esp-idf/components/esp_event/include -IC:/Users/Joerg/Desktop/esp-i
df/components/tcpip_adapter/include -IC:/Users/Joerg/Desktop/esp-idf/components/
lwip/include/apps -IC:/Users/Joerg/Desktop/esp-idf/components/lwip/include/apps/
sntp -IC:/Users/Joerg/Desktop/esp-idf/components/lwip/lwip/src/include -IC:/User
s/Joerg/Desktop/esp-idf/components/lwip/port/esp32/include -IC:/Users/Joerg/Desk
top/esp-idf/components/lwip/port/esp32/include/arch -IC:/Users/Joerg/Desktop/esp
-idf/components/vfs/include -IC:/Users/Joerg/Desktop/esp-idf/components/esp_wifi
/include -IC:/Users/Joerg/Desktop/esp-idf/components/esp_wifi/esp32/include -IC:
/Users/Joerg/Desktop/esp-idf/components/esp_eth/include -IC:/Users/Joerg/Desktop
/esp-idf/components/efuse/include -IC:/Users/Joerg/Desktop/esp-idf/components/ef
use/esp32/include -IC:/Users/Joerg/Desktop/esp-idf/components/app_trace/include
-IC:/Users/Joerg/Desktop/esp-idf/components/console -IC:/Users/Joerg/Desktop/esp
-idf/components/spi_flash/include -mlongcalls -Wno-frame-address -ffunction-se
ctions -fdata-sections -fstrict-volatile-bitfields -nostdlib -Wall -Werror=all -
Wno-error=unused-function -Wno-error=unused-but-set-variable -Wno-error=unused-v
ariable -Wno-error=deprecated-declarations -Wextra -Wno-unused-parameter -Wno-si
gn-compare -ggdb -Og -std=gnu99 -Wno-old-style-declaration -D_GNU_SOURCE -DIDF_V
ER="v4.0-dirty" -DGCC_NOT_5_2_0 -DESP_PLATFORM -MD -MT esp-idf/cmd_system/CMak
eFiles/__idf_cmd_system.dir/cmd_system.c.obj -MF esp-idf\cmd_system\CMakeFiles_
_idf_cmd_system.dir\cmd_system.c.obj.d -o esp-idf/cmd_system/CMakeFiles/__idf_cm
d_system.dir/cmd_system.c.obj -c ../components/cmd_system/cmd_system.c
../components/cmd_system/cmd_system.c: In function 'light_sleep':
../components/cmd_system/cmd_system.c:294:5: error: implicit declaration of func
tion 'uart_wait_tx_idle_polling'; did you mean 'uart_wait_tx_done'? [-Werror=imp
licit-function-declaration]
uart_wait_tx_idle_polling(CONFIG_ESP_CONSOLE_UART_NUM);
^~~~~~~~~~~~~~~~~~~~~~~~~
uart_wait_tx_done
cc1.exe: some warnings being treated as errors
ninja: build stopped: subcommand failed.
ninja failed with exit code 1

C:\Users\Joerg\Documents\GitHub\esp32_nat_router>

STA Static IP not working

The esp32 setup connects to the internet without setting a static ip.
But as soon as I set it, connection to the internet stops. It is connected to my router, yes I can access my router gateway. LAN works, but not internet.

I checked my dhcp clients, and the device "expressif" ip is not set to "192.168.0.9".
On my computer wifi, setting static ip works, but just not on the esp32 for some reason.

Did I do something wrong? I have tried both 192.168.4.1 config page, and through serial monitor console set_sta_static.

Here is the serial monitor log of me setting via set_sta_static and restart to apply changes:

Click to expand log
00:22:27.240 -> esp32> set_sta_static  192.168.0.9 255.255.255.0 192.168.0.1
00:23:12.993 -> �[0;32mI (251407) cmd_router: STA Static IP settings 192.168.0.9/255.255.255.0/192.168.0.1 stored.�[0m
00:23:12.993 -> esp32> �[0;32mI (265727) HTTPServer: Found header => Host: 192.168.4.1�[0m
00:23:29.873 -> �[0;32mI (268307) HTTPServer: Found header => Host: 192.168.4.1�[0m
00:23:33.075 -> restart
00:23:33.406 -> �[0;32mI (271857) cmd_system: Restarting�[0m
00:23:33.406 -> I (271857) wifi:state: run -> init (0)
00:23:33.452 -> I (271857) wifi:pm stop, total sleep time: 108057005 us / 268982778 us
00:23:33.452 -> 
00:23:33.452 -> I (271857) wifi:new:<1,0>, old:<1,0>, ap:<1,1>, sta:<1,0>, prof:1
00:23:33.452 -> I (271867) wifi:station: [redacted] leave, AID = 1, bss_flags is 658531, bss:0x3ffd7da4
00:23:33.452 -> I (271877) wifi:new:<1,0>, old:<1,0>, ap:<1,1>, sta:<1,0>, prof:1
00:23:33.452 -> W (271877) wifi:W (271887) wifi:hmac tx: ifx0 stop, discard
00:23:33.452 -> <ba-del>idx
00:23:33.452 -> �[0;32mI (271887) ESP32 NAT router: disconnected - retry to connect to the AP�[0m
00:23:33.452 -> �[0;32mI (271897) ESP32 NAT router: station disconnected - 0 remain�[0m
00:23:33.500 -> �[0;33mW (271907) httpd_txrx: httpd_sock_err: error in recv : 113�[0m
00:23:33.546 -> I (271997) wifi:flush txq
00:23:33.546 -> I (271997) wifi:stop sw txq
00:23:33.546 -> I (271997) wifi:lmac stop hw txq
00:23:33.546 -> ets Jun  8 2016 00:22:57
00:23:33.594 -> 
00:23:33.594 -> rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
00:23:33.594 -> configsip: 0, SPIWP:0xee
00:23:33.594 -> clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
00:23:33.594 -> mode:DIO, clock div:2
00:23:33.594 -> load:0x3fff0030,len:5356
00:23:33.594 -> boss 0 tail 12 room 4
00:23:33.594 -> load:0x40078000,len:13732
00:23:33.594 -> load:0x40080400,len:3412
00:23:33.594 -> entry 0x40080634
00:23:33.921 -> �[0;32mI (354) cpu_start: Pro cpu up.�[0m
00:23:33.921 -> �[0;32mI (355) cpu_start: Starting app cpu, entry point is 0x40081538�[0m
00:23:33.921 -> �[0;32mI (341) cpu_start: App cpu up.�[0m
00:23:33.921 -> �[0;32mI (369) cpu_start: Pro cpu start user code�[0m
00:23:33.967 -> �[0;32mI (369) cpu_start: cpu freq: 160000000�[0m
00:23:33.967 -> �[0;32mI (369) cpu_start: Application information:�[0m
00:23:33.967 -> �[0;32mI (373) cpu_start: Project name:     esp32_nat_router�[0m
00:23:33.967 -> �[0;32mI (379) cpu_start: App version:      5d490e2-dirty�[0m
00:23:33.967 -> �[0;32mI (385) cpu_start: Compile time:     Apr 13 2021 18:01:34�[0m
00:23:33.967 -> �[0;32mI (391) cpu_start: ELF file SHA256:  4d6fb183f7eaecc5...�[0m
00:23:33.967 -> �[0;32mI (397) cpu_start: ESP-IDF:          v4.4-dev-744-g1cb31e509�[0m
00:23:33.967 -> �[0;32mI (403) heap_init: Initializing. RAM available for dynamic allocation:�[0m
00:23:33.967 -> �[0;32mI (410) heap_init: At 3FFAE6E0 len 00001920 (6 KiB): DRAM�[0m
00:23:34.013 -> �[0;32mI (416) heap_init: At 3FFB8118 len 00027EE8 (159 KiB): DRAM�[0m
00:23:34.013 -> �[0;32mI (423) heap_init: At 3FFE0440 len 00003AE0 (14 KiB): D/IRAM�[0m
00:23:34.013 -> �[0;32mI (429) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM�[0m
00:23:34.013 -> �[0;32mI (435) heap_init: At 40097A00 len 00008600 (33 KiB): IRAM�[0m
00:23:34.013 -> �[0;32mI (443) spi_flash: detected chip: generic�[0m
00:23:34.013 -> �[0;32mI (446) spi_flash: flash io: dio�[0m
00:23:34.013 -> �[0;32mI (451) cpu_start: Starting scheduler on PRO CPU.�[0m
00:23:34.013 -> �[0;32mI (0) cpu_start: Starting scheduler on APP CPU.�[0m
00:23:34.060 -> �[0;32mI (538) ESP32 NAT router: Command history enabled�[0m
00:23:34.060 -> �[0;32mI (538) cmd_router: ssid [redacted]�[0m
00:23:34.060 -> �[0;32mI (538) cmd_router: passwd [redacted]�[0m
00:23:34.060 -> �[0;32mI (538) cmd_router: static_ip 192.168.0.9�[0m
00:23:34.106 -> �[0;32mI (548) cmd_router: subnet_mask 255.255.255.0�[0m
00:23:34.106 -> �[0;32mI (548) cmd_router: gateway_addr 192.168.0.1�[0m
00:23:34.106 -> �[0;32mI (558) cmd_router: ap_ssid [redacted]�[0m
00:23:34.106 -> �[0;32mI (558) cmd_router: ap_passwd [redacted]�[0m
00:23:34.106 -> I (578) wifi:wifi driver task: 3ffc79e8, prio:23, stack:3584, core=0
00:23:34.106 -> �[0;32mI (578) system_api: Base MAC address is not set�[0m
00:23:34.106 -> �[0;32mI (578) system_api: read default base MAC address from EFUSE�[0m
00:23:34.153 -> I (598) wifi:wifi firmware version: 4809a2e
00:23:34.153 -> I (598) wifi:wifi certification version: v7.0
00:23:34.153 -> I (598) wifi:config NVS flash: enabled
00:23:34.153 -> I (598) wifi:config nano formating: disabled
00:23:34.153 -> I (608) wifi:Init data frame dynamic rx buffer num: 32
00:23:34.153 -> I (608) wifi:Init management frame dynamic rx buffer num: 32
00:23:34.153 -> I (618) wifi:Init management short buffer num: 32
00:23:34.153 -> I (618) wifi:Init dynamic tx buffer num: 32
00:23:34.153 -> I (628) wifi:Init static rx buffer size: 1600
00:23:34.153 -> I (628) wifi:Init static rx buffer num: 10
00:23:34.153 -> I (628) wifi:Init dynamic rx buffer num: 32
00:23:34.200 -> �[0;32mI (638) wifi_init: rx ba win: 6�[0m
00:23:34.200 -> �[0;32mI (638) wifi_init: tcpip mbox: 32�[0m
00:23:34.200 -> �[0;32mI (648) wifi_init: udp mbox: 6�[0m
00:23:34.200 -> �[0;32mI (648) wifi_init: tcp mbox: 6�[0m
00:23:34.200 -> �[0;32mI (648) wifi_init: tcp tx win: 5744�[0m
00:23:34.200 -> �[0;32mI (658) wifi_init: tcp rx win: 5744�[0m
00:23:34.200 -> �[0;32mI (658) wifi_init: tcp mss: 1440�[0m
00:23:34.200 -> �[0;32mI (658) wifi_init: WiFi IRAM OP enabled�[0m
00:23:34.200 -> �[0;32mI (668) wifi_init: WiFi RX IRAM OP enabled�[0m
00:23:36.226 -> �[0;32mI (2678) phy_init: phy_version 4670,719f9f6,Feb 18 2021,17:07:07�[0m
00:23:36.320 -> I (2778) wifi:mode : sta ([redacted]) + softAP ([redacted])
00:23:36.320 -> I (2778) wifi:enable tsf
00:23:36.320 -> I (2778) wifi:Total power save buffer number: 16
00:23:36.320 -> I (2788) wifi:Init max length of beacon: 752/752
00:23:36.320 -> I (2788) wifi:Init max length of beacon: 752/752
00:23:36.320 -> �[0;32mI (2788) ESP32 NAT router: wifi_init_apsta finished.�[0m
00:23:36.320 -> �[0;32mI (2798) ESP32 NAT router: connect to ap SSID: [redacted] �[0m
00:23:36.367 -> I (2798) wifi:new:<1,1>, old:<1,1>, ap:<1,1>, sta:<1,0>, prof:1
00:23:36.367 -> I (2808) wifi:state: init -> auth (b0)
00:23:36.367 -> �[0;32mI (2818) gpio: GPIO[2]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0 �[0m
00:23:36.367 -> I (2818) wifi:state: auth -> assoc (0)
00:23:36.367 -> �[0;32mI (2818) ESP32 NAT router: NAT is enabled�[0m
00:23:36.367 -> I (2828) wifi:state: assoc -> run (10)
00:23:36.367 -> �[0;32mI (2828) ESP32 NAT router: Starting config web server�[0m
00:23:36.367 -> W (2838) wifi:<ba-add>idx:0 (ifx:0, [redacted]), tid:0, ssn:0, winSize:64
00:23:36.367 -> �[0;32mI (2848) HTTPServer: Starting server on port: '80'�[0m
00:23:36.414 -> �[0;32mI (2848) HTTPServer: Registering URI handlers�[0m
00:23:36.414 -> I (2858) wifi:connected with [redacted], aid = 1, channel 1, BW20, bssid = [redacted]
00:23:36.414 -> I (2868) wifi:security: [redacted], phy: bgn, rssi: -61
00:23:36.414 -> I (2878) wifi:pm start, type: 1
00:23:36.414 -> 
00:23:36.414 -> �[0;32mI (2878) esp_netif_handlers: sta ip: 192.168.0.9, mask: 255.255.255.0, gw: 192.168.0.1�[0m
00:23:36.414 -> �[0;32mI (2878
00:23:36.414 -> ESP32 NAT ROUTER
00:23:36.414 -> Type 'help' to get the list of commands.
00:23:36.462 -> Use UP/DOWN arrows to navigate through command history.
00:23:36.462 -> Press TAB when typing command name to auto-complete.
00:23:36.462 -> �[5nI (2958) wifi:AP's beacon interval = 102400 us, DTIM period = 1
00:23:36.651 -> 
00:23:36.651 -> Your terminal application does not support escape sequences.
00:23:36.651 -> Line editing and history features are disabled.
00:23:36.651 -> On Windows, try using Putty instead.
00:23:36.651 -> esp32> W (5328) wifi:<ba-del>idx
00:23:42.566 -> I (9058) wifi:new:<1,0>, old:<1,1>, ap:<1,1>, sta:<1,0>, prof:1
00:23:42.612 -> I (9058) wifi:station: [redacted] join, AID=1, bgn, 20
00:23:42.659 -> �[0;32mI (9128) ESP32 NAT router: 1. station connected�[0m
00:23:42.799 -> �[0;32mI (9288) esp_netif_lwip: DHCP server assigned IP to a station, IP is: 192.168.4.2�[0m
00:23:45.871 -> W (12318) wifi:<ba-add>idx:0 (ifx:0, [redacted]), tid:0, ssn:3, winSize:64
00:23:46.583 -> W (13068) wifi:<ba-add>idx:4 (ifx:1, [redacted]), tid:0, ssn:13, winSize:64
00:25:02.784 -> show
00:25:03.116 -> �[0;32mI (89588) cmd_router: ssid [redacted]�[0m
00:25:03.116 -> �[0;32mI (89588) cmd_router: passwd [redacted]�[0m
00:25:03.116 -> �[0;32mI (89588) cmd_router: static_ip 192.168.0.9�[0m
00:25:03.116 -> �[0;32mI (89598) cmd_router: subnet_mask 255.255.255.0�[0m
00:25:03.116 -> �[0;32mI (89608) cmd_router: gateway_addr 192.168.0.1�[0m
00:25:03.163 -> �[0;32mI (89608) cmd_router: ap_ssid [redacted]�[0m
00:25:03.163 -> �[0;32mI (89608) cmd_router: ap_passwd [redacted]�[0m
00:25:03.163 -> STA SSID: [redacted] Password: [redacted]
00:25:03.163 -> AP SSID: [redacted] Password: [redacted]
00:25:03.163 -> AP IP address: 192.168.4.1
00:25:03.163 -> Uplink AP connected
00:25:03.163 -> IP: 192.168.0.9
00:25:03.163 -> 1 Stations connected
00:25:03.163 -> esp32> 

VPN cannot be established when using esp32_nat_router

I programmed my ESP32 with the esp32_nat_router firmware and I'm pretty impressed.
When I write this post, my PC is connected to the esp32_nat_router.
Of course, the wifi signal is not very strong, but it is working. I'm wondering if there is a possibility to use an antenna with these esp32 modules.
Anyway, the problem that I bumped in now is that I cannot establish a VPN connection.
My esp32_nat_router is client for an ASUS router.
I connect my phone or my computer to esp32_nat_router wifi and I try to set a VPN. It doesn't work.
In windows 10 is saying "Verifying your sign-in info" but then I get the message "Can't connect to VPNxxx. A connection to the remote computer could not be established, so the port used for this connection was closed."
It could have anything to do also with the ASUS router?

web ui reboot button doesnt cause restart due to wrong keyword in http_server.c

Reboot button in web UI doesn't cause router reset due to http_server.c expecting 'Restart' instead of 'Reboot'

pages.h: 147 '<td><input type='submit' name='reset' value='Reboot' class='red-button'/></td>\' sets 'reset' = 'Reboot'

http_server.c: 68 'if (strcmp(buf, "reset=Restart") == 0) {' should be 'if (strcmp(buf, "reset=Reboot") == 0) {'

Fix:
set http_server.c: 68 to 'if (strcmp(buf, "reset=Reboot") == 0) {'

Header fields are too long for server to interpret

After setting my SSID and password in STA settings, click "Connect" and this strings come out on my screen.
I guess it's because my SSID contains Chinese characters, do I need to change my WiFi's name? I will try later, if it works, I will comments below.
Also the board I used for this firmware is ESP32 CAM, I don't know whether it is compatible for this.

WT32-ETH01 Support?

Good afternoon, can you make a NAT Router from the WT32-ETH01 board using your firmware?
wt32-eth01

Feature request - second (alternative) STA Settings (uplink WiFi network)

Feature request - Wouldn't it be nice to preselect 2 settings for "STA Settings (uplink WiFi network)" an toogle them by an external switch or (prioritized) automatically? For my mobile application it would be very helpfull to switch between the local Wifi (near the bulding) for unlimited data usesage and the limited/expensive mobile hotspot of the phone during remote operation of the vehicle.

ESP32-Wrover yields 0.5 - 2 Mbps

Hi, and congrats on your work, I find it super interesting!

I'm testing the prebuilt firmware in a Lolin D32 Pro (ESP32-Wrover) and I can't squeeze more than between 0.5 and 2 Mbps. How, and in what conditions, are you measuring your results? I tested both my cellphone and computer connected to the ESP, and just used different web services to measure the download speed. Are the prebuilt binaries optimized when compiled?

I also flashed your ESP8266 firmware in another board and got less than 0.5 Mbps.

Are you planning to merge other features already present in your ESP8266 firmware, like "lock" and "automesh"? That would be great.

NAT and UDP packets

Hello,

Trying to use esp32_nat_router with a big wifi antenna connected to a WROOM_32U to extend my Drone range.

Installation is ok, configuration is ok.

But my drone is sending the video stream as an UDP feed. And I suppose the NAT router does not know to which client send it !

Is there any way to specify a "DMZ" NATed client that would receive every incoming packets, including UDP packets that are not in the NAT table.

Hope It's clear ?!

Thanks,
GS.

Automesh in esp32? just like esp8266.

Will there be an automesh feature in near future?
Esp32 is much more powerful and its automesh must work better than esp8226's.
Thank you for your work!!

no internet connectivity for a second router

My ultimate goal is to have 2 esp32 acting as range extender for my home wifi.

HOME ROUTER <===(802.11 bgn)===> Gateway (esp32)<==(LR mode)==>SPOT-1(esp32)<=== esp32 iot devices
let's ignore the LR mode for now.

  • 1 esp32 as Gateway: connect to my router and exposes AP (Gateway)
    ==> when i connect to the Gateway: i have internet and everything is working just fine
  • if i setup a second esp32 (let s call it SPOT-1): i configure it to connect to Gateway as station And Exposes an AP called SPOT-1, i can see it gets the right configuration.
  • my laptop can connect to SPOT-1 but i can't get internet there. even though i m getting the dns from my home router
  • i tried to change the ip addresses (Gateway on 192.168.4.1, and SPOT-1 on 192.168.5.1) with no luck
  • am i missing something?

No file build\partitions_example.bin

In trying to flash using esptool.py there's no \build\partitions_example.bin

from Readme.md

esptool.py --chip esp32 --port /dev/ttyUSB0
--baud 115200 --before default_reset --after hard_reset write_flash
-z --flash_mode dio --flash_freq 40m --flash_size detect
0x1000 build/bootloader/bootloader.bin
0x10000 build/esp32_nat_router.bin
0x8000 build/partitions_example.bin

DHCP offer DNS 223.5.5.5

I changed the DNS from 8.8.8.8 to 223.5.5.5(Alibaba public DNS server), the clients which connected on ESP32 router can't be resolve host name, even I set the DNS server on client.
#define MY_DNS_IP_ADDR 0xdf050505 // 223.5.5.5 //0x08080808 // 8.8.8.8

static IPs > x.x.x.128/24?

hi, does your statement about the ESP8266 about static IPs hold for the ESP32 port as well, that x.x.x.129 to .255 are available for static IP addresses?

"The ESP's DHCP server uses addresses from x.x.x.2/24 to x.x.x.128/24. Any higher IP address can be assigned statically without any risc of being reassigned dynamically by DHCP."

No internet connection?

Hi, first of all thanks for the project and the simplicity of flashing it through a cmakelists.txt that works with vscode esp-idf in windows.

Everything is up and running, i can see the repeater has connected to my router, and an access point of the repeater has been created.

When i use the access point however there is no internet at all, why is that? There is no log or something similar, just when i connect to the access point it shows "I (422356) esp_netif_lwip: DHCP server assigned IP to a station, IP is: 192.168.4.2" which seems all good. So all links are connected.

Sidenote: My router aka the station uses 192.168.1.1 etc and the esp32 is set to 192.168.4.1 in the accesspoint network maaaybe if that has something to do with it?

Thanks before hand if you have the time to answer this post 👍

Torrent not works.

Hi!

Why download files over torrent not works on the esp32_nat_router?

Thank you.

Beginners Question: Not flashable - problem with the bin files?

Hi i tried to flash two ESP32 with the ESPDownloadTool v3.8.5 with your settings.
UnicodeDecodeError: 'gb2312' codec can't decode bytes in position 18-19: illegal multibyte sequence
is the response.

I used Putty for the serial output:
rst:0x10 (RTCWDT_RTC_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT) flash read err, 1000 ets_main.c 371

Maybe this has something to do with your last commit?
I also tried an older version of the DownloadTool.

Alternatifely, I dont get the esptool to install on linux nor on windows.

Any ideas?

Feature request

I like your repeater code. It works very well. But it would be nice if we could scan nearby access points, and show some information about them, like ssid, dbm etc..

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.