Compare commits
4 Commits
1de283b62f
...
a77918da41
Author | SHA1 | Date | |
---|---|---|---|
a77918da41 | |||
262dad38a6 | |||
cfc9f103cf | |||
0117302672 |
25
.github/workflows/providers/gitea-release.yml
vendored
25
.github/workflows/providers/gitea-release.yml
vendored
@ -74,23 +74,20 @@ jobs:
|
|||||||
# Copy firmware binary
|
# Copy firmware binary
|
||||||
cp .pio/build/esp32dev/firmware.bin .pio/build/esp32dev/filaman_${VERSION}.bin
|
cp .pio/build/esp32dev/firmware.bin .pio/build/esp32dev/filaman_${VERSION}.bin
|
||||||
|
|
||||||
# Copy SPIFFS binary if SPIFFS changed
|
# Always create SPIFFS binary
|
||||||
if [[ "${{ steps.check_spiffs.outputs.SPIFFS_CHANGED }}" == "true" ]]; then
|
|
||||||
echo "SPIFFS changes detected, copying SPIFFS binary..."
|
|
||||||
cp .pio/build/esp32dev/spiffs.bin .pio/build/esp32dev/webpage_${VERSION}.bin
|
cp .pio/build/esp32dev/spiffs.bin .pio/build/esp32dev/webpage_${VERSION}.bin
|
||||||
fi
|
|
||||||
|
|
||||||
# Create full binary (always)
|
# Create full binary (always)
|
||||||
(cd .pio/build/esp32dev && \
|
(cd .pio/build/esp32dev &&
|
||||||
esptool.py --chip esp32 merge_bin \
|
esptool.py --chip esp32 merge_bin
|
||||||
--fill-flash-size 4MB \
|
--fill-flash-size 4MB
|
||||||
--flash_mode dio \
|
--flash_mode dio
|
||||||
--flash_freq 40m \
|
--flash_freq 40m
|
||||||
--flash_size 4MB \
|
--flash_size 4MB
|
||||||
-o filaman_full_${VERSION}.bin \
|
-o filaman_full_${VERSION}.bin
|
||||||
0x0000 bootloader.bin \
|
0x0000 bootloader.bin
|
||||||
0x8000 partitions.bin \
|
0x8000 partitions.bin
|
||||||
0x10000 firmware.bin \
|
0x10000 firmware.bin
|
||||||
0x390000 spiffs.bin)
|
0x390000 spiffs.bin)
|
||||||
|
|
||||||
# Verify file sizes
|
# Verify file sizes
|
||||||
|
13
.github/workflows/providers/github-release.yml
vendored
13
.github/workflows/providers/github-release.yml
vendored
@ -60,11 +60,8 @@ jobs:
|
|||||||
# Copy firmware binary
|
# Copy firmware binary
|
||||||
cp .pio/build/esp32dev/firmware.bin .pio/build/esp32dev/filaman_${VERSION}.bin
|
cp .pio/build/esp32dev/firmware.bin .pio/build/esp32dev/filaman_${VERSION}.bin
|
||||||
|
|
||||||
# Copy SPIFFS binary if SPIFFS changed
|
# Always create SPIFFS binary
|
||||||
if [[ "${{ steps.check_spiffs.outputs.SPIFFS_CHANGED }}" == "true" ]]; then
|
cp .pio/build/esp32dev/spiffs.bin .pio.build/esp32dev/webpage_${VERSION}.bin
|
||||||
echo "SPIFFS changes detected, copying SPIFFS binary..."
|
|
||||||
cp .pio/build/esp32dev/spiffs.bin .pio/build/esp32dev/webpage_${VERSION}.bin
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Create full binary (always)
|
# Create full binary (always)
|
||||||
(cd .pio/build/esp32dev && \
|
(cd .pio/build/esp32dev && \
|
||||||
@ -79,12 +76,6 @@ jobs:
|
|||||||
0x10000 firmware.bin \
|
0x10000 firmware.bin \
|
||||||
0x390000 spiffs.bin)
|
0x390000 spiffs.bin)
|
||||||
|
|
||||||
# Only copy SPIFFS binary if data changed
|
|
||||||
if [[ "${{ steps.check_data.outputs.DATA_CHANGED }}" == "true" ]]; then
|
|
||||||
echo "Data changes detected, copying SPIFFS binary..."
|
|
||||||
cp .pio/build/esp32dev/spiffs.bin .pio/build/esp32dev/webpage_${VERSION}.bin
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Verify file sizes
|
# Verify file sizes
|
||||||
echo "File sizes:"
|
echo "File sizes:"
|
||||||
(cd .pio/build/esp32dev && ls -lh *.bin)
|
(cd .pio/build/esp32dev && ls -lh *.bin)
|
||||||
|
@ -1,5 +1,12 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## [1.2.101] - 2025-02-21
|
||||||
|
### Changed
|
||||||
|
- update webpages for version v1.2.101
|
||||||
|
- always create SPIFFS binary in release workflows
|
||||||
|
- migrate calibration value storage from EEPROM to NVS
|
||||||
|
|
||||||
|
|
||||||
## [1.2.100] - 2025-02-21
|
## [1.2.100] - 2025-02-21
|
||||||
### Changed
|
### Changed
|
||||||
- update webpages for version v1.2.100
|
- update webpages for version v1.2.100
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
; https://docs.platformio.org/page/projectconf.html
|
; https://docs.platformio.org/page/projectconf.html
|
||||||
|
|
||||||
[common]
|
[common]
|
||||||
version = "1.2.100"
|
version = "1.2.101"
|
||||||
|
|
||||||
[env:esp32dev]
|
[env:esp32dev]
|
||||||
platform = espressif32
|
platform = espressif32
|
||||||
|
@ -3,9 +3,9 @@
|
|||||||
#include <ArduinoJson.h>
|
#include <ArduinoJson.h>
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include "HX711.h"
|
#include "HX711.h"
|
||||||
#include <EEPROM.h>
|
|
||||||
#include "display.h"
|
#include "display.h"
|
||||||
#include "esp_task_wdt.h"
|
#include "esp_task_wdt.h"
|
||||||
|
#include <Preferences.h>
|
||||||
|
|
||||||
HX711 scale;
|
HX711 scale;
|
||||||
|
|
||||||
@ -17,6 +17,10 @@ uint8_t weigthCouterToApi = 0;
|
|||||||
uint8_t scale_tare_counter = 0;
|
uint8_t scale_tare_counter = 0;
|
||||||
uint8_t pauseMainTask = 0;
|
uint8_t pauseMainTask = 0;
|
||||||
|
|
||||||
|
Preferences preferences;
|
||||||
|
const char* NVS_NAMESPACE = "scale";
|
||||||
|
const char* NVS_KEY_CALIBRATION = "cal_value";
|
||||||
|
|
||||||
// ##### Funktionen für Waage #####
|
// ##### Funktionen für Waage #####
|
||||||
uint8_t tareScale() {
|
uint8_t tareScale() {
|
||||||
Serial.println("Tare scale");
|
Serial.println("Tare scale");
|
||||||
@ -48,13 +52,12 @@ void scale_loop(void * parameter) {
|
|||||||
|
|
||||||
void start_scale() {
|
void start_scale() {
|
||||||
Serial.println("Prüfe Calibration Value");
|
Serial.println("Prüfe Calibration Value");
|
||||||
long calibrationValue; // calibration value (see example file "Calibration.ino")
|
long calibrationValue;
|
||||||
//calibrationValue = 696.0; // uncomment this if you want to set the calibration value in the sketch
|
|
||||||
|
|
||||||
EEPROM.begin(512);
|
// NVS
|
||||||
EEPROM.get(calVal_eepromAdress, calibrationValue); // uncomment this if you want to fetch the calibration value from eeprom
|
preferences.begin(NVS_NAMESPACE, true); // true = readonly
|
||||||
|
calibrationValue = preferences.getLong(NVS_KEY_CALIBRATION, defaultScaleCalibrationValue);
|
||||||
//calibrationValue = EEPROM.read(calVal_eepromAdress);
|
preferences.end();
|
||||||
|
|
||||||
Serial.print("Read Scale Calibration Value ");
|
Serial.print("Read Scale Calibration Value ");
|
||||||
Serial.println(calibrationValue);
|
Serial.println(calibrationValue);
|
||||||
@ -137,18 +140,19 @@ uint8_t calibrate_scale() {
|
|||||||
{
|
{
|
||||||
Serial.print("New calibration value has been set to: ");
|
Serial.print("New calibration value has been set to: ");
|
||||||
Serial.println(newCalibrationValue);
|
Serial.println(newCalibrationValue);
|
||||||
Serial.print("Save this value to EEPROM adress ");
|
|
||||||
Serial.println(calVal_eepromAdress);
|
|
||||||
|
|
||||||
//EEPROM.put(calVal_eepromAdress, newCalibrationValue);
|
// Speichern mit NVS
|
||||||
EEPROM.put(calVal_eepromAdress, newCalibrationValue);
|
preferences.begin(NVS_NAMESPACE, false); // false = readwrite
|
||||||
EEPROM.commit();
|
preferences.putLong(NVS_KEY_CALIBRATION, newCalibrationValue);
|
||||||
|
preferences.end();
|
||||||
|
|
||||||
EEPROM.get(calVal_eepromAdress, newCalibrationValue);
|
// Verifizieren
|
||||||
//newCalibrationValue = EEPROM.read(calVal_eepromAdress);
|
preferences.begin(NVS_NAMESPACE, true);
|
||||||
|
long verifyValue = preferences.getLong(NVS_KEY_CALIBRATION, 0);
|
||||||
|
preferences.end();
|
||||||
|
|
||||||
Serial.print("Read Value ");
|
Serial.print("Verified stored value: ");
|
||||||
Serial.println(newCalibrationValue);
|
Serial.println(verifyValue);
|
||||||
|
|
||||||
Serial.println("End calibration, revome weight");
|
Serial.println("End calibration, revome weight");
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user