From f2a1a7e962b4346238949ee1fe550d327e947acf Mon Sep 17 00:00:00 2001 From: "Hansi, dl9rdz" Date: Sun, 28 Apr 2019 22:16:19 +0200 Subject: [PATCH] v0.5c: travis continuous integration Squashed commit of the following: commit 24dd1f4579215c342e74511a315e093749b34612 Author: Hansi, dl9rdz Date: Sun Apr 28 22:14:55 2019 +0200 travis ci commit 1062e55bd7c19b2423170c4cc2ca12b8f4956513 Author: Travis CI Date: Sun Apr 28 22:03:17 2019 +0200 travis ci commit acaf7f6a81dff18edc14ceba82862a551bc05431 Author: Hans P. Reiser Date: Sun Apr 28 19:43:04 2019 +0200 travis testing commit c357dbd71bff6e63968fe5e8bedb0a59f6472bed Author: Hans P. Reiser Date: Sun Apr 28 19:28:46 2019 +0200 travis testing commit b4cc1dc18c46b99cf074363db29391398f636be8 Author: Hans P. Reiser Date: Sun Apr 28 19:24:27 2019 +0200 travis testing commit 43057631493ed6e167a00affc163fd112d3d68ad Author: Hans P. Reiser Date: Sun Apr 28 19:20:06 2019 +0200 travis testing commit e4cce47863104b8f8a4140859213751d87f3ff88 Author: Hans P. Reiser Date: Sun Apr 28 19:17:07 2019 +0200 travis testing commit f51d09f1658b865bc73e1448b9c36edd87f1d849 Author: Hans P. Reiser Date: Sun Apr 28 19:11:16 2019 +0200 travis testing commit e0462c838157353223ef939d3a44851c397f94df Author: Hans P. Reiser Date: Sun Apr 28 18:58:50 2019 +0200 scripts for image generation commit ed174f7617c14d6424bbf8799e57daace5494b33 Author: Hans P. Reiser Date: Sun Apr 28 18:17:27 2019 +0200 +skript for image generation --- .travis.yml | 12 +++++++++++- .travis/push.sh | 43 ++++++++++++++++++++++++++++++++++++++++++ RX_FSK/data/config.txt | 8 ++++---- RX_FSK/version.h | 2 +- scripts/makeimage.py | 34 +++++++++++++++++++++++++++++++++ scripts/makespiffs | 6 ++++++ 6 files changed, 99 insertions(+), 6 deletions(-) create mode 100755 .travis/push.sh create mode 100755 scripts/makeimage.py create mode 100755 scripts/makespiffs diff --git a/.travis.yml b/.travis.yml index 48a35af..e1fc3a9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,8 @@ language: c +env: + global: + - ESP32TOOLS=/home/travis/.arduino15/packages/esp32/hardware/esp32/1.0.2/tools + - MKSPIFFS=/home/travis/.arduino15/packages/esp32/tools/mkspiffs/0.2.3/mkspiffs before_install: - "/sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_1.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :1 -ac -screen 0 1280x1024x16" - sleep 3 @@ -14,16 +18,22 @@ before_install: - wget https://github.com/me-no-dev/AsyncTCP/archive/master.zip - unzip master.zip - sudo mv AsyncTCP-master /usr/local/share/arduino/libraries/AsyncTCP + - wget https://github.com/me-no-dev/arduino-esp32fs-plugin/releases/download/1.0/ESP32FS-1.0.zip install: - arduino --pref "boardsmanager.additional.urls=https://dl.espressif.com/dl/package_esp32_index.json" --save-prefs + - arduino --pref "build.verbose=true" --save-prefs - arduino --pref "custom_FlashFreq=ttgo-lora32-v1_80" --save-prefs - arduino --install-boards esp32:esp32 --save-prefs - ln -s $PWD/libraries/SondeLib /usr/local/share/arduino/libraries/SondeLib - ln -s $PWD/libraries/SX1278FSK /usr/local/share/arduino/libraries/SX1278FSK - arduino --install-library "U8g2" script: - - arduino --board esp32:esp32:ttgo-lora32-v1 --verify $PWD/RX_FSK/RX_FSK.ino + - arduino --board esp32:esp32:ttgo-lora32-v1 --verify $PWD/RX_FSK/RX_FSK.ino --verbose | tail -3 | head -1 | awk '{print $NF}' > $PWD/code.bin + - $MKSPIFFS -c $PWD/RX_FSK/data -b 4096 -p 256 -s 1503232 $PWD/spiffs.bin + - $PWD/scripts/makeimage.py $ESP32TOOLS $PWD/code.bin $PWD/spiffs.bin $PWD/out.bin +after_success: + - .travis/push.sh notifications: email: on_success: change diff --git a/.travis/push.sh b/.travis/push.sh new file mode 100755 index 0000000..bbed07b --- /dev/null +++ b/.travis/push.sh @@ -0,0 +1,43 @@ +#!/bin/sh +setup_git() { + git config --global user.email "dl9rdz@darc.de" + git config --global user.name "dl9rdz (via Travis CI)" +} +generate_website_index() { + echo "" > download.html + echo "

Master repository

    " >> download.html + for i in `ls master`; do + TS=`git log master/$i | grep "Date:" | head -1 | awk '{$1="";$2="";$7="";print substr($0,3,length($0)-3)}'` + if [ -z "$TS" ]; then TS=`date`; fi + echo "
  • $i ($TS)
  • \n" >> download.html; + done + echo "

Development repository

    " >> download.html + for i in `ls devel`; do + TS=`git log devel/$i | grep "Date:" | head -1 | awk '{$1="";$2="";$7="";print substr($0,3,length($0)-3)}'` + echo "
  • $i ($TS)
  • \n" >> download.html; + done + echo "
" >> download.html + git add download.html + git commit --message "Travis build: $TRAVIS_BUILD_NUMBER" +} +commit_website_files() { + BRANCH=`git status | head -1 | awk '{print $NF}'` + VERSION=`cat RX_FSK/version.h | tail -1 | egrep -o '".*"' | sed 's/"//g' | sed 's/ /_/g'` + echo "On branch $BRANCH" + echo "Version $VERSION" + cd /tmp + git clone https://github.com/dl9rdz/rdz_ttgo_sonde.git -b gh-pages + cd rdz_ttgo_sonde + cp ~/out.bin ${BRANCH}/${VERSION}-full.bin + git add ${BRANCH}/${VERSION}-full.bin + # git commit --message "Travis build: $TRAVIS_BUILD_NUMBER" +} +upload_files() { + #git remote add origin-pages https://${GH_TOKEN}@github.com/MVSE-outreach/resources.git > /dev/null 2>&1 + #git push --quiet --set-upstream origin-pages gh-pages + git push --quiet +} +setup_git +commit_website_files +generate_website_index +upload_files diff --git a/RX_FSK/data/config.txt b/RX_FSK/data/config.txt index ae94af5..e3e098e 100644 --- a/RX_FSK/data/config.txt +++ b/RX_FSK/data/config.txt @@ -7,16 +7,16 @@ led_pout=9 # OLED Setup is depending on hardware of LoRa board # TTGO v1: SDA=4 SCL=15, RST=16 # TTGO v2: SDA=21 SCL=22, RST=16 -oled_sda=4 -oled_scl=15 +oled_sda=21 +oled_scl=22 oled_rst=16 #-------------------------------# # General config settings #-------------------------------# maxsonde=20 debug=0 -wifi=1 -wifiap=1 +# wifi mode: 1=client in background; 2=AP in background; 3=client on startup, ap if failure +wifi=3 #-------------------------------# # Spectrum display settings #-------------------------------# diff --git a/RX_FSK/version.h b/RX_FSK/version.h index c4ce311..4c2e7fb 100644 --- a/RX_FSK/version.h +++ b/RX_FSK/version.h @@ -1,2 +1,2 @@ const char *version_name = "RDZ_TTGO_SONDE"; -const char *version_id = "master v0.5b"; +const char *version_id = "master v0.5c"; diff --git a/scripts/makeimage.py b/scripts/makeimage.py new file mode 100755 index 0000000..ff16205 --- /dev/null +++ b/scripts/makeimage.py @@ -0,0 +1,34 @@ +#!/usr/bin/python +import sys + +OFFSET_BOOTLOADER = 0x1000 +OFFSET_PARTITIONS = 0x8000 +OFFSET_BOOTAPP0 = 0xE000 +OFFSET_APPLICATION = 0x10000 +OFFSET_SPIFFS = 0x291000 + +esp32tools = sys.argv[1] +file_in = sys.argv[2] +file_spiffs = sys.argv[3] +file_out = sys.argv[4] + +files_in = [ + ('bootloader', OFFSET_BOOTLOADER, esp32tools+"/sdk/bin/bootloader_dio_80m.bin"), + ('partitions', OFFSET_PARTITIONS, esp32tools+"/partitions/default.bin"), + ('bootapp0', OFFSET_BOOTAPP0, esp32tools+"/partitions/boot_app0.bin"), + ('application', OFFSET_APPLICATION, file_in), + ('spiffs', OFFSET_SPIFFS, file_spiffs), +] + +cur_offset = OFFSET_BOOTLOADER +with open(file_out, 'wb') as fout: + for name, offset, file_in in files_in: + assert offset >= cur_offset + fout.write(b'\xff' * (offset - cur_offset)) + cur_offset = offset + with open(file_in, 'rb') as fin: + data = fin.read() + fout.write(data) + cur_offset += len(data) + print('%-12s% 8d' % (name, len(data))) + print('%-12s% 8d' % ('total', cur_offset)) diff --git a/scripts/makespiffs b/scripts/makespiffs new file mode 100755 index 0000000..edc6ca0 --- /dev/null +++ b/scripts/makespiffs @@ -0,0 +1,6 @@ +#!/bin/sh +# first argument: esp32 tools directory +# second argument: data directory +# third argument: output filename +$1/mkspiffs/0.2.3/mkspiffs -c $2 -b 4096 -p 256 -s 1503232 $3 +