Compare commits

...

6 Commits

Author SHA1 Message Date
f0e237cd71 Switch to PIO image
Some checks failed
Test compiling project / test (push) Failing after 0s
2025-05-24 16:02:15 +00:00
7b0f3d20b0 Switch to devcontainer
Some checks are pending
Test compiling project / test (push) Waiting to run
2025-05-24 15:59:22 +00:00
ef04f1077c Merge branch 'main' of ssh://gitea.maiertobi.de:222/tobimai/waterlevel-software
All checks were successful
Test compiling project / test (push) Successful in 2m42s
2025-04-18 21:05:09 +02:00
47445d6cd5 version bump 2025-04-18 21:05:07 +02:00
78867ae8a3 Merge pull request 'Fix Sensor' (#2) from fix-sensor into main
All checks were successful
Test compiling project / test (push) Successful in 2m43s
Reviewed-on: https://gitea.maiertobi.de/tobimai/waterlevel-software/pulls/2
2025-04-18 21:00:15 +02:00
0f581a54c5 Fix Sensor
All checks were successful
Test compiling project / test (push) Successful in 2m46s
2025-04-18 20:57:09 +02:00
9 changed files with 41 additions and 11 deletions

View File

@@ -0,0 +1,17 @@
{
"name": "Waterlevel Software Development",
"dockerComposeFile": "docker-compose.yaml",
"service": "app",
"workspaceFolder": "/workspace",
"customizations": {
"vscode": {
"extensions": [
"platformio.platformio-ide",
"mutantdino.resourcemonitor",
"ms-azuretools.vscode-docker",
"meezilla.json"
]
}
}
}

View File

@@ -0,0 +1,9 @@
version: '3.8'
services:
app:
image: gitea.maiertobi.de/tobimai/devcontainer-pio:latest
user: tobi:tobi
volumes:
- ..:/workspace:cached
- /home/tobi/.ssh:/home/tobi/.ssh:ro
command: sleep infinity

View File

@@ -6,13 +6,9 @@ jobs:
test:
runs-on: ubuntu-latest
container:
image: debian:latest
image: gitea.maiertobi.de/tobimai/devcontainer-pio:latest
steps:
- name: Install necessary dependencies
run: apt update && apt install nodejs python3 python3-pip git curl -y
- name: Install Platformio
run: pip install --break-system-packages --upgrade platformio
- name: Checkout Code
uses: actions/checkout@v2
- name: Run PlatformIO Tests

View File

@@ -117,7 +117,7 @@ float INA233::getBusVoltage() {
float INA233::getShuntVoltage() {
uint16_t rawVoltage = get_word(INA233::_address, REGISTER_READ_VSHUNT);
float voltage = rawVoltage * pow(10,-4);
float voltage = rawVoltage * 2.5e-6;
return voltage;
}
@@ -186,4 +186,8 @@ uint16_t INA233::getConfigRegister() {
void INA233::reset() {
sendByte(INA233::_address, 0x12, 0x00);
}
void INA233::setCalibrationRegister(int value) {
sendWord(INA233::_address, 0xD4, value);
}

View File

@@ -49,6 +49,8 @@ class INA233{
void reset();
void setCalibrationRegister(int value);
bool isConnected(void);
private:

View File

@@ -25,7 +25,7 @@ lib_deps =
https://github.com/tobimai/elog.git#fix-syslog
board_build.partitions = default.csv
upload_protocol = espota
upload_port = 10.1.60.43
upload_port = 192.168.5.205
build_flags = -Wall -Wextra -DLOGGING_SPIFFS_DISABLE -DLOGGING_SD_DISABLE
[env:ESP32_INA226]

View File

@@ -7,7 +7,7 @@
#define water_level_min_key "water_level_min"
#define water_level_max_key "water_level_max"
#define water_volume_key "water_volume"
#define current_software_version Version{1, 2, 0}
#define current_software_version Version{1, 3, 0}
#define REQUIRED_SPIFFS_VERSION Version{8, 0, 0}
#define RESISTOR_VALUE 4

View File

@@ -65,8 +65,8 @@ void wifi_task(void* parameter)
wifi_data.network_name = WiFi.SSID();
wifi_data.ip_address = WiFi.localIP().toString();
// LOG(DEBUG, "RSSI: %F, IP Address, %p, SSID: %s", float(WiFi.RSSI()), WiFi.localIP(), prefs.getString(ssid_key, "NOSSID"));
// Serial.println(WiFi.channel());
LOG(DEBUG, "RSSI: %F, IP Address, %p, SSID: %s", float(WiFi.RSSI()), WiFi.localIP(), prefs.getString(ssid_key, "NOSSID"));
Serial.println(WiFi.channel());
delay(5000);
} else {
LOG(DEBUG, "Connecting to %s using password %s", prefs.getString(ssid_key, ""), prefs.getString(wifi_password_key, ""));
@@ -88,7 +88,8 @@ void ethernet_task(void* parameter)
ethernet_data.link = ETH.linkUp();
ethernet_data.rssi = ETH.linkSpeed();
ethernet_data.ip_address = ETH.localIP().toString();
// LOG(DEBUG, "Ethernet RSSI: %F, IP Address, %s, LINK: %s", float(ethernet_data.rssi), ethernet_data.ip_address, String(ethernet_data.link));
Serial.println( ETH.localIP().toString());
LOG(DEBUG, "Ethernet RSSI: %F, IP Address, %s, LINK: %s", float(ethernet_data.rssi), ETH.localIP().toString().c_str(), String(ethernet_data.link));
delay(60 * 1000);
}
}

View File

@@ -37,6 +37,7 @@ void init_sensor(){
ina_sensor.setShuntVoltageConversionTime(conversion_time_8244uS);
ina_sensor.setBusVoltageConversionTime(conversion_time_8244uS);
ina_sensor.setAveragingMode(averages_128);
ina_sensor.setCalibrationRegister(128);
#endif
}