Skip to content

Commit 7b1ce55

Browse files
committed
initial commit
0 parents  commit 7b1ce55

File tree

138 files changed

+12359
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

138 files changed

+12359
-0
lines changed

.gitignore

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
build/*
2+
!build/bootloader
3+
!build/esp32_nat_router.bin
4+
!build/partitions_example.bin
5+
.pio*
6+
.vscode
7+
.vscode/*
8+
!sdkconfig.*
9+
!sdkconfig.defaults
10+
components/web_server/www/output/html/
11+
release/
12+
pytest/

CMakeLists.txt

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# The following lines of boilerplate have to be in your project's CMakeLists
2+
# in this exact order for cmake to work correctly
3+
cmake_minimum_required(VERSION 3.5)
4+
5+
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
6+
project(esp32_nat_router+)

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2023 Jaya Satish
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

Makefile

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#
2+
# This is a project Makefile. It is assumed the directory this Makefile resides in is a
3+
# project subdirectory.
4+
#
5+
6+
# PROJECT_NAME := esp32_nat_router
7+
8+
include $(IDF_PATH)/make/project.mk
9+

README.md

+152
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,152 @@
1+
# ESP32-NAT Router +
2+
3+
## Acknowledgments
4+
5+
This project builds upon the works of *Martin-Ger's* [ESP32 NAT Router](https://github.com/martin-ger/esp32_nat_router) and *Sam Denty's* [Wi-PWN](https://github.com/samdenty/Wi-PWN) for the UI design. However, other sources have also provided inspiration and contributed to the development of this project, including:
6+
7+
- [@Kevin Wolfe](https://gitlab.com/kevinwolfe) (who provided OTA and other useful resources)
8+
- [@nopnop2002](https://github.com/nopnop2002) (Cjson Doc and Examples)
9+
- [@dchristl](https://github.com/dchristl) (whose work and ideas)
10+
11+
## Features
12+
13+
The features of the project, which includes:
14+
15+
- Providing a user-friendly UI with mobile support for easy accessibility
16+
- Displaying connected states and quality in the UI for transparency
17+
- Scanning for available APs to enhance network connectivity
18+
- Allowing users to disable or enable the on-board indicator LED
19+
- Incorporating a button menu (accessible via Boot or EN button)
20+
- Custom DNS server for personalized settings
21+
- Incorporating a secure web interface with basic authentication method
22+
- Offering OTA updates for easy maintenance and functionality enhancements
23+
- Randomize MAC address
24+
- Switch Between Dark and Light mode. (through settings)
25+
- Auto reload pages when connected to Router
26+
- and many more...........
27+
28+
## First Boot
29+
30+
Upon the first boot of the ESP32 NAT Router, a WiFi network with an open AP and an ssid of "ESP32_NAT_Router +" will be available. Users can configure the device using either a simple web interface or the serial console.
31+
32+
## Web Config Interface
33+
34+
The ESP32 NAT Router has a web interface that allows you to configure all its parameters. To access this interface, connect your PC or smartphone to the WiFi SSID "ESP32_NAT_Router+". Once you're connected, open your web browser and enter
35+
36+
"[http://192.168.4.1](http://192.168.4.1/)''  into the address bar of your browser. Once you have entered this, you will be prompted for a username and password. The default username is "admin" and the default password is "123456789". Please note that it is recommended to change these to a more secure username and password once you have logged in:
37+
38+
<!-- ![image](docs/index.png) -->
39+
40+
To configure the uplink WiFi network, follow these steps:
41+
42+
1. Go to "Settings" in the web interface of the ESP32 NAT Router
43+
2. Enter the appropriate values for the "STA Settings" section. If it is an open network, leave the password field blank
44+
3. Change the "AP Settings" and other customizations as necessary
45+
4. Click on the "Save" button to save the configuration
46+
5. Press the "Reboot" button located at the bottom right corner of the page (Nessory)
47+
6. Wait for the device to reboot
48+
49+
Connect to the newly configured WiFi network with the updated settings.
50+
By following these steps, you can reconfigure the ESP32 NAT Router to connect to a new uplink WiFi network with customized settings based on your preferences.
51+
52+
**Note:** The 5th step is necessary to update certain settings on the device and apply them. Skipping this step may result in the settings not being properly applied, which can lead to issues with the device's functionality. Therefore, it is recommended to always complete the 5th step when making any changes to the device's settings in order to ensure that the device is functioning as expected and that any desired changes have been properly applied.
53+
54+
<!-- ![Scan](docs/images/scan.png )
55+
56+
![Settings](docs/images/settings.png)
57+
![info](docs/images/info.png) -->
58+
59+
## Flashing the prebuild binaries
60+
61+
- Download [latest release](https://github.com/gjroots/esp32_nats_router_plus/releases/latest)
62+
* Download esp32nat_Router+_vX.X.X.zip for fresh install
63+
* Download esp32nat_Router+_full_vX.X.X_0x0.zip for update
64+
- Install [esptool](https://github.com/espressif/esptool)
65+
66+
### First install/ Reset (Terminal/CMD)
67+
68+
Please note that if your device was previously used for other projects, or if you want to reset all settings from a previous version, executing the following steps will result in complete data loss.
69+
70+
Note: replace X.X.X with respective Version.(eg. ...._v1.0.0.bin)
71+
72+
Unpack archive first and then execute:
73+
74+
Single bin method (merged, 0x0):
75+
76+
```
77+
esptool.py write_flash 0x0 esp32nat_Router+_full_vX.X.X_0x0.bin
78+
```
79+
80+
Multi bin method:
81+
82+
```
83+
esptool.py --chip esp32 \
84+
--before default_reset --after hard_reset write_flash \
85+
-z --flash_mode dio --flash_freq 40m --flash_size detect \
86+
0x1000 bootloader.bin \
87+
0x8000 partitions.bin \
88+
0x10000 esp32nat_Router+_vX.X.X.bin
89+
```
90+
91+
### Update from older version
92+
93+
If this project was already installed. No data loss from previous version.
94+
95+
```
96+
esptool.py write_flash 0x10000 esp32nat_Router+_vX.X.X.bin
97+
```
98+
99+
If any problem occurs, erase flash manually before flashing:
100+
101+
```
102+
esptool.py erase_flash
103+
```
104+
105+
### OTA method :
106+
107+
To perform an OTA update on the ESP32-NATS Router+, follow these steps:
108+
109+
1. Go to the "Info" page in the web interface of the router
110+
2. Click on the "Update" button
111+
3. Select the desired bin file for the update
112+
113+
Please note that the OTA method only supports updating with a single bin file, such as "esp32nat_Router+_vX.X.X.bin". Updating with a full bin (merged to single bin 0x0) is not supported.
114+
115+
### Alternative way/ Graphical (Windows only)
116+
117+
As an alternative you might use [Espressif's Flash Download Tools](https://www.espressif.com/en/support/download/other-tools).
118+
Check the marked parameters and files like below (ckeck the COM-Port for your environment).
119+
Check the addresses like below:
120+
121+
122+
![Single bin](docs/images/win_flash_full_bin.png)
123+
124+
### or
125+
126+
![multiple bin's](docs/images/win_flash_multi_bin.png)
127+
128+
## Building the Binaries
129+
130+
To build the binaries, please refer to the following guide: "[How to setup environment and build project](docs/Build_setup.md)" located in the "docs" folder. This guide outlines the necessary steps to set up the environment and build the binaries.
131+
132+
## Advanced topics and configuration
133+
134+
For more advanced configuration and topics, refer to the "[Advanced topics](docs/Advanced_topics.md)" guide located in the "docs" folder. This guide covers topics such as configuring wireless protocols, setting up custom DNS servers working with OTA and other settings.
135+
136+
## Misc
137+
138+
If you experience any issues or have any suggestions for new features, please feel free to ask or raise an issue. Please note that as this project is a spare time project, the creator may not be always available to answer queries promptly. However, if the creator is free, they will respond as soon as possible. Thank you for your understanding and patience.
139+
140+
If you are happy with the project and would like to support the creator, there are several ways to do so. One way is to contribute to the codebase or documentation. Alternatively, you can support the creator through by spreading the word about the project to others who may find it useful.
141+
142+
## License
143+
144+
The software is released under the MIT License, which can be found in the file named "[LICENSE](LICENSE)". Additionally, any third-party source files included in the software will have their own license header.
145+
146+
## Screenshots
147+
148+
[<img src="docs/images/scan.png" alt="scan.png" width="700"/>](docs/images/scan.png)
149+
150+
[<img src="docs/images/settings.png" alt="settings.png" width="700" height= "600"/>](docs/images/settings.png)
151+
152+
[<img src="docs/images/info.png" alt="info.png" width="700"/>](docs/images/info.png)

build_web_pages.bat

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
@echo off
2+
cd components\web_server\www\html
3+
echo Current directory: %cd%
4+
echo Site Building Started
5+
6+
::this command enables to minified version site files
7+
set JEKYLL_ENV=production
8+
9+
::Execute Building Site
10+
bundle exec jekyll build
11+
12+
echo Site Building completed

build_web_pages.sh

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/bin/bash
2+
cd components\\web_server\\www\\html
3+
pwd
4+
echo Site Building Started
5+
6+
# this command enables to minified version site files
7+
JEKYLL_ENV=production # comment out if not require
8+
9+
# this command execute Building Site
10+
bundle exec jekyll build
11+
12+
echo Site Building completed

components/cmd_nvs/CMakeLists.txt

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
idf_component_register(SRCS "cmd_nvs.c"
2+
INCLUDE_DIRS .
3+
REQUIRES console nvs_flash)

0 commit comments

Comments
 (0)