-
-
Notifications
You must be signed in to change notification settings - Fork 345
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
Sming Host Emulator #1692
Merged
Merged
Sming Host Emulator #1692
Changes from 7 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
89e8f8d
Remove duplicate debug statement from `HttpServerConnection::onHeader…
mikee47 7d37668
(char*)getRemoteIp() output garbled, replace with getRemoteIp().toStr…
mikee47 c751372
Move `pwm.h` into `Components/drivers`, consistent with ESP-IDF
mikee47 d434850
Add `esp_wifi` component
mikee47 17d1c40
WifiEvents - move trivial methods into header
mikee47 007f915
Initial `Host` architecture implementation
mikee47 b9c918f
Fix build conflicts
mikee47 fb599d7
Fix `IMPORT_FSTR` for Linux/Windows host builds
mikee47 ad14726
CI updates
mikee47 6ac082e
Update Host readme.md
mikee47 49207bc
Remove unused code
mikee47 d5a56cd
By default, use python ESPTOOL for Windows
mikee47 831bf2b
Remove `ESP_HOME` check from sample `Makefile-user.mk`
mikee47 e39ab67
Create `tests` directory and move `HostTests` sample
mikee47 c91cd84
Revise Travis script
mikee47 cf6d327
Revise Appveyor script
mikee47 17473c0
Fix codacy advisories
mikee47 f3a72bc
Update `readme.md` - interfaces aren't persistent
mikee47 0602d7b
Remove extraneous `ESP_HOME` check in `Arch/Esp8266/app.mk`
mikee47 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
REM Windows install script | ||
|
||
goto :%SMING_ARCH% | ||
|
||
:Esp8266 | ||
|
||
IF "%SDK_VERSION%" == "1.5.0" ( | ||
choco install esp8266-udk --source https://www.myget.org/F/kireevco-chocolatey/ -y --no-progress | ||
mkdir c:\Espressif\utils\ESP8266 | ||
copy /b c:\Espressif\utils\memanalyzer.exe c:\Espressif\utils\ESP8266\memanalyzer.exe | ||
copy /b c:\Espressif\utils\esptool.exe c:\Espressif\utils\ESP8266\esptool.exe | ||
) ELSE ( | ||
choco install esp8266-udk --source https://www.myget.org/F/sming/ -y --no-progress | ||
) | ||
|
||
goto :EOF | ||
|
||
|
||
:Host | ||
|
||
REM Ensure MinGW installation is up to date | ||
mingw-get update | ||
mingw-get upgrade | ||
|
||
goto :EOF | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,48 @@ | ||
#!/bin/bash | ||
set -e # exit with nonzero exit code if anything fails | ||
set -ex # exit with nonzero exit code if anything fails | ||
|
||
env | ||
unset SPIFFY | ||
unset ESPTOOL2 | ||
|
||
export SMING_HOME=$TRAVIS_BUILD_DIR/Sming | ||
export ESP_HOME=$TRAVIS_BUILD_DIR/opt/esp-alt-sdk | ||
if [ "$SDK_VERSION" = "3.0.0" ]; then | ||
export SDK_BASE=$SMING_HOME/third-party/ESP8266_NONOS_SDK | ||
|
||
# Check coding style | ||
if [ "$TRAVIS_BUILD_STAGE_NAME" == "Test" ]; then | ||
.travis/tools/clang/format-pr.sh; | ||
fi | ||
|
||
cd $SMING_HOME | ||
# Setup ARCH SDK paths | ||
if [ "$SMING_ARCH" == "Esp8266" ]; then | ||
export ESP_HOME=$TRAVIS_BUILD_DIR/opt/esp-alt-sdk | ||
if [ "$SDK_VERSION" == "3.0.0" ]; then | ||
export SDK_BASE=$SMING_HOME/third-party/ESP8266_NONOS_SDK | ||
fi | ||
|
||
export PATH=$PATH:$ESP_HOME/xtensa-lx106-elf/bin:$ESP_HOME/utils/:$SMING_HOME/../.travis/tools | ||
if [ "$SDK_VERSION" = "2.0.0" ]; then | ||
../.travis/tools/clang/format-pr.sh; | ||
export PATH=$PATH:$ESP_HOME/xtensa-lx106-elf/bin:$ESP_HOME/utils/ | ||
fi | ||
|
||
if [ "$SDK_VERSION" = "3.0.0" ]; then | ||
export SMING_ARCH=Host | ||
export STRICT=1 | ||
make help | ||
make list-config | ||
make | ||
make Basic_Blink Basic_DateTime Basic_Delegates Basic_Interrupts Basic_ProgMem Basic_Serial Basic_Servo LiveDebug DEBUG_VERBOSE_LEVEL=3 | ||
cd ../samples/HostTests | ||
make flash | ||
cd $SMING_HOME | ||
fi | ||
# Full compile checks please | ||
export STRICT=1 | ||
|
||
export SMING_ARCH=Esp8266 | ||
# Diagnostic info | ||
cd $SMING_HOME | ||
make help | ||
make list-config | ||
make STRICT=1 | ||
make samples | ||
make clean samples-clean | ||
make ENABLE_CUSTOM_HEAP=1 STRICT=1 | ||
make Basic_Blink ENABLE_CUSTOM_HEAP=1 DEBUG_VERBOSE_LEVEL=3 | ||
make dist-clean; make HttpServer_ConfigNetwork ENABLE_CUSTOM_LWIP=2 STRICT=1 | ||
|
||
# Build the framework | ||
make | ||
|
||
if [ "$TRAVIS_BUILD_STAGE_NAME" == "Test" ]; then | ||
make Basic_Blink Basic_DateTime Basic_Delegates Basic_Interrupts Basic_ProgMem Basic_Serial Basic_Servo LiveDebug DEBUG_VERBOSE_LEVEL=3 | ||
cd ../tests/HostTests | ||
make flash | ||
else | ||
make samples | ||
make clean samples-clean | ||
make ENABLE_CUSTOM_HEAP=1 STRICT=1 | ||
make Basic_Blink ENABLE_CUSTOM_HEAP=1 DEBUG_VERBOSE_LEVEL=3 | ||
|
||
make dist-clean | ||
make HttpServer_ConfigNetwork ENABLE_CUSTOM_LWIP=2 STRICT=1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/bin/bash | ||
set -ex # exit with nonzero exit code if anything fails | ||
|
||
if [ "$TRAVIS_BUILD_STAGE_NAME" == "Test" ]; then | ||
sudo update-alternatives --install /usr/bin/clang-format clang-format /usr/bin/clang-format-6.0 100 | ||
fi | ||
|
||
if [ "$SMING_ARCH" == "Esp8266" ]; then | ||
if [ "$SDK_VERSION" == "1.5.0" ] && [ "$TRAVIS_OS_NAME" == "osx" ]; then | ||
SDK_FILE_NAME="esp-alt-sdk-v${SDK_VERSION}.${SDK_BUILD}-macos-x86_64.zip" | ||
fi | ||
|
||
if [ "$SDK_VERSION" == "1.5.0" ] && [ "$TRAVIS_OS_NAME" == "linux" ]; then | ||
SDK_FILE_NAME="esp-alt-sdk-v${SDK_VERSION}.${SDK_BUILD}-linux-x86_64.tar.gz" | ||
fi | ||
|
||
mkdir -p $TRAVIS_BUILD_DIR/opt/esp-alt-sdk | ||
|
||
if [ "$SDK_VERSION" == "1.5.0" ]; then | ||
wget --no-verbose https://bintray.com/artifact/download/kireevco/generic/${SDK_FILE_NAME} | ||
bsdtar -xf ${SDK_FILE_NAME} -C $TRAVIS_BUILD_DIR/opt/esp-alt-sdk | ||
fi | ||
|
||
if [ "$SDK_VERSION" != "1.5.0" ] && [ "$TRAVIS_OS_NAME" == "linux" ]; then | ||
wget --no-verbose https://github.com/nodemcu/nodemcu-firmware/raw/2d958750b56fc60297f564b4ec303e47928b5927/tools/esp-open-sdk.tar.xz | ||
tar -Jxvf esp-open-sdk.tar.xz; ln -s `pwd`/esp-open-sdk/xtensa-lx106-elf $TRAVIS_BUILD_DIR/opt/esp-alt-sdk/. | ||
fi | ||
|
||
if [ "$SDK_VERSION" == "2.0.0" ] && [ "$TRAVIS_OS_NAME" == "linux" ]; then | ||
wget --no-verbose https://www.espressif.com/sites/default/files/sdks/esp8266_nonos_sdk_v2.0.0_16_08_10.zip -O sdk.zip | ||
unzip sdk.zip | ||
ln -s `pwd`/ESP8266_NONOS_SDK/ $TRAVIS_BUILD_DIR/opt/esp-alt-sdk/sdk | ||
fi | ||
fi # Esp8266 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,27 @@ | ||
os: Windows Server 2012 R2 | ||
|
||
environment: | ||
PATH: C:\MinGW\msys\1.0\bin;C:\MinGW\bin;C:\Program Files (x86)\Mono-3.2.3\bin;C:\Python27\scripts;%PATH% | ||
PATH: C:\MinGW\msys\1.0\bin;C:\MinGW\bin;C:\Python27\scripts;%PATH% | ||
SDK_BUILD: 258 | ||
matrix: | ||
- build_platform: "x86" | ||
build_compiler: "mingw" | ||
build_bindings: 1 | ||
SMING_ARCH: Host | ||
|
||
- build_platform: "x86" | ||
build_compiler: "mingw" | ||
SMING_ARCH: Esp8266 | ||
SDK_VERSION: 2.0.0 | ||
|
||
- build_platform: "x86" | ||
build_compiler: "mingw" | ||
build_bindings: 1 | ||
SMING_ARCH: Esp8266 | ||
SDK_VERSION: 1.5.0 | ||
|
||
# cache: | ||
# - src/ # preserve "packages" directory in the root of build folder but will reset it if packages.config is modified | ||
install: | ||
- ps: >- | ||
if($env:SDK_VERSION -eq '1.5.0') { | ||
choco install esp8266-udk --source https://www.myget.org/F/kireevco-chocolatey/ -y --no-progress | ||
mkdir c:\Espressif\utils\ESP8266 | ||
cp c:\Espressif\utils\memanalyzer.exe c:\Espressif\utils\ESP8266\memanalyzer.exe | ||
cp c:\Espressif\utils\esptool.exe c:\Espressif\utils\ESP8266\esptool.exe | ||
} | ||
else { | ||
choco install esp8266-udk --source https://www.myget.org/F/sming/ -y --no-progress | ||
} | ||
- cmd: mingw-get update | ||
- cmd: mingw-get upgrade | ||
- cmd: .appveyor/install.cmd | ||
|
||
build_script: | ||
- cmd: .appveyor/build.cmd |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could try also parallel build splitting this command to the following two:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could.... I gave it a brief try with appveyor but after one initial failure didn't bother any further as I figured what we really need is a clear and accurate log for when it goes wrong. I had a hell of a job with the initial CI updates on appveyor, had to remote terminal into the server to find out how to fix things so really rather not have to do that if poss.!
The
--output-sync
option might help but haven't tried it - I have make 3.81 under MinGW which doesn't have the option anyway. I use parallel building all the time under Windows, on an 8-core system it kind of speeds things up just a teeny bit :-)I suspect on a VM parallel builds wouldn't help much anyway. My Linux install is running under VirtualBox and really doesn't like parallel builds at all, but that's my problem!
I suspect we'd also need lwip: