4 echo "Usage: $0 <sketch name> [upload]"
8 # assign WIFI_SSID and WIFI_PASS in external file ../info
13 TMP="/tmp/ESPcompile.tmp"
15 # MAKE_FILE="/home/dmitry/Bin/SDK/ESP/makeEspArduino.21.02.22/makeEspArduino.mk"
16 MAKE_FILE="/home/dmitry/Bin/SDK/ESP/makeEspArduino/makeEspArduino.mk"
17 # ESP_SDK_ROOT=/home/dmitry/Bin/SDK/ESP/esp8266 # keep it without quotation marks
19 # ESP_SDK_ROOT=~/Bin/SDK/ESP/Arduino
20 # ESP_SDK_ROOT=~/Bin/SDK/ESP/esp8266_3.1.2
21 # ESP_SDK_ROOT=~/Bin/SDK/ESP/esp8266_3.0.2
22 ESP_SDK_ROOT=~/Bin/SDK/ESP/esp8266_2.5.0
25 # LIBS=/home/dmitry/Bin/SDK/ESP/esp8266/libraries
26 # USER_SRC_PATTERN="version.h"
28 DATE=$(date +"%d.%m.%y")
29 echo "#define VERSION \"$DATE\"" > "$1/version.c"
31 # nodemcuv2, generic, esp8285
32 make -f "$MAKE_FILE" ESP_ROOT="$ESP_SDK_ROOT" F_CPU=160000000L CHIP=esp8266 BOARD=esp8285 SKETCH="$SKETCH" $2 2>&1 | tee "$TMP"
34 if [ -s "$TMP" ]; then
35 binSRC=$( cat "$TMP" | grep Linking | sed -e 's/Linking //g' )
38 serialPort=$(cat "$TMP" | grep "opening port" | awk '{split($0,a," "); print a[3]}')
40 serialPort=/dev/ttyUSB0