Compare commits
11 Commits
8ec16cda27
...
master
Author | SHA1 | Date | |
---|---|---|---|
4a4b8ee788
|
|||
83d6b40b20
|
|||
![]() |
8a0585887c | ||
749b1653a8
|
|||
2441590cb8
|
|||
c9073c1b7d
|
|||
4eb14ef3b5
|
|||
7a6268a074
|
|||
3a8286d445 | |||
063dbcf809
|
|||
7289d581a8
|
@@ -15,3 +15,6 @@ configItems = [
|
||||
{"label":"MQTT DebugTopic", "key":"mqttDebugTopic", "type":"C", "length":64, "default":"IoT/RgbLed1/Debug"},
|
||||
{"label":"DebugMode", "key":"debugMode", "type":"I", "default":0}
|
||||
]
|
||||
|
||||
magic = 0xC0DE0006
|
||||
appName = "ESP8266 based RgbLedLight"
|
||||
|
@@ -1,7 +1,7 @@
|
||||
#!/usr/bin/python
|
||||
|
||||
from Cheetah.Template import Template
|
||||
from ConfigDataStructure import configItems
|
||||
from ConfigDataStructure import configItems, magic, appName
|
||||
|
||||
|
||||
|
||||
@@ -23,8 +23,6 @@ from ConfigDataStructure import configItems
|
||||
#]
|
||||
|
||||
|
||||
magic = 0xC0DE0005
|
||||
appName = "ESP8266 based TwoLedSignal"
|
||||
confWifiSsid = "espconfig"
|
||||
|
||||
params = {
|
||||
|
@@ -1,12 +1,12 @@
|
||||
#!/bin/bash
|
||||
|
||||
|
||||
export PROJECTDIR=$PWD/../..
|
||||
export PROJECTDIR=$PWD/../../..
|
||||
|
||||
export PYTHONPATH=$PYTHONPATH:$PROJECTDIR
|
||||
export PYTHONPATH=$PYTHONPATH:$PROJECTDIR/sketch
|
||||
|
||||
python -B configGen.py
|
||||
|
||||
mv configuration.cpp configuration.h $PROJECTDIR
|
||||
mv configuration.cpp configuration.h $PROJECTDIR/libraries/includes
|
||||
|
||||
|
||||
|
12
application.cpp-example
Normal file
12
application.cpp-example
Normal file
@@ -0,0 +1,12 @@
|
||||
#include "defines.h"
|
||||
#include "configuration.h"
|
||||
|
||||
|
||||
void setupApplication() {
|
||||
}
|
||||
|
||||
|
||||
void loopApplication() {
|
||||
}
|
||||
|
||||
|
12
application.h-example
Normal file
12
application.h-example
Normal file
@@ -0,0 +1,12 @@
|
||||
#ifndef APPLICATION_H_
|
||||
#define APPLICATION_H_
|
||||
|
||||
|
||||
|
||||
void setupApplication();
|
||||
void loopApplication();
|
||||
|
||||
|
||||
|
||||
|
||||
#endif /* APPLICATION_H_ */
|
@@ -5,7 +5,7 @@
|
||||
* Author: wn
|
||||
*/
|
||||
|
||||
#include "../defines.h"
|
||||
#include <defines.h>
|
||||
|
||||
#include <ESP8266WiFi.h>
|
||||
#include <ESP8266WebServer.h>
|
||||
@@ -13,7 +13,7 @@
|
||||
|
||||
|
||||
#include "configurationMode.h"
|
||||
#include "../configuration.h"
|
||||
#include <configuration.h>
|
||||
|
||||
|
||||
|
||||
|
@@ -10,7 +10,9 @@
|
||||
|
||||
#define DEBUG
|
||||
|
||||
// for Nodemcu use D2
|
||||
#define CONFIG_SWITCH 0
|
||||
|
||||
#define EEPROM_ADDR 0
|
||||
|
||||
|
||||
|
4
main.cpp
4
main.cpp
@@ -1,12 +1,12 @@
|
||||
#include "main.h"
|
||||
#include "../defines.h"
|
||||
#include <defines.h>
|
||||
|
||||
// #define ESP8266
|
||||
|
||||
|
||||
#include <EEPROM.h>
|
||||
|
||||
#include "../configuration.h"
|
||||
#include <configuration.h>
|
||||
#include "productionMode.h"
|
||||
#include "configurationMode.h"
|
||||
|
||||
|
@@ -7,7 +7,7 @@
|
||||
|
||||
|
||||
|
||||
#include "../defines.h"
|
||||
#include <defines.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
@@ -16,7 +16,7 @@
|
||||
#include <ESP8266WiFi.h>
|
||||
#include <ESP8266WebServer.h>
|
||||
|
||||
#include "../configuration.h"
|
||||
#include <configuration.h>
|
||||
|
||||
void setup_wifi() {
|
||||
delay(10);
|
||||
@@ -61,6 +61,9 @@ void setupProduction() {
|
||||
|
||||
|
||||
void loopProduction() {
|
||||
if (WiFi.status() != WL_CONNECTED) {
|
||||
ESP.reset();
|
||||
}
|
||||
loopApplication();
|
||||
}
|
||||
|
||||
|
33
readme.md
Normal file
33
readme.md
Normal file
@@ -0,0 +1,33 @@
|
||||
# Usage of the esp8266boilerplate project in your own Arduino ESP8266 projects
|
||||
|
||||
Wolfgang Hottgenroth <woho@hottis.de>
|
||||
|
||||
|
||||
* Create an Arduino ESP8266 project in Sloeber
|
||||
* Add esp8266boilerplate as submodule to your project:
|
||||
|
||||
```
|
||||
git submodule init
|
||||
git submodule add git@gitlab.com:wolutator/esp8266boilerplate.git
|
||||
```
|
||||
|
||||
* Copy `ConfigGenerator/ConfigDataStructure.py-example` into your project directory,
|
||||
rename it to `ConfigDataStructure.py`
|
||||
* Edit `ConfigDataStructure.py` according to your requirements
|
||||
* Change into directory ConfigGenerator and run `configGen.sh`,
|
||||
it generates the configuration code for your projects into your
|
||||
project directory (files `configuration.cpp` and `configuration.h`, do not edit
|
||||
these files)
|
||||
* Copy `defines.h-example` into your project directory, rename it to `defines.h` and edit it
|
||||
according to your requirements
|
||||
* In to main cpp file of your project you have the functions `setup()` and `loop()`.
|
||||
Edit this file and call `mainSetup()` from the `setup()` function and `mainLoop()` from
|
||||
the `loop()` function. Do not change anything else in this file.
|
||||
* Add the directory `esp8266boilerplate` as an include and a source location in the
|
||||
properties of your project.
|
||||
* Create all the code you need for you application. Call your own main setup function
|
||||
`setupApplication()` and your own main loop function `loopApplication()`. These functions
|
||||
will be called via mainSetup and mainLoop when the system is running in production
|
||||
(in contrast to configuration) mode.
|
||||
|
||||
|
Reference in New Issue
Block a user