STM32 fix&slim, Wifi manager ESP32, compiled binaries updated for all platforms

This commit is contained in:
2019-03-23 22:26:58 +03:00
parent 6fa661690b
commit 8b9584f975
22 changed files with 15977 additions and 7258 deletions

View File

@@ -1,9 +1,9 @@
#! /bin/bash #! /bin/bash
export FLAGS="$FLAGS -DPIO_SRC_REV="$(git log --pretty=format:%h_%ad -1 --date=short) export FLAGS="$FLAGS -DPIO_SRC_REV="$(git log --pretty=format:%h_%ad -1 --date=short)
export FLAGS="$FLAGS -DDMX_DISABLE" #export FLAGS="$FLAGS -DDMX_DISABLE"
export FLAGS="$FLAGS -DMODBUS_DISABLE" export FLAGS="$FLAGS -DMODBUS_DISABLE"
export FLAGS="$FLAGS -DOWIRE_DISABLE" #export FLAGS="$FLAGS -DOWIRE_DISABLE"
export FLAGS="$FLAGS -DDHT_DISABLE" #export FLAGS="$FLAGS -DDHT_DISABLE"
export FLAGS="$FLAGS -DCOUNTER_DISABLE" export FLAGS="$FLAGS -DCOUNTER_DISABLE"
#export FLAGS="$FLAGS -std=gnu++11" #export FLAGS="$FLAGS -std=gnu++11"
CUSTOM_BUILD_FLAGS_FILE=custom-build-flags/build_flags_esp32.sh CUSTOM_BUILD_FLAGS_FILE=custom-build-flags/build_flags_esp32.sh

View File

@@ -6,6 +6,7 @@ export FLAGS="$FLAGS -DMODBUS_DISABLE"
export FLAGS="$FLAGS -DOWIRE_DISABLE" export FLAGS="$FLAGS -DOWIRE_DISABLE"
export FLAGS="$FLAGS -DDHT_DISABLE" export FLAGS="$FLAGS -DDHT_DISABLE"
export FLAGS="$FLAGS -DCOUNTER_DISABLE" export FLAGS="$FLAGS -DCOUNTER_DISABLE"
export FLAGS="$FLAGS -DNO_HOMIE"
if [ -f $CUSTOM_BUILD_FLAGS_FILE ]; then if [ -f $CUSTOM_BUILD_FLAGS_FILE ]; then
source $CUSTOM_BUILD_FLAGS_FILE source $CUSTOM_BUILD_FLAGS_FILE
fi fi

Binary file not shown.

Binary file not shown.

BIN
compiled/DUE/firmware.bin Executable file

Binary file not shown.

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

BIN
compiled/due-5500/firmware.bin Executable file

Binary file not shown.

BIN
compiled/esp32/firmware.bin Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

BIN
compiled/stm32/firmware.bin Executable file

Binary file not shown.

View File

@@ -3,13 +3,13 @@
# first make your own copy of template # first make your own copy of template
# cp build_flags_template.sh build_flags_ENVNAME.sh # cp build_flags_template.sh build_flags_ENVNAME.sh
# then edit, change or comment something # then edit, change or comment something
export FLAGS="$FLAGS -DMY_CONFIG_SERVER=lazyhome.ru" # export FLAGS="$FLAGS -DMY_CONFIG_SERVER=lazyhome.ru"
#export FLAGS="$FLAGS -DWATCH_DOG_TICKER_DISABLE" # export FLAGS="$FLAGS -DWATCH_DOG_TICKER_DISABLE"
#export FLAGS="$FLAGS -DUSE_1W_PIN=12" # export FLAGS="$FLAGS -DUSE_1W_PIN=12"
#export FLAGS="$FLAGS -DSD_CARD_INSERTED" # export FLAGS="$FLAGS -DSD_CARD_INSERTED"
export FLAGS="$FLAGS -DSERIAL_BAUD=115200" # export FLAGS="$FLAGS -DSERIAL_BAUD=115200"
#export FLAGS="$FLAGS -DWiz5500" # export FLAGS="$FLAGS -DWiz5500"
#export FLAGS="$FLAGS -DDISABLE_FREERAM_PRINT" # export FLAGS="$FLAGS -DDISABLE_FREERAM_PRINT"
export FLAGS="$FLAGS -DCUSTOM_FIRMWARE_MAC=de:ad:be:ef:fe:ff" export FLAGS="$FLAGS -DCUSTOM_FIRMWARE_MAC=de:ad:be:ef:fe:ff"
# export FLAGS="$FLAGS -DDMX_DISABLE" # export FLAGS="$FLAGS -DDMX_DISABLE"
# export FLAGS="$FLAGS -DMODBUS_DISABLE" # export FLAGS="$FLAGS -DMODBUS_DISABLE"
@@ -24,9 +24,10 @@
# export FLAGS="$FLAGS -DDHCP_RETRY_INTERVAL=60000" # export FLAGS="$FLAGS -DDHCP_RETRY_INTERVAL=60000"
# export FLAGS="$FLAGS -DRESTART_LAN_ON_MQTT_ERRORS" # export FLAGS="$FLAGS -DRESTART_LAN_ON_MQTT_ERRORS"
# export FLAGS="$FLAGS -DW5500_CS_PIN=53" # export FLAGS="$FLAGS -DW5500_CS_PIN=53"
#export FLAGS="$FLAGS -DSYSLOG_ENABLE" # export FLAGS="$FLAGS -DSYSLOG_ENABLE"
#export FLAGS="$FLAGS -DDEVICE_NAME=MYDEVICE" # export FLAGS="$FLAGS -DDEVICE_NAME=MYDEVICE"
#export FLAGS="$FLAGS -DDHT_COUNTER_DISABLE" # export FLAGS="$FLAGS -DDHT_DISABLE"
#export FLAGS="$FLAGS -DWITH_PRINTEX_LIB" # export FLAGS="$FLAGS -DCOUNTER_DISABLE"
export FLAGS="$FLAGS -DPIO_SRC_REV="$(git log --pretty=format:%h_%ad -1 --date=short) # export FLAGS="$FLAGS -DWITH_PRINTEX_LIB"
# export FLAGS="$FLAGS -DPIO_SRC_REV="$(git log --pretty=format:%h_%ad -1 --date=short)
echo $FLAGS echo $FLAGS

View File

@@ -51,7 +51,7 @@ static volatile long counter_value[6];
static volatile long counter_value[6]; static volatile long counter_value[6];
#endif #endif
#if defined(__SAM3X8E__) || defined(ARDUINO_ARCH_STM32F1) #if defined(__SAM3X8E__) || defined(ARDUINO_ARCH_STM32)
static short counter_irq_map[54]; static short counter_irq_map[54];
static long counter_value[54]; static long counter_value[54];
static int counters_count; static int counters_count;
@@ -343,12 +343,15 @@ void Input::dht22Poll() {
void Input::contactPoll() { void Input::contactPoll() {
boolean currentInputState; boolean currentInputState;
#if defined(ARDUINO_ARCH_STM32F1) /*
#if defined(ARDUINO_ARCH_STM32)
WiringPinMode inputPinMode; WiringPinMode inputPinMode;
#endif #endif
#if defined(__SAM3X8E__)||defined(ARDUINO_ARCH_AVR)||defined(ARDUINO_ARCH_ESP8266)||defined(ARDUINO_ARCH_ESP32) #if defined(__SAM3X8E__)||defined(ARDUINO_ARCH_AVR)||defined(ARDUINO_ARCH_ESP8266)||defined(ARDUINO_ARCH_ESP32)
#endif #endif
*/
uint32_t inputPinMode; uint32_t inputPinMode;
uint8_t inputOnLevel; uint8_t inputOnLevel;
if (inType & IN_ACTIVE_HIGH) { if (inType & IN_ACTIVE_HIGH) {
@@ -387,12 +390,14 @@ void Input::analogPoll() {
short Noize = ANALOG_NOIZE; short Noize = ANALOG_NOIZE;
short simple = 0; short simple = 0;
#if defined(ARDUINO_ARCH_STM32F1) /*
#if defined(ARDUINO_ARCH_STM32)
WiringPinMode inputPinMode; WiringPinMode inputPinMode;
#endif #endif
#if defined(__SAM3X8E__)||defined(ARDUINO_ARCH_AVR)||defined(ARDUINO_ARCH_ESP8266)||defined(ARDUINO_ARCH_ESP32) #if defined(__SAM3X8E__)||defined(ARDUINO_ARCH_AVR)||defined(ARDUINO_ARCH_ESP8266)||defined(ARDUINO_ARCH_ESP32)
#endif #endif */
uint32_t inputPinMode; uint32_t inputPinMode;
if (inType & IN_ACTIVE_HIGH) { if (inType & IN_ACTIVE_HIGH) {
inputPinMode = INPUT; inputPinMode = INPUT;

View File

@@ -277,7 +277,7 @@ if (isSet)
case -1: //Not known command case -1: //Not known command
case -2: //JSON input (not implemented yet case -2: //JSON input (not implemented yet
break; break;
#if not defined(ARDUINO_ARCH_ESP32) and not defined(ESP8266) and not defined(ARDUINO_ARCH_STM32F1) and not defined(DMX_DISABLE) #if not defined(ARDUINO_ARCH_ESP32) and not defined(ESP8266) and not defined(ARDUINO_ARCH_STM32) and not defined(DMX_DISABLE)
case -3: //RGB color in #RRGGBB notation case -3: //RGB color in #RRGGBB notation
{ {
CRGB rgb; CRGB rgb;

View File

@@ -88,6 +88,7 @@ NRFFlashStorage EEPROM;
#ifdef ARDUINO_ARCH_STM32 #ifdef ARDUINO_ARCH_STM32
EthernetClient ethClient; EthernetClient ethClient;
NRFFlashStorage EEPROM;
#endif #endif
#ifdef NRF5 #ifdef NRF5
@@ -618,7 +619,7 @@ void onInitialStateInitLAN() {
} }
#endif #endif
#if defined(ARDUINO_ARCH_AVR) || defined(__SAM3X8E__)||defined(ARDUINO_ARCH_STM32F1) #if defined(ARDUINO_ARCH_AVR) || defined(__SAM3X8E__)||defined(ARDUINO_ARCH_STM32)
#ifdef W5500_CS_PIN #ifdef W5500_CS_PIN
Ethernet.w5500_cspin = W5500_CS_PIN; Ethernet.w5500_cspin = W5500_CS_PIN;
debugSerial<<F("Use W5500 pin: "); debugSerial<<F("Use W5500 pin: ");
@@ -652,7 +653,7 @@ void onInitialStateInitLAN() {
#if defined(ARDUINO_ARCH_AVR) || defined(__SAM3X8E__) #if defined(ARDUINO_ARCH_AVR) || defined(__SAM3X8E__)
res = Ethernet.begin(mac, 12000); res = Ethernet.begin(mac, 12000);
#endif #endif
#if defined(ARDUINO_ARCH_STM32F1) #if defined(ARDUINO_ARCH_STM32)
res = Ethernet.begin(mac); res = Ethernet.begin(mac);
#endif #endif
wdt_en(); wdt_en();
@@ -678,9 +679,10 @@ void onInitialStateInitLAN() {
#endif #endif
} }
#ifdef ARDUINO_ARCH_STM32F1 #ifdef ARDUINO_ARCH_STM32
void softRebootFunc() { void softRebootFunc() {
nvic_sys_reset(); //nvic_sys_reset();
Serial.println("not implemented");
} }
#endif #endif
@@ -1162,7 +1164,7 @@ lan_status loadConfigFromHttp(int arg_cnt, char **args)
return READ_RE_CONFIG;//-11; return READ_RE_CONFIG;//-11;
} }
#endif #endif
#if defined(__SAM3X8E__) || defined(ARDUINO_ARCH_STM32F1) || defined(ARDUINO_ARCH_ESP32) #if defined(__SAM3X8E__) || defined(ARDUINO_ARCH_STM32) || defined(ARDUINO_ARCH_ESP32)
#if defined(ARDUINO_ARCH_ESP32) #if defined(ARDUINO_ARCH_ESP32)
WiFiClient configEthClient; WiFiClient configEthClient;
#else #else
@@ -1301,7 +1303,7 @@ void setup_main() {
ArtnetSetup(); ArtnetSetup();
#endif #endif
#if defined(ARDUINO_ARCH_ESP8266) and not defined(WIFI_MANAGER_DISABLE) #if (defined(ARDUINO_ARCH_ESP8266) or defined(ARDUINO_ARCH_ESP32)) and not defined(WIFI_MANAGER_DISABLE)
WiFiManager wifiManager; WiFiManager wifiManager;
#if defined(ESP_WIFI_AP) and defined(ESP_WIFI_PWD) #if defined(ESP_WIFI_AP) and defined(ESP_WIFI_PWD)
wifiManager.autoConnect(QUOTE(ESP_WIFI_AP), QUOTE(ESP_WIFI_PWD)); wifiManager.autoConnect(QUOTE(ESP_WIFI_AP), QUOTE(ESP_WIFI_PWD));

View File

@@ -48,7 +48,8 @@
#ifdef ARDUINO_ARCH_STM32 #ifdef ARDUINO_ARCH_STM32
#include "HttpClient.h" #include "HttpClient.h"
#include "UIPEthernet.h" #include "UIPEthernet.h"
#include <EEPROM.h> #include <NRFFlashStorage.h>
//#include <EEPROM.h>
#endif #endif
#if defined(__SAM3X8E__) #if defined(__SAM3X8E__)

View File

@@ -9,7 +9,7 @@
; http://docs.platformio.org/page/projectconf.html ; http://docs.platformio.org/page/projectconf.html
[platformio] [platformio]
src_dir = lighthub src_dir = lighthub
;env_default = esp8266 ;env_default = esp32
;monitor_speed = 115200 ;monitor_speed = 115200
; megaatmega2560 ; megaatmega2560
; megaatmega2560-net ; megaatmega2560-net
@@ -93,24 +93,11 @@ lib_ignore =
HTTPClient HTTPClient
httpClient httpClient
EEPROM EEPROM
https://github.com/anklimov/ModbusMaster
https://github.com/anklimov/Arduino-Temperature-Control-Library.git
https://github.com/anklimov/DS2482_OneWire
DS2482_OneWire
OneWire
DallasTemperature
ModbusMaster
Artnet Artnet
https://github.com/anklimov/Artnet.git
https://github.com/anklimov/ESP-Dmx
HTTPClient HTTPClient
FastLED
Adafruit Unified Sensor
DHT sensor library for ESPx
DHT sensor library
Wire
UIPEthernet UIPEthernet
ESP_EEPROM ESP_EEPROM
EEPROM
lib_deps = lib_deps =
https://github.com/ebenolson/WIFIMANAGER-ESP32.git https://github.com/ebenolson/WIFIMANAGER-ESP32.git
https://github.com/zhouhan0126/WebServer-esp32.git https://github.com/zhouhan0126/WebServer-esp32.git
@@ -121,6 +108,15 @@ lib_deps =
Streaming Streaming
;ESP_EEPROM ;ESP_EEPROM
https://github.com/anklimov/NRFFlashStorage https://github.com/anklimov/NRFFlashStorage
Adafruit Unified Sensor
DHT sensor library for ESPx
https://github.com/anklimov/Artnet.git
https://github.com/anklimov/ModbusMaster
https://github.com/anklimov/Arduino-Temperature-Control-Library.git
https://github.com/anklimov/DS2482_OneWire
https://github.com/anklimov/ESP-Dmx
FastLED
[env:due] [env:due]
platform = atmelsam platform = atmelsam
framework = arduino framework = arduino
@@ -139,6 +135,7 @@ lib_ignore =
NRFFlashStorage NRFFlashStorage
WebServer WebServer
UIPEthernet UIPEthernet
EEPROM
lib_deps = lib_deps =
https://github.com/sebnil/DueFlashStorage https://github.com/sebnil/DueFlashStorage
https://github.com/anklimov/Arduino-Temperature-Control-Library.git https://github.com/anklimov/Arduino-Temperature-Control-Library.git
@@ -216,6 +213,7 @@ lib_ignore =
Ethernet Ethernet
NRFFlashStorage NRFFlashStorage
UIPEthernet UIPEthernet
EEPROM
lib_deps = lib_deps =
https://github.com/anklimov/Arduino-Temperature-Control-Library.git https://github.com/anklimov/Arduino-Temperature-Control-Library.git
https://github.com/anklimov/DS2482_OneWire https://github.com/anklimov/DS2482_OneWire
@@ -291,6 +289,7 @@ lib_ignore =
WebServer WebServer
UIPEthernet UIPEthernet
ESP_EEPROM ESP_EEPROM
EEPROM
lib_deps = lib_deps =
https://github.com/sebnil/DueFlashStorage https://github.com/sebnil/DueFlashStorage
https://github.com/anklimov/Arduino-Temperature-Control-Library.git https://github.com/anklimov/Arduino-Temperature-Control-Library.git
@@ -373,18 +372,21 @@ lib_ignore =
Ethernet2 Ethernet2
Artnet Artnet
Ethernet3 Ethernet3
NRFFlashStorage
WebServer WebServer
ESP_EEPROM ESP_EEPROM
DHT sensor library
DallasTemperature
Adafruit Unified Sensor
DS2482_OneWire
ModbusMaster
Syslog
Wire
EEPROM
lib_deps = lib_deps =
; DallasTemperature
https://github.com/anklimov/aJson https://github.com/anklimov/aJson
https://github.com/anklimov/CmdArduino https://github.com/anklimov/CmdArduino
ArduinoHttpClient ArduinoHttpClient
https://github.com/knolleary/pubsubclient.git https://github.com/knolleary/pubsubclient.git
Adafruit Unified Sensor
DHT sensor library
Streaming Streaming
UIPEthernet UIPEthernet
;EEPROM https://github.com/anklimov/NRFFlashStorage