Skip to content

Commit

Permalink
Merge remote-tracking branch 'tbnobody/OpenDTU/master' into development
Browse files Browse the repository at this point in the history
  • Loading branch information
helgeerbe committed Mar 27, 2023
2 parents 7d48e42 + c47b7dd commit e0a8073
Show file tree
Hide file tree
Showing 15 changed files with 134 additions and 70 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ Topics for 3 phases of a power meter is configurable. Given is an example for th
* Hoymiles HM-1200
* Hoymiles HM-1500
* Solenso SOL-H400
* Solenso SOL-H800
* TSUN TSOL-M350 (Maybe depending on firmware/serial number on the inverter)
* TSUN TSOL-M800 (Maybe depending on firmware/serial number on the inverter)
* TSUN TSOL-M1600 (Maybe depending on firmware/serial number on the inverter)
Expand Down Expand Up @@ -298,7 +299,7 @@ You can also change the pins by creating a custom [device profile](docs/DeviceP
* upload_port
* monitor_port
* Select the arrow button in the blue bottom status bar (PlatformIO: Upload) to compile and upload the firmware. During the compilation, all required libraries are downloaded automatically.
* Under Linux, if the upload fails with error messages "Could not open /dev/ttyUSB0, the port doesn't exist", you can check via ```ls -la /dev/tty*``` to which group your port belongs to, and then add your user this group via ```sudo adduser <yourusername> dialout```
* Under Linux, if the upload fails with error messages "Could not open /dev/ttyUSB0, the port doesn't exist", you can check via ```ls -la /dev/tty*``` to which group your port belongs to, and then add your user this group via ```sudo adduser <yourusername> dialout``` (if you are using ```arch-linux``` use: ```sudo gpasswd -a <yourusername> uucp```, this method requires a logout/login of the affected user).
* There are two videos showing these steps:
* [Git Clone and compilation](https://youtu.be/9cA_esv3zeA)
* [Full installation and compilation](https://youtu.be/xs6TqHn7QWM)
Expand Down Expand Up @@ -353,7 +354,7 @@ esptool.py --port /dev/ttyUSB0 --chip esp32 --before default_reset --after hard_
Users report that [ESP_Flasher](https://github.com/Jason2866/ESP_Flasher/releases/) is suitable for flashing OpenDTU on Windows.

#### Flash with [ESP_Flasher](https://espressif.github.io/esptool-js/) - web version
It is also possible to flash it via the web tools which might be more convenient and is platformindependent.
It is also possible to flash it via the web tools which might be more convenient and is platform independent.

## First configuration
* After the initial flashing of the microcontroller, an Access Point called "OpenDTU-*" is opened. The default password is "openDTU42".
Expand All @@ -369,7 +370,7 @@ It is also possible to flash it via the web tools which might be more convenient
Once you have your OpenDTU running and connected to WLAN, you can do further updates through the web interface.
Navigate to Settings --> Firmware upgrade and press the browse button. Select the firmware file from your local computer.

You'll find the firmware file (after a successfull build process) under `.pio/build/generic/firmware.bin`.
You'll find the firmware file (after a successful build process) under `.pio/build/generic/firmware.bin`.

If you downloaded a precompiled zip archive, unpack it and choose `opendtu-generic.bin`.

Expand Down
4 changes: 2 additions & 2 deletions lib/Hoymiles/src/HoymilesRadio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ void HoymilesRadio::init(SPIClass* initialisedSpiBus, uint8_t pinCE, uint8_t pin
_radio->setRetries(0, 0);
_radio->maskIRQ(true, true, false); // enable only receiving interrupts
if (_radio->isChipConnected()) {
Hoymiles.getMessageOutput()->println(F("Connection successfull"));
Hoymiles.getMessageOutput()->println(F("Connection successful"));
} else {
Hoymiles.getMessageOutput()->println(F("Connection error!!"));
}
Expand Down Expand Up @@ -121,7 +121,7 @@ void HoymilesRadio::loop()
sendRetransmitPacket(verifyResult);

} else {
// Successfull received all packages
// Successful received all packages
Hoymiles.getMessageOutput()->println(F("Success"));
_commandQueue.pop();
_busyFlag = false;
Expand Down
2 changes: 1 addition & 1 deletion platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ build_unflags =
lib_deps =
https://github.com/yubox-node-org/ESPAsyncWebServer
bblanchon/ArduinoJson @ ^6.21.0
https://github.com/bertmelis/espMqttClient.git#v1.4.1
https://github.com/bertmelis/espMqttClient.git#v1.4.2
nrf24/RF24 @ ^1.4.5
olikraus/U8g2 @ ^2.34.16
buelowp/sunset @ ^1.1.7
Expand Down
7 changes: 6 additions & 1 deletion src/MqttHandleInverter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -197,9 +197,14 @@ void MqttHandleInverterClass::onMqttMessage(const espMqttClientTypes::MessagePro
char* strlimit = new char[len + 1];
memcpy(strlimit, payload, len);
strlimit[len] = '\0';
uint32_t payload_val = strtol(strlimit, NULL, 10);
int32_t payload_val = strtol(strlimit, NULL, 10);
delete[] strlimit;

if (payload_val < 0) {
MessageOutput.printf("MQTT payload < 0 received --> ignoring\r\n");
return;
}

if (!strcmp(setting, TOPIC_SUB_LIMIT_PERSISTENT_RELATIVE)) {
// Set inverter limit relative persistent
MessageOutput.printf("Limit Persistent: %d %%\r\n", payload_val);
Expand Down
2 changes: 1 addition & 1 deletion src/WebApi_security.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ void WebApiSecurityClass::onAuthenticateGet(AsyncWebServerRequest* request)
AsyncJsonResponse* response = new AsyncJsonResponse();
JsonObject retMsg = response->getRoot();
retMsg[F("type")] = F("success");
retMsg[F("message")] = F("Authentication successfull!");
retMsg[F("message")] = F("Authentication successful!");
retMsg[F("code")] = WebApiError::SecurityAuthSuccess;

response->setLength();
Expand Down
14 changes: 7 additions & 7 deletions webapp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore"
},
"dependencies": {
"@popperjs/core": "^2.11.6",
"bootstrap": "^5.3.0-alpha1",
"@popperjs/core": "^2.11.7",
"bootstrap": "^5.3.0-alpha2",
"bootstrap-icons-vue": "^1.10.3",
"mitt": "^3.0.0",
"spark-md5": "^3.0.2",
Expand All @@ -21,19 +21,19 @@
"vue-router": "^4.1.6"
},
"devDependencies": {
"@intlify/unplugin-vue-i18n": "^0.9.3",
"@intlify/unplugin-vue-i18n": "^0.10.0",
"@rushstack/eslint-patch": "^1.2.0",
"@types/bootstrap": "^5.2.6",
"@types/node": "^18.15.3",
"@types/node": "^18.15.10",
"@types/spark-md5": "^3.0.2",
"@vitejs/plugin-vue": "^4.1.0",
"@vue/eslint-config-typescript": "^11.0.2",
"@vue/tsconfig": "^0.1.3",
"eslint": "^8.36.0",
"eslint-plugin-vue": "^9.9.0",
"eslint-plugin-vue": "^9.10.0",
"npm-run-all": "^4.1.5",
"sass": "^1.59.3",
"terser": "^5.16.6",
"sass": "^1.60.0",
"terser": "^5.16.8",
"typescript": "^5.0.2",
"vite": "^4.2.1",
"vite-plugin-compression": "^0.5.1",
Expand Down
2 changes: 1 addition & 1 deletion webapp/src/components/PinInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ export default defineComponent({
comSel = 999999;
}
if (comCur == -1 || comCur == 255 || comSel == undefined) {
if (comCur == -1 || comCur == 255 || comCur == undefined) {
comCur = 999999;
}
Expand Down
2 changes: 1 addition & 1 deletion webapp/src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
"9009": "Second must be a number between {min} and {max}!",
"9010": "Time updated!",
"10001": "Password must between 8 and {max} characters long!",
"10002": "Authentication successfull!",
"10002": "Authentication successful!",
"11001": "@:apiresponse.2001",
"11002": "@:apiresponse:5004",
"12001": "Profil must between 1 and {max} characters long!"
Expand Down
2 changes: 1 addition & 1 deletion webapp/src/views/ConsoleInfoView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export default defineComponent({
this.socket.onopen = function (event) {
console.log(event);
console.log("Successfully connected to the echo websocket server...");
console.log("Successfuly connected to the echo websocket server...");
};
// Listen to window events , When the window closes , Take the initiative to disconnect websocket Connect
Expand Down
2 changes: 1 addition & 1 deletion webapp/src/views/HomeView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@ export default defineComponent({
this.socket.onopen = function (event) {
console.log(event);
console.log("Successfully connected to the echo websocket server...");
console.log("Successfuly connected to the echo websocket server...");
};
// Listen to window events , When the window closes , Take the initiative to disconnect websocket Connect
Expand Down
1 change: 1 addition & 0 deletions webapp/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export default defineConfig({
include: path.resolve(path.dirname(fileURLToPath(import.meta.url)), './src/locales/**.json'),
fullInstall: false,
forceStringify: true,
strictMessage: false,
}),
],
resolve: {
Expand Down
Loading

0 comments on commit e0a8073

Please sign in to comment.