formatting changes

comments
wifi manager
This commit is contained in:
Lukas Heiligenbrunner 2020-04-11 10:23:02 +02:00
parent 56b7aa1426
commit a42b4529e6
6 changed files with 25 additions and 74 deletions

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="SerialMonitorSettings" PortName="/dev/ttyUSB0" BaudRate="9600" LineEndingsIndex="0" /> <component name="SerialMonitorSettings" PortName="/dev/ttyUSB1" BaudRate="9600" LineEndingsIndex="0" ShowStatusWidget="false" />
</project> </project>

View File

@ -5,8 +5,12 @@
# please create `CMakeListsUser.txt` in the root of project. # please create `CMakeListsUser.txt` in the root of project.
# The `CMakeListsUser.txt` will not be overwritten by PlatformIO. # The `CMakeListsUser.txt` will not be overwritten by PlatformIO.
cmake_minimum_required(VERSION 3.2) cmake_minimum_required(VERSION 3.13)
project("PumpenSteuerung") set(CMAKE_SYSTEM_NAME Generic)
set(CMAKE_C_COMPILER_WORKS 1)
set(CMAKE_CXX_COMPILER_WORKS 1)
project("PumpenSteuerung" C CXX)
include(CMakeListsPrivate.txt) include(CMakeListsPrivate.txt)
@ -15,74 +19,14 @@ include(CMakeListsUser.txt)
endif() endif()
add_custom_target( add_custom_target(
PLATFORMIO_BUILD ALL Production ALL
COMMAND ${PLATFORMIO_CMD} -f -c clion run "$<$<NOT:$<CONFIG:All>>:-e${CMAKE_BUILD_TYPE}>" COMMAND platformio -c clion run "$<$<NOT:$<CONFIG:All>>:-e${CMAKE_BUILD_TYPE}>"
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
) )
add_custom_target( add_custom_target(
PLATFORMIO_BUILD_VERBOSE ALL Debug ALL
COMMAND ${PLATFORMIO_CMD} -f -c clion run --verbose "$<$<NOT:$<CONFIG:All>>:-e${CMAKE_BUILD_TYPE}>" COMMAND platformio -c clion run --target debug "$<$<NOT:$<CONFIG:All>>:-e${CMAKE_BUILD_TYPE}>"
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
add_custom_target(
PLATFORMIO_UPLOAD ALL
COMMAND ${PLATFORMIO_CMD} -f -c clion run --target upload "$<$<NOT:$<CONFIG:All>>:-e${CMAKE_BUILD_TYPE}>"
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
add_custom_target(
PLATFORMIO_CLEAN ALL
COMMAND ${PLATFORMIO_CMD} -f -c clion run --target clean "$<$<NOT:$<CONFIG:All>>:-e${CMAKE_BUILD_TYPE}>"
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
add_custom_target(
PLATFORMIO_MONITOR ALL
COMMAND ${PLATFORMIO_CMD} -f -c clion device monitor "$<$<NOT:$<CONFIG:All>>:-e${CMAKE_BUILD_TYPE}>"
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
add_custom_target(
PLATFORMIO_TEST ALL
COMMAND ${PLATFORMIO_CMD} -f -c clion test "$<$<NOT:$<CONFIG:All>>:-e${CMAKE_BUILD_TYPE}>"
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
add_custom_target(
PLATFORMIO_PROGRAM ALL
COMMAND ${PLATFORMIO_CMD} -f -c clion run --target program "$<$<NOT:$<CONFIG:All>>:-e${CMAKE_BUILD_TYPE}>"
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
add_custom_target(
PLATFORMIO_UPLOADFS ALL
COMMAND ${PLATFORMIO_CMD} -f -c clion run --target uploadfs "$<$<NOT:$<CONFIG:All>>:-e${CMAKE_BUILD_TYPE}>"
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
add_custom_target(
PLATFORMIO_BUILD_DEBUG ALL
COMMAND ${PLATFORMIO_CMD} -f -c clion run --target debug "$<$<NOT:$<CONFIG:All>>:-e${CMAKE_BUILD_TYPE}>"
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
add_custom_target(
PLATFORMIO_UPDATE_ALL ALL
COMMAND ${PLATFORMIO_CMD} -f -c clion update
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
add_custom_target(
PLATFORMIO_REBUILD_PROJECT_INDEX ALL
COMMAND ${PLATFORMIO_CMD} -f -c clion init --ide clion
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
add_custom_target(
PLATFORMIO_DEVICE_LIST ALL
COMMAND ${PLATFORMIO_CMD} -f -c clion device list
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
) )

View File

@ -12,4 +12,3 @@
platform = espressif8266 platform = espressif8266
board = esp07 board = esp07
framework = arduino framework = arduino

View File

@ -5,14 +5,14 @@
#include "WifiManager.h" #include "WifiManager.h"
void WifiManager::init() { void WifiManager::init() {
Serial.print("Setting soft-AP ... "); Serial.print("Setting up Access Point");
boolean result = WiFi.softAP("ESPsoftAP_01", "pass-to-soft-AP"); boolean result = WiFi.softAP("PumpenSteuerung-Heiligenbrunner", "1qayxsw2");
if(result == true) if(result == true)
{ {
Serial.println("Ready"); Serial.println("Wifi Ready");
} }
else else
{ {
Serial.println("Failed!"); Serial.println("Wifi Setup failed!");
} }
} }

View File

@ -8,6 +8,7 @@
#include <ESP8266WiFi.h> #include <ESP8266WiFi.h>
class WifiManager { class WifiManager {
public:
void init(); void init();
}; };

View File

@ -1,15 +1,19 @@
#include <Arduino.h> #include <Arduino.h>
#include <Ticker.h> #include <Ticker.h>
#include "WifiManager.h"
bool allow; bool allow;
bool error = false; bool error = false;
/** pin config */
static const uint8_t WasserSensorPin = 14; static const uint8_t WasserSensorPin = 14;
static const uint8_t DruckSensorPin = 12; static const uint8_t DruckSensorPin = 12;
static const uint8_t SchuetzPin = 13; static const uint8_t SchuetzPin = 13;
/** time config */ /** time config */
static const int abschaltzeit = 1800; //sek //static const int abschaltzeit = 1800; //sek
static const int abschaltzeit = 900; //sek
static const int maxpumpdauer = 600; //sek static const int maxpumpdauer = 600; //sek
Ticker tick; Ticker tick;
@ -143,6 +147,9 @@ void setup() {
Serial.println("startup sequence complete!\n"); Serial.println("startup sequence complete!\n");
digitalWrite(LED_BUILTIN, HIGH); digitalWrite(LED_BUILTIN, HIGH);
WifiManager mang = WifiManager();
mang.init();
} }