Skip to content

Update build system #162

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

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ wifi_manager/.project
sdkconfig
sdkconfig.old
**/build/
**/managed_components/
dependencies.lock
#doxygen
Doxyfile
wifi_manager/doc/
Expand Down
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
if(IDF_VERSION_MAJOR GREATER_EQUAL 4)
idf_component_register(SRC_DIRS src
REQUIRES log nvs_flash mdns wpa_supplicant lwip esp_http_server
REQUIRES esp_wifi log nvs_flash mdns wpa_supplicant lwip esp_http_server
INCLUDE_DIRS src
EMBED_FILES src/style.css src/code.js src/index.html)
else()
set(COMPONENT_SRCDIRS src)
set(COMPONENT_ADD_INCLUDEDIRS src)
set(COMPONENT_REQUIRES log nvs_flash mdns wpa_supplicant lwip esp_http_server)
set(COMPONENT_REQUIRES esp_wifi log nvs_flash mdns wpa_supplicant lwip esp_http_server)
set(COMPONENT_EMBED_FILES src/style.css src/code.js src/index.html)
register_component()
endif()
Binary file added dist/esp32-wifi-manager_0.0.1.tgz
Binary file not shown.
75 changes: 75 additions & 0 deletions dist/esp32-wifi-manager_0.0.1/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# Prerequisites
*.d

# Object files
*.o
*.ko
*.obj
*.elf

# Linker output
*.ilk
*.map
*.exp

# Precompiled Headers
*.gch
*.pch

# Libraries
*.lib
*.a
*.la
*.lo

# Shared objects (inc. Windows DLLs)
*.dll
*.so
*.so.*
*.dylib

# Executables
*.exe
*.out
*.app
*.i*86
*.x86_64
*.hex

# Debug files
*.dSYM/
*.su
*.idb
*.pdb

# Kernel Module Compile Results
*.mod*
*.cmd
.tmp_versions/
modules.order
Module.symvers
Mkfile.old
dkms.conf

# Eclipse
.metadata/
RemoteSystemsTempFiles/.project
.settings/
*.a
*.o
*.d
wifi_manager/.cproject
wifi_manager/.project
sdkconfig
sdkconfig.old
**/build/
**/managed_components/
dependencies.lock
#doxygen
Doxyfile
wifi_manager/doc/
.project
.cproject

# Visual Studio Code
.vscode/
122 changes: 122 additions & 0 deletions dist/esp32-wifi-manager_0.0.1/.travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
language: bash

# when you suspects issues in cache, use the following line to disable cache.
# cache: false
cache:
directories:
- ${HOME}/distfiles
- ${HOME}/.ccache
- ${HOME}/.cache/pip
os:
- linux

matrix:
include:
- env:
- PROJECT_TARGET="esp32"
- PROJECT_SDK_BRANCH="master"
# - env:
# - PROJECT_TARGET="esp8266"
# - PROJECT_SDK_BRANCH="master"

addons:
apt:
packages:
- gcc
- wget
- make
- libncurses-dev
- flex
- bison
- python
- python-pip
- gperf
- ccache

before_install:
# Save path to the git respository
- PROJECT_PATH=$(pwd)

install:
- export TOOLCHAIN_DIR="${HOME}/${PROJECT_TARGET}"
- |
if [ ${PROJECT_TARGET} == "esp8266" ]; then
export PROJECT_GCC_PREFIX="xtensa-lx106-elf"
export PROJECT_TOOLCHAIN_FILE=xtensa-lx106-elf-linux64-1.22.0-92-g8facf4c-5.2.0.tar.gz
export PROJECT_SDK_NAME="ESP8266_RTOS_SDK"
else
export PROJECT_GCC_PREFIX="xtensa-esp32-elf"
export PROJECT_TOOLCHAIN_FILE=xtensa-esp32-elf-gcc8_2_0-esp32-2019r1-linux-amd64.tar.gz
export PROJECT_SDK_NAME="esp-idf"
fi
- export PROJECT_GCC_FILE="${PROJECT_GCC_PREFIX}-gcc"
- export PROJECT_DISTFILE_DIR="${HOME}/distfiles"
- export IDF_PATH=${TOOLCHAIN_DIR}/${PROJECT_SDK_NAME}
- export PROJECT_LOG="${HOME}/build.log"
- export PROJECT_EXAMPLE_DIR="${PROJECT_PATH}/examples"
# Install ESP32 toochain following steps as desribed
# in http://esp-idf.readthedocs.io/en/latest/linux-setup.html

# Prepare directory for the toolchain
- mkdir -p ${TOOLCHAIN_DIR} ${PROJECT_DISTFILE_DIR}
# Get SDK from github
- git clone --branch ${PROJECT_SDK_BRANCH} --recursive https://github.com/espressif/${PROJECT_SDK_NAME}.git ${IDF_PATH}

# Setup ccache to build faster
# XXX when the entire build process exceeds 50 min, th job will be killed
# https://docs.travis-ci.com/user/customizing-the-build/#build-timeouts
- ccache --version
- mkdir ${HOME}/ccache_bin
- (cd ${HOME}/ccache_bin && ln -s /usr/bin/ccache ${PROJECT_GCC_FILE})
- export CCACHE_BASEDIR=$PROJECT_PATH
- export CCACHE_CPP2=true

# Get Python requirements
- python -m pip install --user --upgrade pyOpenSSL
- python -m pip install --user -r ${IDF_PATH}/requirements.txt

# Download binary toolchain if it does not exist
- |
if [ ! -f ${PROJECT_DISTFILE_DIR}/${PROJECT_TOOLCHAIN_FILE} ]; then
wget -O ${PROJECT_DISTFILE_DIR}/${PROJECT_TOOLCHAIN_FILE} https://dl.espressif.com/dl/${PROJECT_TOOLCHAIN_FILE}
fi
- tar -xz -C ${TOOLCHAIN_DIR} -f ${PROJECT_DISTFILE_DIR}/${PROJECT_TOOLCHAIN_FILE}

# Make toolchains available for all terminal sessions
- export PATH=$HOME/ccache_bin:$PATH:$HOME/${PROJECT_TARGET}/${PROJECT_GCC_PREFIX}/bin

script:
- rm -f ${PROJECT_LOG}
# XXX surpress log output where possible. when the size exceeds 4 MB, the
# job will be killed.
- |
IGNORE_FILE="travis-ignore"

case ${PROJECT_TARGET} in
esp32)
;;
esp8266)
IGNORE_FILE="travis-ignore-esp8266"
# these drivers do not compile for ESP8266 yet
export EXCLUDE_COMPONENTS="encoder max7219 mcp23x17"
;;
esac

cd ${PROJECT_EXAMPLE_DIR}
for i in $(ls -d */); do
if [ ! -e ${PROJECT_EXAMPLE_DIR}/${i}/${IGNORE_FILE} ]; then
echo "Building ${i}..."
cd ${PROJECT_EXAMPLE_DIR}/${i}
make defconfig
make -j2 >> ${PROJECT_LOG}
if [ $? -ne 0 ]; then
# when failed, show last 100 lines for debugging, and exit with
# non-zero exit code
tail -n 100 ${PROJECT_LOG}
exit 1
fi
make clean >/dev/null
# make sure the directory is clean
rm -rf ${i}/sdkconfig ${i}/build
fi
done
12 changes: 12 additions & 0 deletions dist/esp32-wifi-manager_0.0.1/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
if(IDF_VERSION_MAJOR GREATER_EQUAL 4)
idf_component_register(SRC_DIRS src
REQUIRES esp_wifi log nvs_flash mdns wpa_supplicant lwip esp_http_server
INCLUDE_DIRS src
EMBED_FILES src/style.css src/code.js src/index.html)
else()
set(COMPONENT_SRCDIRS src)
set(COMPONENT_ADD_INCLUDEDIRS src)
set(COMPONENT_REQUIRES esp_wifi log nvs_flash mdns wpa_supplicant lwip esp_http_server)
set(COMPONENT_EMBED_FILES src/style.css src/code.js src/index.html)
register_component()
endif()
81 changes: 81 additions & 0 deletions dist/esp32-wifi-manager_0.0.1/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
menu "Wifi Manager Configuration"

config WIFI_MANAGER_TASK_PRIORITY
int "RTOS Task Priority for the wifi_manager"
default 5
help
Tasks spawn by the manager will have a priority of WIFI_MANAGER_TASK_PRIORITY-1. For this particular reason, minimum recommended task priority is 2.

config WIFI_MANAGER_RETRY_TIMER
int "Time (in ms) between each retry attempt"
default 5000
help
Defines the time to wait before an attempt to re-connect to a saved wifi is made after connection is lost or another unsuccesful attempt is made.

config WIFI_MANAGER_MAX_RETRY_START_AP
int "Max Retry before starting the AP"
default 3
help
Defines the maximum number of failed retries allowed before the WiFi manager starts its own access point.

config WIFI_MANAGER_SHUTDOWN_AP_TIMER
int "Time (in ms) to wait before shutting down the AP"
default 60000
help
Defines the time (in ms) to wait after a succesful connection before shutting down the access point.

config WEBAPP_LOCATION
string "Defines the URL where the wifi manager is located"
default "/"
help
This parameter helps you relocate the wifimanager to another URL, for instance /wifimanager/ The trailing slash is important and should be included

config DEFAULT_AP_SSID
string "Access Point SSID"
default "esp32"
help
SSID (network name) the the esp32 will broadcast.

config DEFAULT_AP_PASSWORD
string "Access Point Password"
default "esp32pwd"
help
Password used for the Access Point. Leave empty and set AUTH MODE to WIFI_AUTH_OPEN for no password.

config DEFAULT_AP_CHANNEL
int "Access Point WiFi Channel"
default 1
help
Be careful you might not see the access point if you use a channel not allowed in your country.

config DEFAULT_AP_IP
string "Access Point IP Address"
default "10.10.0.1"
help
This is used for the redirection to the captive portal. It is recommended to leave unchanged.

config DEFAULT_AP_GATEWAY
string "Access Point IP Gateway"
default "10.10.0.1"
help
This is used for the redirection to the captive portal. It is recommended to leave unchanged.

config DEFAULT_AP_NETMASK
string "Access Point Netmask"
default "255.255.255.0"
help
This is used for the redirection to the captive portal. It is recommended to leave unchanged.

config DEFAULT_AP_MAX_CONNECTIONS
int "Access Point Max Connections"
default 4
help
Max is 4.

config DEFAULT_AP_BEACON_INTERVAL
int "Access Point Beacon Interval (ms)"
default 100
help
100ms is the recommended default.

endmenu
19 changes: 19 additions & 0 deletions dist/esp32-wifi-manager_0.0.1/LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Copyright (c) 2017-2019 Tony Pottier

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Loading