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"
35 # ~/Bin/SDK/ESP/esp8266_2.5.0/tools/esptool/esptool.py --chip esp8266 --port /dev/ttyUSB0 --baud 115200 write_flash 0x00000 4_Channel_Switcher.bin
37 if [ -s "$TMP" ]; then
38 binSRC=$( cat "$TMP" | grep Linking | sed -e 's/Linking //g' )
41 serialPort=$(cat "$TMP" | grep "opening port" | awk '{split($0,a," "); print a[3]}')
43 serialPort=/dev/ttyUSB0