change modbus timeout to seconds and default 300 sec, #2254

This commit is contained in:
MichaelDvP
2024-12-04 18:28:13 +01:00
parent a970009d20
commit 55235687ba
6 changed files with 68 additions and 53 deletions

View File

@@ -11,6 +11,11 @@ For more details go to [docs.emsesp.org](https://docs.emsesp.org/).
## Fixed ## Fixed
- long numbers of custom entities [#2267](https://github.com/emsesp/EMS-ESP32/issues/2267)
- modbus command path to `api/` [#2276](https://github.com/emsesp/EMS-ESP32/issues/2276)
## Changed ## Changed
- show operation in pretty telegram between src and dst [#2263](https://github.com/emsesp/EMS-ESP32/discussions/2263) - show operation in pretty telegram between src and dst [#2263](https://github.com/emsesp/EMS-ESP32/discussions/2263)
- update eModbus to 1.7.2 [#2254](https://github.com/emsesp/EMS-ESP32/issues/2254)
- modbus timeout default to 300 sec, change setting from ms to sec [#2254](https://github.com/emsesp/EMS-ESP32/issues/2254)

View File

@@ -24,8 +24,8 @@
"@alova/adapter-xhr": "2.0.11", "@alova/adapter-xhr": "2.0.11",
"@emotion/react": "^11.13.5", "@emotion/react": "^11.13.5",
"@emotion/styled": "^11.13.5", "@emotion/styled": "^11.13.5",
"@mui/icons-material": "^6.1.9", "@mui/icons-material": "^6.1.10",
"@mui/material": "^6.1.9", "@mui/material": "^6.1.10",
"@table-library/react-table-library": "4.1.7", "@table-library/react-table-library": "4.1.7",
"alova": "3.2.6", "alova": "3.2.6",
"async-validator": "^4.2.5", "async-validator": "^4.2.5",
@@ -48,13 +48,13 @@
"@trivago/prettier-plugin-sort-imports": "^4.3.0", "@trivago/prettier-plugin-sort-imports": "^4.3.0",
"@types/formidable": "^3", "@types/formidable": "^3",
"@types/node": "^22.10.1", "@types/node": "^22.10.1",
"@types/react": "^18.3.12", "@types/react": "^18.3.13",
"@types/react-dom": "^18.3.1", "@types/react-dom": "^18.3.1",
"concurrently": "^9.1.0", "concurrently": "^9.1.0",
"eslint": "^9.16.0", "eslint": "^9.16.0",
"eslint-config-prettier": "^9.1.0", "eslint-config-prettier": "^9.1.0",
"formidable": "^3.5.2", "formidable": "^3.5.2",
"prettier": "^3.4.1", "prettier": "^3.4.2",
"rollup-plugin-visualizer": "^5.12.0", "rollup-plugin-visualizer": "^5.12.0",
"terser": "^5.36.0", "terser": "^5.36.0",
"typescript-eslint": "8.17.0", "typescript-eslint": "8.17.0",

View File

@@ -241,7 +241,7 @@ const ApplicationSettings = () => {
name="modbus_timeout" name="modbus_timeout"
label="Timeout" label="Timeout"
slotProps={{ slotProps={{
input: MilliSecondsInputProps input: SecondsInputProps
}} }}
variant="outlined" variant="outlined"
value={numberValue(data.modbus_timeout)} value={numberValue(data.modbus_timeout)}

View File

@@ -840,38 +840,38 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"@mui/core-downloads-tracker@npm:^6.1.9": "@mui/core-downloads-tracker@npm:^6.1.10":
version: 6.1.9 version: 6.1.10
resolution: "@mui/core-downloads-tracker@npm:6.1.9" resolution: "@mui/core-downloads-tracker@npm:6.1.10"
checksum: 10c0/f84c48291e6c85bafb60015f0464f041ca3168dcfd7c563cb584bf925495872f0a180ed52e985b544c6cb87297a1686b1d3a90f451d12594765d0811fc7514b0 checksum: 10c0/b94259c7cc8065dfed7ead4250e1bba4e65ec5625d86a11d118d1c22ec05f058d6f93b66d73bba9d787453058a2a05b5a1bbfd01ac53f3410e25358da3e4a571
languageName: node languageName: node
linkType: hard linkType: hard
"@mui/icons-material@npm:^6.1.9": "@mui/icons-material@npm:^6.1.10":
version: 6.1.9 version: 6.1.10
resolution: "@mui/icons-material@npm:6.1.9" resolution: "@mui/icons-material@npm:6.1.10"
dependencies: dependencies:
"@babel/runtime": "npm:^7.26.0" "@babel/runtime": "npm:^7.26.0"
peerDependencies: peerDependencies:
"@mui/material": ^6.1.9 "@mui/material": ^6.1.10
"@types/react": ^17.0.0 || ^18.0.0 || ^19.0.0 "@types/react": ^17.0.0 || ^18.0.0 || ^19.0.0
react: ^17.0.0 || ^18.0.0 || ^19.0.0 react: ^17.0.0 || ^18.0.0 || ^19.0.0
peerDependenciesMeta: peerDependenciesMeta:
"@types/react": "@types/react":
optional: true optional: true
checksum: 10c0/7efc0c4a4c668118252ec0a0bf7ed8e4d9af68d03d92e76d382109aaf8b018bd3512b47c444947c12df25be02615483a5e4889ddf745b42ab0446583b34d59f8 checksum: 10c0/970a402962b27219bdff4b7af32e758fea800c6879112887cdc71f0d6869c3ea66e24e320edbc39b704f174511a918a055b96d49b91bdeefb1afe8d753b42d4e
languageName: node languageName: node
linkType: hard linkType: hard
"@mui/material@npm:^6.1.9": "@mui/material@npm:^6.1.10":
version: 6.1.9 version: 6.1.10
resolution: "@mui/material@npm:6.1.9" resolution: "@mui/material@npm:6.1.10"
dependencies: dependencies:
"@babel/runtime": "npm:^7.26.0" "@babel/runtime": "npm:^7.26.0"
"@mui/core-downloads-tracker": "npm:^6.1.9" "@mui/core-downloads-tracker": "npm:^6.1.10"
"@mui/system": "npm:^6.1.9" "@mui/system": "npm:^6.1.10"
"@mui/types": "npm:^7.2.19" "@mui/types": "npm:^7.2.19"
"@mui/utils": "npm:^6.1.9" "@mui/utils": "npm:^6.1.10"
"@popperjs/core": "npm:^2.11.8" "@popperjs/core": "npm:^2.11.8"
"@types/react-transition-group": "npm:^4.4.11" "@types/react-transition-group": "npm:^4.4.11"
clsx: "npm:^2.1.1" clsx: "npm:^2.1.1"
@@ -882,7 +882,7 @@ __metadata:
peerDependencies: peerDependencies:
"@emotion/react": ^11.5.0 "@emotion/react": ^11.5.0
"@emotion/styled": ^11.3.0 "@emotion/styled": ^11.3.0
"@mui/material-pigment-css": ^6.1.9 "@mui/material-pigment-css": ^6.1.10
"@types/react": ^17.0.0 || ^18.0.0 || ^19.0.0 "@types/react": ^17.0.0 || ^18.0.0 || ^19.0.0
react: ^17.0.0 || ^18.0.0 || ^19.0.0 react: ^17.0.0 || ^18.0.0 || ^19.0.0
react-dom: ^17.0.0 || ^18.0.0 || ^19.0.0 react-dom: ^17.0.0 || ^18.0.0 || ^19.0.0
@@ -895,16 +895,16 @@ __metadata:
optional: true optional: true
"@types/react": "@types/react":
optional: true optional: true
checksum: 10c0/934be9f17e66ac9944ff970c2a2c67292aadd339f5124e2ec82fbfd25fe713e7716c61005b918dd31836674fb8e327bd87f200276f2ef8930e9ba4e77727bad6 checksum: 10c0/501f434aa61b56806cd6d8bc27ddd0cfc6f423ee132bb0cc02ca36af182b251b8d15dd69ed8b90742813039d2bfe1e396f6ddf84f15f453d53bfbf355d18f99a
languageName: node languageName: node
linkType: hard linkType: hard
"@mui/private-theming@npm:^6.1.9": "@mui/private-theming@npm:^6.1.10":
version: 6.1.9 version: 6.1.10
resolution: "@mui/private-theming@npm:6.1.9" resolution: "@mui/private-theming@npm:6.1.10"
dependencies: dependencies:
"@babel/runtime": "npm:^7.26.0" "@babel/runtime": "npm:^7.26.0"
"@mui/utils": "npm:^6.1.9" "@mui/utils": "npm:^6.1.10"
prop-types: "npm:^15.8.1" prop-types: "npm:^15.8.1"
peerDependencies: peerDependencies:
"@types/react": ^17.0.0 || ^18.0.0 || ^19.0.0 "@types/react": ^17.0.0 || ^18.0.0 || ^19.0.0
@@ -912,13 +912,13 @@ __metadata:
peerDependenciesMeta: peerDependenciesMeta:
"@types/react": "@types/react":
optional: true optional: true
checksum: 10c0/d2ed09a50a30496905ba57735c370efa85b00ed0b29b2bd9e7193416d4825659d48abaf2bcf649a80dfaa035262487b81a3396b042fd97646f775ca4d20dd05c checksum: 10c0/1e296d7582b276e7b9de8c9af252b4998ab8343a570ed7ead8c23b3275a218f0722f389d698c45cab9b4b219ad82411af6f71c7678818d3387925db01d1a9ead
languageName: node languageName: node
linkType: hard linkType: hard
"@mui/styled-engine@npm:^6.1.9": "@mui/styled-engine@npm:^6.1.10":
version: 6.1.9 version: 6.1.10
resolution: "@mui/styled-engine@npm:6.1.9" resolution: "@mui/styled-engine@npm:6.1.10"
dependencies: dependencies:
"@babel/runtime": "npm:^7.26.0" "@babel/runtime": "npm:^7.26.0"
"@emotion/cache": "npm:^11.13.5" "@emotion/cache": "npm:^11.13.5"
@@ -935,19 +935,19 @@ __metadata:
optional: true optional: true
"@emotion/styled": "@emotion/styled":
optional: true optional: true
checksum: 10c0/74d239b2d306b0aa2271d9943cea83ea0a05c16c55cd2239605b0f1cb91fc4aa508891173d1b9bb69e92074d1d4db14d8b85618c639667967a1f608607047e66 checksum: 10c0/2e6ad8f1c3de4ce4b6a246de976f304e433e8a5031465bc9614e51eeae2dd308c76dbdfc2b9f95bbcb971c1008bdbc9103d9418313934a9760f6555334997586
languageName: node languageName: node
linkType: hard linkType: hard
"@mui/system@npm:^6.1.9": "@mui/system@npm:^6.1.10":
version: 6.1.9 version: 6.1.10
resolution: "@mui/system@npm:6.1.9" resolution: "@mui/system@npm:6.1.10"
dependencies: dependencies:
"@babel/runtime": "npm:^7.26.0" "@babel/runtime": "npm:^7.26.0"
"@mui/private-theming": "npm:^6.1.9" "@mui/private-theming": "npm:^6.1.10"
"@mui/styled-engine": "npm:^6.1.9" "@mui/styled-engine": "npm:^6.1.10"
"@mui/types": "npm:^7.2.19" "@mui/types": "npm:^7.2.19"
"@mui/utils": "npm:^6.1.9" "@mui/utils": "npm:^6.1.10"
clsx: "npm:^2.1.1" clsx: "npm:^2.1.1"
csstype: "npm:^3.1.3" csstype: "npm:^3.1.3"
prop-types: "npm:^15.8.1" prop-types: "npm:^15.8.1"
@@ -963,7 +963,7 @@ __metadata:
optional: true optional: true
"@types/react": "@types/react":
optional: true optional: true
checksum: 10c0/0ae66dbbf183bf6ccefeaf3808699c6ef2dd72928134e3e902716e3f75d6b15ccc41c1478a23f20824b76ff3ca86b0923ebccb58ae11b9e04305988eae74d653 checksum: 10c0/ba228faa0a2c3f5b25770faa1484c04846889642eda1d0c3922b324c6de2946fc4debf7ddb994f1ef349bbe260243ab5e1117b624ea5062209ba1898f5dff1a3
languageName: node languageName: node
linkType: hard linkType: hard
@@ -979,9 +979,9 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"@mui/utils@npm:^6.1.9": "@mui/utils@npm:^6.1.10":
version: 6.1.9 version: 6.1.10
resolution: "@mui/utils@npm:6.1.9" resolution: "@mui/utils@npm:6.1.10"
dependencies: dependencies:
"@babel/runtime": "npm:^7.26.0" "@babel/runtime": "npm:^7.26.0"
"@mui/types": "npm:^7.2.19" "@mui/types": "npm:^7.2.19"
@@ -995,7 +995,7 @@ __metadata:
peerDependenciesMeta: peerDependenciesMeta:
"@types/react": "@types/react":
optional: true optional: true
checksum: 10c0/2cd28cc44f9048b2c9b5511f074082da1f5b969c524f08f827aaa5e226392238bb91fbf6c5054290590b5d9a67d7f753a6ee9b7cc7613df7193635b8f63ca577 checksum: 10c0/0cecda147b026fbb6f397e54fc08719c5805a7e5fd4255c30a45a7155748345dbbc57fda9181986db222f93da0012f001b1f1f624084e5227ca7814ed1c3dd30
languageName: node languageName: node
linkType: hard linkType: hard
@@ -1488,7 +1488,7 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"@types/react@npm:*, @types/react@npm:^18.3.12": "@types/react@npm:*":
version: 18.3.12 version: 18.3.12
resolution: "@types/react@npm:18.3.12" resolution: "@types/react@npm:18.3.12"
dependencies: dependencies:
@@ -1498,6 +1498,16 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"@types/react@npm:^18.3.13":
version: 18.3.13
resolution: "@types/react@npm:18.3.13"
dependencies:
"@types/prop-types": "npm:*"
csstype: "npm:^3.0.2"
checksum: 10c0/91815e00157deb179fa670aa2dfc491952698b7743ffddca0e3e0f16e7a18454f3f5ef72321a07386c49e721563b9d280dbbdfae039face764e2fdd8ad949d4b
languageName: node
linkType: hard
"@types/responselike@npm:^1.0.0": "@types/responselike@npm:^1.0.0":
version: 1.0.3 version: 1.0.3
resolution: "@types/responselike@npm:1.0.3" resolution: "@types/responselike@npm:1.0.3"
@@ -1646,15 +1656,15 @@ __metadata:
"@emotion/react": "npm:^11.13.5" "@emotion/react": "npm:^11.13.5"
"@emotion/styled": "npm:^11.13.5" "@emotion/styled": "npm:^11.13.5"
"@eslint/js": "npm:^9.16.0" "@eslint/js": "npm:^9.16.0"
"@mui/icons-material": "npm:^6.1.9" "@mui/icons-material": "npm:^6.1.10"
"@mui/material": "npm:^6.1.9" "@mui/material": "npm:^6.1.10"
"@preact/compat": "npm:^18.3.1" "@preact/compat": "npm:^18.3.1"
"@preact/preset-vite": "npm:^2.9.2" "@preact/preset-vite": "npm:^2.9.2"
"@table-library/react-table-library": "npm:4.1.7" "@table-library/react-table-library": "npm:4.1.7"
"@trivago/prettier-plugin-sort-imports": "npm:^4.3.0" "@trivago/prettier-plugin-sort-imports": "npm:^4.3.0"
"@types/formidable": "npm:^3" "@types/formidable": "npm:^3"
"@types/node": "npm:^22.10.1" "@types/node": "npm:^22.10.1"
"@types/react": "npm:^18.3.12" "@types/react": "npm:^18.3.13"
"@types/react-dom": "npm:^18.3.1" "@types/react-dom": "npm:^18.3.1"
alova: "npm:3.2.6" alova: "npm:3.2.6"
async-validator: "npm:^4.2.5" async-validator: "npm:^4.2.5"
@@ -1665,7 +1675,7 @@ __metadata:
jwt-decode: "npm:^4.0.0" jwt-decode: "npm:^4.0.0"
mime-types: "npm:^2.1.35" mime-types: "npm:^2.1.35"
preact: "npm:^10.25.1" preact: "npm:^10.25.1"
prettier: "npm:^3.4.1" prettier: "npm:^3.4.2"
react: "npm:^18.3.1" react: "npm:^18.3.1"
react-dom: "npm:^18.3.1" react-dom: "npm:^18.3.1"
react-icons: "npm:^5.4.0" react-icons: "npm:^5.4.0"
@@ -5578,12 +5588,12 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"prettier@npm:^3.4.1": "prettier@npm:^3.4.2":
version: 3.4.1 version: 3.4.2
resolution: "prettier@npm:3.4.1" resolution: "prettier@npm:3.4.2"
bin: bin:
prettier: bin/prettier.cjs prettier: bin/prettier.cjs
checksum: 10c0/2d6cc3101ad9de72b49c59339480b0983e6ff6742143da0c43f476bf3b5ef88ede42ebd9956d7a0a8fa59f7a5990e8ef03c9ad4c37f7e4c9e5db43ee0853156c checksum: 10c0/99e076a26ed0aba4ebc043880d0f08bbb8c59a4c6641cdee6cdadf2205bdd87aa1d7823f50c3aea41e015e99878d37c58d7b5f0e663bba0ef047f94e36b96446
languageName: node languageName: node
linkType: hard linkType: hard

View File

@@ -134,7 +134,7 @@
#endif #endif
#ifndef EMSESP_DEFAULT_MODBUS_TIMEOUT #ifndef EMSESP_DEFAULT_MODBUS_TIMEOUT
#define EMSESP_DEFAULT_MODBUS_TIMEOUT 10000 #define EMSESP_DEFAULT_MODBUS_TIMEOUT 300
#endif #endif
#ifndef EMSESP_DEFAULT_BOARD_PROFILE #ifndef EMSESP_DEFAULT_BOARD_PROFILE

View File

@@ -1689,7 +1689,7 @@ void EMSESP::start() {
// start services // start services
if (system_.modbus_enabled()) { if (system_.modbus_enabled()) {
modbus_ = new Modbus; modbus_ = new Modbus;
modbus_->start(1, system_.modbus_port(), system_.modbus_max_clients(), system_.modbus_timeout()); modbus_->start(1, system_.modbus_port(), system_.modbus_max_clients(), system_.modbus_timeout() * 1000);
} }
mqtt_.start(); // mqtt init mqtt_.start(); // mqtt init
system_.start(); // starts commands, led, adc, button, network (sets hostname), syslog & uart system_.start(); // starts commands, led, adc, button, network (sets hostname), syslog & uart