v0.5c: travis continuous integration

Squashed commit of the following:

commit 24dd1f4579
Author: Hansi, dl9rdz <dl9rdz@darc.de>
Date:   Sun Apr 28 22:14:55 2019 +0200

    travis ci

commit 1062e55bd7
Author: Travis CI <travis@travis-ci.org>
Date:   Sun Apr 28 22:03:17 2019 +0200

    travis ci

commit acaf7f6a81
Author: Hans P. Reiser <hr@sec.uni-passau.de>
Date:   Sun Apr 28 19:43:04 2019 +0200

    travis testing

commit c357dbd71b
Author: Hans P. Reiser <hr@sec.uni-passau.de>
Date:   Sun Apr 28 19:28:46 2019 +0200

    travis testing

commit b4cc1dc18c
Author: Hans P. Reiser <hr@sec.uni-passau.de>
Date:   Sun Apr 28 19:24:27 2019 +0200

    travis testing

commit 4305763149
Author: Hans P. Reiser <hr@sec.uni-passau.de>
Date:   Sun Apr 28 19:20:06 2019 +0200

    travis testing

commit e4cce47863
Author: Hans P. Reiser <hr@sec.uni-passau.de>
Date:   Sun Apr 28 19:17:07 2019 +0200

    travis testing

commit f51d09f165
Author: Hans P. Reiser <hr@sec.uni-passau.de>
Date:   Sun Apr 28 19:11:16 2019 +0200

    travis testing

commit e0462c8381
Author: Hans P. Reiser <hr@sec.uni-passau.de>
Date:   Sun Apr 28 18:58:50 2019 +0200

    scripts for image generation

commit ed174f7617
Author: Hans P. Reiser <hr@sec.uni-passau.de>
Date:   Sun Apr 28 18:17:27 2019 +0200

    +skript for image generation
pull/22/head
Hansi, dl9rdz 2019-04-28 22:16:19 +02:00
rodzic 170e7cb2f2
commit f2a1a7e962
6 zmienionych plików z 99 dodań i 6 usunięć

Wyświetl plik

@ -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

43
.travis/push.sh 100755
Wyświetl plik

@ -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 "<html><head></head><body>" > download.html
echo "<h1>Master repository</h1><ul>" >> 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 "<li><a href=\"master/$i\">$i</a> ($TS)</li>\n" >> download.html;
done
echo "</ul><h1>Development repository</h1><ul>" >> 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 "<li><a href=\"devel/$i\">$i</a> ($TS)</li>\n" >> download.html;
done
echo "</ul></body></html>" >> 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

Wyświetl plik

@ -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
#-------------------------------#

Wyświetl plik

@ -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";

Wyświetl plik

@ -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))

Wyświetl plik

@ -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