Compare commits
8 Commits
MoveToBuil
...
master
Author | SHA1 | Date | |
---|---|---|---|
f5b6e2f986
|
|||
169200fc60 | |||
5a9ff398a4
|
|||
859dcf5f24
|
|||
67f181076e
|
|||
ff85deb2bf
|
|||
7887f67442
|
|||
49afd6d818
|
6
.gitignore
vendored
6
.gitignore
vendored
@ -1 +1,7 @@
|
||||
/Release/
|
||||
libraries/includes/configuration.cpp
|
||||
libraries/includes/configuration.h
|
||||
sketch.esp8266.esp8266.nodemcu.bin
|
||||
sketch.esp8266.esp8266.nodemcu.elf
|
||||
sketch/sketch.esp8266.esp8266.nodemcu.bin
|
||||
sketch/sketch.esp8266.esp8266.nodemcu.elf
|
||||
|
@ -4,7 +4,7 @@ stages:
|
||||
|
||||
build:
|
||||
stage: build
|
||||
image: registry.gitlab.com/wolutator/build-env-arduino:latest
|
||||
image: registry.hottis.de/dockerized/build-env-arduino:latest
|
||||
tags:
|
||||
- hottis
|
||||
- linux
|
||||
@ -18,14 +18,12 @@ build:
|
||||
except:
|
||||
- tags
|
||||
script:
|
||||
- pushd $CI_PROJECT_DIR/libraries/esp8266boilerplate/ConfigGenerator && ./configGen.sh && popd
|
||||
- env ARDUINO_SKETCHBOOK_DIR=$CI_PROJECT_DIR arduino-cli compile --fqbn=esp8266:esp8266:nodemcu $CI_PROJECT_DIR/sketch
|
||||
- cp sketch/sketch.esp8266.esp8266.nodemcu.* .
|
||||
- ./build.sh build $CI_PROJECT_DIR
|
||||
|
||||
|
||||
release:
|
||||
stage: release
|
||||
image: registry.gitlab.com/wolutator/base-build-env
|
||||
image: registry.hottis.de/dockerized/base-build-env
|
||||
tags:
|
||||
- hottis
|
||||
- linux
|
||||
@ -37,5 +35,5 @@ release:
|
||||
- release
|
||||
script:
|
||||
- gitlabreleaseuploader.py -p $PRIVATE_TOKEN -i $CI_PROJECT_ID -u $CI_PROJECT_URL
|
||||
-f sketch.esp8266.esp8266.nodemcu.bin -F releaseInfo.json -T $CI_COMMIT_REF_NAME
|
||||
-f sketch.esp8266.esp8266.nodemcu.bin -F releaseInfo.json -T $CI_COMMIT_REF_NAME -c
|
||||
|
||||
|
36
build.sh
Executable file
36
build.sh
Executable file
@ -0,0 +1,36 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ "$1" == "" ]; then
|
||||
echo "Give one of the targets: build, clean, upload"
|
||||
echo "If you want to use a project directory different"
|
||||
echo "than the current directory, give it as a second"
|
||||
echo "argument."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ "$2" != "" ]; then
|
||||
PROJECT_DIR=$2
|
||||
else
|
||||
PROJECT_DIR=$PWD
|
||||
fi
|
||||
|
||||
|
||||
if [ "$1" == "build" ]; then
|
||||
pushd $PROJECT_DIR/libraries/esp8266boilerplate/ConfigGenerator && ./configGen.sh && popd
|
||||
env ARDUINO_SKETCHBOOK_DIR=$PROJECT_DIR arduino-cli compile --fqbn=esp8266:esp8266:nodemcu $PROJECT_DIR/sketch
|
||||
cp sketch/sketch.esp8266.esp8266.nodemcu.* .
|
||||
elif [ "$1" == "clean" ]; then
|
||||
for D in libraries/includes/configuration.h libraries/includes/configuration.cpp sketch/sketch.esp8266.esp8266.nodemcu.bin sketch/sketch.esp8266.esp8266.nodemcu.elf sketch.esp8266.esp8266.nodemcu.bin sketch.esp8266.esp8266.nodemcu.elf; do
|
||||
echo -n "About to delete $D ... "
|
||||
rm $PROJECT_DIR/$D && echo "done"
|
||||
done
|
||||
elif [ "$1" == "upload" ]; then
|
||||
echo "About to upload to device"
|
||||
esptool.py --port /dev/ttyUSB1 write_flash 0 sketch.esp8266.esp8266.nodemcu.bin
|
||||
else
|
||||
echo "Unknown subcommand '$1'"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
|
@ -8,7 +8,7 @@
|
||||
#ifndef DEFINES_H_
|
||||
#define DEFINES_H_
|
||||
|
||||
//#define DEBUG
|
||||
// #define DEBUG
|
||||
#define SLEEP
|
||||
|
||||
#define EEPROM_ADDR 0
|
||||
|
@ -1,6 +1,7 @@
|
||||
{
|
||||
"releaseTag": "v0.0.1",
|
||||
"releaseTag": "v0.0.2",
|
||||
"createReleaseTag": "true",
|
||||
"createRelease": "true",
|
||||
"releaseName": "initial",
|
||||
"description": "initial automatic build"
|
||||
}
|
||||
|
@ -75,25 +75,29 @@ void read_thermometer() {
|
||||
}
|
||||
|
||||
void loopApplication() {
|
||||
static uint32_t lastMillis = 0;
|
||||
mqttLoop();
|
||||
|
||||
#ifndef SLEEP
|
||||
static uint32_t lastMillis = 0;
|
||||
uint32_t currentMillis = millis();
|
||||
if (currentMillis - lastMillis > 1000) {
|
||||
if (currentMillis - lastMillis > (configBlock.measurePeriod * 1000)) {
|
||||
lastMillis = currentMillis;
|
||||
#endif
|
||||
|
||||
read_thermometer();
|
||||
|
||||
#ifndef SLEEP
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef SLEEP
|
||||
#ifdef DEBUG
|
||||
Serial.println("Sleeping");
|
||||
Serial.println("Sleeping");
|
||||
#endif
|
||||
mqttClient.disconnect();
|
||||
ESP.deepSleep(configBlock.measurePeriod * 1000000);
|
||||
mqttClient.disconnect();
|
||||
ESP.deepSleep(configBlock.measurePeriod * 1000000);
|
||||
#endif
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user