From 97f3557e3faa1aca238ae80e1d7e1d9e74af2d62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Xose=20P=C3=A9rez?= Date: Wed, 6 Sep 2017 10:31:43 +0200 Subject: [PATCH] Homogenize board names and build flags --- code/espurna/config/hardware.h | 54 +++++++++++++------------- code/ota_flash.sh | 20 +++++----- code/platformio.ini | 70 +++++++++++++++++----------------- 3 files changed, 72 insertions(+), 72 deletions(-) diff --git a/code/espurna/config/hardware.h b/code/espurna/config/hardware.h index 50c7787f..0d65134f 100644 --- a/code/espurna/config/hardware.h +++ b/code/espurna/config/hardware.h @@ -95,7 +95,7 @@ #elif defined(ITEAD_SONOFF_BASIC) // Info - #define MANUFACTURER "ITEAD_STUDIO" + #define MANUFACTURER "ITEAD" #define DEVICE "SONOFF_BASIC" // Buttons @@ -114,7 +114,7 @@ #elif defined(ITEAD_SONOFF_RF) // Info - #define MANUFACTURER "ITEAD_STUDIO" + #define MANUFACTURER "ITEAD" #define DEVICE "SONOFF_RF" // Buttons @@ -133,7 +133,7 @@ #elif defined(ITEAD_SONOFF_TH) // Info - #define MANUFACTURER "ITEAD_STUDIO" + #define MANUFACTURER "ITEAD" #define DEVICE "SONOFF_TH" // Buttons @@ -152,7 +152,7 @@ #elif defined(ITEAD_SONOFF_SV) // Info - #define MANUFACTURER "ITEAD_STUDIO" + #define MANUFACTURER "ITEAD" #define DEVICE "SONOFF_SV" // Buttons @@ -171,7 +171,7 @@ #elif defined(ITEAD_SLAMPHER) // Info - #define MANUFACTURER "ITEAD_STUDIO" + #define MANUFACTURER "ITEAD" #define DEVICE "SLAMPHER" // Buttons @@ -190,7 +190,7 @@ #elif defined(ITEAD_S20) // Info - #define MANUFACTURER "ITEAD_STUDIO" + #define MANUFACTURER "ITEAD" #define DEVICE "S20" // Buttons @@ -209,7 +209,7 @@ #elif defined(ITEAD_SONOFF_TOUCH) // Info - #define MANUFACTURER "ITEAD_STUDIO" + #define MANUFACTURER "ITEAD" #define DEVICE "SONOFF_TOUCH" // Buttons @@ -228,7 +228,7 @@ #elif defined(ITEAD_SONOFF_POW) // Info - #define MANUFACTURER "ITEAD_STUDIO" + #define MANUFACTURER "ITEAD" #define DEVICE "SONOFF_POW" // Buttons @@ -253,7 +253,7 @@ #elif defined(ITEAD_SONOFF_DUAL) // Info - #define MANUFACTURER "ITEAD_STUDIO" + #define MANUFACTURER "ITEAD" #define DEVICE "SONOFF_DUAL" #define SERIAL_BAUDRATE 19230 #define RELAY_PROVIDER RELAY_PROVIDER_DUAL @@ -271,7 +271,7 @@ #elif defined(ITEAD_SONOFF_4CH) // Info - #define MANUFACTURER "ITEAD_STUDIO" + #define MANUFACTURER "ITEAD" #define DEVICE "SONOFF_4CH" // Buttons @@ -308,7 +308,7 @@ #elif defined(ITEAD_SONOFF_4CH_PRO) // Info - #define MANUFACTURER "ITEAD_STUDIO" + #define MANUFACTURER "ITEAD" #define DEVICE "SONOFF_4CH_PRO" // Buttons @@ -354,7 +354,7 @@ // without problem. // Info - #define MANUFACTURER "ITEAD_STUDIO" + #define MANUFACTURER "ITEAD" #define DEVICE "1CH_INCHING" // Buttons @@ -373,7 +373,7 @@ #elif defined(ITEAD_MOTOR) // Info - #define MANUFACTURER "ITEAD_STUDIO" + #define MANUFACTURER "ITEAD" #define DEVICE "MOTOR" // Buttons @@ -389,11 +389,11 @@ #define LED1_PIN 13 #define LED1_PIN_INVERSE 1 -#elif defined(ITEAD_BN_SZ01) +#elif defined(ITEAD_BNSZ01) // Info - #define MANUFACTURER "ITEAD_STUDIO" - #define DEVICE "BN-SZ01" + #define MANUFACTURER "ITEAD" + #define DEVICE "BNSZ01" #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER #define DUMMY_RELAY_COUNT 1 @@ -409,7 +409,7 @@ #elif defined(ITEAD_SONOFF_RFBRIDGE) // Info - #define MANUFACTURER "ITEAD_STUDIO" + #define MANUFACTURER "ITEAD" #define DEVICE "SONOFF_RFBRIDGE" #define SERIAL_BAUDRATE 19200 #define RELAY_PROVIDER RELAY_PROVIDER_RFBRIDGE @@ -429,7 +429,7 @@ #elif defined(ITEAD_SONOFF_B1) // Info - #define MANUFACTURER "ITEAD_STUDIO" + #define MANUFACTURER "ITEAD" #define DEVICE "SONOFF_B1" #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT #define LIGHT_PROVIDER LIGHT_PROVIDER_MY9192 @@ -442,7 +442,7 @@ #elif defined(ITEAD_SONOFF_LED) // Info - #define MANUFACTURER "ITEAD_STUDIO" + #define MANUFACTURER "ITEAD" #define DEVICE "SONOFF_LED" #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER @@ -462,7 +462,7 @@ #elif defined(ITEAD_SONOFF_T1_1CH) // Info - #define MANUFACTURER "ITEAD_STUDIO" + #define MANUFACTURER "ITEAD" #define DEVICE "SONOFF_T1_1CH" // Buttons @@ -481,7 +481,7 @@ #elif defined(ITEAD_SONOFF_T1_2CH) // Info - #define MANUFACTURER "ITEAD_STUDIO" + #define MANUFACTURER "ITEAD" #define DEVICE "SONOFF_T1_2CH" // Buttons @@ -508,7 +508,7 @@ #elif defined(ITEAD_SONOFF_T1_3CH) // Info - #define MANUFACTURER "ITEAD_STUDIO" + #define MANUFACTURER "ITEAD" #define DEVICE "SONOFF_T1_3CH" // Buttons @@ -598,7 +598,7 @@ #elif defined(AITHINKER_AI_LIGHT) // Info - #define MANUFACTURER "AI_THINKER" + #define MANUFACTURER "AITHINKER" #define DEVICE "AI_LIGHT" #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT #define LIGHT_PROVIDER LIGHT_PROVIDER_MY9192 @@ -615,7 +615,7 @@ #elif defined(MAGICHOME_LED_CONTROLLER) // Info - #define MANUFACTURER "MAGIC_HOME" + #define MANUFACTURER "MAGICHOME" #define DEVICE "LED_CONTROLLER" #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER @@ -674,7 +674,7 @@ #elif defined(JANGOE_WIFI_RELAY_NC) // Info - #define MANUFACTURER "JAN_GOEDEKE" + #define MANUFACTURER "JANGOE" #define DEVICE "WIFI_RELAY_NC" // Buttons @@ -697,7 +697,7 @@ #elif defined(JANGOE_WIFI_RELAY_NO) // Info - #define MANUFACTURER "JAN_GOEDEKE" + #define MANUFACTURER "JANGOE" #define DEVICE "WIFI_RELAY_NO" // Buttons @@ -726,7 +726,7 @@ #elif defined(JORGEGARCIA_WIFI_RELAYS) // Info - #define MANUFACTURER "JORGE_GARCIA" + #define MANUFACTURER "JORGEGARCIA" #define DEVICE "WIFI_RELAYS" // Relays diff --git a/code/ota_flash.sh b/code/ota_flash.sh index 7e6df7f0..f8c12c4a 100755 --- a/code/ota_flash.sh +++ b/code/ota_flash.sh @@ -157,7 +157,7 @@ if [ "$board" == "" ]; then fi if [ "$ip" == "" ]; then - read -p "IP of the device to flash: " -e -i 192.168.1.4 ip + read -p "IP of the device to flash: " -e -i 192.168.4.1 ip fi if [ "$ip" == "" ]; then @@ -176,11 +176,11 @@ fi read -p "Environment to build: " -e -i "esp8266-1m-ota" env echo -echo "IP = $ip" -echo "BOARD = $board" -echo "AUTH = $auth" -echo "FLAGS = $flags" -echo "ENV = $env" +echo "ESPURNA_IP = $ip" +echo "ESPURNA_BOARD = $board" +echo "ESPURNA_AUTH = $auth" +echo "ESPURNA_FLAGS = $flags" +echo "ESPURNA_ENV = $env" echo echo -n "Are these values corrent [y/N]: " @@ -190,9 +190,9 @@ if [ "$response" != "y" ]; then exit fi -export IP=$ip -export BOARD=$board -export AUTH=$auth -export FLAGS=$flags +export ESPURNA_IP=$ip +export ESPURNA_BOARD=$board +export ESPURNA_AUTH=$auth +export ESPURNA_FLAGS=$flags pio run -e $env -t upload diff --git a/code/platformio.ini b/code/platformio.ini index 006c26e9..15cf222a 100644 --- a/code/platformio.ini +++ b/code/platformio.ini @@ -4,7 +4,7 @@ src_dir = espurna data_dir = espurna/data [common] -build_flags = -g -DMQTT_MAX_PACKET_SIZE=400 ${env.FLAGS} +build_flags = -g -DMQTT_MAX_PACKET_SIZE=400 ${env.ESPURNA_FLAGS} debug_flags = -DDEBUG_ESP_CORE -DDEBUG_ESP_SSL -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_HTTP_SERVER -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_TLS_MEM build_flags_512k = ${common.build_flags} -Wl,-Tesp8266.flash.512k0.ld build_flags_1m = ${common.build_flags} -Wl,-Tesp8266.flash.1m0.ld @@ -723,6 +723,29 @@ upload_port = "192.168.4.1" upload_flags = --auth=fibonacci --port 8266 monitor_baud = 115200 +[env:huacanxing-h802] +platform = espressif8266 +framework = arduino +board = esp01_1m +board_flash_mode = dout +lib_deps = ${common.lib_deps} +lib_ignore = ${common.lib_ignore} +build_flags = -g -Wl,-Tesp8266.flash.1m0.ld -DHUACANXING_H802 -DDEBUG_PORT=Serial1 +monitor_baud = 115200 + +[env:huacanxing-h802-ota] +platform = espressif8266 +framework = arduino +board = esp01_1m +board_flash_mode = dout +lib_deps = ${common.lib_deps} +lib_ignore = ${common.lib_ignore} +build_flags = -g -Wl,-Tesp8266.flash.1m0.ld -DHUACANXING_H802 -DDEBUG_PORT=Serial1 +upload_speed = 115200 +upload_port = "192.168.4.1" +upload_flags = --auth=fibonacci --port 8266 +monitor_baud = 115200 + [env:itead-bnsz01] platform = espressif8266 framework = arduino @@ -730,7 +753,7 @@ board = esp8285 board_flash_mode = dout lib_deps = ${common.lib_deps} lib_ignore = ${common.lib_ignore} -build_flags = ${common.build_flags_1m} -DITEAD_BN_SZ01 +build_flags = ${common.build_flags_1m} -DITEAD_BNSZ01 monitor_baud = 115200 [env:itead-bnsz01-ota] @@ -740,7 +763,7 @@ board = esp8285 board_flash_mode = dout lib_deps = ${common.lib_deps} lib_ignore = ${common.lib_ignore} -build_flags = ${common.build_flags_1m} -DITEAD_BN_SZ01 +build_flags = ${common.build_flags_1m} -DITEAD_BNSZ01 upload_speed = 115200 upload_port = "192.168.4.1" upload_flags = --auth=fibonacci --port 8266 @@ -803,10 +826,10 @@ board = esp8285 board_flash_mode = dout lib_deps = ${common.lib_deps} lib_ignore = ${common.lib_ignore} -build_flags = ${common.build_flags_1m} -D${env.BOARD} +build_flags = ${common.build_flags_1m} -D${env.ESPURNA_BOARD} upload_speed = 115200 -upload_port = "${env.IP}" -upload_flags = --auth=${env.AUTH} --port 8266 +upload_port = "${env.ESPURNA_IP}" +upload_flags = --auth=${env.ESPURNA_AUTH} --port 8266 [env:esp8266-1m-ota] platform = espressif8266 @@ -815,10 +838,10 @@ board = esp01_1m board_flash_mode = dout lib_deps = ${common.lib_deps} lib_ignore = ${common.lib_ignore} -build_flags = ${common.build_flags_1m} -D${env.BOARD} +build_flags = ${common.build_flags_1m} -D${env.ESPURNA_BOARD} upload_speed = 115200 -upload_port = "${env.IP}" -upload_flags = --auth=${env.AUTH} --port 8266 +upload_port = "${env.ESPURNA_IP}" +upload_flags = --auth=${env.ESPURNA_AUTH} --port 8266 [env:esp8266-4m-ota] platform = espressif8266 @@ -827,30 +850,7 @@ board = esp12e board_flash_mode = dout lib_deps = ${common.lib_deps} lib_ignore = ${common.lib_ignore} -build_flags = ${common.build_flags} -D${env.BOARD} +build_flags = ${common.build_flags} -D${env.ESPURNA_BOARD} upload_speed = 115200 -upload_port = "${env.IP}" -upload_flags = --auth=${env.AUTH} --port 8266 - -[env:huacanxing-h802] -platform = espressif8266 -framework = arduino -board = esp01_1m -board_flash_mode = dout -lib_deps = ${common.lib_deps} -lib_ignore = ${common.lib_ignore} -build_flags = -g -Wl,-Tesp8266.flash.1m0.ld -DHUACANXING_H802 -DDEBUG_PORT=Serial1 -monitor_baud = 115200 - -[env:huacanxing-h802-ota] -platform = espressif8266 -framework = arduino -board = esp01_1m -board_flash_mode = dout -lib_deps = ${common.lib_deps} -lib_ignore = ${common.lib_ignore} -build_flags = -g -Wl,-Tesp8266.flash.1m0.ld -DHUACANXING_H802 -DDEBUG_PORT=Serial1 -upload_speed = 115200 -upload_port = "192.168.4.1" -upload_flags = --auth=fibonacci --port 8266 -monitor_baud = 115200 +upload_port = "${env.ESPURNA_IP}" +upload_flags = --auth=${env.ESPURNA_AUTH} --port 8266