Compare commits
6 Commits
82455c830f
...
old-rev1-h
| Author | SHA1 | Date | |
|---|---|---|---|
| f0e237cd71 | |||
| 7b0f3d20b0 | |||
| ef04f1077c | |||
| 47445d6cd5 | |||
| 78867ae8a3 | |||
| 0f581a54c5 |
17
.devcontainer/devcontainer.json
Normal file
17
.devcontainer/devcontainer.json
Normal 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"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
9
.devcontainer/docker-compose.yaml
Normal file
9
.devcontainer/docker-compose.yaml
Normal 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
|
||||
@@ -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
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
@@ -49,6 +49,8 @@ class INA233{
|
||||
|
||||
void reset();
|
||||
|
||||
void setCalibrationRegister(int value);
|
||||
|
||||
bool isConnected(void);
|
||||
|
||||
private:
|
||||
|
||||
@@ -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]
|
||||
|
||||
@@ -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
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user