Skip to content

Commit 3dd3865

Browse files
author
Spacehuhn
committed
Added missing ESP libs
ESPAsyncWebServer ESPAsyncTCP SimpleCLI
1 parent 264e110 commit 3dd3865

File tree

125 files changed

+19000
-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.

125 files changed

+19000
-0
lines changed

wifiduck/esp8266/changes.txt

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
libraries:
2+
- Added ESPAsyncTCP
3+
- Added ESPAsyncWebServer
4+
- Added SimpleCLI
5+
16
boards.txt
27
- Added DSTIKE board
38
- Removed every other board except generic ESP866/85, NodeMCU and Lolin/Wemos d1 mini
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#!/bin/bash
2+
3+
echo "Installing ESP8266 Arduino Core ..."
4+
script_init_path="$PWD"
5+
mkdir -p "$ARDUINO_USR_PATH/hardware/esp8266com"
6+
cd "$ARDUINO_USR_PATH/hardware/esp8266com"
7+
8+
echo "Installing Python Serial ..."
9+
pip install pyserial > /dev/null
10+
11+
if [ "$OS_IS_WINDOWS" == "1" ]; then
12+
echo "Installing Python Requests ..."
13+
pip install requests > /dev/null
14+
fi
15+
16+
echo "Cloning Core Repository ..."
17+
git clone https://github.com/esp8266/Arduino.git esp8266 > /dev/null 2>&1
18+
19+
echo "Updating submodules ..."
20+
cd esp8266
21+
git submodule update --init --recursive > /dev/null 2>&1
22+
23+
echo "Installing Platform Tools ..."
24+
cd tools
25+
python get.py > /dev/null
26+
cd $script_init_path
27+
28+
echo "ESP8266 Arduino has been installed in '$ARDUINO_USR_PATH/hardware/esp8266com'"
29+
echo ""
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,220 @@
1+
#!/bin/bash
2+
3+
#OSTYPE: 'linux-gnu', ARCH: 'x86_64' => linux64
4+
#OSTYPE: 'msys', ARCH: 'x86_64' => win32
5+
#OSTYPE: 'darwin18', ARCH: 'i386' => macos
6+
7+
OSBITS=`arch`
8+
if [[ "$OSTYPE" == "linux"* ]]; then
9+
export OS_IS_LINUX="1"
10+
ARCHIVE_FORMAT="tar.xz"
11+
if [[ "$OSBITS" == "i686" ]]; then
12+
OS_NAME="linux32"
13+
elif [[ "$OSBITS" == "x86_64" ]]; then
14+
OS_NAME="linux64"
15+
elif [[ "$OSBITS" == "armv7l" || "$OSBITS" == "aarch64" ]]; then
16+
OS_NAME="linuxarm"
17+
else
18+
OS_NAME="$OSTYPE-$OSBITS"
19+
echo "Unknown OS '$OS_NAME'"
20+
exit 1
21+
fi
22+
elif [[ "$OSTYPE" == "darwin"* ]]; then
23+
export OS_IS_MACOS="1"
24+
ARCHIVE_FORMAT="zip"
25+
OS_NAME="macosx"
26+
elif [[ "$OSTYPE" == "cygwin" ]] || [[ "$OSTYPE" == "msys" ]] || [[ "$OSTYPE" == "win32" ]]; then
27+
export OS_IS_WINDOWS="1"
28+
ARCHIVE_FORMAT="zip"
29+
OS_NAME="windows"
30+
else
31+
OS_NAME="$OSTYPE-$OSBITS"
32+
echo "Unknown OS '$OS_NAME'"
33+
exit 1
34+
fi
35+
export OS_NAME
36+
37+
ARDUINO_BUILD_DIR="$HOME/.arduino/build.tmp"
38+
ARDUINO_CACHE_DIR="$HOME/.arduino/cache.tmp"
39+
40+
if [ "$OS_IS_MACOS" == "1" ]; then
41+
export ARDUINO_IDE_PATH="/Applications/Arduino.app/Contents/Java"
42+
export ARDUINO_USR_PATH="$HOME/Documents/Arduino"
43+
elif [ "$OS_IS_WINDOWS" == "1" ]; then
44+
export ARDUINO_IDE_PATH="$HOME/arduino_ide"
45+
export ARDUINO_USR_PATH="$HOME/Documents/Arduino"
46+
else
47+
export ARDUINO_IDE_PATH="$HOME/arduino_ide"
48+
export ARDUINO_USR_PATH="$HOME/Arduino"
49+
fi
50+
51+
if [ ! -d "$ARDUINO_IDE_PATH" ]; then
52+
echo "Installing Arduino IDE on $OS_NAME ..."
53+
echo "Downloading 'arduino-nightly-$OS_NAME.$ARCHIVE_FORMAT' to 'arduino.$ARCHIVE_FORMAT' ..."
54+
if [ "$OS_IS_LINUX" == "1" ]; then
55+
wget -O "arduino.$ARCHIVE_FORMAT" "https://www.arduino.cc/download.php?f=/arduino-nightly-$OS_NAME.$ARCHIVE_FORMAT" > /dev/null 2>&1
56+
echo "Extracting 'arduino.$ARCHIVE_FORMAT' ..."
57+
tar xf "arduino.$ARCHIVE_FORMAT" > /dev/null
58+
mv arduino-nightly "$ARDUINO_IDE_PATH"
59+
else
60+
curl -o "arduino.$ARCHIVE_FORMAT" -L "https://www.arduino.cc/download.php?f=/arduino-nightly-$OS_NAME.$ARCHIVE_FORMAT" > /dev/null 2>&1
61+
echo "Extracting 'arduino.$ARCHIVE_FORMAT' ..."
62+
unzip "arduino.$ARCHIVE_FORMAT" > /dev/null
63+
if [ "$OS_IS_MACOS" == "1" ]; then
64+
mv "Arduino.app" "/Applications/Arduino.app"
65+
else
66+
mv arduino-nightly "$ARDUINO_IDE_PATH"
67+
fi
68+
fi
69+
rm -rf "arduino.$ARCHIVE_FORMAT"
70+
71+
mkdir -p "$ARDUINO_USR_PATH/libraries"
72+
mkdir -p "$ARDUINO_USR_PATH/hardware"
73+
74+
echo "Arduino IDE Installed in '$ARDUINO_IDE_PATH'"
75+
echo ""
76+
fi
77+
78+
function build_sketch(){ # build_sketch <fqbn> <path-to-ino> [extra-options]
79+
if [ "$#" -lt 2 ]; then
80+
echo "ERROR: Illegal number of parameters"
81+
echo "USAGE: build_sketch <fqbn> <path-to-ino> [extra-options]"
82+
return 1
83+
fi
84+
85+
local fqbn="$1"
86+
local sketch="$2"
87+
local xtra_opts="$3"
88+
local win_opts=""
89+
if [ "$OS_IS_WINDOWS" == "1" ]; then
90+
local ctags_version=`ls "$ARDUINO_IDE_PATH/tools-builder/ctags/"`
91+
local preprocessor_version=`ls "$ARDUINO_IDE_PATH/tools-builder/arduino-preprocessor/"`
92+
win_opts="-prefs=runtime.tools.ctags.path=$ARDUINO_IDE_PATH/tools-builder/ctags/$ctags_version -prefs=runtime.tools.arduino-preprocessor.path=$ARDUINO_IDE_PATH/tools-builder/arduino-preprocessor/$preprocessor_version"
93+
fi
94+
95+
echo ""
96+
echo "Compiling '"$(basename "$sketch")"' ..."
97+
mkdir -p "$ARDUINO_BUILD_DIR"
98+
mkdir -p "$ARDUINO_CACHE_DIR"
99+
$ARDUINO_IDE_PATH/arduino-builder -compile -logger=human -core-api-version=10810 \
100+
-fqbn=$fqbn \
101+
-warnings="all" \
102+
-tools "$ARDUINO_IDE_PATH/tools-builder" \
103+
-tools "$ARDUINO_IDE_PATH/tools" \
104+
-built-in-libraries "$ARDUINO_IDE_PATH/libraries" \
105+
-hardware "$ARDUINO_IDE_PATH/hardware" \
106+
-hardware "$ARDUINO_USR_PATH/hardware" \
107+
-libraries "$ARDUINO_USR_PATH/libraries" \
108+
-build-cache "$ARDUINO_CACHE_DIR" \
109+
-build-path "$ARDUINO_BUILD_DIR" \
110+
$win_opts $xtra_opts "$sketch"
111+
}
112+
113+
function count_sketches() # count_sketches <examples-path>
114+
{
115+
local examples="$1"
116+
rm -rf sketches.txt
117+
if [ ! -d "$examples" ]; then
118+
touch sketches.txt
119+
return 0
120+
fi
121+
local sketches=$(find $examples -name *.ino)
122+
local sketchnum=0
123+
for sketch in $sketches; do
124+
local sketchdir=$(dirname $sketch)
125+
local sketchdirname=$(basename $sketchdir)
126+
local sketchname=$(basename $sketch)
127+
if [[ "${sketchdirname}.ino" != "$sketchname" ]]; then
128+
continue
129+
fi;
130+
if [[ -f "$sketchdir/.test.skip" ]]; then
131+
continue
132+
fi
133+
echo $sketch >> sketches.txt
134+
sketchnum=$(($sketchnum + 1))
135+
done
136+
return $sketchnum
137+
}
138+
139+
function build_sketches() # build_sketches <fqbn> <examples-path> <chunk> <total-chunks> [extra-options]
140+
{
141+
local fqbn=$1
142+
local examples=$2
143+
local chunk_idex=$3
144+
local chunks_num=$4
145+
local xtra_opts=$5
146+
147+
if [ "$#" -lt 2 ]; then
148+
echo "ERROR: Illegal number of parameters"
149+
echo "USAGE: build_sketches <fqbn> <examples-path> [<chunk> <total-chunks>] [extra-options]"
150+
return 1
151+
fi
152+
153+
if [ "$#" -lt 4 ]; then
154+
chunk_idex="0"
155+
chunks_num="1"
156+
xtra_opts=$3
157+
fi
158+
159+
if [ "$chunks_num" -le 0 ]; then
160+
echo "ERROR: Chunks count must be positive number"
161+
return 1
162+
fi
163+
if [ "$chunk_idex" -ge "$chunks_num" ]; then
164+
echo "ERROR: Chunk index must be less than chunks count"
165+
return 1
166+
fi
167+
168+
set +e
169+
count_sketches "$examples"
170+
local sketchcount=$?
171+
set -e
172+
local sketches=$(cat sketches.txt)
173+
rm -rf sketches.txt
174+
175+
local chunk_size=$(( $sketchcount / $chunks_num ))
176+
local all_chunks=$(( $chunks_num * $chunk_size ))
177+
if [ "$all_chunks" -lt "$sketchcount" ]; then
178+
chunk_size=$(( $chunk_size + 1 ))
179+
fi
180+
181+
local start_index=$(( $chunk_idex * $chunk_size ))
182+
if [ "$sketchcount" -le "$start_index" ]; then
183+
echo "Skipping job"
184+
return 0
185+
fi
186+
187+
local end_index=$(( $(( $chunk_idex + 1 )) * $chunk_size ))
188+
if [ "$end_index" -gt "$sketchcount" ]; then
189+
end_index=$sketchcount
190+
fi
191+
192+
local start_num=$(( $start_index + 1 ))
193+
echo "Found $sketchcount Sketches";
194+
echo "Chunk Count : $chunks_num"
195+
echo "Chunk Size : $chunk_size"
196+
echo "Start Sketch: $start_num"
197+
echo "End Sketch : $end_index"
198+
199+
local sketchnum=0
200+
for sketch in $sketches; do
201+
local sketchdir=$(dirname $sketch)
202+
local sketchdirname=$(basename $sketchdir)
203+
local sketchname=$(basename $sketch)
204+
if [ "${sketchdirname}.ino" != "$sketchname" ] \
205+
|| [ -f "$sketchdir/.test.skip" ]; then
206+
continue
207+
fi
208+
sketchnum=$(($sketchnum + 1))
209+
if [ "$sketchnum" -le "$start_index" ] \
210+
|| [ "$sketchnum" -gt "$end_index" ]; then
211+
continue
212+
fi
213+
build_sketch "$fqbn" "$sketch" "$xtra_opts"
214+
local result=$?
215+
if [ $result -ne 0 ]; then
216+
return $result
217+
fi
218+
done
219+
return 0
220+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
#!/bin/bash
2+
3+
echo "Installing Python Wheel ..."
4+
pip install wheel > /dev/null 2>&1
5+
6+
echo "Installing PlatformIO ..."
7+
pip install -U platformio > /dev/null 2>&1
8+
9+
echo "PlatformIO has been installed"
10+
echo ""
11+
12+
13+
function build_pio_sketch(){ # build_pio_sketch <board> <path-to-ino>
14+
if [ "$#" -lt 2 ]; then
15+
echo "ERROR: Illegal number of parameters"
16+
echo "USAGE: build_pio_sketch <board> <path-to-ino>"
17+
return 1
18+
fi
19+
20+
local board="$1"
21+
local sketch="$2"
22+
local sketch_dir=$(dirname "$sketch")
23+
echo ""
24+
echo "Compiling '"$(basename "$sketch")"' ..."
25+
python -m platformio ci -l '.' --board "$board" "$sketch_dir" --project-option="board_build.partitions = huge_app.csv"
26+
}
27+
28+
function count_sketches() # count_sketches <examples-path>
29+
{
30+
local examples="$1"
31+
rm -rf sketches.txt
32+
if [ ! -d "$examples" ]; then
33+
touch sketches.txt
34+
return 0
35+
fi
36+
local sketches=$(find $examples -name *.ino)
37+
local sketchnum=0
38+
for sketch in $sketches; do
39+
local sketchdir=$(dirname $sketch)
40+
local sketchdirname=$(basename $sketchdir)
41+
local sketchname=$(basename $sketch)
42+
if [[ "${sketchdirname}.ino" != "$sketchname" ]]; then
43+
continue
44+
fi;
45+
if [[ -f "$sketchdir/.test.skip" ]]; then
46+
continue
47+
fi
48+
echo $sketch >> sketches.txt
49+
sketchnum=$(($sketchnum + 1))
50+
done
51+
return $sketchnum
52+
}
53+
54+
function build_pio_sketches() # build_pio_sketches <board> <examples-path> <chunk> <total-chunks>
55+
{
56+
if [ "$#" -lt 2 ]; then
57+
echo "ERROR: Illegal number of parameters"
58+
echo "USAGE: build_pio_sketches <board> <examples-path> [<chunk> <total-chunks>]"
59+
return 1
60+
fi
61+
62+
local board=$1
63+
local examples=$2
64+
local chunk_idex=$3
65+
local chunks_num=$4
66+
67+
if [ "$#" -lt 4 ]; then
68+
chunk_idex="0"
69+
chunks_num="1"
70+
fi
71+
72+
if [ "$chunks_num" -le 0 ]; then
73+
echo "ERROR: Chunks count must be positive number"
74+
return 1
75+
fi
76+
if [ "$chunk_idex" -ge "$chunks_num" ]; then
77+
echo "ERROR: Chunk index must be less than chunks count"
78+
return 1
79+
fi
80+
81+
set +e
82+
count_sketches "$examples"
83+
local sketchcount=$?
84+
set -e
85+
local sketches=$(cat sketches.txt)
86+
rm -rf sketches.txt
87+
88+
local chunk_size=$(( $sketchcount / $chunks_num ))
89+
local all_chunks=$(( $chunks_num * $chunk_size ))
90+
if [ "$all_chunks" -lt "$sketchcount" ]; then
91+
chunk_size=$(( $chunk_size + 1 ))
92+
fi
93+
94+
local start_index=$(( $chunk_idex * $chunk_size ))
95+
if [ "$sketchcount" -le "$start_index" ]; then
96+
echo "Skipping job"
97+
return 0
98+
fi
99+
100+
local end_index=$(( $(( $chunk_idex + 1 )) * $chunk_size ))
101+
if [ "$end_index" -gt "$sketchcount" ]; then
102+
end_index=$sketchcount
103+
fi
104+
105+
local start_num=$(( $start_index + 1 ))
106+
echo "Found $sketchcount Sketches";
107+
echo "Chunk Count : $chunks_num"
108+
echo "Chunk Size : $chunk_size"
109+
echo "Start Sketch: $start_num"
110+
echo "End Sketch : $end_index"
111+
112+
local sketchnum=0
113+
for sketch in $sketches; do
114+
local sketchdir=$(dirname $sketch)
115+
local sketchdirname=$(basename $sketchdir)
116+
local sketchname=$(basename $sketch)
117+
if [ "${sketchdirname}.ino" != "$sketchname" ] \
118+
|| [ -f "$sketchdir/.test.skip" ]; then
119+
continue
120+
fi
121+
sketchnum=$(($sketchnum + 1))
122+
if [ "$sketchnum" -le "$start_index" ] \
123+
|| [ "$sketchnum" -gt "$end_index" ]; then
124+
continue
125+
fi
126+
build_pio_sketch "$board" "$sketch"
127+
local result=$?
128+
if [ $result -ne 0 ]; then
129+
return $result
130+
fi
131+
done
132+
return 0
133+
}

0 commit comments

Comments
 (0)