You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
44 lines
1.4 KiB
44 lines
1.4 KiB
LIBS := EspSoftwareSerial AsyncTCP_SSL TinyGPSPlus-ESP32 HardwareSerial_RS485
|
|
DEFAULT_PORT := /dev/ttyUSB0
|
|
BAUD_RATE := 9600
|
|
SUCCESS_MSG := "SUCCESS!"
|
|
LIBRARIES_DIR := ${HOME}/Arduino/libraries
|
|
AC := arduino-cli
|
|
AC_FLAGS := --libraries "${LIBRARIES_DIR}"
|
|
ESP32_BOARD_CAT := esp32:esp32
|
|
ESP32_BOARD_ID := esp32:esp32:esp32doit-devkit-v1
|
|
CONFIG_FILE := config.yaml
|
|
|
|
# attempt to compile program
|
|
default:
|
|
$(AC) compile --clean --fqbn ${ESP32_BOARD_ID} ${AC_FLAGS} .
|
|
echo ${SUCCESS_MSG}
|
|
|
|
new-serial:
|
|
echo "You may leave the serial view at any time with the key combo control+b, then press d"
|
|
sleep 5
|
|
tmux new -ds _serial; tmux send-keys -t _serial '# you may exit any time with control+d, then x' Enter 'screen ${DEFAULT_PORT} ${BAUD_RATE}' Enter
|
|
tmux a -t _serial
|
|
|
|
join-serial:
|
|
tmux a -t _serial
|
|
|
|
kill-serial:
|
|
tmux send-keys -t _serial C-a
|
|
tmux send-keys -t _serial k
|
|
tmux send-keys -t _serial y
|
|
tmux send-keys -t _serial exit Enter
|
|
|
|
# upload files to the specified port
|
|
upload:
|
|
$(AC) compile --clean --fqbn ${ESP32_BOARD_ID} ${AC_FLAGS} --port ${DEFAULT_PORT} --upload .
|
|
echo ${SUCCESS_MSG}
|
|
|
|
# install all dependencies needed for the project
|
|
install-deps:
|
|
$(AC) core update-index --config-file ${CONFIG_FILE}
|
|
$(AC) core install $(ESP32_BOARD_CAT)
|
|
$(AC) lib install ${LIBS}
|
|
cd ${LIBRARIES_DIR}/ && wget https://github.com/me-no-dev/AsyncTCP/archive/refs/heads/master.zip && unzip master.zip
|
|
echo ${SUCCESS_MSG}
|