Travis knx usb (#48)

* Update .travis.yml

* Update platformio.ini

* Update .travis.yml

* Fix compilation

* Change platformio config

* Try to fix travis build

* save work

* save work

* save work

* save work

* save work

* save work

* save work

* save work

* save work

* save work

* save work

* save work

* save work

* save work

* save work

* save work

* save work

* Add new pio config for CI

* save work

* save work

* save work

* save work

* Try to fix CI run for example knx-linux

* Fix compilation

* Try to fix ESP8266 compilation

* Do not enable cEMI server per default. Is only enabled during platformio build externally
This commit is contained in:
nanosonde 2019-12-16 19:52:10 +01:00 committed by thelsing
parent b9571112d6
commit 1d01317845
7 changed files with 135 additions and 58 deletions

View File

@ -1,16 +1,8 @@
language: cpp
cache:
directories:
- ~/arduino_ide
- ~/.arduino15/packages/
git:
depth: false
quiet: true
matrix:
matrix:
include:
- os: linux
# Test build for Linux platform
- language: cpp
os: linux
addons:
apt:
sources:
@ -19,51 +11,90 @@ matrix:
- g++-7
env:
- MATRIX_EVAL="CC=gcc-7 && CXX=g++-7"
- MODE=LINUX
- os: linux
cache:
directories:
- ~/arduino_ide
- ~/.arduino15/packages/
git:
depth: false
quiet: true
before_install:
- eval "${MATRIX_EVAL}"
install:
script:
- cd examples/knx-linux
- mkdir -p build
- cd build
- cmake ..
- make
# Test build for Arduino platform
- language: cpp
os: linux
env:
- MODE=ARDUINO
cache:
directories:
- ~/arduino_ide
- ~/.arduino15/packages/
git:
depth: false
quiet: true
before_install:
- downloadArduinoLib() { wget -O $1.zip $2; unzip -o $1.zip -d $HOME/arduino_ide/libraries; }
- source <(curl -SLs "https://raw.githubusercontent.com/adafruit/travis-ci-arduino/master/install.sh")
- downloadArduinoLib FlashStorage "https://github.com/thelsing/FlashStorage/archive/master.zip"
- downloadArduinoLib BSEC "https://github.com/BoschSensortec/BSEC-Arduino-library/archive/master.zip"
# only default warning level
- sed -i 's#compiler.warning_level=all#compiler.warning_level=default#' ~/.arduino15/preferences.txt
# changes for bsec lib
# samd
- sed -ri 's#(recipe.c.combine.pattern=[^$]*\{archive_file\}")( -Wl,--end-group)#\1 {compiler.libraries.ldflags}\2#' ~/.arduino15/packages/arduino/hardware/samd/1.8.4/platform.txt
- sed -i 's#compiler.elf2hex.extra_flags=#compiler.elf2hex.extra_flags=\ncompiler.libraries.ldflags=#' ~/.arduino15/packages/arduino/hardware/samd/1.8.4/platform.txt
# esp8266
- sed -ri 's#(recipe.c.combine.pattern=[^$]*\{compiler.c.elf.libs\})( -Wl,--end-group "-L\{build.path\}")#\1 {compiler.libraries.ldflags}\2#' ~/.arduino15/packages/esp8266/hardware/esp8266/2.6.3/platform.txt
- sed -i 's#compiler.elf2hex.extra_flags=#compiler.elf2hex.extra_flags=\ncompiler.libraries.ldflags=#' ~/.arduino15/packages/esp8266/hardware/esp8266/2.6.3/platform.txt
- sed -i '/^.*libalgobsec.*$/d' ~/.arduino15/packages/esp8266/hardware/esp8266/2.6.3/tools/sdk/ld/eagle.app.v6.common.ld.h
- sed -ri 's#(\*libwps\.a:\(\.literal\.\* \.text\.\*\))#\1\n *libalgobsec.a:(.literal.* .text.*)#' ~/.arduino15/packages/esp8266/hardware/esp8266/2.6.3/tools/sdk/ld/eagle.app.v6.common.ld.h
before_install:
- downloadArduinoLib() { wget -O $1.zip $2; unzip -o $1.zip -d $HOME/arduino_ide/libraries; }
- if [ "$MODE" = "LINUX" ]; then eval "${MATRIX_EVAL}"; fi
- if [ "$MODE" = "ARDUINO" ]; then source <(curl -SLs "https://raw.githubusercontent.com/adafruit/travis-ci-arduino/master/install.sh"); fi
- if [ "$MODE" = "ARDUINO" ]; then downloadArduinoLib FlashStorage "https://github.com/thelsing/FlashStorage/archive/master.zip"; fi
- if [ "$MODE" = "ARDUINO" ]; then downloadArduinoLib BSEC "https://github.com/BoschSensortec/BSEC-Arduino-library/archive/master.zip"; fi
# only default warning level
- if [ "$MODE" = "ARDUINO" ]; then sed -i 's#compiler.warning_level=all#compiler.warning_level=default#' ~/.arduino15/preferences.txt; fi
# changes for bsec lib
# samd
- if [ "$MODE" = "ARDUINO" ]; then sed -ri 's#(recipe.c.combine.pattern=[^$]*\{archive_file\}")( -Wl,--end-group)#\1 {compiler.libraries.ldflags}\2#' ~/.arduino15/packages/arduino/hardware/samd/1.8.4/platform.txt; fi
- if [ "$MODE" = "ARDUINO" ]; then sed -i 's#compiler.elf2hex.extra_flags=#compiler.elf2hex.extra_flags=\ncompiler.libraries.ldflags=#' ~/.arduino15/packages/arduino/hardware/samd/1.8.4/platform.txt; fi
# esp8266
- if [ "$MODE" = "ARDUINO" ]; then sed -ri 's#(recipe.c.combine.pattern=[^$]*\{compiler.c.elf.libs\})( -Wl,--end-group "-L\{build.path\}")#\1 {compiler.libraries.ldflags}\2#' ~/.arduino15/packages/esp8266/hardware/esp8266/2.6.2/platform.txt; fi
- if [ "$MODE" = "ARDUINO" ]; then sed -i 's#compiler.elf2hex.extra_flags=#compiler.elf2hex.extra_flags=\ncompiler.libraries.ldflags=#' ~/.arduino15/packages/esp8266/hardware/esp8266/2.6.2/platform.txt; fi
- if [ "$MODE" = "ARDUINO" ]; then sed -i '/^.*libalgobsec.*$/d' ~/.arduino15/packages/esp8266/hardware/esp8266/2.6.2/tools/sdk/ld/eagle.app.v6.common.ld.h; fi
- if [ "$MODE" = "ARDUINO" ]; then sed -ri 's#(\*libwps\.a:\(\.literal\.\* \.text\.\*\))#\1\n *libalgobsec.a:(.literal.* .text.*)#' ~/.arduino15/packages/esp8266/hardware/esp8266/2.6.2/tools/sdk/ld/eagle.app.v6.common.ld.h; fi
# the HDC100X lib is not properly set up in githup so move things around a bit
- rm -rf $HOME/arduino_ide/libraries/HDC100X_Arduino_Library-master
- downloadArduinoLib HDC100X "https://github.com/RFgermany/HDC100X_Arduino_Library/archive/master.zip"
- mv $HOME/arduino_ide/libraries/HDC100X_Arduino_Library-master/HDC100X/* $HOME/arduino_ide/libraries/HDC100X_Arduino_Library-master
#- buildExampleSketch() { arduino --verify --board $BOARD $PWD/examples/$1/$1.ino; }
# the HDC100X lib is not properly set up in githup so move things around a bit
- if [ "$MODE" = "ARDUINO" ]; then rm -rf $HOME/arduino_ide/libraries/HDC100X_Arduino_Library-master; fi
- if [ "$MODE" = "ARDUINO" ]; then downloadArduinoLib HDC100X "https://github.com/RFgermany/HDC100X_Arduino_Library/archive/master.zip"; fi
- if [ "$MODE" = "ARDUINO" ]; then mv $HOME/arduino_ide/libraries/HDC100X_Arduino_Library-master/HDC100X/* $HOME/arduino_ide/libraries/HDC100X_Arduino_Library-master; fi
#- buildExampleSketch() { arduino --verify --board $BOARD $PWD/examples/$1/$1.ino; }
install:
- if [ "$MODE" = "ARDUINO" ]; then arduino --install-library "WiFiManager"; fi
script:
- if [ "$MODE" = "LINUX" ]; then cd knx-linux; fi
- if [ "$MODE" = "LINUX" ]; then mkdir -p build; fi
- if [ "$MODE" = "LINUX" ]; then cd build; fi
- if [ "$MODE" = "LINUX" ]; then cmake ..; fi
- if [ "$MODE" = "LINUX" ]; then make; fi
# - if [ "$MODE" = "ARDUINO" ]; then buildExampleSketch knx-demo; fi
# - if [ "$MODE" = "ARDUINO" ]; then buildExampleSketch knx-sonoffS20; fi
# - if [ "$MODE" = "ARDUINO" ]; then buildExampleSketch knx-bme680; fi
# - if [ "$MODE" = "ARDUINO" ]; then buildExampleSketch knx-hdc1008; fi
- if [ "$MODE" = "ARDUINO" ]; then build_platform zero; fi
- if [ "$MODE" = "ARDUINO" ]; then build_platform esp8266; fi
install:
- arduino --install-library "WiFiManager"
script:
# - buildExampleSketch knx-demo
# - buildExampleSketch knx-sonoffS20
# - buildExampleSketch knx-bme680
# - buildExampleSketch knx-hdc1008
- build_platform zero
- build_platform esp8266
# Test build for PlatformIO based projects
- language: python
python:
- "2.7"
cache:
directories:
- "~/.platformio"
env:
- PLATFORMIO_EXTRA_SCRIPTS=pre:/tmp/scripts/custom_hwids.py
install:
- pip install -U platformio
- platformio update
script:
# PRE scripts have to be copied manually as "platformio ci does not care about it"
- mkdir -p /tmp/scripts
- cp examples/knx-usb/custom_hwids.py /tmp/scripts
- platformio settings set force_verbose yes
- echo "-------";pwd;echo "--------";
- platformio ci --lib="." --project-conf=examples/knx-usb/platformio-ci.ini examples/knx-usb/src/main.cpp
notifications:
email:
on_success: change

View File

@ -0,0 +1,7 @@
{
// See http://go.microsoft.com/fwlink/?LinkId=827846
// for the documentation about the extensions.json format
"recommendations": [
"platformio.platformio-ide"
]
}

View File

@ -1,5 +1,8 @@
Import("env")
# access to global build environment
print(env)
board_config = env.BoardConfig()
board_config.update("build.hwids", [
# ["0x135e", "0x0024"] # Merten GmbH & Co. KG

View File

@ -0,0 +1,30 @@
;PlatformIO Project Configuration File
;
; Build options: build flags, source filter
; Upload options: custom upload port, speed and extra flags
; Library options: dependencies, extra library storages
; Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html
[env:adafruit_feather_m0]
platform = atmelsam
board = adafruit_feather_m0
framework = arduino
; VID must be changed to some known KNX Manufacturer
; so that the KNX USB interface gets recognized by ETS
extra_scripts = pre:custom_hwids.py
board_build.usb_product="KNX RF - USB Interface"
lib_deps =
SPI
Adafruit TinyUSB Library
https://github.com/thelsing/FlashStorage.git
knx
build_flags =
-DMEDIUM_TYPE=2
-DUSE_CEMI_SERVER
-DUSE_TINYUSB
-Wno-unknown-pragmas

View File

@ -7,11 +7,18 @@
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html
[platformio]
; We have to keep libdeps dir out the project directory otherwise,
; library scanner seems to have issues so compilation fails
libdeps_dir = /tmp/libdeps
[env:adafruit_feather_m0]
platform = atmelsam
board = adafruit_feather_m0
framework = arduino
; We consider that the this projects is opened within its project directory
; while working with VS Code.
lib_extra_dirs = ../../../
; VID must be changed to some known KNX Manufacturer
; so that the KNX USB interface gets recognized by ETS
@ -19,8 +26,8 @@ extra_scripts = pre:custom_hwids.py
board_build.usb_product="KNX RF - USB Interface"
lib_deps =
Adafruit_TinyUSB_Arduino
SPI
Adafruit TinyUSB Library
https://github.com/thelsing/FlashStorage.git
knx
@ -32,4 +39,3 @@ build_flags =
debug_tool = jlink
#upload_protocol = jlink

View File

@ -10,7 +10,7 @@
#define GPIO_GDO0_PIN 24 // GPIO 24 (GPIO_GEN5) -> WiringPi: 5 -> Pin number on header: 18
#endif
#define USE_CEMI_SERVER
//#define USE_CEMI_SERVER
#define USE_RF
#define USE_TP
#define USE_IP

View File

@ -7,7 +7,7 @@
#include "callback_property.h"
//224.0.23.12
#define DEFAULT_MULTICAST_ADDR 0xE000170C
#define DEFAULT_MULTICAST_ADDR ((uint32_t)0xE000170C)
IpParameterObject::IpParameterObject(DeviceObject& deviceObject, Platform& platform): _deviceObject(deviceObject),
_platform(platform)