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